Don't show number of hops in status bar if it isn't available

This commit is contained in:
Michal Krenek (Mikos) 2017-03-21 16:59:48 +01:00
parent d8d158c100
commit 07d504ab30

View File

@ -432,14 +432,11 @@ class QSpectrumAnalyzerMainWindow(QtWidgets.QMainWindow, Ui_QSpectrumAnalyzerMai
sweep_time = timestamp - self.prev_data_timestamp
self.prev_data_timestamp = timestamp
self.show_status(
self.tr("Frequency hops: {} | Sweep time: {:.2f} s | FPS: {:.2f}").format(
self.power_thread.params["hops"] or self.tr("N/A"),
sweep_time,
1 / sweep_time
),
timeout=0
)
status = []
if self.power_thread.params["hops"]:
status.append(self.tr("Frequency hops: {}").format(self.power_thread.params["hops"]))
status.append(self.tr("Sweep time: {:.2f} s | FPS: {:.2f}").format(sweep_time, 1 / sweep_time))
self.show_status(" | ".join(status), timeout=0)
def start(self, single_shot=False):
"""Start power thread"""