diff options
author | Pawel Spychalski (DzikuVx) <pspychalski@gmail.com> | 2019-02-26 17:23:04 +0300 |
---|---|---|
committer | Pawel Spychalski (DzikuVx) <pspychalski@gmail.com> | 2019-02-26 17:23:04 +0300 |
commit | 521915b5a9ec4c75255bfe1adce1b5adc610b342 (patch) | |
tree | 105b0d2add39aa11d698d768f30bf6f15025e690 /tabs | |
parent | 97c622fbb1c7bcddc61b50393aa8d1109d9dab9f (diff) |
1.8 removed
Diffstat (limited to 'tabs')
-rw-r--r-- | tabs/adjustments.js | 6 | ||||
-rwxr-xr-x | tabs/calibration.js | 88 | ||||
-rw-r--r-- | tabs/configuration.html | 2 | ||||
-rw-r--r-- | tabs/configuration.js | 34 | ||||
-rw-r--r-- | tabs/osd.js | 4 | ||||
-rwxr-xr-x | tabs/pid_tuning.js | 13 | ||||
-rw-r--r-- | tabs/receiver.js | 13 | ||||
-rw-r--r-- | tabs/setup.html | 12 | ||||
-rwxr-xr-x | tabs/setup.js | 41 |
9 files changed, 49 insertions, 164 deletions
diff --git a/tabs/adjustments.js b/tabs/adjustments.js index a36a2e6e..3821ecc7 100644 --- a/tabs/adjustments.js +++ b/tabs/adjustments.js @@ -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); diff --git a/tabs/calibration.js b/tabs/calibration.js index d3b73631..fa0b830a 100755 --- a/tabs/calibration.js +++ b/tabs/calibration.js @@ -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(); - - 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); - } + loadChainer.setChain([ + mspHelper.loadStatus, + mspHelper.loadSensorConfig, + mspHelper.loadCalibrationData + ]); + loadChainer.setExitPoint(loadHtml); + loadChainer.execute(); + + saveChainer.setChain([ + mspHelper.saveCalibrationData + ]); + 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); } }; diff --git a/tabs/configuration.html b/tabs/configuration.html index 34c6a7ee..aec756b8 100644 --- a/tabs/configuration.html +++ b/tabs/configuration.html @@ -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> diff --git a/tabs/configuration.js b/tabs/configuration.js index da0a4032..c27ca591 100644 --- a/tabs/configuration.js +++ b/tabs/configuration.js @@ -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 diff --git a/tabs/osd.js b/tabs/osd.js index 94369e92..6ffd9496 100644 --- a/tabs/osd.js +++ b/tabs/osd.js @@ -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) } ] diff --git a/tabs/pid_tuning.js b/tabs/pid_tuning.js index 6b101060..9aa67682 100755 --- a/tabs/pid_tuning.js +++ b/tabs/pid_tuning.js @@ -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() { diff --git a/tabs/receiver.js b/tabs/receiver.js index 62dce43a..48f8e4dc 100644 --- a/tabs/receiver.js +++ b/tabs/receiver.js @@ -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 () { diff --git a/tabs/setup.html b/tabs/setup.html index ce9942dd..0e5974c2 100644 --- a/tabs/setup.html +++ b/tabs/setup.html @@ -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> diff --git a/tabs/setup.js b/tabs/setup.js index a8c7ea26..da829d81 100755 --- a/tabs/setup.js +++ b/tabs/setup.js @@ -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() { |