Added waterfall_clear()

This commit is contained in:
ha7ilm 2016-08-11 22:53:28 +02:00
parent 5b360f86ea
commit 327ef6b51b

View File

@ -1894,6 +1894,14 @@ function waterfall_add(data)
waterfall_image.data[base+x*4+i] = ((color>>>0)>>((3-i)*8))&0xff;
}*/
if(mathbox_mode==MATHBOX_MODES.WATERFALL)
{
//Handle mathbox
for(var i=0;i<fft_size;i++) mathbox_data[i+mathbox_data_index*fft_size]=data[i];
mathbox_shift();
}
else
{
//Add line to waterfall image
oneline_image = canvas_context.createImageData(w,1);
for(x=0;x<w;x++)
@ -1907,13 +1915,9 @@ function waterfall_add(data)
canvas_context.putImageData(oneline_image, 0, canvas_actual_line--);
shift_canvases();
if(canvas_actual_line<0) add_canvas();
//Handle mathbox
if(mathbox_mode==MATHBOX_MODES.WATERFALL)
{
for(var i=0;i<fft_size;i++) mathbox_data[i+mathbox_data_index*fft_size]=data[i];
mathbox_shift();
}
}
/*
@ -2101,6 +2105,18 @@ function mathbox_toggle()
if(mathbox_mode == MATHBOX_MODES.UNINITIALIZED) mathbox_init();
mathbox_mode = (mathbox_mode == MATHBOX_MODES.NONE) ? MATHBOX_MODES.WATERFALL : MATHBOX_MODES.NONE;
mathbox_clear_data();
waterfall_clear();
}
function waterfall_clear()
{
while(canvases.length) //delete all canvases
{
var x=canvases.shift();
x.parentNode.removeChild(x);
delete x;
}
add_canvas();
}
function openwebrx_resize()