From 339864a5727727a0955be85585bc52d30cf0b572 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Sun, 31 Jul 2022 14:40:20 -0400 Subject: [PATCH 1/5] Now calculating waterfall colors based on what is on the screen (with zoom). --- htdocs/openwebrx.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 7a075e9..a0848db 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -942,9 +942,15 @@ var waterfall_measure_minmax_now = false; var waterfall_measure_minmax_continuous = false; function waterfall_measure_minmax_do(what) { + // Get visible range + var range = get_visible_freq_range(); + var start = center_freq - bandwidth / 2; + // this is based on an oversampling factor of about 1,25 - var ignored = .1 * what.length; - var data = what.slice(ignored, -ignored); + range.start = Math.max(0.1, (range.start - start) / bandwidth); + range.end = Math.min(0.9, (range.end - start) / bandwidth); + + var data = what.slice(range.start * what.length, range.end * what.length); return { min: Math.min.apply(Math, data), max: Math.max.apply(Math, data) From ff4355541143203d9c503fe06e8bf962a79d2d1d Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Sun, 31 Jul 2022 15:01:15 -0400 Subject: [PATCH 2/5] Now resetting zoom when changing to a different profile. --- htdocs/openwebrx.js | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 7a075e9..e02f3ef 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -778,6 +778,7 @@ function on_ws_recv(evt) { $('#openwebrx-sdr-profiles-listbox').val(currentprofile.toString()); waterfall_clear(); + zoom_set(0); } if ('tuning_precision' in config) From 2ccdc90cc5a8be2bf9c7f408cff54e8705aed89d Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Mon, 25 Jul 2022 22:55:18 -0400 Subject: [PATCH 3/5] Added an option to add callsign database URL for lookups on a map. --- htdocs/map.js | 17 +++++++++++++++-- owrx/config/defaults.py | 1 + owrx/connection.py | 1 + owrx/controllers/settings/general.py | 7 +++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/htdocs/map.js b/htdocs/map.js index af879d0..9a5141f 100644 --- a/htdocs/map.js +++ b/htdocs/map.js @@ -37,6 +37,7 @@ $(function(){ var retention_time = 2 * 60 * 60 * 1000; var strokeOpacity = 0.8; var fillOpacity = 0.35; + var callsign_url = null; var colorKeys = {}; var colorScale = chroma.scale(['red', 'blue', 'green']).mode('hsl'); @@ -286,6 +287,9 @@ $(function(){ if ('map_position_retention_time' in config) { retention_time = config.map_position_retention_time * 1000; } + if ('callsign_url' in config) { + callsign_url = config['callsign_url']; + } break; case "update": processUpdates(json.value); @@ -340,6 +344,15 @@ $(function(){ return infowindow; } + var linkifyCallsign = function(callsign) { + if ((callsign_url == null) || (callsign_url == '')) + return callsign; + else + return '' + callsign + ''; + }; + var infowindow; var showLocatorInfoWindow = function(locator, pos) { var infowindow = getInfoWindow(); @@ -357,7 +370,7 @@ $(function(){ '
    ' + inLocator.map(function(i){ var timestring = moment(i.lastseen).fromNow(); - var message = i.callsign + ' (' + timestring + ' using ' + i.mode; + var message = linkifyCallsign(i.callsign) + ' (' + timestring + ' using ' + i.mode; if (i.band) message += ' on ' + i.band; message += ')'; return '
  • ' + message + '
  • ' @@ -378,7 +391,7 @@ $(function(){ commentString = '
    ' + marker.comment + '
    '; } infowindow.setContent( - '

    ' + callsign + '

    ' + + '

    ' + linkifyCallsign(callsign) + '

    ' + '
    ' + timestring + ' using ' + marker.mode + ( marker.band ? ' on ' + marker.band : '' ) + '
    ' + commentString ); diff --git a/owrx/config/defaults.py b/owrx/config/defaults.py index f03dded..203c257 100644 --- a/owrx/config/defaults.py +++ b/owrx/config/defaults.py @@ -147,6 +147,7 @@ defaultConfig = PropertyLayer( squelch_auto_margin=10, google_maps_api_key="", map_position_retention_time=2 * 60 * 60, + callsign_url="https://www.qrzcq.com/call/{}", decoding_queue_workers=2, decoding_queue_length=10, wsjt_decoding_depth=3, diff --git a/owrx/connection.py b/owrx/connection.py index 699da31..dfb526c 100644 --- a/owrx/connection.py +++ b/owrx/connection.py @@ -456,6 +456,7 @@ class MapConnection(OpenWebRxClient): "google_maps_api_key", "receiver_gps", "map_position_retention_time", + "callsign_url", "receiver_name", ) filtered_config.wire(self.write_config) diff --git a/owrx/controllers/settings/general.py b/owrx/controllers/settings/general.py index 232c543..7958368 100644 --- a/owrx/controllers/settings/general.py +++ b/owrx/controllers/settings/general.py @@ -168,6 +168,13 @@ class GeneralSettingsController(SettingsFormController): infotext="Specifies how log markers / grids will remain visible on the map", append="s", ), + TextInput( + "callsign_url", + "Callsign database URL", + infotext="Specifies callsign lookup URL, such as QRZ.COM " + + "or QRZCQ.COM. Place curly brackers ({}) where callsign " + + "is supposed to be.", + ), ), ] From bb625a5f9f99777d5958f465693fd61446dc4ac2 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Sun, 24 Jul 2022 22:57:56 -0400 Subject: [PATCH 4/5] Added filter boundaries display. --- htdocs/lib/Demodulator.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/lib/Demodulator.js b/htdocs/lib/Demodulator.js index b43adce..79282b6 100644 --- a/htdocs/lib/Demodulator.js +++ b/htdocs/lib/Demodulator.js @@ -81,6 +81,12 @@ Envelope.prototype.draw = function(visible_range){ scale_ctx.fill(); scale_ctx.globalAlpha = 1; scale_ctx.stroke(); + scale_ctx.lineWidth = 1; + scale_ctx.textAlign = "left"; + scale_ctx.fillText(this.demodulator.high_cut.toString(), to_px + env_att_w, env_h2); + scale_ctx.textAlign = "right"; + scale_ctx.fillText(this.demodulator.low_cut.toString(), from_px - env_att_w, env_h2); + scale_ctx.lineWidth = 3; } if (typeof line !== "undefined") // out of screen? { From e92b6d657bbde1ea7bbc9f311896ff097cc9511e Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Sun, 31 Jul 2022 16:10:33 -0400 Subject: [PATCH 5/5] Addressing comments from jketterl. --- htdocs/map.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/map.js b/htdocs/map.js index 9a5141f..8c9ea8c 100644 --- a/htdocs/map.js +++ b/htdocs/map.js @@ -348,9 +348,9 @@ $(function(){ if ((callsign_url == null) || (callsign_url == '')) return callsign; else - return '' + callsign + ''; + '">' + callsign + ''; }; var infowindow;