1
0
Fork 0
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:
shota 2023-10-15 17:26:46 +09:00
parent 0bb8c1521b
commit 51c33d2bd9
9 changed files with 60 additions and 5 deletions

View file

@ -1581,6 +1581,9 @@
"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."
},
"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": {
"message": "Loaded Battery Profile: <strong style=\"color: #37a8db\">$1</strong>"
},
@ -4883,6 +4886,12 @@
"motor_direction_inverted_hint": {
"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": {
"message": "Blackbox fields"
},
@ -5198,14 +5207,20 @@
"sensorDataFlashFreeSpace": {
"message": "Dataflash: free space"
},
"mixerProfile1": {
"message": "Mixer profile 1"
},
"mixerProfile2": {
"message": "Mixer profile 2"
},
"sensorProfile1": {
"message": "Profile 1"
"message": "PID profile 1"
},
"sensorProfile2": {
"message": "Profile 2"
"message": "PID profile 2"
},
"sensorProfile3": {
"message": "Profile 3"
"message": "PID profile 3"
},
"sensorBatteryProfile1": {
"message": "Battery profile 1"

View file

@ -118,6 +118,7 @@ var FC = {
i2cError: 0,
activeSensors: 0,
mode: [],
mixer_profile: 0,
profile: 0,
battery_profile: 0,
uid: [0, 0, 0],

View file

@ -260,6 +260,7 @@ GUI_control.prototype.updateStatusBar = function() {
};
GUI_control.prototype.updateProfileChange = function() {
$('#mixerprofilechange').val(CONFIG.mixer_profile);
$('#profilechange').val(CONFIG.profile);
$('#batteryprofilechange').val(CONFIG.battery_profile);
};

View file

@ -240,5 +240,7 @@ var MSPCodes = {
MSP2_INAV_SET_LED_STRIP_CONFIG_EX: 0x2049,
MSP2_INAV_RATE_DYNAMICS: 0x2060,
MSP2_INAV_SET_RATE_DYNAMICS: 0x2061
MSP2_INAV_SET_RATE_DYNAMICS: 0x2061,
MSP2_INAV_SELECT_MIXER_PROFILE: 0x2070
};

View file

@ -79,6 +79,8 @@ var mspHelper = (function (gui) {
profile_byte = data.getUint8(offset++)
CONFIG.profile = profile_byte & 0x0F;
CONFIG.battery_profile = (profile_byte & 0xF0) >> 4;
profile_byte = data.getUint8(offset++)
CONFIG.mixer_profile = profile_byte & 0x0F;
CONFIG.armingFlags = data.getUint32(offset, true);
offset += 4;
gui.updateStatusBar();

View file

@ -1685,7 +1685,7 @@ dialog {
color: white;
font-size: 10px;
margin-top: 20px;
width: 269px;
width: 410px;
float: right;
margin-right: 10px;
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 {
color: white;
margin-top: 16px;

View file

@ -87,6 +87,16 @@
<div class="legend" i18n="sensorDataFlashFreeSpace"></div>
</li>
</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 class="dropdown dropdown-dark">
<form name="profile-change" id="profile-change">

10
main.js
View file

@ -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');
profile_e.change(function () {

View file

@ -20,6 +20,11 @@
<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>
<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>