Skip to content

Commit

Permalink
Don't show number of hops in status bar if it isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
xmikos committed Mar 21, 2017
1 parent d8d158c commit 07d504a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions qspectrumanalyzer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,11 @@ def update_data(self, data_storage):
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"""
Expand Down

0 comments on commit 07d504a

Please sign in to comment.