This commit is contained in:
2021-10-28 13:02:11 -04:00
10 changed files with 332 additions and 88 deletions

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'mainwindow.ui'
## Form generated from reading UI file ''
##
## Created by: Qt User Interface Compiler version 5.15.2
##
@ -129,6 +129,12 @@ class Ui_MainWindow(object):
self.viewSatellites = QGraphicsView(self.centralwidget)
self.viewSatellites.setObjectName(u"viewSatellites")
self.viewSatellites.setGeometry(QRect(450, 10, 280, 280))
brush = QBrush(QColor(0, 0, 0, 255))
brush.setStyle(Qt.NoBrush)
self.viewSatellites.setBackgroundBrush(brush)
brush1 = QBrush(QColor(255, 255, 255, 255))
brush1.setStyle(Qt.NoBrush)
self.viewSatellites.setForegroundBrush(brush1)
self.label_14 = QLabel(self.centralwidget)
self.label_14.setObjectName(u"label_14")
self.label_14.setGeometry(QRect(10, 10, 221, 16))

View File

@ -1,3 +1,3 @@
MainWindow.py : mainwindow.ui
pyside2-uic $< -o $@
pyside2-uic -o $@ $<

View File

@ -41,6 +41,7 @@ fix_mode = [
'0=None', '1=No', '2=2D', '3=3D'
];
config_file = "gps_tool.yaml"
gpsd_host="127.0.0.1"
gpsd_report = ()
@ -98,7 +99,7 @@ class QtGPSWindow(MainWindow):
self.gpx_track.segments.append(self.gpx_segment)
self.log_enabled = 0
self.dirname = ""
self.dirname = "."
self.num_points = 0
self.my_thread = DataThread()
@ -111,6 +112,7 @@ class QtGPSWindow(MainWindow):
self.yellow = QColor(255,211,0)
self.green = QColor(0,255,0)
self.blue = QColor(0,0,255)
self.white = QColor(255,255,255)
self.scene = QtWidgets.QGraphicsScene()
self.viewSatellites.setScene(self.scene)
@ -154,7 +156,8 @@ class QtGPSWindow(MainWindow):
satellites = getattr(report, 'satellites')
txt = "%4s %4s %4s %3s %1s" % ('PRN', 'Azim', 'Elev', 'SNR', 'Used')
self.txtSatellites.setTextColor(self.black)
self.txtSatellites.setStyleSheet("background-color: rgb(0, 0, 0)")
self.txtSatellites.setTextColor(self.white)
self.txtSatellites.setFontWeight(QFont.Bold)
self.txtSatellites.setText(txt)
@ -225,6 +228,7 @@ class QtGPSWindow(MainWindow):
polar.set_theta_zero_location('N', offset=0)
canvas = FigureCanvas(figure)
self.scene.clear()
self.scene.addWidget(canvas)
h = float(self.scene.height()) / 2.0
w = float(self.scene.width()) / 2.0
@ -236,7 +240,7 @@ class QtGPSWindow(MainWindow):
def toggle_logging(self):
if self.log_enabled:
self.log_enabled = 0
self.dir_dialog()
# self.dir_dialog()
self.save_log()
self.toggleLogging.setText("Start")
else:
@ -286,8 +290,8 @@ class QtGPSWindow(MainWindow):
self.log_enabled = 0
sys.exit(0)
if os.path.isfile('config.yaml'):
with open('config.yaml') as f:
if os.path.isfile(config_file):
with open(config_file) as f:
config = yaml.load(f, Loader=yaml.FullLoader)
if 'gpsd_host' in config:
gpsd_host = config['gpsd_host']

View File

@ -442,6 +442,24 @@
<height>280</height>
</rect>
</property>
<property name="backgroundBrush">
<brush brushstyle="NoBrush">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</property>
<property name="foregroundBrush">
<brush brushstyle="NoBrush">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</property>
</widget>
<widget class="QLabel" name="label_14">
<property name="geometry">