10.3.x-maintenance
skaman82 2015-12-16 12:59:30 +01:00
commit 61ef07a46f
6 changed files with 41 additions and 23 deletions

View File

@ -1391,13 +1391,13 @@
"message": "Failsafe Throttle" "message": "Failsafe Throttle"
}, },
"failsafeFeaturesHelpNew": { "failsafeFeaturesHelpNew": {
"message": "Failsafe has two stages. <strong>Stage 1</strong> is entered when a flightchannel has an invalid pulse length, the receiver reports failsafe mode or there is no signal from the receiver at all, the channel fallback settings are applied to <span style=\"color: red\">all channels</span> and a short amount of time is provided to allow for recovery. <strong>Stage 2</strong> is entered when the error condition takes longer then the configured guard time while the craft is <span style=\"color: red\">armed</span>, all channels will remain at the applied channel fallback setting unless overruled by the chosen procedure. <br /><strong>Note:</strong> Prior to entering stage 1, channel fallback settings are also applied to individual AUX channels that have invalid pulses." "message": "Failsafe has two stages. <strong>Stage 1</strong> is entered when a flightchannel has an invalid pulse length, the receiver reports failsafe mode or there is no signal from the receiver at all, the channel fallback settings are applied to <span style=\"color: red\">all channels</span> and a short amount of time is provided to allow for recovery. <strong>Stage 2</strong> is entered when the error condition takes longer than the configured guard time while the craft is <span style=\"color: red\">armed</span>, all channels will remain at the applied channel fallback setting unless overruled by the chosen procedure. <br /><strong>Note:</strong> Prior to entering stage 1, channel fallback settings are also applied to individual AUX channels that have invalid pulses."
}, },
"failsafePulsrangeTitle": { "failsafePulsrangeTitle": {
"message": "Valid Pulse Range Settings" "message": "Valid Pulse Range Settings"
}, },
"failsafePulsrangeHelp": { "failsafePulsrangeHelp": {
"message": "Pulses shorter then minimum or longer then maximum are invalid and will trigger application of individual channel fallback settings for AUX channels or entering stage 1 for flightchannels" "message": "Pulses shorter than minimum or longer than maximum are invalid and will trigger application of individual channel fallback settings for AUX channels or entering stage 1 for flightchannels"
}, },
"failsafeRxMinUsecItem": { "failsafeRxMinUsecItem": {
"message": "Minimum length" "message": "Minimum length"

View File

@ -68,7 +68,6 @@
/* outline: 1px solid silver; */ /* outline: 1px solid silver; */
border-radius: 3px; border-radius: 3px;
border: 1px solid silver; border: 1px solid silver;
#
} }
.tab-adjustments .adjustment td { .tab-adjustments .adjustment td {

View File

@ -58,7 +58,7 @@
} }
.tab-auxiliary .mode.off .info, .tab-auxiliary .mode.on .info { .tab-auxiliary .mode.off .info, .tab-auxiliary .mode.on .info {
color:;
} }
.tab-auxiliary .mode .info { .tab-auxiliary .mode .info {

View File

@ -118,7 +118,7 @@
</div> </div>
<div class="notice"> <div class="notice">
<p i18n="motorsNotice"></p> <p i18n="motorsNotice"></p>
<label><input id="motorsEnableTestMode" class="togglesmall" type="checkbox" /><span <label><input id="motorsEnableTestMode" type="checkbox" /><span
class="motorsEnableTestMode" i18n="motorsEnableControl"></span></label> class="motorsEnableTestMode" i18n="motorsEnableControl"></span></label>
</div> </div>
<div class="cler-both"></div> <div class="cler-both"></div>

View File

@ -1,6 +1,10 @@
'use strict'; 'use strict';
TABS.motors = {}; TABS.motors = {
allowTestMode: false,
feature3DEnabled: false,
feature3DSupported: false
};
TABS.motors.initialize = function (callback) { TABS.motors.initialize = function (callback) {
var self = this; var self = this;
@ -20,11 +24,14 @@ TABS.motors.initialize = function (callback) {
} }
function load_3d() { function load_3d() {
MSP.send_message(MSP_codes.MSP_3D, false, false, get_motor_data); var next_callback = get_motor_data;
if (semver.gte(CONFIG.apiVersion, "1.14.0")) {
self.feature3DSupported = true;
MSP.send_message(MSP_codes.MSP_3D, false, false, next_callback);
} else {
next_callback();
} }
function update_arm_status() {
self.armed = bit_check(CONFIG.mode, 0);
} }
function get_motor_data() { function get_motor_data() {
@ -38,6 +45,10 @@ TABS.motors.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_MISC, false, false, get_arm_status); MSP.send_message(MSP_codes.MSP_MISC, false, false, get_arm_status);
function update_arm_status() {
self.armed = bit_check(CONFIG.mode, 0);
}
function initSensorData() { function initSensorData() {
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
SENSOR_DATA.accelerometer[i] = 0; SENSOR_DATA.accelerometer[i] = 0;
@ -164,6 +175,12 @@ TABS.motors.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); localize();
self.feature3DEnabled = bit_check(BF_CONFIG.features, 12);
self.allowTestMode = true;
if (self.feature3DEnabled && !self.feature3DSupported) {
self.allowTestMode = false;
}
$('#motorsEnableTestMode').prop('disabled', 'true'); $('#motorsEnableTestMode').prop('disabled', 'true');
update_model(CONFIG.multiType); update_model(CONFIG.multiType);
@ -297,9 +314,9 @@ TABS.motors.initialize = function (callback) {
$('div.sliders input').prop('max', MISC.maxthrottle); $('div.sliders input').prop('max', MISC.maxthrottle);
$('div.values li:not(:last)').text(MISC.mincommand); $('div.values li:not(:last)').text(MISC.mincommand);
if(bit_check(BF_CONFIG.features,12)){ if(self.feature3DEnabled && self.feature3DSupported) {
$('div.sliders input').val(_3D.neutral3d); $('div.sliders input').val(_3D.neutral3d);
}else{ } else {
$('div.sliders input').val(MISC.mincommand); $('div.sliders input').val(MISC.mincommand);
} }
@ -354,10 +371,10 @@ TABS.motors.initialize = function (callback) {
$('div.sliders input').prop('disabled', true); $('div.sliders input').prop('disabled', true);
// change all values to default // change all values to default
if (! bit_check(BF_CONFIG.features,12)) { if (self.feature3DEnabled && self.feature3DSupported) {
$('div.sliders input').val(MISC.mincommand);
} else {
$('div.sliders input').val(_3D.neutral3d); $('div.sliders input').val(_3D.neutral3d);
} else {
$('div.sliders input').val(MISC.mincommand);
} }
// trigger change event so values are sent to mcu // trigger change event so values are sent to mcu
@ -439,8 +456,10 @@ TABS.motors.initialize = function (callback) {
$('#motorsEnableTestMode').prop('disabled', true); $('#motorsEnableTestMode').prop('disabled', true);
$('#motorsEnableTestMode').prop('checked', false); $('#motorsEnableTestMode').prop('checked', false);
} else { } else {
if (self.allowTestMode) {
$('#motorsEnableTestMode').prop('disabled', false); $('#motorsEnableTestMode').prop('disabled', false);
} }
}
if (previousArmState != self.armed) { if (previousArmState != self.armed) {
console.log('arm state change detected'); console.log('arm state change detected');

View File

@ -56,7 +56,7 @@
font-weight: bold; font-weight: bold;
border: 1px solid silver; border: 1px solid silver;
background-color: #ececec; background-color: #ececec;
border-radius: 3px: border-radius: 3px;
z-index: 100; z-index: 100;
} }