Skip to content

Commit 16dd2bc

Browse files
authored
Added TELEMETRY_MAVLINK debug fields settings (#864)
* Added TELEMETRY_MAVLINK debug fields settings * Resolved SonarCloud notices * Code style improvement * Code style improvement
1 parent 5e28a44 commit 16dd2bc

File tree

3 files changed

+54
-12
lines changed

3 files changed

+54
-12
lines changed

src/flightlog_fielddefs.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -552,13 +552,18 @@ export function adjustFieldDefsList(firmwareType, firmwareVersion) {
552552
DEBUG_MODE.splice(DEBUG_MODE.indexOf('GPS_RESCUE_THROTTLE_PID'), 1, 'AUTOPILOT_ALTITUDE');
553553
DEBUG_MODE.splice(DEBUG_MODE.indexOf("GYRO_SCALED"), 1);
554554
DEBUG_MODE.splice(DEBUG_MODE.indexOf("RANGEFINDER_QUALITY") + 1, 0, "OPTICALFLOW");
555-
DEBUG_MODE.push('TPA');
556-
DEBUG_MODE.push('S_TERM');
557-
DEBUG_MODE.push('SPA');
558-
DEBUG_MODE.push('TASK');
559-
DEBUG_MODE.push('GIMBAL');
560-
DEBUG_MODE.push('WING_SETPOINT');
561-
DEBUG_MODE.push('AUTOPILOT_POSITION');
555+
DEBUG_MODE.push(
556+
'TPA',
557+
'S_TERM',
558+
'SPA',
559+
'TASK',
560+
'GIMBAL',
561+
'WING_SETPOINT',
562+
'AUTOPILOT_POSITION',
563+
'CHIRP',
564+
'FLASH_TEST_PRBS',
565+
'MAVLINK_TELEMETRY',
566+
);
562567
}
563568
if (semver.gte(firmwareVersion, "2025.12.0")) {
564569
//rename DUAL_GYRO_ to MULTI_GYRO
@@ -623,7 +628,7 @@ export function adjustFieldDefsList(firmwareType, firmwareVersion) {
623628
);
624629
}
625630
}
626-
631+
627632
FLIGHT_LOG_FLIGHT_MODE_NAME = makeReadOnly(FLIGHT_LOG_FLIGHT_MODE_NAME);
628633
} else {
629634
DEBUG_MODE = DEBUG_MODE_COMPLETE;

src/flightlog_fields_presenter.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,13 @@ const DEBUG_FRIENDLY_FIELD_NAMES_INITIAL = {
11341134
"debug[4]": "Stick Limit",
11351135
"debug[5]": "Speed Limit",
11361136
},
1137+
MAVLINK_TELEMETRY: {
1138+
"debug[all]": "MAVLink telemetry",
1139+
"debug[0]": "Should send telemetry",
1140+
"debug[1]": "Actual free TX buffers space",
1141+
"debug[2]": "Estimated free TX buffers space",
1142+
"debug[3]": "Telemetries call counter",
1143+
},
11371144
};
11381145

11391146
let DEBUG_FRIENDLY_FIELD_NAMES = null;

src/graph_config.js

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ GraphConfig.getDefaultCurveForField = function (flightLog, fieldName) {
596596
min: 0,
597597
max: 1,
598598
},
599-
};
599+
};
600600
case "debug[6]": // outlier count 0-3
601601
case "debug[7]": // valid count 0-3
602602
return {
@@ -605,7 +605,7 @@ GraphConfig.getDefaultCurveForField = function (flightLog, fieldName) {
605605
min: 0,
606606
max: 50, // put them at the very bottom
607607
},
608-
};
608+
};
609609
default:
610610
return getCurveForMinMaxFields(fieldName);
611611
}
@@ -859,15 +859,15 @@ GraphConfig.getDefaultCurveForField = function (flightLog, fieldName) {
859859
min: 0,
860860
max: 1,
861861
},
862-
};
862+
};
863863
case "debug[7]": // smoothed Rx Rate Hz
864864
return {
865865
power: 1.0,
866866
MinMax: {
867867
min: 0,
868868
max: 1200,
869869
},
870-
};
870+
};
871871
default:
872872
return getCurveForMinMaxFields(fieldName);
873873
}
@@ -1454,6 +1454,36 @@ GraphConfig.getDefaultCurveForField = function (flightLog, fieldName) {
14541454
default:
14551455
return getCurveForMinMaxFields(fieldName);
14561456
}
1457+
case "MAVLINK_TELEMETRY":
1458+
switch (fieldName) {
1459+
case "debug[0]":
1460+
return {
1461+
power: 1,
1462+
MinMax: {
1463+
min: 0,
1464+
max: 1,
1465+
},
1466+
};
1467+
case "debug[1]":
1468+
case "debug[2]":
1469+
return {
1470+
power: 1,
1471+
MinMax: {
1472+
min: 0,
1473+
max: 100,
1474+
},
1475+
};
1476+
case "debug[3]":
1477+
return {
1478+
power: 1,
1479+
MinMax: {
1480+
min: 0,
1481+
max: 50,
1482+
},
1483+
};
1484+
default:
1485+
return getCurveForMinMaxFields(fieldName);
1486+
}
14571487
}
14581488
}
14591489
// if not found above then

0 commit comments

Comments
 (0)