forked from pw0300/Qgis_plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshowazimuthgui.py
More file actions
37 lines (27 loc) · 1.01 KB
/
showazimuthgui.py
File metadata and controls
37 lines (27 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: latin1 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
import math
from ui_showazimuth import Ui_ShowAzimuth
class ShowAzimuthGui(QDialog, QObject, Ui_ShowAzimuth):
unsetTool = pyqtSignal()
def __init__(self, parent, flags):
QDialog.__init__(self, parent, flags)
self.setupUi(self)
def initGui(self):
pass
def writeAzimuth(self, az):
try:
az = float(az)
self.lineGon.setText(str(200 * az / math.pi))
self.lineDegrees.setText(str(180 * az / math.pi))
self.lineRadians.setText(str(az))
except (TypeError, ValueError):
self.lineGon.setText("Error.")
self.lineDegrees.setText("Error.")
self.lineRadians.setText("Error.")
@pyqtSignature("on_buttonClose_clicked()")
def on_buttonClose_clicked(self):
self.unsetTool.emit()
self.close()