diff --git a/lib/gui/gui.py b/lib/gui/gui.py index 62fa4daf84c272d6b7037a0da0e2a0d71411f4c6..17d8fe502d0945a2f3ff59f0de76ef46b4f2b253 100644 --- a/lib/gui/gui.py +++ b/lib/gui/gui.py @@ -98,7 +98,10 @@ class SuGui(QtWidgets.QMainWindow): # Thread stuff # progress_bar self.progress_bar_thread.set_measure_time(options['capture_time']) - self.progress_bar_thread.progress.connect(self.update_progress_bar, QtCore.Qt.QueuedConnection) + self.progress_bar_thread.progress.connect(self.update_progress_bar, \ + QtCore.Qt.QueuedConnection) + self.progress_bar_thread.run_time.connect(self.update_run_time, \ + QtCore.Qt.QueuedConnection) self.progress_bar_thread.start() self._set_setEnabled(False) @@ -115,6 +118,11 @@ class SuGui(QtWidgets.QMainWindow): """ self.progressBar.setValue(text) + def update_run_time(self, run_time): + capture_time = self._extract_options()['capture_time'] + self.label_status. \ + setText("Time: %ss of %ss" % (run_time, capture_time)) + def stop_button(self): """ Stop button action in main window. diff --git a/lib/gui/update_progress_bar.py b/lib/gui/update_progress_bar.py index 76352e930d64743b1342bb47a3a705212449cdc8..02a3396de262d5ed0623188a04acfdef6d78473a 100644 --- a/lib/gui/update_progress_bar.py +++ b/lib/gui/update_progress_bar.py @@ -6,6 +6,7 @@ from PyQt5.QtCore import QThread, pyqtSignal, QObject class UpdateProgressBar(QThread): progress = pyqtSignal(int) + run_time = pyqtSignal(int) def __init__(self): """ @@ -25,6 +26,7 @@ class UpdateProgressBar(QThread): while True: running_time_in_percent = self.time_to_percent() self.progress.emit(running_time_in_percent) + self.run_time.emit(float(time.time())-self.start_time) if running_time_in_percent >= 100: # kill thread if 100 % is reached