Adding all current customizations to the original forked code.
This commit is contained in:
@ -24,5 +24,7 @@
|
||||
<g id="play-button"><circle cx="350" cy="350" r="330" fill="none" stroke="#fff" stroke-width="36"/><path d="M195 211v278l366-139z" fill="#fff"/></g>
|
||||
<g id="meta-mute" stroke="#fff" stroke-width="5"><path stroke-linejoin="round" style="paint-order:fill" fill="none" d="m21.989 47.699 17.4 15.051V13.769L22.235 28.606H6v19.093z" transform="matrix(5.3513 0 0 5.3723 -.73 -1.542)"/><path d="m48.652 50.27 20.743-24.299M69.395 50.27 48.652 25.971" stroke-linecap="round" transform="matrix(5.3513 0 0 5.3723 -.73 -1.542)"/></g>
|
||||
<g id="waterfall-continuous"><g stroke="#fff" stroke-width="8"><path d="M5 40A35 35 0 0 1 26.606 7.664a35 35 0 0 1 38.143 7.587" fill="none"/><path d="m68.284 11.716 2.828 9.9-9.899-2.829z" fill="#fff"/></g><path d="m48.008 48.144 2.816 8.624h9.035L45.075 14h-9.739L20.141 56.768h8.976l2.875-8.624zm-2.405-7.333H34.456l5.573-16.72z" fill="#fff" aria-label="A"/><g stroke="#fff" stroke-width="8"><path d="M75 40a35 35 0 0 1-21.606 32.336 35 35 0 0 1-38.143-7.587" fill="none"/><path d="m11.716 68.284-2.828-9.9 9.899 2.829z" fill="#fff"/></g></g>
|
||||
<g id="noise-reduce" fill="#fff" stroke-width=".767"><path d="m 36.606611,74.237282 -9.008789,0 L 11.11833,30.951149 q 0.659179,3.164062 0.659179,4.96582 l 0,38.320313 -10.0195308,0 0,-68.7744143 9.0087888,0 16.479492,42.4072263 Q 26.58708,44.706032 26.58708,42.904274 l 0,-37.4414063 10.019531,0 0,68.7744143 z"/><path d="m 80.200361,74.237282 -10.722656,0 L 58.139814,42.28904 q 0,0 0,-6.196289 l 10.107422,0 0,-21.796875 -12.963867,0 0,59.941406 -10.283203,0 0,-68.7744143 27.290039,0 q 6.196289,0 6.196289,6.3281253 l 0,25.004883 q 0,4.350585 -2.944336,5.625 -1.582031,0.659179 -6.679688,0.659179 l 11.337891,31.157227 z"/></g>
|
||||
<g id="disabled" fill="#fff" stroke-width=".767"><path d="M 59.826868,-0.58229828 28.318079,81.155983 l -7.602539,0 31.376953,-81.73828128 7.734375,0 z"/></g>
|
||||
</defs>
|
||||
</svg>
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
@ -201,6 +201,12 @@
|
||||
</div>
|
||||
<input title="Waterfall maximum level" id="openwebrx-waterfall-color-max" class="openwebrx-panel-slider" type="range" min="-200" max="100" value="50" step="1" onchange="updateWaterfallColors(1);" oninput="updateVolume()">
|
||||
</div>
|
||||
<div class="openwebrx-panel-line">
|
||||
<div title="Noise reduction on/off" class="openwebrx-nr-toggle openwebrx-button openwebrx-slider-button" onclick="toggleNR();">
|
||||
<svg viewBox="0 0 80 80"><use xlink:href="static/gfx/svg-defs.svg#noise-reduce"></use></svg>
|
||||
</div>
|
||||
<input title="Noise reduction level" disabled id="openwebrx-panel-nr" class="openwebrx-panel-slider" type="range" min="-10" max="10" value="0" step="1" onchange="updateNR()" oninput="updateNR()">
|
||||
</div>
|
||||
<div class="openwebrx-panel-line">
|
||||
<div class="openwebrx-button openwebrx-square-button openwebrx-zoom-button" onclick="zoomInOneStep();" title="Zoom in one step"><svg viewBox="0 0 80 80"><use xlink:href="static/gfx/svg-defs.svg#zoom-in"></use></svg></div>
|
||||
<div class="openwebrx-button openwebrx-square-button openwebrx-zoom-button" onclick="zoomOutOneStep();" title="Zoom out one step"><svg viewBox="0 0 80 80"><use xlink:href="static/gfx/svg-defs.svg#zoom-out"></use></svg></div>
|
||||
|
@ -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?
|
||||
{
|
||||
|
@ -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,32 @@ $(function(){
|
||||
return infowindow;
|
||||
}
|
||||
|
||||
var linkifyCallsign = function(callsign) {
|
||||
if ((callsign_url == null) || (callsign_url == ''))
|
||||
return callsign;
|
||||
else
|
||||
return '<a target="callsign_info" href="' +
|
||||
callsign_url.replaceAll('{}', callsign.replace(new RegExp('-.*$'), '')) +
|
||||
'">' + callsign + '</a>';
|
||||
};
|
||||
|
||||
var distanceKm = function(p1, p2) {
|
||||
// Earth radius in km
|
||||
var R = 6371.0;
|
||||
// Convert degrees to radians
|
||||
var rlat1 = p1.lat() * (Math.PI/180);
|
||||
var rlat2 = p2.lat() * (Math.PI/180);
|
||||
// Compute difference in radians
|
||||
var difflat = rlat2-rlat1;
|
||||
var difflon = (p2.lng()-p1.lng()) * (Math.PI/180);
|
||||
// Compute distance
|
||||
d = 2 * R * Math.asin(Math.sqrt(
|
||||
Math.sin(difflat/2) * Math.sin(difflat/2) +
|
||||
Math.cos(rlat1) * Math.cos(rlat2) * Math.sin(difflon/2) * Math.sin(difflon/2)
|
||||
));
|
||||
return Math.round(d);
|
||||
}
|
||||
|
||||
var infowindow;
|
||||
var showLocatorInfoWindow = function(locator, pos) {
|
||||
var infowindow = getInfoWindow();
|
||||
@ -351,13 +381,15 @@ $(function(){
|
||||
}).sort(function(a, b){
|
||||
return b.lastseen - a.lastseen;
|
||||
});
|
||||
var distance = receiverMarker?
|
||||
" at " + distanceKm(receiverMarker.position, pos) + " km" : "";
|
||||
infowindow.setContent(
|
||||
'<h3>Locator: ' + locator + '</h3>' +
|
||||
'<h3>Locator: ' + locator + distance + '</h3>' +
|
||||
'<div>Active Callsigns:</div>' +
|
||||
'<ul>' +
|
||||
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 '<li>' + message + '</li>'
|
||||
@ -374,11 +406,15 @@ $(function(){
|
||||
var marker = markers[callsign];
|
||||
var timestring = moment(marker.lastseen).fromNow();
|
||||
var commentString = "";
|
||||
var distance = "";
|
||||
if (marker.comment) {
|
||||
commentString = '<div>' + marker.comment + '</div>';
|
||||
}
|
||||
if (receiverMarker) {
|
||||
distance = " at " + distanceKm(receiverMarker.position, marker.position) + " km";
|
||||
}
|
||||
infowindow.setContent(
|
||||
'<h3>' + callsign + '</h3>' +
|
||||
'<h3>' + linkifyCallsign(callsign) + distance + '</h3>' +
|
||||
'<div>' + timestring + ' using ' + marker.mode + ( marker.band ? ' on ' + marker.band : '' ) + '</div>' +
|
||||
commentString
|
||||
);
|
||||
|
@ -31,6 +31,9 @@ var fft_compression = "none";
|
||||
var fft_codec;
|
||||
var waterfall_setup_done = 0;
|
||||
var secondary_fft_size;
|
||||
var tuning_step = 1;
|
||||
var nr_enabled = false;
|
||||
var nr_threshold = 0;
|
||||
|
||||
function updateVolume() {
|
||||
audioEngine.setVolume(parseFloat($("#openwebrx-panel-volume").val()) / 100);
|
||||
@ -51,6 +54,28 @@ function toggleMute() {
|
||||
updateVolume();
|
||||
}
|
||||
|
||||
function updateNR() {
|
||||
var $nrPanel = $('#openwebrx-panel-nr');
|
||||
|
||||
nr_threshold = Math.round(parseFloat($nrPanel.val()));
|
||||
$nrPanel.attr('title', 'Noise level (' + nr_threshold + ' dB)');
|
||||
nr_changed();
|
||||
}
|
||||
|
||||
function toggleNR() {
|
||||
var $nrPanel = $('#openwebrx-panel-nr');
|
||||
|
||||
if ($nrPanel.prop('disabled')) {
|
||||
$nrPanel.prop('disabled', false);
|
||||
nr_enabled = true;
|
||||
} else {
|
||||
$nrPanel.prop('disabled', true);
|
||||
nr_enabled = false;
|
||||
}
|
||||
|
||||
nr_changed();
|
||||
}
|
||||
|
||||
function zoomInOneStep() {
|
||||
zoom_set(zoom_level + 1);
|
||||
}
|
||||
@ -257,18 +282,23 @@ var scale_canvas_drag_params = {
|
||||
};
|
||||
|
||||
function scale_canvas_mousedown(evt) {
|
||||
scale_canvas_drag_params.mouse_down = true;
|
||||
scale_canvas_drag_params.drag = false;
|
||||
scale_canvas_drag_params.start_x = evt.pageX;
|
||||
scale_canvas_drag_params.key_modifiers.shiftKey = evt.shiftKey;
|
||||
scale_canvas_drag_params.key_modifiers.altKey = evt.altKey;
|
||||
scale_canvas_drag_params.key_modifiers.ctrlKey = evt.ctrlKey;
|
||||
// Left button only
|
||||
if (evt.button == 0) {
|
||||
scale_canvas_drag_params.mouse_down = true;
|
||||
scale_canvas_drag_params.drag = false;
|
||||
scale_canvas_drag_params.start_x = evt.pageX;
|
||||
scale_canvas_drag_params.key_modifiers.shiftKey = evt.shiftKey;
|
||||
scale_canvas_drag_params.key_modifiers.altKey = evt.altKey;
|
||||
scale_canvas_drag_params.key_modifiers.ctrlKey = evt.ctrlKey;
|
||||
}
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
||||
function scale_offset_freq_from_px(x, visible_range) {
|
||||
if (typeof visible_range === "undefined") visible_range = get_visible_freq_range();
|
||||
return (visible_range.start + visible_range.bw * (x / waterfallWidth())) - center_freq;
|
||||
|
||||
var f = (visible_range.start + visible_range.bw * (x / waterfallWidth())) - center_freq;
|
||||
return tuning_step>0? Math.round(f / tuning_step) * tuning_step : f;
|
||||
}
|
||||
|
||||
function scale_canvas_mousemove(evt) {
|
||||
@ -307,7 +337,8 @@ function scale_canvas_end_drag(x) {
|
||||
}
|
||||
|
||||
function scale_canvas_mouseup(evt) {
|
||||
scale_canvas_end_drag(evt.pageX);
|
||||
if (evt.button == 0)
|
||||
scale_canvas_end_drag(evt.pageX);
|
||||
}
|
||||
|
||||
function scale_px_from_freq(f, range) {
|
||||
@ -513,11 +544,16 @@ function resize_scale() {
|
||||
|
||||
function canvas_get_freq_offset(relativeX) {
|
||||
var rel = (relativeX / canvas_container.clientWidth);
|
||||
return Math.round((bandwidth * rel) - (bandwidth / 2));
|
||||
var off = (bandwidth * rel) - (bandwidth / 2);
|
||||
|
||||
return tuning_step>0?
|
||||
Math.round(off / tuning_step) * tuning_step : Math.round(off);
|
||||
}
|
||||
|
||||
function canvas_get_frequency(relativeX) {
|
||||
return center_freq + canvas_get_freq_offset(relativeX);
|
||||
var f = center_freq + canvas_get_freq_offset(relativeX);
|
||||
|
||||
return tuning_step>0? Math.round(f / tuning_step) * tuning_step : f;
|
||||
}
|
||||
|
||||
|
||||
@ -535,16 +571,23 @@ function format_frequency(format, freq_hz, pre_divide, decimals) {
|
||||
var canvas_drag = false;
|
||||
var canvas_drag_min_delta = 1;
|
||||
var canvas_mouse_down = false;
|
||||
var canvas_mouse2_down = 0;
|
||||
var canvas_drag_last_x;
|
||||
var canvas_drag_last_y;
|
||||
var canvas_drag_start_x;
|
||||
var canvas_drag_start_y;
|
||||
|
||||
function canvas_mousedown(evt) {
|
||||
canvas_mouse_down = true;
|
||||
canvas_drag = false;
|
||||
canvas_drag_last_x = canvas_drag_start_x = evt.pageX;
|
||||
canvas_drag_last_y = canvas_drag_start_y = evt.pageY;
|
||||
if (evt.button > 0)
|
||||
if (canvas_mouse2_down == 0)
|
||||
canvas_mouse2_down = evt.button;
|
||||
else {
|
||||
canvas_mouse_down = true;
|
||||
canvas_drag = false;
|
||||
canvas_drag_last_x = canvas_drag_start_x = evt.pageX;
|
||||
canvas_drag_last_y = canvas_drag_start_y = evt.pageY;
|
||||
}
|
||||
|
||||
evt.preventDefault(); //don't show text selection mouse pointer
|
||||
}
|
||||
|
||||
@ -581,16 +624,21 @@ function canvas_container_mouseleave() {
|
||||
}
|
||||
|
||||
function canvas_mouseup(evt) {
|
||||
if (!waterfall_setup_done) return;
|
||||
var relativeX = get_relative_x(evt);
|
||||
if (evt.button > 0) {
|
||||
if (evt.button == canvas_mouse2_down)
|
||||
canvas_mouse2_down = 0;
|
||||
} else {
|
||||
if (!waterfall_setup_done) return;
|
||||
var relativeX = get_relative_x(evt);
|
||||
|
||||
if (!canvas_drag) {
|
||||
$('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().set_offset_frequency(canvas_get_freq_offset(relativeX));
|
||||
if (!canvas_drag) {
|
||||
$('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().set_offset_frequency(canvas_get_freq_offset(relativeX));
|
||||
}
|
||||
else {
|
||||
canvas_end_drag();
|
||||
}
|
||||
canvas_mouse_down = false;
|
||||
}
|
||||
else {
|
||||
canvas_end_drag();
|
||||
}
|
||||
canvas_mouse_down = false;
|
||||
}
|
||||
|
||||
function canvas_end_drag() {
|
||||
@ -618,7 +666,16 @@ function canvas_mousewheel(evt) {
|
||||
if (!waterfall_setup_done) return;
|
||||
var relativeX = get_relative_x(evt);
|
||||
var dir = (evt.deltaY / Math.abs(evt.deltaY)) > 0;
|
||||
zoom_step(dir, relativeX, zoom_center_where_calc(evt.pageX));
|
||||
|
||||
// Zoom when mouse button down, tune otherwise
|
||||
if (canvas_mouse2_down > 0) {
|
||||
zoom_step(dir, relativeX, zoom_center_where_calc(evt.pageX));
|
||||
} else {
|
||||
var f = $('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().get_offset_frequency();
|
||||
f += dir? -tuning_step : tuning_step;
|
||||
$('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().set_offset_frequency(f);
|
||||
}
|
||||
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
||||
@ -771,11 +828,15 @@ function on_ws_recv(evt) {
|
||||
$('#openwebrx-sdr-profiles-listbox').val(currentprofile.toString());
|
||||
|
||||
waterfall_clear();
|
||||
zoom_set(0);
|
||||
}
|
||||
|
||||
if ('tuning_precision' in config)
|
||||
$('#openwebrx-panel-receiver').demodulatorPanel().setTuningPrecision(config['tuning_precision']);
|
||||
|
||||
if ('tuning_step' in config)
|
||||
tuning_step = config['tuning_step'];
|
||||
|
||||
break;
|
||||
case "secondary_config":
|
||||
var s = json['value'];
|
||||
@ -935,9 +996,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)
|
||||
@ -1556,3 +1623,13 @@ function sdr_profile_changed() {
|
||||
var value = $('#openwebrx-sdr-profiles-listbox').val();
|
||||
ws.send(JSON.stringify({type: "selectprofile", params: {profile: value}}));
|
||||
}
|
||||
|
||||
function nr_changed() {
|
||||
ws.send(JSON.stringify({
|
||||
"type": "connectionproperties",
|
||||
"params": {
|
||||
"nr_enabled": nr_enabled,
|
||||
"nr_threshold": nr_threshold
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
Reference in New Issue
Block a user