Moved switching of 'FEATURE_SUPEREXPO_RATES' to PID tab.

10.3.x-maintenance
mikeller 2016-07-06 22:26:11 +12:00
parent 13263b5629
commit 6694faff33
4 changed files with 64 additions and 22 deletions

View File

@ -530,7 +530,10 @@
"message": "Configure via the Race Transponder tab after enabling."
},
"featureSUPEREXPO_RATES": {
"message": "Rate value adds instead of rate also Super Expo. Mid stick stays same. Rc rate is always linear"
"message": "Use Super Expo rates curve"
},
"featureSUPEREXPO_RATESTip": {
"message": "Rate value adds instead of rate also Super Expo. Mid stick stays same. Rc rate is always linear. You can modify this setting in the PID tuning tab."
},
"featureAIRMODE": {
"message": "Airmode always enabled!"
@ -1597,11 +1600,11 @@
"pidTuningYaw": {
"message": "Yaw (Hz)"
},
"pidTuningShowRatesWithSuperExpo": {
"message": "Show rates with SuperExpo"
"pidTuningSuperExpo": {
"message": "Enable SuperExpo"
},
"pidTuningRatesSuperExpoHelp": {
"message": "To enable SuperExpo, enable 'SUPEREXPO_RATES' in 'Other Features' on the 'Configuration' tab."
"message": "This setting controls the feature 'SUPEREXPO_RATES'"
},
"configHelp2": {
"message": "Arbitrary board rotation in degrees, to allow mounting it sideways / upside down / rotated etc. When running external sensors, use the sensor alignments (Gyro, Acc, Mag) to define sensor position independent from board orientation. "

View File

@ -157,10 +157,10 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
);
}
if (CONFIG.flightControllerIdentifier == "BTFL" && semver.gte(CONFIG.flightControllerVersion, "2.8.0")) {
if (CONFIG.flightControllerIdentifier === "BTFL" && semver.gte(CONFIG.flightControllerVersion, "2.8.0")) {
features.push(
{bit: 22, group: 'other', name: 'AIRMODE'},
{bit: 23, group: 'other', name: 'SUPEREXPO_RATES'}
{bit: 23, group: 'other', mode: 'readonly', name: 'SUPEREXPO_RATES', haveTip: true}
);
}
@ -201,13 +201,20 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
+ feature_tip_html + '</td></tr>');
radioGroups.push(features[i].group);
} else {
var readonlyModifier = '';
if (features[i].mode === 'readonly') {
readonlyModifier = ' readonly';
}
row_e = $('<tr><td><input class="feature toggle"'
+ i
+ '" name="'
+ features[i].name
+ '" title="'
+ features[i].name
+ '" type="checkbox"/></td><td><label for="feature-'
+ '" type="checkbox"'
+ readonlyModifier
+ '/></td><td><label for="feature-'
+ i
+ '">'
+ features[i].name

View File

@ -62,6 +62,19 @@
</div>
</th>
</tr>
<tr class="new_rates">
<td colspan=7>
<div class="checkbox super_expo_checkbox" style="margin-top: 10px;">
<div style="float: left; margin-right: 5px; margin-left: 3px; margin-bottom: 5px;">
<input type="checkbox" name="show_superexpo_rates" class="toggle" />
</div>
<label for="showSuperExpoRates">
<span i18n="pidTuningSuperExpo"></span>
</label>
<div class="helpicon cf_tip" i18n_title="pidTuningRatesSuperExpoHelp"></div>
</div>
</td>
</tr>
<tr class="ROLL">
<!-- 0 -->
<td bgcolor="#FF8080"></td>
@ -282,19 +295,6 @@
<td i18n="pidTuningMaxAngularVelYaw"></td>
<td class="maxAngularVelYaw"></td>
</tr>
<tr class="new_rates">
<td colspan=2>
<div class="checkbox super_expo_checkbox" style="margin-top: 10px;">
<div style="float: left; margin-right: 5px; margin-left: 3px; margin-bottom: 5px;">
<input type="checkbox" name="show_superexpo_rates" class="toggle" />
</div>
<label for="showSuperExpoRates">
<span i18n="pidTuningShowRatesWithSuperExpo"></span>
</label>
<div class="helpicon cf_tip" i18n_title="pidTuningRatesSuperExpoHelp"></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>

View File

@ -4,6 +4,8 @@ TABS.pid_tuning = {
controllerChanged: false
};
var SUPEREXPO_FEATURE_BIT = 23;
TABS.pid_tuning.initialize = function (callback) {
var self = this;
if (GUI.active_tab != 'pid_tuning') {
@ -28,11 +30,24 @@ TABS.pid_tuning.initialize = function (callback) {
return MSP.promise(MSP_codes.MSP_ADVANCED_TUNING);
}).then(function() {
return MSP.promise(MSP_codes.MSP_FILTER_CONFIG);
}).then(function() {
var promise = true;
if (CONFIG.flightControllerIdentifier === "BTFL" && semver.gte(CONFIG.flightControllerVersion, "2.8.0")) {
promise = MSP.promise(MSP_codes.MSP_BF_CONFIG);
}
return promise;
}).then(function() {
$('#content').load("./tabs/pid_tuning.html", process_html);
});
function pid_and_rc_to_form() {
if (CONFIG.flightControllerIdentifier === "BTFL" && semver.gte(CONFIG.flightControllerVersion, "2.8.0")) {
//This will need to be reworked to remove BF_CONFIG reference eventually
$('.pid_tuning input[name="show_superexpo_rates"]').prop(
'checked', bit_check(BF_CONFIG.features, SUPEREXPO_FEATURE_BIT));
}
// Fill in the data from PIDs array
var i = 0;
$('.pid_tuning .ROLL input').each(function () {
@ -200,6 +215,16 @@ TABS.pid_tuning.initialize = function (callback) {
}
function form_to_pid_and_rc() {
if (CONFIG.flightControllerIdentifier === "BTFL" && semver.gte(CONFIG.flightControllerVersion, "2.8.0")) {
//This will need to be reworked to remove BF_CONFIG reference eventually
if ($('.pid_tuning input[name="show_superexpo_rates"]').is(':checked')) {
BF_CONFIG.features = bit_set(BF_CONFIG.features, SUPEREXPO_FEATURE_BIT);
} else {
BF_CONFIG.features = bit_clear(BF_CONFIG.features, SUPEREXPO_FEATURE_BIT);
}
}
// Fill in the data from PIDs array
// Catch all the changes and stuff the inside PIDs array
var i = 0;
$('table.pid_tuning tr.ROLL input').each(function () {
@ -469,11 +494,11 @@ TABS.pid_tuning.initialize = function (callback) {
var maxAngularVelPitchElement = $('.rc_curve .maxAngularVelPitch');
var maxAngularVelYawElement = $('.rc_curve .maxAngularVelYaw');
var superExpoElement = $('.rc_curve input[name="show_superexpo_rates"]');
var superExpoElement = $('.pid_tuning input[name="show_superexpo_rates"]');
var useLegacyCurve = false;
if (CONFIG.flightControllerIdentifier !== "BTFL" || semver.lt(CONFIG.flightControllerVersion, "2.8.0")) {
$('.rc_curve .new_rates').hide();
$('.new_rates').hide();
useLegacyCurve = true;
}
@ -637,6 +662,13 @@ TABS.pid_tuning.initialize = function (callback) {
}
}).then(function() {
return MSP.promise(MSP_codes.MSP_SET_RC_TUNING, MSP.crunch(MSP_codes.MSP_SET_RC_TUNING));
}).then(function() {
var promise = true;
if (CONFIG.flightControllerIdentifier === "BTFL" && semver.gte(CONFIG.flightControllerVersion, "2.8.0")) {
promise = MSP.promise(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG));
}
return promise;
}).then(function() {
return MSP.promise(MSP_codes.MSP_EEPROM_WRITE);
}).then(function() {