@@ -353,6 +353,42 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
353353 orientation_acc_e . val ( SENSOR_ALIGNMENT . align_acc ) ;
354354 orientation_mag_e . val ( SENSOR_ALIGNMENT . align_mag ) ;
355355
356+ orientation_gyro_e . change ( function ( ) {
357+ let value = parseInt ( $ ( this ) . val ( ) ) ;
358+
359+ let newValue = undefined ;
360+ if ( value !== SENSOR_ALIGNMENT . align_gyro ) {
361+ newValue = $ ( this ) . find ( 'option:selected' ) . text ( ) ;
362+ }
363+ self . analyticsChanges [ 'GyroAlignment' ] = newValue ;
364+
365+ SENSOR_ALIGNMENT . align_gyro = value ;
366+ } ) ;
367+
368+ orientation_acc_e . change ( function ( ) {
369+ let value = parseInt ( $ ( this ) . val ( ) ) ;
370+
371+ let newValue = undefined ;
372+ if ( value !== SENSOR_ALIGNMENT . align_acc ) {
373+ newValue = $ ( this ) . find ( 'option:selected' ) . text ( ) ;
374+ }
375+ self . analyticsChanges [ 'AccAlignment' ] = newValue ;
376+
377+ SENSOR_ALIGNMENT . align_acc = value ;
378+ } ) ;
379+
380+ orientation_mag_e . change ( function ( ) {
381+ let value = parseInt ( $ ( this ) . val ( ) ) ;
382+
383+ let newValue = undefined ;
384+ if ( value !== SENSOR_ALIGNMENT . align_mag ) {
385+ newValue = $ ( this ) . find ( 'option:selected' ) . text ( ) ;
386+ }
387+ self . analyticsChanges [ 'MagAlignment' ] = newValue ;
388+
389+ SENSOR_ALIGNMENT . align_mag = value ;
390+ } ) ;
391+
356392 // Multi gyro config
357393 if ( semver . gte ( CONFIG . apiVersion , "1.41.0" ) ) {
358394
@@ -393,6 +429,30 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
393429 $ ( '.gyro_alignment_inputs_second' ) . toggle ( detected_gyro_2 ) ;
394430 $ ( '.gyro_alignment_inputs_selection' ) . toggle ( detected_gyro_1 || detected_gyro_2 ) ;
395431 $ ( '.gyro_alignment_inputs_notfound' ) . toggle ( ! detected_gyro_1 && ! detected_gyro_2 ) ;
432+
433+ orientation_gyro_1_align_e . change ( function ( ) {
434+ let value = parseInt ( $ ( this ) . val ( ) ) ;
435+
436+ let newValue = undefined ;
437+ if ( value !== SENSOR_ALIGNMENT . gyro_1_align ) {
438+ newValue = $ ( this ) . find ( 'option:selected' ) . text ( ) ;
439+ }
440+ self . analyticsChanges [ 'Gyro1Alignment' ] = newValue ;
441+
442+ SENSOR_ALIGNMENT . gyro_1_align = value ;
443+ } ) ;
444+
445+ orientation_gyro_2_align_e . change ( function ( ) {
446+ let value = parseInt ( $ ( this ) . val ( ) ) ;
447+
448+ let newValue = undefined ;
449+ if ( value !== SENSOR_ALIGNMENT . gyro_2_align ) {
450+ newValue = $ ( this ) . find ( 'option:selected' ) . text ( ) ;
451+ }
452+ self . analyticsChanges [ 'Gyro2Alignment' ] = newValue ;
453+
454+ SENSOR_ALIGNMENT . gyro_2_align = value ;
455+ } ) ;
396456 }
397457 }
398458
@@ -437,8 +497,24 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
437497 $ ( 'input[id="unsyncedPWMSwitch"]' ) . prop ( 'checked' , PID_ADVANCED_CONFIG . use_unsyncedPwm !== 0 ) . change ( ) ;
438498 $ ( 'input[name="unsyncedpwmfreq"]' ) . val ( PID_ADVANCED_CONFIG . motor_pwm_rate ) ;
439499 $ ( 'input[name="digitalIdlePercent"]' ) . val ( PID_ADVANCED_CONFIG . digitalIdlePercent ) ;
440- $ ( 'input[id="dshotBidir"]' ) . prop ( 'checked' , MOTOR_CONFIG . use_dshot_telemetry ) . change ( ) ;
441- $ ( 'input[name="motorPoles"]' ) . val ( MOTOR_CONFIG . motor_poles ) ;
500+ if ( semver . gte ( CONFIG . apiVersion , "1.42.0" ) ) {
501+ let dshotBidirectional_e = $ ( 'input[id="dshotBidir"]' ) ;
502+ dshotBidirectional_e . prop ( 'checked' , MOTOR_CONFIG . use_dshot_telemetry ) . change ( ) ;
503+
504+ dshotBidirectional_e . change ( function ( ) {
505+ let value = $ ( this ) . prop ( 'checked' ) ;
506+
507+ var newValue = undefined ;
508+ if ( value !== MOTOR_CONFIG . use_dshot_telemetry ) {
509+ newValue = value ? 'On' : 'Off' ;
510+ }
511+ self . analyticsChanges [ 'BidirectionalDshot' ] = newValue ;
512+
513+ MOTOR_CONFIG . use_dshot_telemetry = value ;
514+ } ) ;
515+
516+ $ ( 'input[name="motorPoles"]' ) . val ( MOTOR_CONFIG . motor_poles ) ;
517+ }
442518
443519 esc_protocol_e . val ( PID_ADVANCED_CONFIG . fast_pwm_protocol + 1 ) ;
444520 esc_protocol_e . change ( function ( ) {
@@ -1069,7 +1145,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
10691145 MOTOR_CONFIG . mincommand = parseInt ( $ ( 'input[name="mincommand"]' ) . val ( ) ) ;
10701146 if ( semver . gte ( CONFIG . apiVersion , "1.42.0" ) ) {
10711147 MOTOR_CONFIG . motor_poles = parseInt ( $ ( 'input[name="motorPoles"]' ) . val ( ) ) ;
1072- MOTOR_CONFIG . use_dshot_telemetry = $ ( 'input[id="dshotBidir"]' ) . prop ( 'checked' ) ;
10731148 }
10741149
10751150 if ( self . SHOW_OLD_BATTERY_CONFIG ) {
@@ -1089,13 +1164,8 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
10891164 MOTOR_3D_CONFIG . neutral = parseInt ( $ ( 'input[name="3dneutral"]' ) . val ( ) ) ;
10901165 }
10911166
1092- SENSOR_ALIGNMENT . align_gyro = parseInt ( orientation_gyro_e . val ( ) ) ;
1093- SENSOR_ALIGNMENT . align_acc = parseInt ( orientation_acc_e . val ( ) ) ;
1094- SENSOR_ALIGNMENT . align_mag = parseInt ( orientation_mag_e . val ( ) ) ;
10951167 if ( semver . gte ( CONFIG . apiVersion , "1.41.0" ) ) {
10961168 SENSOR_ALIGNMENT . gyro_to_use = parseInt ( orientation_gyro_to_use_e . val ( ) ) ;
1097- SENSOR_ALIGNMENT . gyro_1_align = parseInt ( orientation_gyro_1_align_e . val ( ) ) ;
1098- SENSOR_ALIGNMENT . gyro_2_align = parseInt ( orientation_gyro_2_align_e . val ( ) ) ;
10991169 }
11001170
11011171 PID_ADVANCED_CONFIG . fast_pwm_protocol = parseInt ( esc_protocol_e . val ( ) - 1 ) ;
0 commit comments