Skip to content

Commit 9b40aef

Browse files
committed
feat: add MULTI_GYRO debug mode support
Add support for new MULTI_GYRO debug modes to replace DUAL_GYRO: - MULTI_GYRO (replaces DUAL_GYRO) - MULTI_GYRO_RAW - MULTI_GYRO_COMBINED (replaces DUAL_GYRO_COMBINED) - MULTI_GYRO_DIFF - MULTI_GYRO_SCALED (replaces DUAL_GYRO_SCALED) Features: - Full backward compatibility via translation aliases - Proper value scaling and field presentation - Graph configuration support - Maintains existing DUAL_GYRO modes for legacy logs Files modified: - flightlog_fielddefs.js: Added debug mode definitions - flightlog_parser.js: Added translation mappings - flightlog_fields_presenter.js: Added field names and scaling - graph_config.js: Added graph configuration support
1 parent 95cbf3a commit 9b40aef

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed

src/flightlog_fielddefs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ export const DEBUG_MODE_COMPLETE = makeReadOnly([
287287
"DUAL_GYRO_RAW",
288288
"DUAL_GYRO_COMBINED", // deprecated
289289
"DUAL_GYRO_DIFF",
290+
"MULTI_GYRO", // replaces DUAL_GYRO
291+
"MULTI_GYRO_RAW",
292+
"MULTI_GYRO_COMBINED", // replaces DUAL_GYRO_COMBINED
293+
"MULTI_GYRO_DIFF",
290294
"MAX7456_SIGNAL",
291295
"MAX7456_SPICLOCK",
292296
"SBUS",
@@ -315,6 +319,7 @@ export const DEBUG_MODE_COMPLETE = makeReadOnly([
315319
"AC_CORRECTION",
316320
"AC_ERROR",
317321
"DUAL_GYRO_SCALED",
322+
"MULTI_GYRO_SCALED", // replaces DUAL_GYRO_SCALED
318323
"DSHOT_RPM_ERRORS",
319324
"CRSF_LINK_STATISTICS_UPLINK",
320325
"CRSF_LINK_STATISTICS_PWR",

src/flightlog_fields_presenter.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,17 @@ const DEBUG_FRIENDLY_FIELD_NAMES_INITIAL = {
425425
"debug[6]": "Not Used",
426426
"debug[7]": "Not Used",
427427
},
428+
MULTI_GYRO: {
429+
"debug[all]": "Debug Multi Gyro",
430+
"debug[0]": "Gyro 1 Filtered [roll]",
431+
"debug[1]": "Gyro 1 Filtered [pitch]",
432+
"debug[2]": "Gyro 2 Filtered [roll]",
433+
"debug[3]": "Gyro 2 Filtered [pitch]",
434+
"debug[4]": "Not Used",
435+
"debug[5]": "Not Used",
436+
"debug[6]": "Not Used",
437+
"debug[7]": "Not Used",
438+
},
428439
DUAL_GYRO_RAW: {
429440
"debug[all]": "Debug Dual Gyro Raw",
430441
"debug[0]": "Gyro 1 Raw [roll]",
@@ -436,6 +447,17 @@ const DEBUG_FRIENDLY_FIELD_NAMES_INITIAL = {
436447
"debug[6]": "Not Used",
437448
"debug[7]": "Not Used",
438449
},
450+
MULTI_GYRO_RAW: {
451+
"debug[all]": "Debug Multi Gyro Raw",
452+
"debug[0]": "Gyro 1 Raw [roll]",
453+
"debug[1]": "Gyro 1 Raw [pitch]",
454+
"debug[2]": "Gyro 2 Raw [roll]",
455+
"debug[3]": "Gyro 2 Raw [pitch]",
456+
"debug[4]": "Not Used",
457+
"debug[5]": "Not Used",
458+
"debug[6]": "Not Used",
459+
"debug[7]": "Not Used",
460+
},
439461
DUAL_GYRO_COMBINED: {
440462
"debug[all]": "Debug Dual Combined",
441463
"debug[0]": "Not Used",
@@ -447,6 +469,17 @@ const DEBUG_FRIENDLY_FIELD_NAMES_INITIAL = {
447469
"debug[6]": "Not Used",
448470
"debug[7]": "Not Used",
449471
},
472+
MULTI_GYRO_COMBINED: {
473+
"debug[all]": "Debug Multi Combined",
474+
"debug[0]": "Not Used",
475+
"debug[1]": "Gyro Filtered [roll]",
476+
"debug[2]": "Gyro Filtered [pitch]",
477+
"debug[3]": "Not Used",
478+
"debug[4]": "Not Used",
479+
"debug[5]": "Not Used",
480+
"debug[6]": "Not Used",
481+
"debug[7]": "Not Used",
482+
},
450483
DUAL_GYRO_DIFF: {
451484
"debug[all]": "Debug Dual Gyro Diff",
452485
"debug[0]": "Gyro Diff [roll]",
@@ -458,6 +491,17 @@ const DEBUG_FRIENDLY_FIELD_NAMES_INITIAL = {
458491
"debug[6]": "Not Used",
459492
"debug[7]": "Not Used",
460493
},
494+
MULTI_GYRO_DIFF: {
495+
"debug[all]": "Debug Multi Gyro Diff",
496+
"debug[0]": "Gyro Diff [roll]",
497+
"debug[1]": "Gyro Diff [pitch]",
498+
"debug[2]": "Gyro Diff [yaw]",
499+
"debug[3]": "Not Used",
500+
"debug[4]": "Not Used",
501+
"debug[5]": "Not Used",
502+
"debug[6]": "Not Used",
503+
"debug[7]": "Not Used",
504+
},
461505
MAX7456_SIGNAL: {
462506
"debug[all]": "Max7456 Signal",
463507
"debug[0]": "Mode Reg",
@@ -744,6 +788,17 @@ const DEBUG_FRIENDLY_FIELD_NAMES_INITIAL = {
744788
"debug[6]": "Not Used",
745789
"debug[7]": "Not Used",
746790
},
791+
MULTI_GYRO_SCALED: {
792+
"debug[all]": "Multi Gyro Scaled",
793+
"debug[0]": "Gyro 1 [roll]",
794+
"debug[1]": "Gyro 1 [pitch]",
795+
"debug[2]": "Gyro 2 [roll]",
796+
"debug[3]": "Gyro 2 [pitch]",
797+
"debug[4]": "Not Used",
798+
"debug[5]": "Not Used",
799+
"debug[6]": "Not Used",
800+
"debug[7]": "Not Used",
801+
},
747802
DSHOT_RPM_ERRORS: {
748803
"debug[all]": "DSHOT RPM Error",
749804
"debug[0]": "DSHOT RPM Error [1]",
@@ -1840,6 +1895,12 @@ FlightLogFieldPresenter.decodeDebugFieldToFriendly = function (
18401895
case "DUAL_GYRO_COMBINED":
18411896
case "DUAL_GYRO_DIFF":
18421897
case "DUAL_GYRO_RAW":
1898+
case "DUAL_GYRO_SCALED":
1899+
case "MULTI_GYRO":
1900+
case "MULTI_GYRO_COMBINED":
1901+
case "MULTI_GYRO_DIFF":
1902+
case "MULTI_GYRO_RAW":
1903+
case "MULTI_GYRO_SCALED":
18431904
case "NOTCH":
18441905
case "GYRO_SAMPLE":
18451906
return `${Math.round(flightLog.gyroRawToDegreesPerSecond(value))} °/s`;
@@ -2538,6 +2599,12 @@ FlightLogFieldPresenter.ConvertDebugFieldValue = function (
25382599
case "DUAL_GYRO_COMBINED":
25392600
case "DUAL_GYRO_DIFF":
25402601
case "DUAL_GYRO_RAW":
2602+
case "DUAL_GYRO_SCALED":
2603+
case "MULTI_GYRO":
2604+
case "MULTI_GYRO_COMBINED":
2605+
case "MULTI_GYRO_DIFF":
2606+
case "MULTI_GYRO_RAW":
2607+
case "MULTI_GYRO_SCALED":
25412608
case "NOTCH":
25422609
case "GYRO_SAMPLE":
25432610
return toFriendly

src/flightlog_parser.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,12 @@ export function FlightLogParser(logData) {
446446
chirp_frequency_start_deci_hz : "chirp_frequency_start_deci_hz",
447447
chirp_frequency_end_deci_hz : "chirp_frequency_end_deci_hz",
448448
chirp_time_seconds : "chirp_time_seconds",
449+
// DUAL_GYRO to MULTI_GYRO debug mode aliases
450+
DUAL_GYRO: "MULTI_GYRO",
451+
DUAL_GYRO_RAW: "MULTI_GYRO_RAW",
452+
DUAL_GYRO_COMBINED: "MULTI_GYRO_COMBINED",
453+
DUAL_GYRO_DIFF: "MULTI_GYRO_DIFF",
454+
DUAL_GYRO_SCALED: "MULTI_GYRO_SCALED",
449455
},
450456
frameTypes,
451457
// Blackbox state:

src/graph_config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,11 @@ GraphConfig.getDefaultCurveForField = function (flightLog, fieldName) {
522522
case "DUAL_GYRO_DIFF":
523523
case "DUAL_GYRO_RAW":
524524
case "DUAL_GYRO_SCALED":
525+
case "MULTI_GYRO":
526+
case "MULTI_GYRO_COMBINED":
527+
case "MULTI_GYRO_DIFF":
528+
case "MULTI_GYRO_RAW":
529+
case "MULTI_GYRO_SCALED":
525530
case "NOTCH":
526531
case "AC_CORRECTION":
527532
case "AC_ERROR":

0 commit comments

Comments
 (0)