mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-13 19:40:22 +03:00
mixer_profile switch support
This commit is contained in:
parent
0bb8c1521b
commit
51c33d2bd9
9 changed files with 60 additions and 5 deletions
|
@ -1581,6 +1581,9 @@
|
||||||
"pidTuning_gyro_dyn_lpf_max_hz_help": {
|
"pidTuning_gyro_dyn_lpf_max_hz_help": {
|
||||||
"message": "Defines the gyro LPF cutoff frequency at maximum throttle. When throttle is decreased, LPF cutoff frequency is decreased as well, down to the minimum cutoff frequency."
|
"message": "Defines the gyro LPF cutoff frequency at maximum throttle. When throttle is decreased, LPF cutoff frequency is decreased as well, down to the minimum cutoff frequency."
|
||||||
},
|
},
|
||||||
|
"loadedMixerProfile": {
|
||||||
|
"message": "Loaded Mixer Profile: <strong style=\"color: #37a8db\">$1</strong>, Check modes tab: MIXER PROFILE 2 if you don't see the changes"
|
||||||
|
},
|
||||||
"loadedBatteryProfile": {
|
"loadedBatteryProfile": {
|
||||||
"message": "Loaded Battery Profile: <strong style=\"color: #37a8db\">$1</strong>"
|
"message": "Loaded Battery Profile: <strong style=\"color: #37a8db\">$1</strong>"
|
||||||
},
|
},
|
||||||
|
@ -4883,6 +4886,12 @@
|
||||||
"motor_direction_inverted_hint": {
|
"motor_direction_inverted_hint": {
|
||||||
"message": "Enable if the motor direction is reversed and the props are mounted in the opposite direction."
|
"message": "Enable if the motor direction is reversed and the props are mounted in the opposite direction."
|
||||||
},
|
},
|
||||||
|
"mixer_pid_profile_linking": {
|
||||||
|
"message": "PID Profile will use same index as Mixer Profile index"
|
||||||
|
},
|
||||||
|
"mixer_pid_profile_linking_hint": {
|
||||||
|
"message": "mixer_pid_profile_linking: Enable on both Mixer Profile if you want PID Profile switching handled by Mixer Profile switching(Recommend in vtol/mixed plaform type setup)"
|
||||||
|
},
|
||||||
"blackboxFields": {
|
"blackboxFields": {
|
||||||
"message": "Blackbox fields"
|
"message": "Blackbox fields"
|
||||||
},
|
},
|
||||||
|
@ -5198,14 +5207,20 @@
|
||||||
"sensorDataFlashFreeSpace": {
|
"sensorDataFlashFreeSpace": {
|
||||||
"message": "Dataflash: free space"
|
"message": "Dataflash: free space"
|
||||||
},
|
},
|
||||||
|
"mixerProfile1": {
|
||||||
|
"message": "Mixer profile 1"
|
||||||
|
},
|
||||||
|
"mixerProfile2": {
|
||||||
|
"message": "Mixer profile 2"
|
||||||
|
},
|
||||||
"sensorProfile1": {
|
"sensorProfile1": {
|
||||||
"message": "Profile 1"
|
"message": "PID profile 1"
|
||||||
},
|
},
|
||||||
"sensorProfile2": {
|
"sensorProfile2": {
|
||||||
"message": "Profile 2"
|
"message": "PID profile 2"
|
||||||
},
|
},
|
||||||
"sensorProfile3": {
|
"sensorProfile3": {
|
||||||
"message": "Profile 3"
|
"message": "PID profile 3"
|
||||||
},
|
},
|
||||||
"sensorBatteryProfile1": {
|
"sensorBatteryProfile1": {
|
||||||
"message": "Battery profile 1"
|
"message": "Battery profile 1"
|
||||||
|
|
1
js/fc.js
1
js/fc.js
|
@ -118,6 +118,7 @@ var FC = {
|
||||||
i2cError: 0,
|
i2cError: 0,
|
||||||
activeSensors: 0,
|
activeSensors: 0,
|
||||||
mode: [],
|
mode: [],
|
||||||
|
mixer_profile: 0,
|
||||||
profile: 0,
|
profile: 0,
|
||||||
battery_profile: 0,
|
battery_profile: 0,
|
||||||
uid: [0, 0, 0],
|
uid: [0, 0, 0],
|
||||||
|
|
|
@ -260,6 +260,7 @@ GUI_control.prototype.updateStatusBar = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
GUI_control.prototype.updateProfileChange = function() {
|
GUI_control.prototype.updateProfileChange = function() {
|
||||||
|
$('#mixerprofilechange').val(CONFIG.mixer_profile);
|
||||||
$('#profilechange').val(CONFIG.profile);
|
$('#profilechange').val(CONFIG.profile);
|
||||||
$('#batteryprofilechange').val(CONFIG.battery_profile);
|
$('#batteryprofilechange').val(CONFIG.battery_profile);
|
||||||
};
|
};
|
||||||
|
|
|
@ -240,5 +240,7 @@ var MSPCodes = {
|
||||||
MSP2_INAV_SET_LED_STRIP_CONFIG_EX: 0x2049,
|
MSP2_INAV_SET_LED_STRIP_CONFIG_EX: 0x2049,
|
||||||
|
|
||||||
MSP2_INAV_RATE_DYNAMICS: 0x2060,
|
MSP2_INAV_RATE_DYNAMICS: 0x2060,
|
||||||
MSP2_INAV_SET_RATE_DYNAMICS: 0x2061
|
MSP2_INAV_SET_RATE_DYNAMICS: 0x2061,
|
||||||
|
|
||||||
|
MSP2_INAV_SELECT_MIXER_PROFILE: 0x2070
|
||||||
};
|
};
|
||||||
|
|
|
@ -79,6 +79,8 @@ var mspHelper = (function (gui) {
|
||||||
profile_byte = data.getUint8(offset++)
|
profile_byte = data.getUint8(offset++)
|
||||||
CONFIG.profile = profile_byte & 0x0F;
|
CONFIG.profile = profile_byte & 0x0F;
|
||||||
CONFIG.battery_profile = (profile_byte & 0xF0) >> 4;
|
CONFIG.battery_profile = (profile_byte & 0xF0) >> 4;
|
||||||
|
profile_byte = data.getUint8(offset++)
|
||||||
|
CONFIG.mixer_profile = profile_byte & 0x0F;
|
||||||
CONFIG.armingFlags = data.getUint32(offset, true);
|
CONFIG.armingFlags = data.getUint32(offset, true);
|
||||||
offset += 4;
|
offset += 4;
|
||||||
gui.updateStatusBar();
|
gui.updateStatusBar();
|
||||||
|
|
11
main.css
11
main.css
|
@ -1685,7 +1685,7 @@ dialog {
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
width: 269px;
|
width: 410px;
|
||||||
float: right;
|
float: right;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
line-height: 12px;
|
line-height: 12px;
|
||||||
|
@ -1700,6 +1700,15 @@ dialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#mixer_profile_change {
|
||||||
|
color: white;
|
||||||
|
margin-top: 16px;
|
||||||
|
width: 130px;
|
||||||
|
float: left;
|
||||||
|
margin-right: 10px;
|
||||||
|
line-height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
#profile_change {
|
#profile_change {
|
||||||
color: white;
|
color: white;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
|
|
10
main.html
10
main.html
|
@ -87,6 +87,16 @@
|
||||||
<div class="legend" i18n="sensorDataFlashFreeSpace"></div>
|
<div class="legend" i18n="sensorDataFlashFreeSpace"></div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<div id="mixer_profile_change">
|
||||||
|
<div class="dropdown dropdown-dark">
|
||||||
|
<form name="mixer-profile-change" id="mixer-profile-change">
|
||||||
|
<select class="dropdown-select" id="mixerprofilechange">
|
||||||
|
<option value="0" i18n="mixerProfile1"></option>
|
||||||
|
<option value="1" i18n="mixerProfile2"></option>
|
||||||
|
</select>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div id="profile_change">
|
<div id="profile_change">
|
||||||
<div class="dropdown dropdown-dark">
|
<div class="dropdown dropdown-dark">
|
||||||
<form name="profile-change" id="profile-change">
|
<form name="profile-change" id="profile-change">
|
||||||
|
|
10
main.js
10
main.js
|
@ -545,6 +545,16 @@ $(document).ready(function () {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var mixerprofile_e = $('#mixerprofilechange');
|
||||||
|
|
||||||
|
mixerprofile_e.change(function () {
|
||||||
|
var mixerprofile = parseInt($(this).val());
|
||||||
|
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_MIXER_PROFILE, [mixerprofile], false, function () {
|
||||||
|
GUI.log(chrome.i18n.getMessage('loadedMixerProfile', [mixerprofile + 1]));
|
||||||
|
updateActivatedTab();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
var profile_e = $('#profilechange');
|
var profile_e = $('#profilechange');
|
||||||
|
|
||||||
profile_e.change(function () {
|
profile_e.change(function () {
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
<label for="motor_direction_inverted"><span data-i18n="motor_direction_inverted"></span></label>
|
<label for="motor_direction_inverted"><span data-i18n="motor_direction_inverted"></span></label>
|
||||||
<div class="helpicon cf_tip" data-i18n_title="motor_direction_inverted_hint"></div>
|
<div class="helpicon cf_tip" data-i18n_title="motor_direction_inverted_hint"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="checkbox">
|
||||||
|
<input id="mixer_pid_profile_linking" type="checkbox" class="toggle" data-setting="mixer_pid_profile_linking" />
|
||||||
|
<label for="mixer_pid_profile_linking"><span data-i18n="mixer_pid_profile_linking"></span></label>
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="mixer_pid_profile_linking_hint"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue