Skip to content
Snippets Groups Projects
Commit 8f8ceb82 authored by Daniel Meißner's avatar Daniel Meißner Committed by Daniel Meißner
Browse files

gui: added widget to view results, still WIP

parent b03c4033
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@ from lib.gr.noise_detect import NoiseFloorDetect
from lib.gui.update_progress_bar import UpdateProgressBar
from lib.gui.capture import Capture
from lib.gui.noise_floor_plot import NoiseFloorPlot
from lib.gui.results import Results
class SuGui(QtWidgets.QMainWindow):
......@@ -168,9 +169,6 @@ class SuGui(QtWidgets.QMainWindow):
logging.info("Close application")
QtCore.QCoreApplication.instance().quit()
def results_button(self):
pass
def refresh_hw_button(self):
"""
Refresh combo box with current connected hardware.
......@@ -215,6 +213,17 @@ class SuGui(QtWidgets.QMainWindow):
self.nf_plot.label_data.setText(string)
self.nf_plot.show()
def results_button(self):
if len(Disk.get_su_created_folders(self.lineEdit_dump_file.text())) == 0:
QtWidgets.QMessageBox.about(self,
"No su path selected",
"Please select a su path.")
else:
self.results = Results(self.lineEdit_dump_file.text())
self.results.show()
def nf_plot_result(self, result):
print("Returned nf detect thread.")
self.nf_result = result
......@@ -229,6 +238,7 @@ class SuGui(QtWidgets.QMainWindow):
self.label_file_overwrite.setText("not writable")
self.label_file_overwrite.setStyleSheet('color: red')
else:
self.button_results.setEnabled(False)
self.label_file_overwrite.setText("")
self.label_disk_space.setText("Free disk space:\n" \
"" + Disk.sizeof_fmt(free_disk_space))
......
# -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from lib.disk import Disk
class Results(QtWidgets.QMainWindow):
def __init__(self, path):
super(Results, self).__init__()
uic.loadUi("lib/gui/su_results.ui", self)
self.path = path
self.setWindowTitle("Measurements in %s" % self.path)
self.tableView_results.setDisabled(True)
self.button_close.clicked.connect(self.close_button)
# holds full path
self.su_directories = Disk.get_su_created_folders(path)
self.create_table_view()
def close_button(self):
"""
Close button action
"""
self.close()
def create_table_view(self):
pass
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SU::Results</class>
<widget class="QMainWindow" name="SU::Results">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1009</width>
<height>571</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="button_close">
<property name="geometry">
<rect>
<x>860</x>
<y>530</y>
<width>141</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Close</string>
</property>
</widget>
<widget class="QColumnView" name="columnView_runs">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>301</width>
<height>271</height>
</rect>
</property>
</widget>
<widget class="QTableView" name="tableView_results">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>320</x>
<y>10</y>
<width>681</width>
<height>511</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="button_close_2">
<property name="geometry">
<rect>
<x>10</x>
<y>530</y>
<width>301</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Run signal detection</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>290</y>
<width>291</width>
<height>231</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</widget>
<action name="actionAbout">
<property name="text">
<string>About</string>
</property>
</action>
<action name="actionQuit">
<property name="text">
<string>Quit</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<tabstops>
<tabstop>button_close</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment