Now allowing to scan digital modes, by defaulting to not scanning them.

This commit is contained in:
Marat Fayzullin 2024-08-06 23:43:58 -04:00
parent 66d230eaa8
commit 6882e9a640
3 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,6 @@
function BookmarkBar() {
var me = this;
me.toScan = ['lsb', 'usb', 'usbd', 'cw', 'am', 'sam', 'nfm'];
me.modesToScan = ['lsb', 'usb', 'cw', 'am', 'sam', 'nfm'];
me.localBookmarks = new BookmarkLocalStorage();
me.$container = $("#openwebrx-bookmarks-container");
me.bookmarks = {};
@ -113,7 +113,7 @@ BookmarkBar.prototype.showEditDialog = function(bookmark) {
name: "",
frequency: center_freq + this.getDemodulator().get_offset_frequency(),
modulation: mode,
scannable : this.toScan.indexOf(mode) >= 0
scannable : this.modesToScan.indexOf(mode) >= 0
}
}
this.$dialog.bookmarkDialog().setValues(bookmark);

View File

@ -1,5 +1,5 @@
function Scanner(bookmarkBar, msec) {
this.modes = ['lsb', 'usb', 'usbd', 'cw', 'am', 'sam', 'nfm'];
this.modes = ['lsb', 'usb', 'cw', 'am', 'sam', 'nfm'];
this.bbar = bookmarkBar;
this.bookmarks = null;
this.msec = msec;
@ -93,7 +93,7 @@ Scanner.prototype.start = function() {
this.current = -1;
// Get all scannable bookmarks from the bookmark bar
this.bookmarks = this.bbar.getAllBookmarks().filter(
(b) => !!b.scannable && !!b.frequency && !!b.modulation && this.modes.indexOf(b.modulation)>=0
(b) => !!b.scannable && !!b.frequency && !!b.modulation
);
// If there are bookmarks to scan...

View File

@ -10,13 +10,19 @@ logger = logging.getLogger(__name__)
class Bookmark(object):
SCANNABLE_MODES = ["lsb", "usb", "cw", "am", "sam", "nfm"]
def __init__(self, j, srcFile: str = None):
self.name = j["name"]
self.frequency = j["frequency"]
self.modulation = j["modulation"]
self.description = j["description"] if "description" in j else ""
self.scannable = j["scannable"] if "scannable" in j else True
self.srcFile = srcFile
# By default, only scan modulations that make sense to scan
if "scannable" in j:
self.scannable = j["scannable"]
else:
self.scannable = j["modulation"] in Bookmark.SCANNABLE_MODES
def getName(self):
return self.name