1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 00:35:20 +03:00

Add highlighting for fields that change with profiles

- Added field arrays for control and battery profiles.
- Added highlight mechanism for **data-setting** fields
- Changed battery and control profile drop down text to match the field colours.
This commit is contained in:
Darren Lines 2022-02-19 18:34:37 +00:00
parent a31aa128f1
commit 0f27abf733
4 changed files with 187 additions and 26 deletions

158
js/fc.js
View file

@ -1408,5 +1408,163 @@ var FC = {
default: 0
}
}
},
getBatteryProfileParameters: function () {
return [
'bat_cells',
'vbat_cell_detect_voltage',
'vbat_max_cell_voltage',
'vbat_min_cell_voltage',
'vbat_warning_cell_voltage',
'battery_capacity',
'battery_capacity_warning',
'battery_capacity_critical',
'battery_capacity_unit',
'controlrate_profile',
'throttle_scale',
'throttle_idle',
'turtle_mode_power_factor',
'failsafe_throttle',
'fw_min_throttle_down_pitch',
'nav_mc_hover_thr',
'nav_fw_cruise_thr',
'nav_fw_min_thr',
'nav_fw_max_thr',
'nav_fw_pitch2thr',
'nav_fw_launch_thr',
'nav_fw_launch_idle_thr',
'limit_cont_current',
'limit_burst_current',
'limit_burst_current_time',
'limit_burst_current_falldown_time',
'limit_cont_power',
'limit_burst_power',
'limit_burst_power_time',
'limit_burst_power_falldown_time'
];
},
isBatteryProfileParameter: function(paramName) {
return ($.inArray(paramName,this.getBatteryProfileParameters()) != -1);
//return true;
},
getControlProfileParameters: function () {
return [
'mc_p_pitch',
'mc_i_pitch',
'mc_d_pitch',
'mc_cd_pitch',
'mc_p_roll',
'mc_i_roll',
'mc_d_roll',
'mc_cd_roll',
'mc_p_yaw',
'mc_i_yaw',
'mc_d_yaw',
'mc_cd_yaw',
'mc_p_level',
'mc_i_level',
'mc_d_level',
'fw_p_pitch',
'fw_i_pitch',
'fw_d_pitch',
'fw_ff_pitch',
'fw_p_roll',
'fw_i_roll',
'fw_d_roll',
'fw_ff_roll',
'fw_p_yaw',
'fw_i_yaw',
'fw_d_yaw',
'fw_ff_yaw',
'fw_p_level',
'fw_i_level',
'fw_d_level',
'max_angle_inclination_rll',
'max_angle_inclination_pit',
'dterm_lpf_hz',
'dterm_lpf_type',
'dterm_lpf2_hz',
'dterm_lpf2_type',
'yaw_lpf_hz',
'fw_iterm_throw_limit',
'fw_loiter_direction',
'fw_reference_airspeed',
'fw_turn_assist_yaw_gain',
'fw_turn_assist_pitch_gain',
'fw_iterm_limit_stick_position',
'fw_yaw_iterm_freeze_bank_angle',
'pidsum_limit',
'pidsum_limit_yaw',
'iterm_windup',
'rate_accel_limit_roll_pitch',
'rate_accel_limit_yaw',
'heading_hold_rate_limit',
'nav_mc_pos_z_p',
'nav_mc_vel_z_p',
'nav_mc_vel_z_i',
'nav_mc_vel_z_d',
'nav_mc_pos_xy_p',
'nav_mc_vel_xy_p',
'nav_mc_vel_xy_i',
'nav_mc_vel_xy_d',
'nav_mc_vel_xy_ff',
'nav_mc_heading_p',
'nav_mc_vel_xy_dterm_lpf_hz',
'nav_mc_vel_xy_dterm_attenuation',
'nav_mc_vel_xy_dterm_attenuation_start',
'nav_mc_vel_xy_dterm_attenuation_end',
'nav_fw_pos_z_p',
'nav_fw_pos_z_i',
'nav_fw_pos_z_d',
'nav_fw_pos_xy_p',
'nav_fw_pos_xy_i',
'nav_fw_pos_xy_d',
'nav_fw_heading_p',
'nav_fw_pos_hdg_p',
'nav_fw_pos_hdg_i',
'nav_fw_pos_hdg_d',
'nav_fw_pos_hdg_pidsum_limit',
'mc_iterm_relax',
'mc_iterm_relax_cutoff',
'd_boost_min',
'd_boost_max',
'd_boost_max_at_acceleration',
'd_boost_gyro_delta_lpf_hz',
'antigravity_gain',
'antigravity_accelerator',
'antigravity_cutoff_lpf_hz',
'pid_type',
'mc_cd_lpf_hz',
'fw_level_pitch_trim',
'smith_predictor_strength',
'smith_predictor_delay',
'smith_predictor_lpf_hz',
'fw_level_pitch_gain',
'thr_mid',
'thr_expo',
'tpa_rate',
'tpa_breakpoint',
'fw_tpa_time_constant',
'rc_expo',
'rc_yaw_expo',
'roll_rate',
'pitch_rate',
'yaw_rate',
'manual_rc_expo',
'manual_rc_yaw_expo',
'manual_roll_rate',
'manual_pitch_rate',
'manual_yaw_rate',
'fpv_mix_degrees',
'rate_dynamics_center_sensitivity',
'rate_dynamics_end_sensitivity',
'rate_dynamics_center_correction',
'rate_dynamics_end_correction',
'rate_dynamics_center_weight',
'rate_dynamics_end_weight'
];
},
isControlProfileParameter: function(paramName) {
return ($.inArray(paramName, this.getControlProfileParameters()) != -1);
}
};