1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-23 16:25:19 +03:00

MSP_IDENT removed from usage

This commit is contained in:
Pawel Spychalski (DzikuVx) 2017-01-19 19:52:57 +01:00
parent e7a3647459
commit 93a4dd1b84
11 changed files with 212 additions and 292 deletions

View file

@ -803,7 +803,7 @@ function configuration_restore(callback) {
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
helper.timeout.add('waiting_for_bootup', function waiting_for_bootup() {
MSP.send_message(MSPCodes.MSP_IDENT, false, false, function () {
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function () {
GUI.log(chrome.i18n.getMessage('deviceReady'));
if (callback) callback();

View file

@ -61,7 +61,7 @@ var MSPCodes = {
MSP_SET_SENSOR_CONFIG: 97,
// Multiwii MSP commands
MSP_IDENT: 100,
MSP_IDENT: 100, //deprecated, do not use
MSP_STATUS: 101,
MSP_RAW_IMU: 102,
MSP_SERVO: 103,

View file

@ -1731,6 +1731,11 @@ var mspHelper = (function (gui) {
/*
* Basic sending methods used for chaining purposes
*/
/**
* @deprecated
* @param callback
*/
self.loadMspIdent = function (callback) {
MSP.send_message(MSPCodes.MSP_IDENT, false, false, callback);
};

View file

@ -36,7 +36,7 @@ $(document).ready(function () {
} else {
helper.timeout.add('waiting_for_bootup', function waiting_for_bootup() {
MSP.send_message(MSPCodes.MSP_IDENT, false, false, function () {
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function () {
//noinspection JSUnresolvedVariable
GUI.log(chrome.i18n.getMessage('deviceReady'));
//noinspection JSValidateTypes

View file

@ -13,7 +13,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
var loadChainer = new MSPChainerClass();
loadChainer.setChain([
mspHelper.loadMspIdent,
mspHelper.loadBfConfig,
mspHelper.loadMisc,
mspHelper.loadArmingConfig,

View file

@ -4,60 +4,34 @@
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/iNavFlight/inav/releases" target="_blank"></a>
</div>
<div class="note newpane">
<div class="note">
<div class="note_spacer">
<p i18n="failsafeFeaturesHelpNew"></p>
</p>
</div>
</div>
<div class="note oldpane">
<div class="note_spacer">
<p i18n="failsafeFeaturesHelpOld"></p>
</p>
<p data-i18n="failsafeFeaturesHelpNew"></p>
</div>
</div>
<div class="leftWrapper">
<div class="gui_box grey oldpane">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="failsafePaneTitleOld"></div>
</div>
<div class="spacer_box">
<div class="checkbox">
<div class="numberspacer" >
<input type="checkbox" name="failsafe_feature" class="feature toggle rxFailsafe" id="failsafe_feature" />
</div>
<label for="failsafe_feature"><span i18n="failsafeFeatureItemOld"></span>
</label>
</div>
<div class="number">
<label> <input type="number" name="failsafe_throttle_old" min="0" max="2000" /> <span
i18n="failsafeThrottleItemOld"></span>
</label>
</div>
</div>
</div>
<div class="gui_box grey newpane">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="failsafePulsrangeTitle"></div>
<div class="helpicon cf_tip" i18n_title="failsafePulsrangeHelp"></div>
<div class="spacer_box_title" data-i18n="failsafePulsrangeTitle"></div>
<div class="helpicon cf_tip" data-i18n_title="failsafePulsrangeHelp"></div>
</div>
<div class="spacer_box">
<div class="number">
<label> <input type="number" name="rx_min_usec" min="750" max="2250" /> <span
i18n="failsafeRxMinUsecItem"></span>
data-i18n="failsafeRxMinUsecItem"></span>
</label>
</div>
<div class="number">
<label> <input type="number" name="rx_max_usec" min="750" max="2250" /> <span
i18n="failsafeRxMaxUsecItem"></span>
data-i18n="failsafeRxMaxUsecItem"></span>
</label>
</div>
</div>
</div>
<div class="gui_box grey stage1 newpane">
<div class="gui_box grey stage1">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="failsafeChannelFallbackSettingsTitle"></div>
<div class="helpicon cf_tip" i18n_title="failsafeChannelFallbackSettingsHelp"></div>
<div class="spacer_box_title" data-i18n="failsafeChannelFallbackSettingsTitle"></div>
<div class="helpicon cf_tip" data-i18n_title="failsafeChannelFallbackSettingsHelp"></div>
</div>
<div class="spacer_box">
<div class="activechannellist">
@ -67,67 +41,67 @@
</div>
</div>
<div class="rightWrapper">
<div class="gui_box grey newpane">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="failsafeStageTwoSettingsTitle"></div>
<div class="spacer_box_title" data-i18n="failsafeStageTwoSettingsTitle"></div>
</div>
<div class="spacer_box">
<div class="checkbox">
<div class="numberspacer" >
<input type="checkbox" name="failsafe_feature_new" class="feature toggle rxFailsafe" id="failsafe_feature_new" />
</div>
<label for="failsafe_feature_new"><span i18n="failsafeFeatureItem"></span>
<label for="failsafe_feature_new"><span data-i18n="failsafeFeatureItem"></span>
</label>
<div class="helpicon cf_tip" i18n_title="failsafeFeatureHelp"></div>
<div class="helpicon cf_tip" data-i18n_title="failsafeFeatureHelp"></div>
</div>
<div class="checkbox stage2">
<div class="numberspacer" >
<input type="checkbox" name="failsafe_kill_switch" class="toggle" id="failsafe_kill_switch" />
</div>
<label for="failsafe_kill_switch"><span i18n="failsafeKillSwitchItem"></span>
<label for="failsafe_kill_switch"><span data-i18n="failsafeKillSwitchItem"></span>
</label>
<div class="helpicon cf_tip" i18n_title="failsafeKillSwitchHelp"></div>
<div class="helpicon cf_tip" data-i18n_title="failsafeKillSwitchHelp"></div>
</div>
<div class="number stage2">
<label> <input type="number" name="failsafe_delay" min="0" max="2000" /> <span
i18n="failsafeDelayItem"></span>
data-i18n="failsafeDelayItem"></span>
</label>
<div class="helpicon cf_tip" i18n_title="failsafeDelayHelp"></div>
<div class="helpicon cf_tip" data-i18n_title="failsafeDelayHelp"></div>
</div>
<div class="number stage2">
<label> <input type="number" name="failsafe_throttle_low_delay" min="0" max="2000" /> <span
i18n="failsafeThrottleLowItem"></span>
data-i18n="failsafeThrottleLowItem"></span>
</label>
<div class="helpicon cf_tip" i18n_title="failsafeThrottleLowHelp"></div>
<div class="helpicon cf_tip" data-i18n_title="failsafeThrottleLowHelp"></div>
</div>
<!-- radio buttons -->
<div class="subline stage2" i18n="failsafeSubTitle1"></div>
<div class="subline stage2" data-i18n="failsafeSubTitle1"></div>
<div class="radioarea pro1 stage2">
<div class="radiobuttons"><input class="procedure" id="drop" name="group1" type="radio"/>
<label for="drop" i18n="failsafeProcedureItemSelect2"></label>
<label for="drop" data-i18n="failsafeProcedureItemSelect2"></label>
</div>
</div>
<div class="radioarea pro2 stage2">
<div class="radiobuttons"><input class="procedure" id="land" name="group1" type="radio" checked/>
<label for="land" i18n="failsafeProcedureItemSelect1"></label>
<label for="land" data-i18n="failsafeProcedureItemSelect1"></label>
</div>
<div class="proceduresettings">
<div class="number">
<label> <input type="number" name="failsafe_throttle" min="0" max="2000" /> <span
i18n="failsafeThrottleItem"></span>
data-i18n="failsafeThrottleItem"></span>
</label>
</div>
<div class="number">
<label> <input type="number" name="failsafe_off_delay" min="0" max="2000" /> <span
i18n="failsafeOffDelayItem"></span>
data-i18n="failsafeOffDelayItem"></span>
</label>
<div class="helpicon cf_tip" i18n_title="failsafeOffDelayHelp"></div>
<div class="helpicon cf_tip" data-i18n_title="failsafeOffDelayHelp"></div>
</div>
</div>
</div>
<div class="radioarea pro4 stage2">
<div class="radiobuttons"><input class="procedure" id="rth" name="group1" type="radio"/>
<label for="rth" i18n="failsafeProcedureItemSelect3"></label>
<label for="rth" data-i18n="failsafeProcedureItemSelect3"></label>
</div>
</div>
</div>
@ -136,7 +110,7 @@
</div>
<div class="content_toolbar">
<div class="btn save_btn">
<a class="save" href="#" i18n="configurationButtonSave"></a>
<a class="save" href="#" data-i18n="configurationButtonSave"></a>
</div>
</div>
</div>

View file

@ -3,7 +3,6 @@
TABS.failsafe = {};
TABS.failsafe.initialize = function (callback, scrollPosition) {
var self = this;
if (GUI.active_tab != 'failsafe') {
GUI.active_tab = 'failsafe';
@ -38,7 +37,6 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
MSP.send_message(MSPCodes.MSP_RC, false, false, load_config);
}
// BEGIN Support for pre API version 1.15.0
function load_config() {
MSP.send_message(MSPCodes.MSP_BF_CONFIG, false, false, load_misc);
}
@ -46,22 +44,12 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
function load_misc() {
MSP.send_message(MSPCodes.MSP_MISC, false, false, load_html);
}
// END (Support for pre API version 1.15.0
function load_html() {
$('#content').load("./tabs/failsafe.html", process_html);
}
var apiVersionGte1_15_0 = semver.gte(CONFIG.apiVersion, "1.15.0");
// Uncomment next line for testing older functionality on newer API version
//apiVersionGte1_15_0 = false;
if(apiVersionGte1_15_0) {
MSP.send_message(MSPCodes.MSP_IDENT, false, false, load_rx_config);
} else {
MSP.send_message(MSPCodes.MSP_IDENT, false, false, load_config);
}
load_rx_config();
function process_html() {
var failsafeFeature;
@ -69,18 +57,6 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
// translate to user-selected language
localize();
// Conditionally hide the old or the new control pane's
if(apiVersionGte1_15_0) {
var oldPane = $('div.oldpane');
oldPane.prop("disabled", true);
oldPane.hide();
} else {
var newPane = $('div.newpane');
newPane.prop("disabled", true);
newPane.hide();
}
if(apiVersionGte1_15_0) {
// generate labels for assigned aux modes
var auxAssignment = [],
i,
@ -267,19 +243,8 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
// set stage 2 kill switch option
$('input[name="failsafe_kill_switch"]').prop('checked', FAILSAFE_CONFIG.failsafe_kill_switch);
} else {
// set FAILSAFE feature option (pre API 1.15.0)
failsafeFeature = $('input[name="failsafe_feature"]');
failsafeFeature.prop('checked', bit_check(BF_CONFIG.features, 8));
// fill failsafe_throttle field (pre API 1.15.0)
$('input[name="failsafe_throttle_old"]').val(MISC.failsafe_throttle);
}
$('a.save').click(function () {
// gather data that doesn't have automatic change event bound
if(apiVersionGte1_15_0) {
RX_CONFIG.rx_min_usec = parseInt($('input[name="rx_min_usec"]').val());
RX_CONFIG.rx_max_usec = parseInt($('input[name="rx_max_usec"]').val());
@ -304,17 +269,6 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
}
FAILSAFE_CONFIG.failsafe_kill_switch = $('input[name="failsafe_kill_switch"]').is(':checked') ? 1 : 0;
} else {
// get FAILSAFE feature option (pre API 1.15.0)
if ($('input[name="failsafe_feature"]').is(':checked')) {
BF_CONFIG.features = bit_set(BF_CONFIG.features, 8);
} else {
BF_CONFIG.features = bit_clear(BF_CONFIG.features, 8);
}
// get failsafe_throttle field value (pre API 1.15.0)
MISC.failsafe_throttle = parseInt($('input[name="failsafe_throttle_old"]').val());
}
function save_failssafe_config() {
MSP.send_message(MSPCodes.MSP_SET_FAILSAFE_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FAILSAFE_CONFIG), false, save_rxfail_config);
@ -328,12 +282,6 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
MSP.send_message(MSPCodes.MSP_SET_BF_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_BF_CONFIG), false, save_to_eeprom);
}
// BEGIN pre API 1.15.0 save functions
function save_misc() {
MSP.send_message(MSPCodes.MSP_SET_MISC, mspHelper.crunch(MSPCodes.MSP_SET_MISC), false, save_to_eeprom);
}
// END pre API 1.15.0 save functions
function save_to_eeprom() {
MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, reboot);
}
@ -351,11 +299,7 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
GUI.handleReconnect($('.tab_failsafe a'));
}
if(apiVersionGte1_15_0) {
MSP.send_message(MSPCodes.MSP_SET_RX_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_RX_CONFIG), false, save_failssafe_config);
} else {
MSP.send_message(MSPCodes.MSP_SET_BF_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_BF_CONFIG), false, save_misc);
}
});
GUI.content_ready(callback);

View file

@ -178,7 +178,7 @@ TABS.motors.initialize = function (callback) {
$motorsEnableTestMode.prop('checked', false);
$motorsEnableTestMode.prop('disabled', true);
update_model(CONFIG.multiType);
update_model(BF_CONFIG.mixerConfiguration);
// Always start with default/empty sensor data array, clean slate all
initSensorData();

View file

@ -256,7 +256,6 @@ TABS.profiles.initialize = function (callback, scrollPosition) {
}
loadChainer.setChain([
mspHelper.loadMspIdent,
mspHelper.loadBfConfig,
mspHelper.loadLoopTime,
mspHelper.loadINAVPidConfig,

View file

@ -39,11 +39,11 @@ TABS.servos.initialize = function (callback) {
$('#content').load("./tabs/servos.html", process_html);
}
MSP.send_message(MSPCodes.MSP_IDENT, false, false, get_servo_configurations);
get_servo_configurations();
function update_ui() {
if (semver.lt(CONFIG.apiVersion, "1.12.0") || SERVO_CONFIG.length == 0) {
if (SERVO_CONFIG.length == 0) {
$(".tab-servos").removeClass("supported");
return;

View file

@ -16,7 +16,6 @@ TABS.setup.initialize = function (callback) {
var loadChainer = new MSPChainerClass();
loadChainer.setChain([
mspHelper.loadMspIdent,
mspHelper.loadBfConfig,
mspHelper.loadMisc
]);
@ -274,7 +273,7 @@ TABS.setup.initialize3D = function () {
//
// load the model including materials
if (useWebGlRenderer) {
model_file = mixerList[CONFIG.multiType - 1].model;
model_file = mixerList[BF_CONFIG.mixerConfiguration - 1].model;
} else {
model_file = 'fallback'
}