mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 20:35:19 +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:
parent
a31aa128f1
commit
0f27abf733
4 changed files with 187 additions and 26 deletions
158
js/fc.js
158
js/fc.js
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -12,6 +12,14 @@ var Settings = (function () {
|
|||
var settingName = input.data('setting');
|
||||
var inputUnit = input.data('unit');
|
||||
|
||||
if (FC.isBatteryProfileParameter(settingName)) {
|
||||
input.css("background-color","#fef2d5");
|
||||
}
|
||||
|
||||
if (FC.isControlProfileParameter(settingName)) {
|
||||
input.css("background-color","#d5ebfe");
|
||||
}
|
||||
|
||||
return mspHelper.getSetting(settingName).then(function (s) {
|
||||
// Check if the input declares a parent
|
||||
// to be hidden in case of the setting not being available.
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
}
|
||||
|
||||
.dropdown-dark {
|
||||
background: #636363; /* NEW2 */
|
||||
background: #636363; /* NEW2 */
|
||||
background: #3e403f; /* NEW */
|
||||
|
||||
border-color: #111 #0a0a0a black;
|
||||
|
@ -123,11 +123,7 @@
|
|||
-webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
color:#a6a6a6;
|
||||
text-shadow:0px 1px rgba(0, 0, 0, 0.25);
|
||||
|
||||
|
||||
|
||||
|
||||
text-shadow:0px 1px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.dropdown-dark:before {
|
||||
border-bottom-color: #aaa;
|
||||
|
@ -143,9 +139,17 @@
|
|||
|
||||
}
|
||||
.dropdown-dark .dropdown-select:focus {
|
||||
color: #fff;
|
||||
color: #fff !important;
|
||||
}
|
||||
.dropdown-dark .dropdown-select > option {
|
||||
background: #56ab1a;
|
||||
text-shadow: 0 1px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.dropdown-dark #profilechange {
|
||||
color: #d5ebfe;
|
||||
}
|
||||
|
||||
.dropdown-dark #batteryprofilechange {
|
||||
color: #fef2d5;
|
||||
}
|
|
@ -178,24 +178,21 @@
|
|||
<tr>
|
||||
<th class="roll" data-i18n="pidTuningRollRate"></th>
|
||||
<td class="roll">
|
||||
<input type="number" id="rate-roll" class="rate-tpa_input" step="10" min="40"
|
||||
max="1800" />
|
||||
<input type="number" class="rate-tpa_input" data-setting="roll_rate" data-setting-unit="ddeg" />
|
||||
<input type="number" id="rate-roll" class="rate-tpa_input" step="10" min="40" max="1800" />
|
||||
degrees per second
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="pitch" data-i18n="pidTuningPitchRate"></th>
|
||||
<td class="pitch">
|
||||
<input type="number" id="rate-pitch" class="rate-tpa_input" step="10" min="40"
|
||||
max="1800" /> degrees per second
|
||||
<input type="number" id="rate-pitch" class="rate-tpa_input" step="10" min="40" max="1800" /> degrees per second
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="yaw" data-i18n="pidTuningYawRate"></th>
|
||||
<td class="yaw">
|
||||
<input type="number" id="rate-yaw" class="rate-tpa_input" step="10" min="10"
|
||||
max="1800" />
|
||||
degrees per second
|
||||
<input type="number" id="rate-yaw" class="rate-tpa_input" step="10" min="10" max="1800" /> degrees per second
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -213,46 +210,40 @@
|
|||
<tr>
|
||||
<th data-i18n="pidTuningMaxRollAngle"></th>
|
||||
<td>
|
||||
<input data-setting="max_angle_inclination_rll" data-setting-multiplier="10"
|
||||
type="number" class="rate-tpa_input" /> degrees
|
||||
<input type="number" class="rate-tpa_input" data-setting="max_angle_inclination_rll" data-setting-multiplier="10" /> degrees
|
||||
<div class="helpicon cf_tip" data-i18n_title="pidTuningMaxRollAngleHelp"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th data-i18n="pidTuningMaxPitchAngle"></th>
|
||||
<td>
|
||||
<input data-setting="max_angle_inclination_pit" data-setting-multiplier="10"
|
||||
type="number" class="rate-tpa_input" /> degrees
|
||||
<input type="number" class="rate-tpa_input" data-setting="max_angle_inclination_pit" data-setting-multiplier="10" /> degrees
|
||||
<div class="helpicon cf_tip" data-i18n_title="pidTuningMaxPitchAngleHelp"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th data-i18n="magHoldYawRate"></th>
|
||||
<td>
|
||||
<input type="number" id="magHoldYawRate" class="rate-tpa_input" step="5" min="10"
|
||||
max="250" /> degrees per second
|
||||
<input type="number" id="magHoldYawRate" class="rate-tpa_input" step="5" min="10" max="250" /> degrees per second
|
||||
<div class="helpicon cf_tip" data-i18n_title="pidTuningMagHoldYawRateHelp"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="roll" data-i18n="pidTuningManualRollRate"></th>
|
||||
<td class="roll">
|
||||
<input type="number" id="rate-manual-roll" class="rate-tpa_input" step="1" min="0"
|
||||
max="100" /> %
|
||||
<input type="number" id="rate-manual-roll" class="rate-tpa_input" step="1" min="0" max="100" /> %
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="pitch" data-i18n="pidTuningManualPitchRate"></th>
|
||||
<td class="pitch">
|
||||
<input type="number" id="rate-manual-pitch" class="rate-tpa_input" step="1" min="0"
|
||||
max="100" /> %
|
||||
<input type="number" id="rate-manual-pitch" class="rate-tpa_input" step="1" min="0" max="100" /> %
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="yaw" data-i18n="pidTuningManualYawRate"></th>
|
||||
<td class="yaw">
|
||||
<input type="number" id="rate-manual-yaw" class="rate-tpa_input" step="1" min="0"
|
||||
max="100" /> %
|
||||
<input type="number" id="rate-manual-yaw" class="rate-tpa_input" step="1" min="0" max="100" /> %
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue