diff --git a/lib/gui/gui.py b/lib/gui/gui.py index caa4526d3d3c48de2042ddf30216417583b44612..524447b4214fa189422aa3336c83685861860458 100644 --- a/lib/gui/gui.py +++ b/lib/gui/gui.py @@ -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)) diff --git a/lib/gui/results.py b/lib/gui/results.py new file mode 100644 index 0000000000000000000000000000000000000000..d830e364dde7a971868d8d5ff6c35b7db168baf8 --- /dev/null +++ b/lib/gui/results.py @@ -0,0 +1,32 @@ +# -*- 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 diff --git a/lib/gui/su_results.ui b/lib/gui/su_results.ui new file mode 100644 index 0000000000000000000000000000000000000000..d14e156d72c15389dcc35e9aae9830501a532b98 --- /dev/null +++ b/lib/gui/su_results.ui @@ -0,0 +1,103 @@ +<?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>