mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-24 16:55:22 +03:00
1.8 removed
This commit is contained in:
parent
97c622fbb1
commit
521915b5a9
14 changed files with 75 additions and 244 deletions
|
@ -847,7 +847,7 @@
|
|||
"message": "<strong>Note:</strong> Do <span style=\"color: red\">NOT</span> disable MSP on the first serial port unless you know what you are doing. You may have to reflash and erase your configuration if you do."
|
||||
},
|
||||
"portsFirmwareUpgradeRequired": {
|
||||
"message": "Firmware upgrade <span style=\"color: red\">required</span>. Serial port configurations of firmware < 1.8.0 is not supported."
|
||||
"message": "Firmware upgrade <span style=\"color: red\">required</span>."
|
||||
},
|
||||
"portsButtonSave": {
|
||||
"message": "Save and Reboot"
|
||||
|
|
10
js/fc.js
10
js/fc.js
|
@ -580,12 +580,10 @@ var FC = {
|
|||
{bit: 22, group: 'other', name: 'AIRMODE', haveTip: false, showNameInTip: false}
|
||||
);
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
features.push(
|
||||
{bit: 30, group: 'other', name: 'FW_LAUNCH', haveTip: false, showNameInTip: false},
|
||||
{bit: 2, group: 'other', name: 'TX_PROF_SEL', haveTip: false, showNameInTip: false}
|
||||
);
|
||||
}
|
||||
features.push(
|
||||
{bit: 30, group: 'other', name: 'FW_LAUNCH', haveTip: false, showNameInTip: false},
|
||||
{bit: 2, group: 'other', name: 'TX_PROF_SEL', haveTip: false, showNameInTip: false}
|
||||
);
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '2.0.0')) {
|
||||
features.push(
|
||||
|
|
|
@ -1229,10 +1229,6 @@ var mspHelper = (function (gui) {
|
|||
break;
|
||||
|
||||
case MSPCodes.MSP_CALIBRATION_DATA:
|
||||
if (semver.lte(CONFIG.flightControllerVersion, "1.8.0")) {
|
||||
break;
|
||||
}
|
||||
|
||||
var callibrations = data.getUint8(0);
|
||||
CALIBRATION_DATA.acc.Pos0 = (1 & (callibrations >> 0));
|
||||
CALIBRATION_DATA.acc.Pos1 = (1 & (callibrations >> 1));
|
||||
|
@ -2253,10 +2249,6 @@ var mspHelper = (function (gui) {
|
|||
|
||||
self.sendMotorMixer = function (onCompleteCallback) {
|
||||
|
||||
if (semver.lt(CONFIG.flightControllerVersion, "1.8.1")) {
|
||||
onCompleteCallback();
|
||||
}
|
||||
|
||||
var nextFunction = sendMixer,
|
||||
servoIndex = 0;
|
||||
|
||||
|
@ -2863,19 +2855,11 @@ var mspHelper = (function (gui) {
|
|||
};
|
||||
|
||||
self.loadCalibrationData = function (callback) {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
|
||||
MSP.send_message(MSPCodes.MSP_CALIBRATION_DATA, false, false, callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSP_CALIBRATION_DATA, false, false, callback);
|
||||
};
|
||||
|
||||
self.saveCalibrationData = function (callback) {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
|
||||
MSP.send_message(MSPCodes.MSP_SET_CALIBRATION_DATA, mspHelper.crunch(MSPCodes.MSP_SET_CALIBRATION_DATA), false, callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSP_SET_CALIBRATION_DATA, mspHelper.crunch(MSPCodes.MSP_SET_CALIBRATION_DATA), false, callback);
|
||||
};
|
||||
|
||||
self.loadRthAndLandConfig = function (callback) {
|
||||
|
@ -2895,11 +2879,7 @@ var mspHelper = (function (gui) {
|
|||
};
|
||||
|
||||
self.getMissionInfo = function (callback) {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
|
||||
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, callback);
|
||||
};
|
||||
|
||||
self._getSetting = function (name) {
|
||||
|
@ -3111,11 +3091,7 @@ var mspHelper = (function (gui) {
|
|||
};
|
||||
|
||||
self.loadMotorMixRules = function (callback) {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
|
||||
MSP.send_message(MSPCodes.MSP2_COMMON_MOTOR_MIXER, false, false, callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSP2_COMMON_MOTOR_MIXER, false, false, callback);
|
||||
};
|
||||
|
||||
self.loadMotors = function (callback) {
|
||||
|
@ -3123,29 +3099,21 @@ var mspHelper = (function (gui) {
|
|||
};
|
||||
|
||||
self.getCraftName = function(callback) {
|
||||
if (semver.gt(CONFIG.flightControllerVersion, "1.8.0")) {
|
||||
MSP.send_message(MSPCodes.MSP_NAME, false, false, function(resp) {
|
||||
var name = resp.data.readString();
|
||||
if (callback) {
|
||||
callback(name);
|
||||
}
|
||||
});
|
||||
} else if (callback) {
|
||||
callback(null);
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSP_NAME, false, false, function(resp) {
|
||||
var name = resp.data.readString();
|
||||
if (callback) {
|
||||
callback(name);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
self.setCraftName = function(name, callback) {
|
||||
if (semver.gt(CONFIG.flightControllerVersion, "1.8.0")) {
|
||||
var data = [];
|
||||
name = name || "";
|
||||
for (var ii = 0; ii < name.length; ii++) {
|
||||
data.push(name.charCodeAt(ii));
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSP_SET_NAME, data, false, callback);
|
||||
} else if (callback) {
|
||||
callback();
|
||||
var data = [];
|
||||
name = name || "";
|
||||
for (var ii = 0; ii < name.length; ii++) {
|
||||
data.push(name.charCodeAt(ii));
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSP_SET_NAME, data, false, callback);
|
||||
};
|
||||
|
||||
self.loadMixerConfig = function (callback) {
|
||||
|
|
|
@ -53,29 +53,15 @@ helper.periodicStatusUpdater = (function () {
|
|||
if (ANALOG != undefined) {
|
||||
var nbCells;
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
nbCells = ANALOG.cell_count;
|
||||
} else {
|
||||
nbCells = Math.floor(ANALOG.voltage / MISC.vbatmaxcellvoltage) + 1;
|
||||
if (ANALOG.voltage == 0)
|
||||
nbCells = 1;
|
||||
}
|
||||
|
||||
nbCells = ANALOG.cell_count;
|
||||
var min = MISC.vbatmincellvoltage * nbCells;
|
||||
var max = MISC.vbatmaxcellvoltage * nbCells;
|
||||
var warn = MISC.vbatwarningcellvoltage * nbCells;
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
$(".battery-status").css({
|
||||
width: ANALOG.battery_percentage + "%",
|
||||
display: 'inline-block'
|
||||
});
|
||||
} else {
|
||||
$(".battery-status").css({
|
||||
width: ((ANALOG.voltage - min) / (max - min) * 100) + "%",
|
||||
display: 'inline-block'
|
||||
});
|
||||
}
|
||||
$(".battery-status").css({
|
||||
width: ANALOG.battery_percentage + "%",
|
||||
display: 'inline-block'
|
||||
});
|
||||
|
||||
if (active) {
|
||||
$(".linkicon").css({
|
||||
|
@ -87,7 +73,7 @@ helper.periodicStatusUpdater = (function () {
|
|||
});
|
||||
}
|
||||
|
||||
if (((semver.gte(CONFIG.flightControllerVersion, '1.8.1')) && (((ANALOG.use_capacity_thresholds) && (ANALOG.battery_remaining_capacity <= (MISC.battery_capacity_warning - MISC.battery_capacity_critical))) || ((!ANALOG.use_capacity_thresholds) && (ANALOG.voltage < warn))) || (ANALOG.voltage < min)) || ((semver.lt(CONFIG.flightControllerVersion, '1.8.1')) && (ANALOG.voltage < warn))) {
|
||||
if (((ANALOG.use_capacity_thresholds && ANALOG.battery_remaining_capacity <= MISC.battery_capacity_warning - MISC.battery_capacity_critical) || (!ANALOG.use_capacity_thresholds && ANALOG.voltage < warn)) || ANALOG.voltage < min) {
|
||||
$(".battery-status").css('background-color', '#D42133');
|
||||
} else {
|
||||
$(".battery-status").css('background-color', '#59AA29');
|
||||
|
@ -124,12 +110,7 @@ helper.periodicStatusUpdater = (function () {
|
|||
}
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_ACTIVEBOXES, false, false);
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
MSP.send_message(MSPCodes.MSPV2_INAV_ANALOG, false, false);
|
||||
} else {
|
||||
MSP.send_message(MSPCodes.MSP_ANALOG, false, false);
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSPV2_INAV_ANALOG, false, false);
|
||||
|
||||
privateScope.updateView();
|
||||
}
|
||||
|
|
1
main.js
1
main.js
|
@ -123,7 +123,6 @@ $(document).ready(function () {
|
|||
}
|
||||
});
|
||||
|
||||
//set '1.8.0' for test
|
||||
appUpdater.checkRelease(chrome.runtime.getManifest().version);
|
||||
|
||||
// log library versions in console to make version tracking easier
|
||||
|
|
|
@ -64,11 +64,7 @@ TABS.adjustments.initialize = function (callback) {
|
|||
|
||||
// update list of selected functions
|
||||
var functionListOptions = $(functionList).find('option');
|
||||
var availableFunctionCount = 21;
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
availableFunctionCount = 32;
|
||||
}
|
||||
var availableFunctionCount = 32;
|
||||
|
||||
var functionListOptions = $(functionListOptions).slice(0,availableFunctionCount);
|
||||
functionList.empty().append(functionListOptions);
|
||||
|
|
|
@ -52,30 +52,20 @@ TABS.calibration.initialize = function (callback) {
|
|||
GUI.active_tab = 'calibration';
|
||||
googleAnalytics.sendAppView('Calibration');
|
||||
}
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
|
||||
loadChainer.setChain([
|
||||
mspHelper.loadStatus,
|
||||
mspHelper.loadSensorConfig,
|
||||
mspHelper.loadCalibrationData
|
||||
]);
|
||||
loadChainer.setExitPoint(loadHtml);
|
||||
loadChainer.execute();
|
||||
loadChainer.setChain([
|
||||
mspHelper.loadStatus,
|
||||
mspHelper.loadSensorConfig,
|
||||
mspHelper.loadCalibrationData
|
||||
]);
|
||||
loadChainer.setExitPoint(loadHtml);
|
||||
loadChainer.execute();
|
||||
|
||||
saveChainer.setChain([
|
||||
mspHelper.saveCalibrationData
|
||||
]);
|
||||
saveChainer.setExitPoint(reboot);
|
||||
saveChainer.setChain([
|
||||
mspHelper.saveCalibrationData
|
||||
]);
|
||||
saveChainer.setExitPoint(reboot);
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_IDENT, false, false, loadHtml);
|
||||
} else {
|
||||
loadChainer.setChain([
|
||||
mspHelper.loadStatus
|
||||
]);
|
||||
loadChainer.setExitPoint(loadHtml);
|
||||
loadChainer.execute();
|
||||
|
||||
saveChainer.setExitPoint(reboot);
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSP_IDENT, false, false, loadHtml);
|
||||
|
||||
function reboot() {
|
||||
//noinspection JSUnresolvedVariable
|
||||
|
@ -132,32 +122,6 @@ TABS.calibration.initialize = function (callback) {
|
|||
updateSensorData();
|
||||
}
|
||||
|
||||
//For 1.8.0
|
||||
function calibrate() {
|
||||
var self = $(this);
|
||||
|
||||
if (!self.hasClass('disabled')) {
|
||||
self.addClass('disabled');
|
||||
MSP.send_message(MSPCodes.MSP_ACC_CALIBRATION, false, false, function () {
|
||||
GUI.log(chrome.i18n.getMessage('initialSetupAccelCalibStarted'));
|
||||
});
|
||||
|
||||
helper.timeout.add('button_reset', function () {
|
||||
GUI.log(chrome.i18n.getMessage('initialSetupAccelCalibEnded'));
|
||||
|
||||
self.removeClass('disabled');
|
||||
|
||||
if (!bit_check(CONFIG.armingFlags & 0xff00, 13)) {
|
||||
for (var i = 0; i < 6; i++) {
|
||||
CALIBRATION_DATA.acc['Pos' + i] = 1;
|
||||
}
|
||||
updateCalibrationSteps();
|
||||
}
|
||||
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
function calibrateNew() {
|
||||
var newStep = null,
|
||||
$button = $(this);
|
||||
|
@ -215,17 +179,6 @@ TABS.calibration.initialize = function (callback) {
|
|||
saveChainer.execute();
|
||||
});
|
||||
|
||||
if (semver.lte(CONFIG.flightControllerVersion, "1.8.0")) {
|
||||
$('#accPosAll, #mag-calibrated-data').hide();
|
||||
|
||||
var accIsCalibrate = +(!bit_check(CONFIG.armingFlags & 0xff00, 13));
|
||||
for (var i = 0; i < 6; i++) {
|
||||
CALIBRATION_DATA.acc['Pos' + i] = accIsCalibrate;
|
||||
}
|
||||
|
||||
updateCalibrationSteps();
|
||||
}
|
||||
|
||||
if (SENSOR_CONFIG.magnetometer === 0) {
|
||||
//Comment for test
|
||||
$('#mag_btn, #mag-calibrated-data').css('pointer-events', 'none').css('opacity', '0.4');
|
||||
|
@ -258,9 +211,7 @@ TABS.calibration.initialize = function (callback) {
|
|||
|
||||
modalProcessing.close();
|
||||
GUI.log(chrome.i18n.getMessage('initialSetupMagCalibEnded'));
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
|
||||
MSP.send_message(MSPCodes.MSP_CALIBRATION_DATA, false, false, updateSensorData);
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSP_CALIBRATION_DATA, false, false, updateSensorData);
|
||||
helper.interval.remove('compass_calibration_interval');
|
||||
}
|
||||
}, 1000);
|
||||
|
@ -277,13 +228,10 @@ TABS.calibration.initialize = function (callback) {
|
|||
|
||||
// translate to user-selected language
|
||||
localize();
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
|
||||
$('#calibrate-start-button').on('click', calibrateNew);
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_CALIBRATION_DATA, false, false, updateSensorData);
|
||||
} else {
|
||||
$('#calibrate-start-button').on('click', calibrate);
|
||||
}
|
||||
$('#calibrate-start-button').on('click', calibrateNew);
|
||||
MSP.send_message(MSPCodes.MSP_CALIBRATION_DATA, false, false, updateSensorData);
|
||||
|
||||
GUI.content_ready(callback);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -495,7 +495,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="config-section gui_box grey requires-v1_8_1">
|
||||
<div class="config-section gui_box grey">
|
||||
<div class="gui_box_titlebar">
|
||||
<div class="spacer_box_title" data-i18n="configurationBatteryCapacity"></div>
|
||||
</div>
|
||||
|
|
|
@ -44,12 +44,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
loadCraftName
|
||||
];
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
loadChain.push(mspHelper.loadMiscV2);
|
||||
} else {
|
||||
loadChain.push(mspHelper.loadMisc);
|
||||
}
|
||||
|
||||
loadChain.push(mspHelper.loadMiscV2);
|
||||
loadChainer.setChain(loadChain);
|
||||
loadChainer.setExitPoint(load_html);
|
||||
loadChainer.execute();
|
||||
|
@ -71,12 +66,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
saveCraftName,
|
||||
];
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
saveChain.push(mspHelper.saveMiscV2);
|
||||
} else {
|
||||
saveChain.push(mspHelper.saveMisc);
|
||||
}
|
||||
|
||||
saveChain.push(mspHelper.saveMiscV2);
|
||||
saveChain.push(mspHelper.saveToEeprom);
|
||||
|
||||
saveChainer.setChain(saveChain);
|
||||
|
@ -417,14 +407,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
$('#maxthrottle').val(MISC.maxthrottle);
|
||||
$('#mincommand').val(MISC.mincommand);
|
||||
|
||||
// Battery thresholds resolution is 100mV and voltage scale max is 255 before 1.8.1
|
||||
if (semver.lt(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
$('#mincellvoltage').attr('step', '0.1');
|
||||
$('#maxcellvoltage').attr('step', '0.1');
|
||||
$('#warningcellvoltage').attr('step', '0.1');
|
||||
$('#voltagescale').attr('max', '255');
|
||||
}
|
||||
|
||||
// fill battery voltage
|
||||
$('#voltagesource').val(MISC.voltage_source);
|
||||
$('#cells').val(MISC.battery_cells);
|
||||
|
@ -736,12 +718,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
SENSOR_CONFIG.opflow = $sensorOpflow.val();
|
||||
});
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
|
||||
$(".requires-v1_8_1").show();
|
||||
} else {
|
||||
$(".requires-v1_8_1").hide();
|
||||
}
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "2.0.0")) {
|
||||
$(".requires-v2_0_0").show();
|
||||
} else {
|
||||
|
@ -903,11 +879,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
});
|
||||
|
||||
helper.interval.add('config_load_analog', function () {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
$('#batteryvoltage').val([ANALOG.voltage.toFixed(2)]);
|
||||
} else {
|
||||
$('#batteryvoltage').val([ANALOG.voltage.toFixed(1)]);
|
||||
}
|
||||
$('#batteryvoltage').val([ANALOG.voltage.toFixed(2)]);
|
||||
$('#batterycurrent').val([ANALOG.amperage.toFixed(2)]);
|
||||
}, 100, true); // 10 fps
|
||||
|
||||
|
|
|
@ -574,7 +574,6 @@ OSD.constants = {
|
|||
{
|
||||
name: 'MAIN_BATT_REMAINING_PERCENTAGE',
|
||||
id: 38,
|
||||
min_version: '1.8.1',
|
||||
preview: '100%'
|
||||
},
|
||||
{
|
||||
|
@ -912,7 +911,6 @@ OSD.constants = {
|
|||
{
|
||||
name: 'WH_DRAWN',
|
||||
id: 36,
|
||||
min_version: '1.8.1',
|
||||
preview: FONT.symbol(SYM.WH) + FONT.embed_dot('1.25')
|
||||
},
|
||||
{
|
||||
|
@ -923,7 +921,6 @@ OSD.constants = {
|
|||
{
|
||||
name: 'MAIN_BATT_REMAINING_CAPACITY',
|
||||
id: 37,
|
||||
min_version: '1.8.1',
|
||||
preview: FONT.symbol(SYM.MAH) + '690 ' // 4 chars
|
||||
},
|
||||
{
|
||||
|
@ -934,7 +931,6 @@ OSD.constants = {
|
|||
{
|
||||
name: 'EFFICIENCY_WH',
|
||||
id: 39,
|
||||
min_version: '1.8.1',
|
||||
preview: FONT.embed_dot('1.23') + FONT.symbol(SYM.WH_KM_0) + FONT.symbol(SYM.WH_KM_1)
|
||||
}
|
||||
]
|
||||
|
|
|
@ -16,12 +16,7 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
mspHelper.loadPidAdvanced,
|
||||
mspHelper.loadFilterConfig
|
||||
];
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
loadChain.push(mspHelper.loadRateProfileData);
|
||||
} else {
|
||||
loadChain.push(mspHelper.loadRcTuningData);
|
||||
}
|
||||
loadChain.push(mspHelper.loadRateProfileData);
|
||||
|
||||
loadChainer.setChain(loadChain);
|
||||
loadChainer.setExitPoint(load_html);
|
||||
|
@ -233,11 +228,7 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
}
|
||||
|
||||
function send_rc_tuning_changes() {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
MSP.send_message(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE, mspHelper.crunch(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE), false, saveINAVPidConfig);
|
||||
} else {
|
||||
MSP.send_message(MSPCodes.MSP_SET_RC_TUNING, mspHelper.crunch(MSPCodes.MSP_SET_RC_TUNING), false, saveINAVPidConfig);
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE, mspHelper.crunch(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE), false, saveINAVPidConfig);
|
||||
}
|
||||
|
||||
function saveINAVPidConfig() {
|
||||
|
|
|
@ -24,12 +24,7 @@ TABS.receiver.initialize = function (callback) {
|
|||
mspHelper.loadRcDeadband
|
||||
];
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
loadChain.push(mspHelper.loadRateProfileData);
|
||||
} else {
|
||||
loadChain.push(mspHelper.loadRcTuningData);
|
||||
}
|
||||
|
||||
loadChain.push(mspHelper.loadRateProfileData);
|
||||
loadChainer.setChain(loadChain);
|
||||
loadChainer.setExitPoint(load_html);
|
||||
loadChainer.execute();
|
||||
|
@ -328,11 +323,7 @@ TABS.receiver.initialize = function (callback) {
|
|||
});
|
||||
}
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
MSP.send_message(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE, mspHelper.crunch(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE), false, save_rc_map);
|
||||
} else {
|
||||
MSP.send_message(MSPCodes.MSP_SET_RC_TUNING, mspHelper.crunch(MSPCodes.MSP_SET_RC_TUNING), false, save_rc_map);
|
||||
}
|
||||
MSP.send_message(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE, mspHelper.crunch(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE), false, save_rc_map);
|
||||
});
|
||||
|
||||
$("a.sticks").click(function () {
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
<div class="spacer_box">
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">
|
||||
<tbody>
|
||||
<tr class="requires-v1_8_1">
|
||||
<tr>
|
||||
<td data-i18n="initialSetupBatteryDetectedCells"></td>
|
||||
<td class="bat-cells">0</td>
|
||||
</tr>
|
||||
|
@ -100,19 +100,19 @@
|
|||
<td data-i18n="initialSetupBatteryVoltage"></td>
|
||||
<td class="bat-voltage">0 V</td>
|
||||
</tr>
|
||||
<tr class="requires-v1_8_1">
|
||||
<tr>
|
||||
<td data-i18n="initialSetupBatteryPercentage"></td>
|
||||
<td class="bat-percent">0 %</td>
|
||||
</tr>
|
||||
<tr class="requires-v1_8_1">
|
||||
<tr>
|
||||
<td data-i18n="initialSetupBatteryRemainingCapacity"></td>
|
||||
<td class="bat-remain-cap">NA</td>
|
||||
</tr>
|
||||
<tr class="requires-v1_8_1">
|
||||
<tr>
|
||||
<td data-i18n="initialSetupBatteryFull"></td>
|
||||
<td class="bat-full">0</td>
|
||||
</tr>
|
||||
<tr class="requires-v1_8_1">
|
||||
<tr>
|
||||
<td data-i18n="initialSetupBatteryThresholds"></td>
|
||||
<td class="bat-thresh">0</td>
|
||||
</tr>
|
||||
|
@ -128,7 +128,7 @@
|
|||
<td data-i18n="initialSetupDrawn"></td>
|
||||
<td class="bat-mah-drawn">0 mAh</td>
|
||||
</tr>
|
||||
<tr class="requires-v1_8_1">
|
||||
<tr>
|
||||
<td data-i18n="initialSetup_Wh_drawn"></td>
|
||||
<td class="bat-mwh-drawn">0 Wh</td>
|
||||
</tr>
|
||||
|
|
|
@ -21,12 +21,7 @@ TABS.setup.initialize = function (callback) {
|
|||
mspHelper.loadMixerConfig
|
||||
];
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
loadChain.push(mspHelper.loadMiscV2);
|
||||
} else {
|
||||
loadChain.push(mspHelper.loadMisc);
|
||||
}
|
||||
|
||||
loadChain.push(mspHelper.loadMiscV2);
|
||||
loadChainer.setChain(loadChain);
|
||||
loadChainer.setExitPoint(load_html);
|
||||
loadChainer.execute();
|
||||
|
@ -150,26 +145,22 @@ TABS.setup.initialize = function (callback) {
|
|||
helper.mspBalancedInterval.add('setup_data_pull_fast', 40, 1, get_fast_data);
|
||||
helper.mspBalancedInterval.add('setup_data_pull_slow', 250, 1, get_slow_data);
|
||||
|
||||
if (semver.lt(CONFIG.flightControllerVersion, '1.8.1')) {
|
||||
$('.requires-v1_8_1').hide();
|
||||
}
|
||||
|
||||
helper.interval.add('gui_analog_update', function () {
|
||||
bat_cells_e.text(chrome.i18n.getMessage('initialSetupBatteryDetectedCellsValue', [ANALOG.cell_count]));
|
||||
bat_voltage_e.text(chrome.i18n.getMessage('initialSetupBatteryVoltageValue', [ANALOG.voltage]));
|
||||
remaining_capacity_wh_decimals = ANALOG.battery_remaining_capacity.toString().length < 5 ? 3 : (7 - ANALOG.battery_remaining_capacity.toString().length);
|
||||
remaining_capacity_value = MISC.battery_capacity_unit == 'mAh' ? ANALOG.battery_remaining_capacity : (ANALOG.battery_remaining_capacity / 1000).toFixed(remaining_capacity_wh_decimals < 0 ? 0 : remaining_capacity_wh_decimals);
|
||||
remaining_capacity_unit = MISC.battery_capacity_unit == 'mAh' ? 'mAh' : 'Wh';
|
||||
bat_remaining_e.text(chrome.i18n.getMessage('initialSetupBatteryRemainingCapacityValue', ((MISC.battery_capacity > 0) && ANALOG.battery_full_when_plugged_in) ? [remaining_capacity_value, remaining_capacity_unit] : ['NA', '']));
|
||||
bat_percent_e.text(chrome.i18n.getMessage('initialSetupBatteryPercentageValue', [ANALOG.battery_percentage]));
|
||||
bat_full_e.text(chrome.i18n.getMessage('initialSetupBatteryFullValue', [ANALOG.battery_full_when_plugged_in]));
|
||||
bat_thresh_e.text(chrome.i18n.getMessage('initialSetupBatteryThresholdsValue', [ANALOG.use_capacity_thresholds]));
|
||||
bat_mah_drawn_e.text(chrome.i18n.getMessage('initialSetupBatteryMahValue', [ANALOG.mAhdrawn]));
|
||||
capacity_drawn_decimals = ANALOG.mWhdrawn.toString().length < 5 ? 3 : (7 - ANALOG.mWhdrawn.toString().length);
|
||||
bat_wh_drawn_e.text(chrome.i18n.getMessage('initialSetup_Wh_drawnValue', [(ANALOG.mWhdrawn / 1000).toFixed(capacity_drawn_decimals < 0 ? 0 : capacity_drawn_decimals)]));
|
||||
bat_current_draw_e.text(chrome.i18n.getMessage('initialSetupCurrentDrawValue', [ANALOG.amperage.toFixed(2)]));
|
||||
bat_power_draw_e.text(chrome.i18n.getMessage('initialSetupPowerDrawValue', [ANALOG.power.toFixed(2)]));
|
||||
rssi_e.text(chrome.i18n.getMessage('initialSetupRSSIValue', [((ANALOG.rssi / 1023) * 100).toFixed(0)]));
|
||||
bat_cells_e.text(chrome.i18n.getMessage('initialSetupBatteryDetectedCellsValue', [ANALOG.cell_count]));
|
||||
bat_voltage_e.text(chrome.i18n.getMessage('initialSetupBatteryVoltageValue', [ANALOG.voltage]));
|
||||
remaining_capacity_wh_decimals = ANALOG.battery_remaining_capacity.toString().length < 5 ? 3 : (7 - ANALOG.battery_remaining_capacity.toString().length);
|
||||
remaining_capacity_value = MISC.battery_capacity_unit == 'mAh' ? ANALOG.battery_remaining_capacity : (ANALOG.battery_remaining_capacity / 1000).toFixed(remaining_capacity_wh_decimals < 0 ? 0 : remaining_capacity_wh_decimals);
|
||||
remaining_capacity_unit = MISC.battery_capacity_unit == 'mAh' ? 'mAh' : 'Wh';
|
||||
bat_remaining_e.text(chrome.i18n.getMessage('initialSetupBatteryRemainingCapacityValue', ((MISC.battery_capacity > 0) && ANALOG.battery_full_when_plugged_in) ? [remaining_capacity_value, remaining_capacity_unit] : ['NA', '']));
|
||||
bat_percent_e.text(chrome.i18n.getMessage('initialSetupBatteryPercentageValue', [ANALOG.battery_percentage]));
|
||||
bat_full_e.text(chrome.i18n.getMessage('initialSetupBatteryFullValue', [ANALOG.battery_full_when_plugged_in]));
|
||||
bat_thresh_e.text(chrome.i18n.getMessage('initialSetupBatteryThresholdsValue', [ANALOG.use_capacity_thresholds]));
|
||||
bat_mah_drawn_e.text(chrome.i18n.getMessage('initialSetupBatteryMahValue', [ANALOG.mAhdrawn]));
|
||||
capacity_drawn_decimals = ANALOG.mWhdrawn.toString().length < 5 ? 3 : (7 - ANALOG.mWhdrawn.toString().length);
|
||||
bat_wh_drawn_e.text(chrome.i18n.getMessage('initialSetup_Wh_drawnValue', [(ANALOG.mWhdrawn / 1000).toFixed(capacity_drawn_decimals < 0 ? 0 : capacity_drawn_decimals)]));
|
||||
bat_current_draw_e.text(chrome.i18n.getMessage('initialSetupCurrentDrawValue', [ANALOG.amperage.toFixed(2)]));
|
||||
bat_power_draw_e.text(chrome.i18n.getMessage('initialSetupPowerDrawValue', [ANALOG.power.toFixed(2)]));
|
||||
rssi_e.text(chrome.i18n.getMessage('initialSetupRSSIValue', [((ANALOG.rssi / 1023) * 100).toFixed(0)]));
|
||||
}, 100, true);
|
||||
|
||||
function updateArminFailure() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue