diff options
author | Scott Murray <scott.murray@konsulko.com> | 2017-12-21 19:39:18 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2017-12-21 19:39:18 -0500 |
commit | 4eb2ac75588b2ce1f47c2b52ec3ed9ce1b674d22 (patch) | |
tree | bccf355549c8b0b07dcfc75435f362d88c2c9b69 /app/api/Binding.qml | |
parent | 29410eb4d5fe7331379423aafca886e8098fd5d2 (diff) |
Changes include:
- Change the 'SCAN' label color when scanning. This visually
signals to the user that scanning is taking place, which is
useful with the Kingfisher Si4689 radio where scanning jumps
to a found station.
- Update the frequency when scanning signals a station is found.
This improves behavior when using the Kingfisher radio, where
the frequency update from the binding can fall prey to a race
with the scanning state change in the QML.
- Explicitly prevent triggering another scan while one is in
progress. This is more of a general robustness fix to prevent
unnecessary calls to the binding. It does help avoid potential
issues with the Kingfisher radio where we really cannot interrupt
a scan at present.
Change-Id: I08825c7f51d354a20b38f647e72e4535bca37bd9
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'app/api/Binding.qml')
-rw-r--r-- | app/api/Binding.qml | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/api/Binding.qml b/app/api/Binding.qml index 3b43510..7750452 100644 --- a/app/api/Binding.qml +++ b/app/api/Binding.qml @@ -106,6 +106,7 @@ WebSocket { } else if (event.event === "radio/station_found") { if(scanningState == activeState) { scanningState = stoppedState + frequency = event.data.value stationId = freq2str(event.data.value) root.stationFound() } @@ -177,13 +178,17 @@ WebSocket { } function scanUp() { - scanningState = activeState - sendSocketMessage("scan_start", { direction: "forward" }) + if(scanningState != activeState) { + scanningState = activeState + sendSocketMessage("scan_start", { direction: "forward" }) + } } function scanDown() { - scanningState = activeState - sendSocketMessage("scan_start", { direction: "backward" }) + if(scanningState != activeState) { + scanningState = activeState + sendSocketMessage("scan_start", { direction: "backward" }) + } } function updateFrequencyRange(band) { |