update bookmarks

This commit is contained in:
Jakob Ketterl 2020-05-02 01:10:41 +02:00
parent d9a818525d
commit 20023e3989
2 changed files with 2 additions and 5 deletions

View File

@ -8,13 +8,10 @@ function BookmarkBar() {
var $bookmark = $(e.target).closest('.bookmark'); var $bookmark = $(e.target).closest('.bookmark');
me.$container.find('.bookmark').removeClass('selected'); me.$container.find('.bookmark').removeClass('selected');
var b = $bookmark.data(); var b = $bookmark.data();
if (!b || !b.frequency || (!b.modulation && !b.digital_modulation)) return; if (!b || !b.frequency || !b.modulation) return;
me.getDemodulator().set_offset_frequency(b.frequency - center_freq); me.getDemodulator().set_offset_frequency(b.frequency - center_freq);
if (b.modulation) { if (b.modulation) {
me.getDemodulatorPanel().setMode(b.modulation); me.getDemodulatorPanel().setMode(b.modulation);
} else if (b.digital_modulation) {
// TODO: update bookmarks so they don't contain digital_modulation
me.getDemodulatorPanel().setMode(b.digital_modulation);
} }
$bookmark.addClass('selected'); $bookmark.addClass('selected');
}); });

View File

@ -818,7 +818,7 @@ function on_ws_recv(evt) {
var as_bookmarks = json['value'].map(function (d) { var as_bookmarks = json['value'].map(function (d) {
return { return {
name: d['mode'].toUpperCase(), name: d['mode'].toUpperCase(),
digital_modulation: d['mode'], modulation: d['mode'],
frequency: d['frequency'] frequency: d['frequency']
}; };
}); });