From 1b9a525449f9fd152c39234c86ea9ad35696a52c Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Mon, 26 Feb 2024 05:44:56 -0500 Subject: [PATCH] Limited scaner to LSB, USB, CW, AM, SAM, NFM modes. --- htdocs/lib/Scanner.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/lib/Scanner.js b/htdocs/lib/Scanner.js index 852e06b1..b6d3f5eb 100644 --- a/htdocs/lib/Scanner.js +++ b/htdocs/lib/Scanner.js @@ -1,4 +1,5 @@ function Scanner(bookmarkBar, msec) { + this.modes = ['lsb', 'usb', 'cw', 'am', 'sam', 'nfm']; this.bbar = bookmarkBar; this.bookmarks = null; this.msec = msec; @@ -7,9 +8,6 @@ function Scanner(bookmarkBar, msec) { } Scanner.prototype.tuneBookmark = function(b) { - // Must have frequency, skip digital voice modes - if (!b.frequency || !b.modulation || b.modulation=='dmr') return false; - //console.log("TUNE: " + b.name + " at " + b.frequency + ": " + b.modulation); // Tune to the bookmark frequency @@ -91,9 +89,13 @@ Scanner.prototype.stop = function() { Scanner.prototype.start = function() { // If timer is not running... if (!this.timer) { - // Get all bookmarks from the bookmark bar - this.bookmarks = this.bbar.getAllBookmarks(); - this.current = -1; + // Nothing found yet + this.current = -1; + + // Get all scannable bookmarks from the bookmark bar + this.bookmarks = this.bbar.getAllBookmarks().filter( + (b) => !!b.frequency && !!b.modulation && this.modes.indexOf(b.modulation)>=0 + ); // If there are bookmarks to scan... if (this.bookmarks && this.bookmarks.length>0) {