Working waterfall with channel selection
This commit is contained in:
parent
5b99240944
commit
33f5f57524
4
csdr.py
4
csdr.py
@ -135,6 +135,10 @@ class dsp:
|
|||||||
return int(round(self.if_samp_rate()/31.25))
|
return int(round(self.if_samp_rate()/31.25))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
def secondary_bw(self):
|
||||||
|
if self.secondary_demodulator == "bpsk31":
|
||||||
|
return 31.25
|
||||||
|
|
||||||
def start_secondary_demodulator(self):
|
def start_secondary_demodulator(self):
|
||||||
if(not self.secondary_demodulator): return
|
if(not self.secondary_demodulator): return
|
||||||
print "[openwebrx] starting secondary demodulator from IF input sampled at %d"%self.if_samp_rate()
|
print "[openwebrx] starting secondary demodulator from IF input sampled at %d"%self.if_samp_rate()
|
||||||
|
@ -153,7 +153,9 @@
|
|||||||
<br />We're working on the code right now, so the application might fail.
|
<br />We're working on the code right now, so the application might fail.
|
||||||
</div>
|
</div>
|
||||||
<div class="openwebrx-panel" id="openwebrx-panel-digimodes" data-panel-name="digimodes" data-panel-pos="left" data-panel-order="2" data-panel-size="619,210">
|
<div class="openwebrx-panel" id="openwebrx-panel-digimodes" data-panel-name="digimodes" data-panel-pos="left" data-panel-order="2" data-panel-size="619,210">
|
||||||
<div id="openwebrx-digimode-canvas-container"></div>
|
<div id="openwebrx-digimode-canvas-container">
|
||||||
|
<div id="openwebrx-digimode-select-channel"></div>
|
||||||
|
</div>
|
||||||
<div id="openwebrx-digimode-content-container">
|
<div id="openwebrx-digimode-content-container">
|
||||||
<div class="gradient"></div>
|
<div class="gradient"></div>
|
||||||
<div id="openwebrx-digimode-content">
|
<div id="openwebrx-digimode-content">
|
||||||
|
@ -830,6 +830,7 @@ img.openwebrx-mirror-img
|
|||||||
#openwebrx-digimode-canvas-container canvas
|
#openwebrx-digimode-canvas-container canvas
|
||||||
{
|
{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#openwebrx-secondary-demod-listbox
|
#openwebrx-secondary-demod-listbox
|
||||||
@ -944,3 +945,18 @@ img.openwebrx-mirror-img
|
|||||||
0%{ transform: rotateX(0deg) rotateY(-90deg) translateX(-5px) scale(1.3); }
|
0%{ transform: rotateX(0deg) rotateY(-90deg) translateX(-5px) scale(1.3); }
|
||||||
100%{ transform: rotateX(0deg) rotateY(0deg) translateX(0) scale(1); }
|
100%{ transform: rotateX(0deg) rotateY(0deg) translateX(0) scale(1); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#openwebrx-digimode-select-channel
|
||||||
|
{
|
||||||
|
transition: all 500ms;
|
||||||
|
background-color: Yellow;
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
height: 100%;
|
||||||
|
width: 0px;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1206,6 +1206,12 @@ function on_ws_recv(evt)
|
|||||||
break;
|
break;
|
||||||
case "secondary_setup":
|
case "secondary_setup":
|
||||||
secondary_demod_init_canvases();
|
secondary_demod_init_canvases();
|
||||||
|
break;
|
||||||
|
case "if_samp_rate":
|
||||||
|
if_samp_rate=parseInt(param[1]);
|
||||||
|
break;
|
||||||
|
case "secondary_bw":
|
||||||
|
secondary_bw=parseFloat(param[1]);
|
||||||
break;
|
break;
|
||||||
case "fft_fps":
|
case "fft_fps":
|
||||||
fft_fps=parseInt(param[1]);
|
fft_fps=parseInt(param[1]);
|
||||||
@ -2241,13 +2247,13 @@ function secondary_demod_create_canvas()
|
|||||||
new_canvas.style.height=$(secondary_demod_canvas_container).height()+"px";
|
new_canvas.style.height=$(secondary_demod_canvas_container).height()+"px";
|
||||||
console.log(new_canvas.width, new_canvas.height, new_canvas.style.width, new_canvas.style.height);
|
console.log(new_canvas.width, new_canvas.height, new_canvas.style.width, new_canvas.style.height);
|
||||||
secondary_demod_current_canvas_actual_line=new_canvas.height-1;
|
secondary_demod_current_canvas_actual_line=new_canvas.height-1;
|
||||||
$(secondary_demod_canvas_container).append(new_canvas);
|
$(secondary_demod_canvas_container).children().last().before(new_canvas);
|
||||||
return new_canvas;
|
return new_canvas;
|
||||||
}
|
}
|
||||||
|
|
||||||
function secondary_demod_remove_canvases()
|
function secondary_demod_remove_canvases()
|
||||||
{
|
{
|
||||||
$(secondary_demod_canvas_container).children().remove();
|
$(secondary_demod_canvas_container).children("canvas").remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
function secondary_demod_init_canvases()
|
function secondary_demod_init_canvases()
|
||||||
@ -2263,6 +2269,7 @@ function secondary_demod_init_canvases()
|
|||||||
secondary_demod_current_canvas_actual_line=$(secondary_demod_canvas_container).height()-1;
|
secondary_demod_current_canvas_actual_line=$(secondary_demod_canvas_container).height()-1;
|
||||||
secondary_demod_current_canvas_index=0;
|
secondary_demod_current_canvas_index=0;
|
||||||
secondary_demod_canvases_initialized=true;
|
secondary_demod_canvases_initialized=true;
|
||||||
|
secondary_demod_update_marker();
|
||||||
}
|
}
|
||||||
|
|
||||||
function secondary_demod_canvases_update_top()
|
function secondary_demod_canvases_update_top()
|
||||||
@ -2283,6 +2290,12 @@ function secondary_demod_init()
|
|||||||
{
|
{
|
||||||
$("#openwebrx-panel-digimodes")[0].openwebrxHidden = true;
|
$("#openwebrx-panel-digimodes")[0].openwebrxHidden = true;
|
||||||
secondary_demod_canvas_container = $("#openwebrx-digimode-canvas-container")[0];
|
secondary_demod_canvas_container = $("#openwebrx-digimode-canvas-container")[0];
|
||||||
|
$(secondary_demod_canvas_container)
|
||||||
|
.mousemove(secondary_demod_canvas_container_mousemove)
|
||||||
|
.mouseup(secondary_demod_canvas_container_mouseup)
|
||||||
|
.mousedown(secondary_demod_canvas_container_mousedown)
|
||||||
|
.mouseenter(secondary_demod_canvas_container_mousein)
|
||||||
|
.mouseleave(secondary_demod_canvas_container_mouseout);
|
||||||
}
|
}
|
||||||
|
|
||||||
function secondary_demod_start(subtype)
|
function secondary_demod_start(subtype)
|
||||||
@ -2390,3 +2403,48 @@ function secondary_demod_listbox_update()
|
|||||||
console.log("update");
|
console.log("update");
|
||||||
secondary_demod_listbox_updating = false;
|
secondary_demod_listbox_updating = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
secondary_demod_channel_freq=1000;
|
||||||
|
function secondary_demod_update_marker()
|
||||||
|
{
|
||||||
|
var width = Math.max( (secondary_bw / if_samp_rate) * $(secondary_demod_canvas_container).width(), 5);
|
||||||
|
var center_at = (secondary_demod_channel_freq / if_samp_rate) * $(secondary_demod_canvas_container).width();
|
||||||
|
var left = center_at-width / 2;
|
||||||
|
console.log("sdum", width, left);
|
||||||
|
$("#openwebrx-digimode-select-channel").width(width).css("left",left+"px")
|
||||||
|
}
|
||||||
|
|
||||||
|
function secondary_demod_update_channel_freq_from_event(evt)
|
||||||
|
{
|
||||||
|
var relativeX=(evt.offsetX)?evt.offsetX:evt.layerX;
|
||||||
|
//console.log("ize", evt, e);
|
||||||
|
secondary_demod_channel_freq=(relativeX/$(secondary_demod_canvas_container).width()) * if_samp_rate;
|
||||||
|
secondary_demod_update_marker();
|
||||||
|
}
|
||||||
|
|
||||||
|
secondary_demod_mousedown=false;
|
||||||
|
function secondary_demod_canvas_container_mousein()
|
||||||
|
{
|
||||||
|
$("#openwebrx-digimode-select-channel").css("opacity","0.7");
|
||||||
|
}
|
||||||
|
|
||||||
|
function secondary_demod_canvas_container_mouseout()
|
||||||
|
{
|
||||||
|
$("#openwebrx-digimode-select-channel").css("opacity","0");
|
||||||
|
}
|
||||||
|
|
||||||
|
function secondary_demod_canvas_container_mousemove(evt)
|
||||||
|
{
|
||||||
|
if(secondary_demod_mousedown) secondary_demod_update_channel_freq_from_event(evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
function secondary_demod_canvas_container_mousedown(evt)
|
||||||
|
{
|
||||||
|
if(evt.which==1) secondary_demod_mousedown=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function secondary_demod_canvas_container_mouseup(evt)
|
||||||
|
{
|
||||||
|
if(evt.which==1) secondary_demod_mousedown=false;
|
||||||
|
secondary_demod_update_channel_freq_from_event(evt);
|
||||||
|
}
|
||||||
|
@ -522,7 +522,7 @@ class WebRXHandler(BaseHTTPRequestHandler):
|
|||||||
try:
|
try:
|
||||||
secondary_spectrum_data=dsp.read_secondary_fft(dsp.get_secondary_fft_bytes_to_read())
|
secondary_spectrum_data=dsp.read_secondary_fft(dsp.get_secondary_fft_bytes_to_read())
|
||||||
if len(secondary_spectrum_data) == 0: break
|
if len(secondary_spectrum_data) == 0: break
|
||||||
print "len(secondary_spectrum_data)", len(secondary_spectrum_data) #TODO digimodes
|
# print "len(secondary_spectrum_data)", len(secondary_spectrum_data) #TODO digimodes
|
||||||
rxws.send(self, secondary_spectrum_data, "FFTS")
|
rxws.send(self, secondary_spectrum_data, "FFTS")
|
||||||
except: break
|
except: break
|
||||||
myclient.loopstat=42
|
myclient.loopstat=42
|
||||||
@ -589,7 +589,7 @@ class WebRXHandler(BaseHTTPRequestHandler):
|
|||||||
else:
|
else:
|
||||||
dsp.set_secondary_demodulator(param_value)
|
dsp.set_secondary_demodulator(param_value)
|
||||||
do_secondary_demod = True
|
do_secondary_demod = True
|
||||||
rxws.send(self, "MSG secondary_fft_size={0} secondary_setup".format(cfg.digimodes_fft_size))
|
rxws.send(self, "MSG secondary_fft_size={0} if_samp_rate={1} secondary_bw={2} secondary_setup".format(cfg.digimodes_fft_size, dsp.if_samp_rate(), dsp.secondary_bw()))
|
||||||
if dsp_initialized: dsp.start()
|
if dsp_initialized: dsp.start()
|
||||||
elif param_name=="secondary_offset_freq" and 0 <= int(param_value) <= dsp.if_samp_rate()/2 and cfg.digimodes_enable:
|
elif param_name=="secondary_offset_freq" and 0 <= int(param_value) <= dsp.if_samp_rate()/2 and cfg.digimodes_enable:
|
||||||
dsp.set_secondary_offset_freq(int(param_value))
|
dsp.set_secondary_offset_freq(int(param_value))
|
||||||
|
Loading…
Reference in New Issue
Block a user