Skip to content

Commit 19355e1

Browse files
Gary KeebleGary Keeble
authored andcommitted
Patch to fix incorrect notch width display
Fix to stop notch center line width extending to frequency zero if user has not setup the notch filter.
1 parent 8621618 commit 19355e1

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

js/graph_spectrum.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -239,33 +239,29 @@ try {
239239
if (mouseFrequency !=null) drawMarkerLine(mouseFrequency, PLOTTED_BLACKBOX_RATE, '', WIDTH, HEIGHT, (15*offset++) + MARGIN, "rgba(0,255,0,0.50)", 3);
240240
offset++; // make some space!
241241
if(flightLog.getSysConfig().gyro_lowpass_hz!=null) drawMarkerLine(flightLog.getSysConfig().gyro_lowpass_hz/100.0, PLOTTED_BLACKBOX_RATE, 'GYRO LPF cutoff', WIDTH, HEIGHT, (15*offset++) + MARGIN, "rgba(128,255,128,0.50)");
242-
if(flightLog.getSysConfig().gyro_notch_hz!=null) {
243-
if(flightLog.getSysConfig().gyro_notch_hz > 0) {
242+
if(flightLog.getSysConfig().gyro_notch_hz!=null && flightLog.getSysConfig().gyro_notch_cutoff!=null ) {
243+
if(flightLog.getSysConfig().gyro_notch_hz > 0 && flightLog.getSysConfig().gyro_notch_cutoff > 0) {
244244
var gradient = canvasCtx.createLinearGradient(0,0,0,(HEIGHT));
245245
gradient.addColorStop(1, 'rgba(128,255,128,0.10)');
246246
gradient.addColorStop(0, 'rgba(128,255,128,0.35)');
247247
drawMarkerLine(flightLog.getSysConfig().gyro_notch_hz/100.0, PLOTTED_BLACKBOX_RATE, null, WIDTH, HEIGHT, (15*offset) + MARGIN, gradient, (flightLog.getSysConfig().gyro_notch_hz - flightLog.getSysConfig().gyro_notch_cutoff)/100.0);
248248
drawMarkerLine(flightLog.getSysConfig().gyro_notch_hz/100.0, PLOTTED_BLACKBOX_RATE, 'GYRO notch center', WIDTH, HEIGHT, (15*offset++) + MARGIN, "rgba(128,255,128,0.50)"); // highlight the center
249-
if(flightLog.getSysConfig().gyro_notch_cutoff!=null) {
250-
drawMarkerLine(flightLog.getSysConfig().gyro_notch_cutoff/100.0, PLOTTED_BLACKBOX_RATE, 'GYRO notch cutoff', WIDTH, HEIGHT, (15*offset++) + MARGIN, "rgba(128,255,128,0.50)");
251-
}
249+
drawMarkerLine(flightLog.getSysConfig().gyro_notch_cutoff/100.0, PLOTTED_BLACKBOX_RATE, 'GYRO notch cutoff', WIDTH, HEIGHT, (15*offset++) + MARGIN, "rgba(128,255,128,0.50)");
252250
}
253251
}
254252
offset++; // make some space!
255253
if(isYawField) {
256254
if(flightLog.getSysConfig().yaw_lpf_hz!=null) drawMarkerLine(flightLog.getSysConfig().yaw_lpf_hz/100.0, PLOTTED_BLACKBOX_RATE, 'YAW LPF cutoff', WIDTH, HEIGHT, (15*offset++) + MARGIN);
257255
} else {
258256
if(flightLog.getSysConfig().dterm_lpf_hz!=null) drawMarkerLine(flightLog.getSysConfig().dterm_lpf_hz/100.0, PLOTTED_BLACKBOX_RATE, 'D-TERM LPF cutoff', WIDTH, HEIGHT, (15*offset++) + MARGIN);
259-
if(flightLog.getSysConfig().dterm_notch_hz!=null) {
260-
if(flightLog.getSysConfig().dterm_notch_hz > 0) {
257+
if(flightLog.getSysConfig().dterm_notch_hz!=null && flightLog.getSysConfig().dterm_notch_cutoff!=null ) {
258+
if(flightLog.getSysConfig().dterm_notch_hz > 0 && flightLog.getSysConfig().dterm_notch_cutoff > 0) {
261259
var gradient = canvasCtx.createLinearGradient(0,0,0,(HEIGHT));
262260
gradient.addColorStop(1, 'rgba(128,128,255,0.10)');
263261
gradient.addColorStop(0, 'rgba(128,128,255,0.35)');
264262
drawMarkerLine(flightLog.getSysConfig().dterm_notch_hz/100.0, PLOTTED_BLACKBOX_RATE, null, WIDTH, HEIGHT, (15*offset) + MARGIN, gradient, (flightLog.getSysConfig().dterm_notch_hz - flightLog.getSysConfig().dterm_notch_cutoff)/100.0);
265263
drawMarkerLine(flightLog.getSysConfig().dterm_notch_hz/100.0, PLOTTED_BLACKBOX_RATE, 'D-TERM notch center', WIDTH, HEIGHT, (15*offset++) + MARGIN); // highlight the center
266-
if(flightLog.getSysConfig().dterm_notch_cutoff!=null) {
267-
drawMarkerLine(flightLog.getSysConfig().dterm_notch_cutoff/100.0, PLOTTED_BLACKBOX_RATE, 'D-TERM notch cutoff', WIDTH, HEIGHT, (15*offset++) + MARGIN);
268-
}
264+
drawMarkerLine(flightLog.getSysConfig().dterm_notch_cutoff/100.0, PLOTTED_BLACKBOX_RATE, 'D-TERM notch cutoff', WIDTH, HEIGHT, (15*offset++) + MARGIN);
269265
}
270266
}
271267
}

js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Global Level Variables
44
var userSettings = {};
55

6-
var VIEWER_VERSION = '2.5.2'; // Current version
6+
var VIEWER_VERSION = '2.5.3'; // Current version
77

88
function BlackboxLogViewer() {
99
function supportsRequiredAPIs() {

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Betaflight - Blackbox Explorer",
33
"description": "Interactive flight log viewer for Betaflight",
4-
"version": "2.5.2",
4+
"version": "2.5.3",
55
"manifest_version": 2,
66
"app": {
77
"background": {

0 commit comments

Comments
 (0)