Skip to content

Commit b33f719

Browse files
committed
Fix debug modes
1 parent 4b20639 commit b33f719

File tree

4 files changed

+40
-38
lines changed

4 files changed

+40
-38
lines changed

js/flightlog_fielddefs.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ let
348348
"GPS_RESCUE_TRACKING",
349349
"ATTITUDE",
350350
"VTX_MSP",
351+
"GPS_DOP",
351352
]),
352353

353354
SUPER_EXPO_YAW = makeReadOnly([
@@ -541,24 +542,9 @@ function adjustFieldDefsList(firmwareType, firmwareVersion) {
541542
DEBUG_MODE.splice(DEBUG_MODE.indexOf('DUAL_GYRO'), 1);
542543
DEBUG_MODE.splice(DEBUG_MODE.indexOf('DUAL_GYRO_COMBINED'), 1);
543544
}
544-
if (semver.gte(firmwareVersion, '4.2.0')) {
545-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('FF_INTERPOLATED'), 1);
546-
}
547545
if (semver.gte(firmwareVersion, '4.3.0')) {
548546
DEBUG_MODE.splice(DEBUG_MODE.indexOf('FF_INTERPOLATED'), 1, 'FEEDFORWARD');
549547
DEBUG_MODE.splice(DEBUG_MODE.indexOf('FF_LIMIT'), 1, 'FEEDFORWARD_LIMIT');
550-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('DYN_IDLE'), 1);
551-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('FFT'), 1);
552-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('FFT_TIME'), 1);
553-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('FFT_FREQ'), 1);
554-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('GPS_RESCUE_THROTTLE_PID'), 1);
555-
}
556-
if (semver.gte(firmwareVersion, '4.4.0')) {
557-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('BARO'), 1);
558-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('RTH'), 1);
559-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('GPS_RESCUE_THROTTLE_PID'), 1);
560-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('VTX_MSP'), 1);
561-
DEBUG_MODE.splice(DEBUG_MODE.indexOf('GPS_DOP'), 1);
562548
}
563549

564550
DEBUG_MODE = makeReadOnly(DEBUG_MODE);

js/flightlog_fields_presenter.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,20 @@ function FlightLogFieldPresenter() {
676676
'debug[2]':'Setpoint Roll',
677677
'debug[3]':'Setpoint Pitch',
678678
},
679+
'VTX_MSP' : {
680+
'debug[all]': 'VTX MSP',
681+
'debug[0]': 'packetCounter',
682+
'debug[1]': 'isCrsfPortConfig',
683+
'debug[2]': 'isLowPowerDisarmed',
684+
'debug[3]': 'mspTelemetryDescriptor',
685+
},
686+
'GPS_DOP' : {
687+
'debug[all]': 'GPS Dilution of Precision',
688+
'debug[0]': 'Number of Satellites',
689+
'debug[1]': 'pDOP (positional - 3D)',
690+
'debug[2]': 'hDOP (horizontal - 2D)',
691+
'debug[3]': 'vDOP (vertical - 1D)',
692+
},
679693
};
680694

681695
let DEBUG_FRIENDLY_FIELD_NAMES = null;
@@ -707,20 +721,6 @@ function FlightLogFieldPresenter() {
707721
'debug[2]':'Altitude',
708722
'debug[3]':'Target altitude',
709723
};
710-
DEBUG_FRIENDLY_FIELD_NAMES.VTX_MSP = {
711-
'debug[all]': 'VTX MSP',
712-
'debug[0]': 'packetCounter',
713-
'debug[1]': 'isCrsfPortConfig',
714-
'debug[2]': 'isLowPowerDisarmed',
715-
'debug[3]': 'mspTelemetryDescriptor',
716-
};
717-
DEBUG_FRIENDLY_FIELD_NAMES.GPS_DOP = {
718-
'debug[all]': 'GPS Dilution of Precision',
719-
'debug[0]': 'Number of Satellites',
720-
'debug[1]': 'pDOP (positional - 3D)',
721-
'debug[2]': 'hDOP (horizontal - 2D)',
722-
'debug[3]': 'vDOP (vertical - 1D)',
723-
};
724724
} else if (semver.gte(firmwareVersion, '4.3.0')) {
725725
DEBUG_FRIENDLY_FIELD_NAMES.FEEDFORWARD = {
726726
'debug[all]':'Feedforward [roll]',
@@ -1327,7 +1327,7 @@ function FlightLogFieldPresenter() {
13271327
case 'debug[2]': // hDOP (horizontal - 2D)
13281328
case 'debug[3]': // vDOP (vertical - 1D)
13291329
default:
1330-
return (value / 100).toFixed(1);
1330+
return (value / 100).toFixed(2);
13311331
}
13321332
}
13331333
return value.toFixed(0);

js/graph_config.js

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,23 @@ GraphConfig.load = function(config) {
893893
};
894894
default:
895895
return getCurveForMinMaxFields(fieldName);
896-
}
896+
}
897+
case 'GPS_DOP':
898+
switch (fieldName) {
899+
case 'debug[0]': // Number of Satellites (now this is in normal GPS data, maybe gpsTrust?)
900+
case 'debug[1]': // pDOP
901+
case 'debug[2]': // hDOP
902+
case 'debug[3]': // vDOP
903+
return {
904+
offset: 0,
905+
power: 1.0,
906+
inputRange: 200,
907+
outputRange: 1.0,
908+
};
909+
default:
910+
return getCurveForMinMaxFields(fieldName);
911+
}
912+
897913
case 'BARO':
898914
switch (fieldName) {
899915
case 'debug[0]': // Baro state 0-10
@@ -941,7 +957,7 @@ GraphConfig.load = function(config) {
941957
i, j;
942958

943959
const EXAMPLE_GRAPHS = [];
944-
960+
945961
if (!flightLog.isFieldDisabled().MOTORS) {
946962
EXAMPLE_GRAPHS.push({label: "Motors",fields: ["motor[all]", "servo[5]"]});
947963
EXAMPLE_GRAPHS.push({label: "Motors (Legacy)",fields: ["motorLegacy[all]", "servo[5]"]});
@@ -990,7 +1006,7 @@ GraphConfig.load = function(config) {
9901006
height: srcGraph.height || 1
9911007
},
9921008
found;
993-
1009+
9941010
if (graphNames !== undefined) {
9951011
found = false;
9961012
for (j = 0; j < graphNames.length; j++) {
@@ -999,12 +1015,12 @@ GraphConfig.load = function(config) {
9991015
break;
10001016
}
10011017
}
1002-
1018+
10031019
if (!found) {
10041020
continue;
10051021
}
10061022
}
1007-
1023+
10081024
for (j = 0; j < srcGraph.fields.length; j++) {
10091025
var
10101026
srcFieldName = srcGraph.fields[j],
@@ -1014,10 +1030,10 @@ GraphConfig.load = function(config) {
10141030

10151031
destGraph.fields.push(destField);
10161032
}
1017-
1033+
10181034
result.push(destGraph);
10191035
}
1020-
1036+
10211037
return result;
10221038
};
10231039
})();

js/grapher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ function FlightLogGrapher(flightLog, graphConfig, canvas, stickCanvas, craftCanv
232232
idents.vbatField = fieldIndex;
233233
idents.numCells = flightLog.getNumCellsEstimate();
234234
break;
235-
case "BaroAlt":
235+
case "baroAlt":
236236
idents.baroField = fieldIndex;
237237
break;
238238
case "roll":

0 commit comments

Comments
 (0)