mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Set waterfall theme and small wf optimization
This commit is contained in:
parent
1de42f6ff1
commit
94b4889478
4 changed files with 46 additions and 23 deletions
|
@ -92,7 +92,8 @@ const configDefaultSettings = '{\
|
||||||
"tuning_range_fmax" : "50.0",\
|
"tuning_range_fmax" : "50.0",\
|
||||||
"respond_to_cq" : "True",\
|
"respond_to_cq" : "True",\
|
||||||
"rx_buffer_size" : "16", \
|
"rx_buffer_size" : "16", \
|
||||||
"enable_explorer" : "False" \
|
"enable_explorer" : "False", \
|
||||||
|
"wftheme": 2 \
|
||||||
}';
|
}';
|
||||||
|
|
||||||
if (!fs.existsSync(configPath)) {
|
if (!fs.existsSync(configPath)) {
|
||||||
|
|
|
@ -413,10 +413,13 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', ()
|
||||||
// Create spectrum object on canvas with ID "waterfall"
|
// Create spectrum object on canvas with ID "waterfall"
|
||||||
global.spectrum = new Spectrum(
|
global.spectrum = new Spectrum(
|
||||||
"waterfall", {
|
"waterfall", {
|
||||||
spectrumPercent: 0
|
spectrumPercent: 0,
|
||||||
|
wf_rows: 192 //Assuming 1 row = 1 pixe1, 192 is the height of the spectrum container
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Set waterfalltheme
|
||||||
|
document.getElementById("wftheme_selector").value = config.wftheme;
|
||||||
|
spectrum.setColorMap(config.wftheme);
|
||||||
|
|
||||||
// on click radio control toggle view
|
// on click radio control toggle view
|
||||||
// disabled
|
// disabled
|
||||||
|
@ -1120,9 +1123,17 @@ document.getElementById('hamlib_rigctld_stop').addEventListener('click', () => {
|
||||||
config.theme = theme;
|
config.theme = theme;
|
||||||
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Waterfall theme selector changed
|
||||||
|
document.getElementById("wftheme_selector").addEventListener("change", () => {
|
||||||
|
var wftheme = document.getElementById("wftheme_selector").value;
|
||||||
|
spectrum.setColorMap(wftheme);
|
||||||
|
config.wftheme = wftheme;
|
||||||
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update channel selector clicked
|
// Update channel selector clicked
|
||||||
document.getElementById("update_channel_selector").addEventListener("click", () => {
|
document.getElementById("update_channel_selector").addEventListener("click", () => {
|
||||||
config.update_channel = document.getElementById("update_channel_selector").value;
|
config.update_channel = document.getElementById("update_channel_selector").value;
|
||||||
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
||||||
|
|
|
@ -1192,6 +1192,17 @@
|
||||||
<option value="zephyr">Zephyr</option>
|
<option value="zephyr">Zephyr</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="input-group input-group-sm mb-1"> <span class="input-group-text w-50" id="basic-addon1">Waterfall Theme</span>
|
||||||
|
<select class="form-select form-select-sm w-50" id="wftheme_selector">
|
||||||
|
<option value="2">Default</option>
|
||||||
|
<option value="0">Turbo</option>
|
||||||
|
<option value="1">Fosphor</option>
|
||||||
|
<option value="3">Inferno</option>
|
||||||
|
<option value="4">Magma</option>
|
||||||
|
<option value="5">Jet</option>
|
||||||
|
<option value="6">Binary</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div class="input-group input-group-sm mb-1"> <span class="input-group-text w-50" id="basic-addon1">Update channel</span>
|
<div class="input-group input-group-sm mb-1"> <span class="input-group-text w-50" id="basic-addon1">Update channel</span>
|
||||||
<select class="form-select form-select-sm w-50" id="update_channel_selector">
|
<select class="form-select form-select-sm w-50" id="update_channel_selector">
|
||||||
<option value="latest">stable</option>
|
<option value="latest">stable</option>
|
||||||
|
|
|
@ -88,40 +88,34 @@ Spectrum.prototype.drawSpectrum = function(bins) {
|
||||||
this.ctx_wf.stroke()
|
this.ctx_wf.stroke()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 586Hz LINES
|
// 586Hz and 1700Hz LINES
|
||||||
var bandwidth = 568;
|
var linePositionLow = 121.6; //150 - bandwith/20
|
||||||
var linePositionLow = 150 - ((bandwidth/2)/10);
|
var linePositionHigh = 178.4; //150 + bandwidth/20
|
||||||
var linePositionHigh = 150 + ((bandwidth/2)/10);
|
var linePositionLow2 = 65; //150 - bandwith/20
|
||||||
|
var linePositionHigh2 = 235; //150 + bandwith/20
|
||||||
this.ctx_wf.beginPath();
|
this.ctx_wf.beginPath();
|
||||||
this.ctx_wf.moveTo(linePositionLow,0);
|
this.ctx_wf.moveTo(linePositionLow,0);
|
||||||
this.ctx_wf.lineTo(linePositionLow, height);
|
this.ctx_wf.lineTo(linePositionLow, height);
|
||||||
this.ctx_wf.moveTo(linePositionHigh,0);
|
this.ctx_wf.moveTo(linePositionHigh,0);
|
||||||
this.ctx_wf.lineTo(linePositionHigh, height);
|
this.ctx_wf.lineTo(linePositionHigh, height);
|
||||||
|
this.ctx_wf.moveTo(linePositionLow2,0);
|
||||||
|
this.ctx_wf.lineTo(linePositionLow2, height);
|
||||||
|
this.ctx_wf.moveTo(linePositionHigh2,0);
|
||||||
|
this.ctx_wf.lineTo(linePositionHigh2, height);
|
||||||
this.ctx_wf.lineWidth = 1;
|
this.ctx_wf.lineWidth = 1;
|
||||||
this.ctx_wf.strokeStyle = '#C3C3C3';
|
this.ctx_wf.strokeStyle = '#C3C3C3';
|
||||||
this.ctx_wf.stroke()
|
this.ctx_wf.stroke()
|
||||||
|
|
||||||
// 1700Hz LINES
|
// ---- END OF MODIFICATION ------
|
||||||
var bandwidth = 1700;
|
|
||||||
var linePositionLow = 150 - ((bandwidth/2)/10);
|
|
||||||
var linePositionHigh = 150 + ((bandwidth/2)/10);
|
|
||||||
this.ctx_wf.beginPath();
|
|
||||||
this.ctx_wf.moveTo(linePositionLow,0);
|
|
||||||
this.ctx_wf.lineTo(linePositionLow, height);
|
|
||||||
this.ctx_wf.moveTo(linePositionHigh,0);
|
|
||||||
this.ctx_wf.lineTo(linePositionHigh, height);
|
|
||||||
this.ctx_wf.lineWidth = 1;
|
|
||||||
this.ctx_wf.strokeStyle = '#C3C3C3';
|
|
||||||
this.ctx_wf.stroke()
|
|
||||||
|
|
||||||
|
|
||||||
// ---- END OF MODIFICATION ------
|
|
||||||
|
|
||||||
|
|
||||||
// Fill with black
|
// Fill with black
|
||||||
this.ctx.fillStyle = "white";
|
this.ctx.fillStyle = "white";
|
||||||
this.ctx.fillRect(0, 0, width, height);
|
this.ctx.fillRect(0, 0, width, height);
|
||||||
|
|
||||||
|
//Commenting out the remainder of this code, it's not needed and unused as of 6.9.11 and saves three if statements
|
||||||
|
return;
|
||||||
|
/*
|
||||||
// FFT averaging
|
// FFT averaging
|
||||||
if (this.averaging > 0) {
|
if (this.averaging > 0) {
|
||||||
if (!this.binsAverage || this.binsAverage.length != bins.length) {
|
if (!this.binsAverage || this.binsAverage.length != bins.length) {
|
||||||
|
@ -174,6 +168,12 @@ Spectrum.prototype.drawSpectrum = function(bins) {
|
||||||
|
|
||||||
// Copy axes from offscreen canvas
|
// Copy axes from offscreen canvas
|
||||||
this.ctx.drawImage(this.ctx_axes.canvas, 0, 0);
|
this.ctx.drawImage(this.ctx_axes.canvas, 0, 0);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
//Allow setting colormap
|
||||||
|
Spectrum.prototype.setColorMap = function(index) {
|
||||||
|
this.colormap = colormaps[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
Spectrum.prototype.updateAxes = function() {
|
Spectrum.prototype.updateAxes = function() {
|
||||||
|
|
Loading…
Reference in a new issue