From c498e7de342fde713f88f93f0cb2aeffdad0eb95 Mon Sep 17 00:00:00 2001 From: skaman82 Date: Fri, 20 Nov 2015 21:42:40 +0100 Subject: [PATCH 1/9] Added support for failsafe TAB Made in cooperation with skaman82. Summary of modifications: - Extended data storage to hold data for new/changed MSP messages. - Added support for added/changed MSP messages. - Added assigned mode(s) to AUX labels. - Tooltip changes. - Included style modifications to configuration tab from Skaman82. - Moved all texts from failsafe tab .html to `messages.json`. - Removed failsafe settings from configuration tab (now obsolete). - Added failsafe-tab variables to Backup & Restore. - Reorganized stage 2 elements, cleanup and corrections. --- _locales/en/messages.json | 86 +++++- images/icons/cf_failsafe_procedure1.svg | 48 +++ images/icons/cf_failsafe_procedure2.svg | 54 ++++ images/icons/cf_failsafe_procedure3.svg | 56 ++++ images/icons/cf_failsafe_procedure4.svg | 82 +++++ images/icons/cf_icon_failsafe_grey.svg | 11 + images/icons/cf_icon_failsafe_white.svg | 11 + js/backup_restore.js | 66 +++- js/data_storage.js | 21 ++ js/gui.js | 1 + js/msp.js | 102 ++++++- main.css | 11 +- main.html | 36 +-- main.js | 4 +- tabs/configuration.css | 8 +- tabs/configuration.html | 28 +- tabs/configuration.js | 2 - tabs/failsafe.css | 222 ++++++++++++++ tabs/failsafe.html | 151 ++++++++++ tabs/failsafe.js | 382 ++++++++++++++++++++++++ 20 files changed, 1317 insertions(+), 65 deletions(-) create mode 100644 images/icons/cf_failsafe_procedure1.svg create mode 100644 images/icons/cf_failsafe_procedure2.svg create mode 100644 images/icons/cf_failsafe_procedure3.svg create mode 100644 images/icons/cf_failsafe_procedure4.svg create mode 100644 images/icons/cf_icon_failsafe_grey.svg create mode 100644 images/icons/cf_icon_failsafe_white.svg create mode 100644 tabs/failsafe.css create mode 100644 tabs/failsafe.html create mode 100644 tabs/failsafe.js diff --git a/_locales/en/messages.json b/_locales/en/messages.json index ff0b4b1e..526119f1 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -425,9 +425,6 @@ "configurationReceiver": { "message": "Receiver Mode" }, - "configurationFailsafe": { - "message": "Receiver failsafe" - }, "configurationRSSI": { "message": "RSSI (Signal Strength)" }, @@ -481,9 +478,6 @@ "configurationThrottleMaximum": { "message": "Maximum Throttle" }, - "configurationThrottleFailsafe": { - "message": "Failsafe Throttle" - }, "configurationThrottleMinimumCommand": { "message": "Minimum Command" }, @@ -1271,5 +1265,83 @@ }, "configHelp1": { "message": "RSSI is a measurement of signal strength and is very handy so you know when your aircraft isw going out of range or if it is suffering RF interference." + }, + "failsafeFeaturesHelpOld": { + "message": "Failsafe configuration has changed considerably. You should use a version above v1.11.0-RC1 to enable the improved configuration panel." + }, + "failsafePaneTitleOld": { + "message": "Receiver failsafe" + }, + "failsafeFeatureItemOld": { + "message": "Failsafe settings on RX signal loss" + }, + "failsafeThrottleItemOld": { + "message": "Failsafe Throttle" + }, + "failsafeFeaturesHelpNew": { + "message": "Failsafe has two stages. Stage 1 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 all channels and a short amount of time is provided to allow for recovery. Stage 2 is entered when the error condition takes longer then the configured guard time while the craft is armed, all channels will remain at the applied channel fallback setting unless overruled by the chosen procedure.
Note: Prior to entering stage 1, channel fallback settings are also applied to individual AUX channels that have invalid pulses." + }, + "failsafePulsrangeTitle": { + "message": "Valid Pulse Range Settings" + }, + "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" + }, + "failsafeRxMinUsecItem": { + "message": "Minimum length" + }, + "failsafeRxMaxUsecItem": { + "message": "Maximum length" + }, + "failsafeChannelFallbackSettingsTitle": { + "message": "Channel Fallback Settings" + }, + "failsafeChannelFallbackSettingsHelp": { + "message": "These settings are applied to invalid individual AUX channels or to all channels when entering stage 1. Note: values are saved in steps of 25usec, so small changes disappear" + }, + "failsafeStageTwoSettingsTitle": { + "message": "Stage 2 - Settings" + }, + "failsafeFeatureItem": { + "message": "Failsafe Stage 2 enabled" + }, + "failsafeFeatureHelp": { + "message": "Note: When Stage 2 is DISABLED, the fallback setting Auto is used instead of the user settings for all flightchannels (Roll, Pitch, Yaw and Throttle)." + }, + "failsafeDelayItem": { + "message": "Guard time for stage 2 activation after signal lost [1 = 0.1 sec.]" + }, + "failsafeDelayHelp": { + "message": "Time for stage 1 to wait for recovery" + }, + "failsafeThrottleLowItem": { + "message": "Failsafe Throttle Low Delay [1 = 0.1 sec.]" + }, + "failsafeThrottleLowHelp": { + "message": "Just disarm the craft instead of executing the selected failsafe procedure when the throttle was low for this amount of time" + }, + "failsafeThrottleItem": { + "message": "Throttle value used while landing" + }, + "failsafeOffDelayItem": { + "message": "Delay for turning off the Motors during Failsafe [1 = 0.1 sec.]" + }, + "failsafeOffDelayHelp": { + "message": "Time to stay in landing mode untill the motors are turned off and the craft is disarmed" + }, + "failsafeSubTitle1": { + "message": "Stage 2 - Failsafe Procedure" + }, + "failsafeProcedureItemSelect1": { + "message": "Land" + }, + "failsafeProcedureItemSelect2": { + "message": "Drop" + }, + "failsafeKillSwitchItem": { + "message": "Failsafe Kill Switch (setup Failsafe in Modes Tab)" + }, + "failsafeKillSwitchHelp": { + "message": "Set this option to make the failsafe switch, configured in the modes tab, act as a direct kill switch, bypassing the selected failsafe procedure. Note: Arming is blocked with the failsafe kill switch in the ON position" } -} \ No newline at end of file +} diff --git a/images/icons/cf_failsafe_procedure1.svg b/images/icons/cf_failsafe_procedure1.svg new file mode 100644 index 00000000..3b7f5c5d --- /dev/null +++ b/images/icons/cf_failsafe_procedure1.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/icons/cf_failsafe_procedure2.svg b/images/icons/cf_failsafe_procedure2.svg new file mode 100644 index 00000000..fd80bd06 --- /dev/null +++ b/images/icons/cf_failsafe_procedure2.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/icons/cf_failsafe_procedure3.svg b/images/icons/cf_failsafe_procedure3.svg new file mode 100644 index 00000000..c649e1fd --- /dev/null +++ b/images/icons/cf_failsafe_procedure3.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/icons/cf_failsafe_procedure4.svg b/images/icons/cf_failsafe_procedure4.svg new file mode 100644 index 00000000..db707e4b --- /dev/null +++ b/images/icons/cf_failsafe_procedure4.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/icons/cf_icon_failsafe_grey.svg b/images/icons/cf_icon_failsafe_grey.svg new file mode 100644 index 00000000..dd586e1f --- /dev/null +++ b/images/icons/cf_icon_failsafe_grey.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/images/icons/cf_icon_failsafe_white.svg b/images/icons/cf_icon_failsafe_white.svg new file mode 100644 index 00000000..59b5b9f7 --- /dev/null +++ b/images/icons/cf_icon_failsafe_white.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/js/backup_restore.js b/js/backup_restore.js index 6cf002b8..8f80b114 100644 --- a/js/backup_restore.js +++ b/js/backup_restore.js @@ -99,6 +99,11 @@ function configuration_backup(callback) { if (semver.gte(CONFIG.apiVersion, "1.14.0")) { uniqueData.push(MSP_codes.MSP_3D); } + if (semver.gte(CONFIG.apiVersion, "1.15.0")) { + uniqueData.push(MSP_codes.MSP_RX_CONFIG); + uniqueData.push(MSP_codes.MSP_FAILSAFE_CONFIG); + uniqueData.push(MSP_codes.MSP_RXFAIL_CONFIG); + } } update_unique_data_list(); @@ -126,6 +131,11 @@ function configuration_backup(callback) { if (semver.gte(CONFIG.apiVersion, "1.14.0")) { configuration._3D = jQuery.extend(true, {}, _3D); } + if (semver.gte(CONFIG.apiVersion, "1.15.0")) { + configuration.RX_CONFIG = jQuery.extend(true, {}, RX_CONFIG); + configuration.FAILSAFE_CONFIG = jQuery.extend(true, {}, FAILSAFE_CONFIG); + configuration.RXFAIL_CONFIG = jQuery.extend(true, [], RXFAIL_CONFIG); + } save(); } @@ -507,6 +517,52 @@ function configuration_restore(callback) { appliedMigrationsCount++; } + if (compareVersions(migratedVersion, '0.66.0') && !compareVersions(configuration.apiVersion, '1.15.0')) { + // api 1.15 exposes RX_CONFIG, FAILSAFE_CONFIG and RXFAIL_CONFIG configuration + + if (configuration.RX_CONFIG == undefined) { + configuration.RX_CONFIG = { + serialrx_provider: 0, + spektrum_sat_bind: 0, + midrc: 1500, + mincheck: 1100, + maxcheck: 1900, + rx_min_usec: 885, + rx_max_usec: 2115 + }; + } + + if (configuration.FAILSAFE_CONFIG == undefined) { + configuration.FAILSAFE_CONFIG = { + failsafe_delay: 10, + failsafe_off_delay: 200, + failsafe_throttle: 1000, + failsafe_kill_switch: 0, + failsafe_throttle_low_delay: 100, + failsafe_procedure: 0 + }; + } + + if (configuration.RXFAIL_CONFIG == undefined) { + configuration.RXFAIL_CONFIG = [ + {mode: 0, value: 1500}, + {mode: 0, value: 1500}, + {mode: 0, value: 1500}, + {mode: 0, value: 875} + ]; + + for (var i = 0; i < 14; i++) { + var rxfailChannel = { + mode: 1, + value: 1500 + }; + configuration.RXFAIL_CONFIG.push(rxfailChannel); + } + } + + appliedMigrationsCount++; + } + if (appliedMigrationsCount > 0) { GUI.log(chrome.i18n.getMessage('configMigrationSuccessful', [appliedMigrationsCount])); } @@ -617,6 +673,11 @@ function configuration_restore(callback) { if (semver.gte(CONFIG.apiVersion, "1.14.0")) { uniqueData.push(MSP_codes.MSP_SET_3D); } + if (semver.gte(CONFIG.apiVersion, "1.15.0")) { + uniqueData.push(MSP_codes.MSP_SET_RX_CONFIG); + uniqueData.push(MSP_codes.MSP_SET_FAILSAFE_CONFIG); + uniqueData.push(MSP_codes.MSP_SET_RXFAIL_CONFIG); + } } function load_objects() { @@ -628,6 +689,9 @@ function configuration_restore(callback) { ARMING_CONFIG = configuration.ARMING_CONFIG; FC_CONFIG = configuration.FC_CONFIG; _3D = configuration._3D; + RX_CONFIG = configuration.RX_CONFIG; + FAILSAFE_CONFIG = configuration.FAILSAFE_CONFIG; + RXFAIL_CONFIG = configuration.RXFAIL_CONFIG; } function send_unique_data_item() { @@ -676,4 +740,4 @@ function configuration_restore(callback) { upload(); } -} \ No newline at end of file +} diff --git a/js/data_storage.js b/js/data_storage.js index 02aa21ea..fe980504 100755 --- a/js/data_storage.js +++ b/js/data_storage.js @@ -178,3 +178,24 @@ var DATAFLASH = { totalSize: 0, usedSize: 0 }; + +var RX_CONFIG = { + serialrx_provider: 0, + maxcheck: 0, + midrc: 0, + mincheck: 0, + spektrum_sat_bind: 0, + rx_min_usec: 0, + rx_max_usec: 0 +}; + +var FAILSAFE_CONFIG = { + failsafe_delay: 0, + failsafe_off_delay: 0, + failsafe_throttle: 0, + failsafe_kill_switch: 0, + failsafe_throttle_low_delay: 0, + failsafe_procedure: 0 +}; + +var RXFAIL_CONFIG = []; diff --git a/js/gui.js b/js/gui.js index 57ba8100..3707fcd3 100644 --- a/js/gui.js +++ b/js/gui.js @@ -18,6 +18,7 @@ var GUI_control = function () { 'help' ]; this.defaultAllowedTabsWhenConnected = [ + 'failsafe', 'adjustments', 'auxiliary', 'cli', diff --git a/js/msp.js b/js/msp.js index cfde7dc0..bbe56949 100644 --- a/js/msp.js +++ b/js/msp.js @@ -13,6 +13,8 @@ var MSP_codes = { MSP_SET_CHANNEL_FORWARDING: 33, MSP_MODE_RANGES: 34, MSP_SET_MODE_RANGE: 35, + MSP_RX_CONFIG: 44, + MSP_SET_RX_CONFIG: 45, MSP_LED_STRIP_CONFIG: 48, MSP_SET_LED_STRIP_CONFIG: 49, MSP_ADJUSTMENT_RANGES: 52, @@ -29,6 +31,10 @@ var MSP_codes = { MSP_DATAFLASH_ERASE: 72, MSP_LOOP_TIME: 73, MSP_SET_LOOP_TIME: 74, + MSP_FAILSAFE_CONFIG: 75, + MSP_SET_FAILSAFE_CONFIG: 76, + MSP_RXFAIL_CONFIG: 77, + MSP_SET_RXFAIL_CONFIG: 78, // Multiwii MSP commands MSP_IDENT: 100, @@ -755,6 +761,7 @@ var MSP = { ADJUSTMENT_RANGES.push(adjustmentRange); } break; + case MSP_codes.MSP_CHANNEL_FORWARDING: for (var i = 0; i < data.byteLength && i < SERVO_CONFIG.length; i ++) { var channelIndex = data.getUint8(i); @@ -766,6 +773,56 @@ var MSP = { } break; + case MSP_codes.MSP_RX_CONFIG: + var offset = 0; + RX_CONFIG.serialrx_provider = data.getUint8(offset, 1); + offset++; + RX_CONFIG.maxcheck = data.getUint16(offset, 1); + offset += 2; + RX_CONFIG.midrc = data.getUint16(offset, 1); + offset += 2; + RX_CONFIG.mincheck = data.getUint16(offset, 1); + offset += 2; + RX_CONFIG.spektrum_sat_bind = data.getUint8(offset, 1); + offset++; + RX_CONFIG.rx_min_usec = data.getUint16(offset, 1); + offset += 2; + RX_CONFIG.rx_max_usec = data.getUint16(offset, 1); + offset += 2; + break; + + case MSP_codes.MSP_FAILSAFE_CONFIG: + var offset = 0; + FAILSAFE_CONFIG.failsafe_delay = data.getUint8(offset, 1); + offset++; + FAILSAFE_CONFIG.failsafe_off_delay = data.getUint8(offset, 1); + offset++; + FAILSAFE_CONFIG.failsafe_throttle = data.getUint16(offset, 1); + offset += 2; + FAILSAFE_CONFIG.failsafe_kill_switch = data.getUint8(offset, 1); + offset++; + FAILSAFE_CONFIG.failsafe_throttle_low_delay = data.getUint16(offset, 1); + offset += 2; + FAILSAFE_CONFIG.failsafe_procedure = data.getUint8(offset, 1); + offset++; + break; + + case MSP_codes.MSP_RXFAIL_CONFIG: + RXFAIL_CONFIG = []; // empty the array as new data is coming in + + var channelCount = data.byteLength / 3; + + var offset = 0; + for (var i = 0; offset < data.byteLength && i < channelCount; i++, offset++) { + var rxfailChannel = { + mode: data.getUint8(offset++, 1), + value: data.getUint16(offset++, 1) + }; + RXFAIL_CONFIG.push(rxfailChannel); + } + break; + + case MSP_codes.MSP_LED_STRIP_CONFIG: LED_STRIP = []; @@ -848,7 +905,15 @@ var MSP = { case MSP_codes.MSP_SET_ARMING_CONFIG: console.log('Arming config saved'); break; - + case MSP_codes.MSP_SET_RX_CONFIG: + console.log('Rx config saved'); + break; + case MSP_codes.MSP_SET_RXFAIL_CONFIG: + console.log('Rxfail config saved'); + break; + case MSP_codes.MSP_SET_FAILSAFE_CONFIG: + console.log('Failsafe config saved'); + break; default: console.log('Unknown code detected: ' + code); } else { @@ -1090,6 +1155,41 @@ MSP.crunch = function (code) { buffer.push(Math.round(MISC.vbatmaxcellvoltage * 10)); buffer.push(Math.round(MISC.vbatwarningcellvoltage * 10)); break; + + case MSP_codes.MSP_SET_RX_CONFIG: + buffer.push(RX_CONFIG.serialrx_provider); + buffer.push(lowByte(RX_CONFIG.maxcheck)); + buffer.push(highByte(RX_CONFIG.maxcheck)); + buffer.push(lowByte(RX_CONFIG.midrc)); + buffer.push(highByte(RX_CONFIG.midrc)); + buffer.push(lowByte(RX_CONFIG.mincheck)); + buffer.push(highByte(RX_CONFIG.mincheck)); + buffer.push(RX_CONFIG.spektrum_sat_bind); + buffer.push(lowByte(RX_CONFIG.rx_min_usec)); + buffer.push(highByte(RX_CONFIG.rx_min_usec)); + buffer.push(lowByte(RX_CONFIG.rx_max_usec)); + buffer.push(highByte(RX_CONFIG.rx_max_usec)); + break; + + case MSP_codes.MSP_SET_FAILSAFE_CONFIG: + buffer.push(FAILSAFE_CONFIG.failsafe_delay); + buffer.push(FAILSAFE_CONFIG.failsafe_off_delay); + buffer.push(lowByte(FAILSAFE_CONFIG.failsafe_throttle)); + buffer.push(highByte(FAILSAFE_CONFIG.failsafe_throttle)); + buffer.push(FAILSAFE_CONFIG.failsafe_kill_switch); + buffer.push(lowByte(FAILSAFE_CONFIG.failsafe_throttle_low_delay)); + buffer.push(highByte(FAILSAFE_CONFIG.failsafe_throttle_low_delay)); + buffer.push(FAILSAFE_CONFIG.failsafe_procedure); + break; + + case MSP_codes.MSP_SET_RXFAIL_CONFIG: + for (var i = 0; i < RXFAIL_CONFIG.length; i++) { + buffer.push(RXFAIL_CONFIG[i].mode); + buffer.push(lowByte(RXFAIL_CONFIG[i].value)); + buffer.push(highByte(RXFAIL_CONFIG[i].value)); + } + break; + case MSP_codes.MSP_SET_CHANNEL_FORWARDING: for (var i = 0; i < SERVO_CONFIG.length; i++) { var out = SERVO_CONFIG[i].indexOfChannelToForward; diff --git a/main.css b/main.css index b16ce9a8..0ea32ce1 100644 --- a/main.css +++ b/main.css @@ -722,6 +722,13 @@ li.active .ic_flasher { } /* SPARE Tab-Icons */ +.ic_failsafe { + background-image: url(images/icons/cf_icon_failsafe_grey.svg); +} + +li.active .ic_failsafe { + background-image: url(images/icons/cf_icon_failsafe_white.svg); +} .ic_backup { background-image: url(images/icons/cf_icon_backup_grey.svg); } @@ -1300,7 +1307,7 @@ dialog { } /* fixing padding for all Tabs*/ -.tab-setup, .tab-landing, .tab-adjustments, .tab-auxiliary, .tab-cli, .tab-configuration, .tab-dataflash, +.tab-setup, .tab-landing, .tab-adjustments, .tab-auxiliary, .tab-cli, .tab-configuration, .tab-failsafe, .tab-dataflash, .tab-firmware_flasher, .tab-gps, .tab-help, .tab-led-strip, .tab-logging, .tab-modes, .tab-motors, .tab-pid_tuning, .tab-ports, .tab-receiver, .tab-sensors, .tab-servos { height: 100%; @@ -1369,7 +1376,7 @@ dialog { /* lets see if we really need this? */ } - .tab-setup, .tab-landing, .tab-adjustments, .tab-auxiliary, .tab-cli, .tab-configuration, .tab-dataflash, + .tab-setup, .tab-landing, .tab-adjustments, .tab-auxiliary, .tab-cli, .tab-configuration, .tab-failsafe, .tab-dataflash, .tab-firmware_flasher, .tab-gps, .tab-help, .tab-led-strip, .tab-logging, .tab-modes, .tab-motors, .tab-pid_tuning, .tab-ports, .tab-receiver, .tab-sensors, .tab-servos { diff --git a/main.html b/main.html index 88320b86..71e16c89 100755 --- a/main.html +++ b/main.html @@ -25,6 +25,7 @@ + @@ -75,6 +76,7 @@ + @@ -161,36 +163,26 @@
    -
  • -
  • -
  • +
  • +
  • +
  • -
  • -
  • +
  • +
  • Failsafe
  • +
  • -
  • -
  • +
  • +
  • -
  • -
  • -
  • +
  • +
  • +
  • -
  • +
-
-
-
-
-
- - - - - - - - - - - -
-
- -
-
-
diff --git a/tabs/configuration.js b/tabs/configuration.js index bd4d8355..0f723758 100644 --- a/tabs/configuration.js +++ b/tabs/configuration.js @@ -318,7 +318,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) { $('input[name="minthrottle"]').val(MISC.minthrottle); $('input[name="midthrottle"]').val(MISC.midrc); $('input[name="maxthrottle"]').val(MISC.maxthrottle); - $('input[name="failsafe_throttle"]').val(MISC.failsafe_throttle); $('input[name="mincommand"]').val(MISC.mincommand); // fill battery @@ -405,7 +404,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) { MISC.minthrottle = parseInt($('input[name="minthrottle"]').val()); MISC.midrc = parseInt($('input[name="midthrottle"]').val()); MISC.maxthrottle = parseInt($('input[name="maxthrottle"]').val()); - MISC.failsafe_throttle = parseInt($('input[name="failsafe_throttle"]').val()); MISC.mincommand = parseInt($('input[name="mincommand"]').val()); MISC.vbatmincellvoltage = parseFloat($('input[name="mincellvoltage"]').val()); diff --git a/tabs/failsafe.css b/tabs/failsafe.css new file mode 100644 index 00000000..1ab23e5b --- /dev/null +++ b/tabs/failsafe.css @@ -0,0 +1,222 @@ +.tab-failsafe { + position: relative; +} + +.tab-failsafe .leftWrapper { + float: left; + width: calc(50% - 20px); +} + +.tab-failsafe .rightWrapper { + float: left; + width: calc(50% - 0px); + margin: 0 0 0 20px; +} + +.tab-failsafe .number { + margin-bottom: 5px; + clear: left; +} + +.tab-failsafe .number input { + width: 50px; + padding-left: 3px; + height: 20px; + line-height: 20px; + text-align: left; + border: 1px solid silver; + border-radius: 3px; + margin-right: 11px; + font-size: 12px; + font-weight: normal; +} + +.tab-failsafe .number input.disabled { + width: 43px; + padding: 0px 5px; + background-color: #ececec; +} + +.tab-failsafe .number span { + margin-left: 0px; +} + +.tab-failsafe .checkbox { + float: left; + width: 100%; + margin-bottom: 6px; + padding-bottom: 5px; + border-bottom: 1px solid #ddd; + margin-top: 0px; +} + +.tab-failsafe .subline { + float:left; + width:100%; + font-size: 13px; + margin-top:15px; + margin-bottom:5px; +} + +.tab-failsafe .radioarea { + float:left; + width:100%; + border-radius:5px; + background-color:#ededed; + margin-bottom:0px; + margin-top:5px; + height: 150px; +} + +.tab-failsafe .radiobuttons { + float: left; + width: 50%; + margin-top: 38px; + margin-left: 15px; + font-size: 12px; + font-family: 'open_sansregular', Arial; +} + +.tab-failsafe .radiobuttons input { + margin-right: 8px; + margin-bottom: 10px; +} + +.tab-failsafe .proceduresettings { + padding:10px; + margin-top: 75px; +} + +.tab-failsafe .radiobuttons label { + float: left; + width:130px; + margin-top: -2px; +} + +.tab-failsafe .pro1 { + background-image:url(../images/icons/cf_failsafe_procedure1.svg); + background-position: top right 10px; + background-size: 200px; + background-repeat:no-repeat; +} + +.tab-failsafe .pro2 { + background-image:url(../images/icons/cf_failsafe_procedure2.svg); + background-position: top right 10px; + background-size: 200px; + background-repeat:no-repeat; +} + +.tab-failsafe .pro3 { + background-image:url(../images/icons/cf_failsafe_procedure3.svg); + background-position: top right 10px; + background-size: 200px; + background-repeat:no-repeat; +} + +.tab-failsafe .pro4 { + background-image:url(../images/icons/cf_failsafe_procedure4.svg); + background-position: top right 10px; + background-size: 200px; + background-repeat:no-repeat; +} + +.tab-failsafe .spacer_box .helpicon { + margin-top:3px; + margin-right:0px; + +} + +.tab-failsafe .checkbox:last-child { + border-bottom: none; +} + +.tab-failsafe .freelabel { + margin-left: 10px; + position: relative; +} + +.tab-failsafe input { + float: left; +} + +.tab-failsafe span { + margin: 0px +} + +.tab-failsafe .spacer_box { + padding-bottom: 10px; + float: left; + width: calc(100% - 20px); +} + +.tab-failsafe .number { + padding-bottom: 5px; + border-bottom: 1px solid #ddd; + width: 100%; + float: left; +} + +.tab-failsafe .number:last-child { + border-bottom: none; + padding-bottom: 0px; + margin-bottom: 0px; +} + +.tab-failsafe .gui_box_titlebar { + margin-bottom: 0px; +} + +.tab-failsafe .numberspacer { + float: left; + width: 65px; + height: 21px; +} + +.tab-failsafe .gui_box { + font-style: normal; + font-family: 'open_sanssemibold', Arial; + margin-bottom: 15px; + float: left; +} + +.tab-failsafe .gui_box span { + font-style: normal; + font-family: 'open_sansregular', Arial; + line-height: 19px; + color: #7d7d7d; + font-size: 11px; +} + +.tab-failsafe .stage1 .number input { + float:right; + margin-right:0px; + } + +.tab-failsafe .stage1 select { + float:left; + width: 95%; + height: 22px; + margin: 0px; + border: 1px solid silver; + } + +.tab-failsafe .modename { + background-color: #828885; + border-radius: 3px; + border: 1px solid #686c6a; + color: #fff !important; + font-weight:normal; + font-family: 'open_sanssemibold', Arial; + padding-left: 3px; + padding-right:3px; + margin-right:3px; +} + +.tab-failsafe .channelname { + margin-right:3px; +} + +@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) { + +} diff --git a/tabs/failsafe.html b/tabs/failsafe.html new file mode 100644 index 00000000..1a153e75 --- /dev/null +++ b/tabs/failsafe.html @@ -0,0 +1,151 @@ +
+
+
Failsafe
+
+ +
+
+
+

+

+
+
+
+
+

+

+
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+
diff --git a/tabs/failsafe.js b/tabs/failsafe.js new file mode 100644 index 00000000..6f8999d1 --- /dev/null +++ b/tabs/failsafe.js @@ -0,0 +1,382 @@ +'use strict'; + +TABS.failsafe = {}; + +TABS.failsafe.initialize = function (callback, scrollPosition) { + var self = this; + + if (GUI.active_tab != 'failsafe') { + GUI.active_tab = 'failsafe'; + googleAnalytics.sendAppView('Failsafe'); + } + + function load_rx_config() { + MSP.send_message(MSP_codes.MSP_RX_CONFIG, false, false, load_failssafe_config); + } + + function load_failssafe_config() { + MSP.send_message(MSP_codes.MSP_FAILSAFE_CONFIG, false, false, load_rxfail_config); + } + + function load_rxfail_config() { + MSP.send_message(MSP_codes.MSP_RXFAIL_CONFIG, false, false, get_box_names); + } + + function get_box_names() { + MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_mode_ranges); + } + + function get_mode_ranges() { + MSP.send_message(MSP_codes.MSP_MODE_RANGES, false, false, get_box_ids); + } + + function get_box_ids() { + MSP.send_message(MSP_codes.MSP_BOXIDS, false, false, get_rc_data); + } + + function get_rc_data() { + MSP.send_message(MSP_codes.MSP_RC, false, false, load_config); + } + + // BEGIN Support for pre API version 1.15.0 + function load_config() { + MSP.send_message(MSP_codes.MSP_BF_CONFIG, false, false, load_misc); + } + + function load_misc() { + MSP.send_message(MSP_codes.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(MSP_codes.MSP_IDENT, false, false, load_rx_config); + } else { + MSP.send_message(MSP_codes.MSP_IDENT, false, false, load_config); + } + + function process_html() { + var failsafeFeature; + + // 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, + element; + + for (var channelIndex = 0; channelIndex < RC.active_channels - 4; channelIndex++) { + auxAssignment.push(""); + } + + for (var modeIndex = 0; modeIndex < AUX_CONFIG.length; modeIndex++) { + + var modeId = AUX_CONFIG_IDS[modeIndex]; + + // scan mode ranges to find assignments + for (var modeRangeIndex = 0; modeRangeIndex < MODE_RANGES.length; modeRangeIndex++) { + var modeRange = MODE_RANGES[modeRangeIndex]; + + if (modeRange.id != modeId) { + continue; + } + + var range = modeRange.range; + if (!(range.start < range.end)) { + continue; // invalid! + } + + auxAssignment[modeRange.auxChannelIndex] += "" + AUX_CONFIG[modeIndex] + ""; + } + } + + // generate full channel list + var channelNames = [ + chrome.i18n.getMessage('controlAxisRoll'), + chrome.i18n.getMessage('controlAxisPitch'), + chrome.i18n.getMessage('controlAxisYaw'), + chrome.i18n.getMessage('controlAxisThrottle') + ], + fullChannels_e = $('div.activechannellist'), + aux_index = 1, + aux_assignment_index = 0; + + for (i = 0; i < RXFAIL_CONFIG.length; i++) { + if (i < channelNames.length) { + fullChannels_e.append('\ +
\ +
\ + ' + channelNames[i] + '\ +
\ +
\ + \ + \ +
\ +
\ +
\ + '); + } else { + fullChannels_e.append('\ +
\ +
\ + ' + chrome.i18n.getMessage("controlAxisAux" + (aux_index++)) + '\ + ' + auxAssignment[aux_assignment_index++] + '\ +
\ +
\ + \ + \ +
\ +
\ +
\ + '); + } + } + + var channel_mode_array = []; + $('.number', fullChannels_e).each(function () { + channel_mode_array.push($('select.aux_set' , this)); + }); + + var channel_value_array = []; + $('.number', fullChannels_e).each(function () { + channel_value_array.push($('input[name="aux_value"]' , this)); + }); + + var channelMode = $('select.aux_set'); + var channelValue = $('input[name="aux_value"]'); + + // UI hooks + channelMode.change(function () { + var currentMode = parseInt($(this).val()); + var i = parseInt($(this).prop("id")); + RXFAIL_CONFIG[i].mode = currentMode; + if (currentMode == 2) { + channel_value_array[i].prop("disabled", false); + channel_value_array[i].show(); + } else { + channel_value_array[i].prop("disabled", true); + channel_value_array[i].hide(); + } + }); + + // UI hooks + channelValue.change(function () { + var i = parseInt($(this).prop("id")); + RXFAIL_CONFIG[i].value = parseInt($(this).val()); + }); + + // for some odd reason chrome 38+ changes scroll according to the touched select element + // i am guessing this is a bug, since this wasn't happening on 37 + // code below is a temporary fix, which we will be able to remove in the future (hopefully) + $('#content').scrollTop((scrollPosition) ? scrollPosition : 0); + + // fill stage 1 Valid Pulse Range Settings + $('input[name="rx_min_usec"]').val(RX_CONFIG.rx_min_usec); + $('input[name="rx_max_usec"]').val(RX_CONFIG.rx_max_usec); + + // fill fallback settings (mode and value) for all channels + for (i = 0; i < RXFAIL_CONFIG.length; i++) { + channel_value_array[i].val(RXFAIL_CONFIG[i].value); + channel_mode_array[i].val(RXFAIL_CONFIG[i].mode); + channel_mode_array[i].change(); + } + + // fill stage 2 fields + failsafeFeature = $('input[name="failsafe_feature_new"]'); + failsafeFeature.change(function () { + if ($(this).is(':checked')) { + $('div.stage2').show(); + } else { + $('div.stage2').hide(); + } + }); + + failsafeFeature.prop('checked', bit_check(BF_CONFIG.features, 8)); + failsafeFeature.change(); + + $('input[name="failsafe_throttle"]').val(FAILSAFE_CONFIG.failsafe_throttle); + $('input[name="failsafe_off_delay"]').val(FAILSAFE_CONFIG.failsafe_off_delay); + $('input[name="failsafe_throttle_low_delay"]').val(FAILSAFE_CONFIG.failsafe_throttle_low_delay); + $('input[name="failsafe_delay"]').val(FAILSAFE_CONFIG.failsafe_delay); + + // set stage 2 failsafe procedure + $('input[type="radio"].procedure').change(function () { + var element = $(this), + checked = element.is(':checked'), + id = element.attr('id'); + switch(id) { + case 'drop': + if (checked) { + $('input[name="failsafe_throttle"]').prop("disabled", true); + $('input[name="failsafe_off_delay"]').prop("disabled", true); + } + break; + + case 'land': + if (checked) { + $('input[name="failsafe_throttle"]').prop("disabled", false); + $('input[name="failsafe_off_delay"]').prop("disabled", false); + } + break; + } + }); + + switch(FAILSAFE_CONFIG.failsafe_procedure) { + default: + case 0: + element = $('input[id="land"]') ; + element.prop('checked', true); + element.change(); + break; + case 1: + element = $('input[id="drop"]'); + element.prop('checked', true); + element.change(); + break; + } + + // 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()); + + // get FAILSAFE feature option (>= API 1.15.0) + if ($('input[name="failsafe_feature_new"]').is(':checked')) { + BF_CONFIG.features = bit_set(BF_CONFIG.features, 8); + } else { + BF_CONFIG.features = bit_clear(BF_CONFIG.features, 8); + } + + FAILSAFE_CONFIG.failsafe_throttle = parseInt($('input[name="failsafe_throttle"]').val()); + FAILSAFE_CONFIG.failsafe_off_delay = parseInt($('input[name="failsafe_off_delay"]').val()); + FAILSAFE_CONFIG.failsafe_throttle_low_delay = parseInt($('input[name="failsafe_throttle_low_delay"]').val()); + FAILSAFE_CONFIG.failsafe_delay = parseInt($('input[name="failsafe_delay"]').val()); + + if( $('input[id="land"]').is(':checked')) { + FAILSAFE_CONFIG.failsafe_procedure = 0; + } else if( $('input[id="drop"]').is(':checked')) { + FAILSAFE_CONFIG.failsafe_procedure = 1; + } + + 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(MSP_codes.MSP_SET_FAILSAFE_CONFIG, MSP.crunch(MSP_codes.MSP_SET_FAILSAFE_CONFIG), false, save_rxfail_config); + } + + function save_rxfail_config() { + MSP.send_message(MSP_codes.MSP_SET_RXFAIL_CONFIG, MSP.crunch(MSP_codes.MSP_SET_RXFAIL_CONFIG), false, save_bf_config); + } + + function save_bf_config() { + MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_to_eeprom); + } + + // BEGIN pre API 1.15.0 save functions + function save_misc() { + MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_to_eeprom); + } + // END pre API 1.15.0 save functions + + function save_to_eeprom() { + MSP.send_message(MSP_codes.MSP_EEPROM_WRITE, false, false, reboot); + } + + function reboot() { + GUI.log(chrome.i18n.getMessage('configurationEepromSaved')); + + GUI.tab_switch_cleanup(function() { + MSP.send_message(MSP_codes.MSP_SET_REBOOT, false, false, reinitialize); + }); + } + + function reinitialize() { + GUI.log(chrome.i18n.getMessage('deviceRebooting')); + + if (BOARD.find_board_definition(CONFIG.boardIdentifier).vcp) { // VCP-based flight controls may crash old drivers, we catch and reconnect + $('a.connect').click(); + GUI.timeout_add('start_connection',function start_connection() { + $('a.connect').click(); + },2000); + } else { + + GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() { + MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () { + GUI.log(chrome.i18n.getMessage('deviceReady')); + TABS.failsafe.initialize(false, $('#content').scrollTop()); + }); + },1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts + } + } + + if(apiVersionGte1_15_0) { + MSP.send_message(MSP_codes.MSP_SET_RX_CONFIG, MSP.crunch(MSP_codes.MSP_SET_RX_CONFIG), false, save_failssafe_config); + } else { + MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_misc); + } + }); + + // status data pulled via separate timer with static speed + GUI.interval_add('status_pull', function status_pull() { + MSP.send_message(MSP_codes.MSP_STATUS); + }, 250, true); + + GUI.content_ready(callback); + } +}; + +TABS.failsafe.cleanup = function (callback) { + if (callback) callback(); +}; From a0522d0f22b5a87a0da5f76f286bc3b0987f76ef Mon Sep 17 00:00:00 2001 From: Mauro Mombelli Date: Mon, 14 Dec 2015 14:23:54 +0100 Subject: [PATCH 2/9] Fix servo range angleAtMin is always positive, so we have to manage its inverted-user friendly rappresentation --- tabs/servos.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tabs/servos.js b/tabs/servos.js index 6f269165..fd71a5e2 100755 --- a/tabs/servos.js +++ b/tabs/servos.js @@ -78,7 +78,7 @@ TABS.servos.initialize = function (callback) { \ \ \ - \ + \ \ ' + servoCheckbox + '\ \ @@ -133,7 +133,7 @@ TABS.servos.initialize = function (callback) { SERVO_CONFIG[info.obj].middle = parseInt($('.middle input', this).val()); SERVO_CONFIG[info.obj].min = parseInt($('.min input', this).val()); SERVO_CONFIG[info.obj].max = parseInt($('.max input', this).val()); - SERVO_CONFIG[info.obj].angleAtMin = parseInt($('.angleAtMin input', this).val()); + SERVO_CONFIG[info.obj].angleAtMin = -parseInt($('.angleAtMin input', this).val()); SERVO_CONFIG[info.obj].angleAtMax = parseInt($('.angleAtMax input', this).val()); var val = parseInt($('.direction select', this).val()); From a091d8c2ad9aede97fc4208a76553586e5482867 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Mon, 14 Dec 2015 21:28:22 +0100 Subject: [PATCH 3/9] Add support for LTM telemetry in Cleanflight v1.12.0 / MSP API 1.15 --- _locales/en/messages.json | 3 +++ tabs/ports.js | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index ff0b4b1e..b4476bcf 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -594,6 +594,9 @@ "portsFunction_TELEMETRY_HOTT": { "message": "HoTT" }, + "portsFunction_TELEMETRY_LTM": { + "message": "LTM" + }, "portsFunction_TELEMETRY_MSP": { "message": "MSP" }, diff --git a/tabs/ports.js b/tabs/ports.js index 5352b31d..9d20a30e 100644 --- a/tabs/ports.js +++ b/tabs/ports.js @@ -12,12 +12,19 @@ TABS.ports.initialize = function (callback, scrollPosition) { {name: 'GPS', groups: ['gps'], maxPorts: 1}, {name: 'TELEMETRY_FRSKY', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1}, {name: 'TELEMETRY_HOTT', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1}, - {name: 'TELEMETRY_MSP', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1}, {name: 'TELEMETRY_SMARTPORT', groups: ['telemetry'], maxPorts: 1}, {name: 'RX_SERIAL', groups: ['rx'], maxPorts: 1}, {name: 'BLACKBOX', groups: ['logging', 'blackbox'], sharableWith: ['msp'], notSharableWith: ['telemetry'], maxPorts: 1}, ]; - + + if (semver.gte(CONFIG.apiVersion, "1.15.0")) { + var ltmFunctionRule = {name: 'TELEMETRY_LTM', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1}; + functionRules.push(ltmFunctionRule); + } else { + var mspFunctionRule = {name: 'TELEMETRY_MSP', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1}; + functionRules.push(mspFunctionRule); + } + for (var i = 0; i < functionRules.length; i++) { functionRules[i].displayName = chrome.i18n.getMessage('portsFunction_' + functionRules[i].name); } @@ -125,8 +132,6 @@ TABS.ports.initialize = function (callback, scrollPosition) { port_configuration_e.data('serialPort', serialPort); - // TODO check functions - // TODO set baudrate var msp_baudrate_e = port_configuration_e.find('select.msp_baudrate'); msp_baudrate_e.val(serialPort.msp_baudrate); From 79889b99bda3fb3210e56d262a3a66646ff9d12e Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Mon, 14 Dec 2015 22:54:14 +0100 Subject: [PATCH 4/9] Fix a stray unescaped `&` in main.html --- main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.html b/main.html index 71e16c89..3ace3e17 100755 --- a/main.html +++ b/main.html @@ -164,7 +164,7 @@
  • -
  • +
    From ae67707e0d0ae29a5f2bcd9a5a6210a447078c70 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Mon, 14 Dec 2015 22:56:41 +0100 Subject: [PATCH 5/9] Updating failsafe version message. --- _locales/en/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 363db688..62900b71 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1270,7 +1270,7 @@ "message": "RSSI is a measurement of signal strength and is very handy so you know when your aircraft isw going out of range or if it is suffering RF interference." }, "failsafeFeaturesHelpOld": { - "message": "Failsafe configuration has changed considerably. You should use a version above v1.11.0-RC1 to enable the improved configuration panel." + "message": "Failsafe configuration has changed considerably. Use Cleanflight v1.12.0+ to enable the improved configuration panel." }, "failsafePaneTitleOld": { "message": "Receiver failsafe" From 84b2c415c208cf79a554edb6ba5653790a4464b0 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Mon, 14 Dec 2015 22:57:35 +0100 Subject: [PATCH 6/9] Fix a couple of typos. --- _locales/en/messages.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 62900b71..31fbba3e 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -436,7 +436,7 @@ }, "configurationSerialRXHelp": { - "message": "Note: Rememer to configure a Serial Port (via Ports tab) and choose a Serial Receiver Provider when using RX_SERIAL feature." + "message": "Note: Remember to configure a Serial Port (via Ports tab) and choose a Serial Receiver Provider when using RX_SERIAL feature." }, "configurationBoardAlignment": { @@ -1267,7 +1267,7 @@ "message": "The values below change the behaviour of the ANGLE and HORIZON flight modes. Different PID controllers handle the LEVEL values differently. Please check the documentation." }, "configHelp1": { - "message": "RSSI is a measurement of signal strength and is very handy so you know when your aircraft isw going out of range or if it is suffering RF interference." + "message": "RSSI is a measurement of signal strength and is very handy so you know when your aircraft is going out of range or if it is suffering RF interference." }, "failsafeFeaturesHelpOld": { "message": "Failsafe configuration has changed considerably. Use Cleanflight v1.12.0+ to enable the improved configuration panel." From c095a55b0e41aadcf44d4cdaca42d8d76ee2971e Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Mon, 14 Dec 2015 23:00:35 +0100 Subject: [PATCH 7/9] Remove OPBL message now that cleanflight releases no-longer include OPBL compatible binaries. --- _locales/en/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 31fbba3e..62475fbf 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1152,7 +1152,7 @@ "message": "Warning" }, "firmwareFlasherWarningText": { - "message": "Please do not try to flash non-cleanflight hardware with this firmware flasher.
    Do not disconnect the board or turn off your computer while flashing.

    Note: STM32 bootloader is stored in ROM, it cannot be bricked.
    Note: Auto-Connect is always disabled while you are inside firmware flasher.
    Note: Make sure you have a backup; some upgrades/downgrades will wipe your configuration.
    Note: If you have problems flashing try disconnecting all cables from your FC.

    Note: If you have lost comminication with your board then power off the board, jumper the bootloader pins, power on, enable 'No reboot sequence', enable 'Full chip erase', re-flash, then power off, remove bootloader jumper, power on and connect (For all firmware except OPBL firmware)." + "message": "Please do not try to flash non-cleanflight hardware with this firmware flasher.
    Do not disconnect the board or turn off your computer while flashing.

    Note: STM32 bootloader is stored in ROM, it cannot be bricked.
    Note: Auto-Connect is always disabled while you are inside firmware flasher.
    Note: Make sure you have a backup; some upgrades/downgrades will wipe your configuration.
    Note: If you have problems flashing try disconnecting all cables from your FC.

    Note: If you have lost comminication with your board then power off the board, jumper the bootloader pins, power on, enable 'No reboot sequence', enable 'Full chip erase', re-flash, then power off, remove bootloader jumper, power on and connect." }, "firmwareFlasherButtonLeave": { "message": "Leave Firmware Flasher" From 4deec20727d0cd8c35a883a566eb44359b6754f7 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Mon, 14 Dec 2015 23:59:40 +0100 Subject: [PATCH 8/9] Cleanup and highlight recovery process to cut down on support emails. --- _locales/en/messages.json | 20 +++++++++++++------- main.css | 29 +++++++++++++++++++++++++++++ tabs/firmware_flasher.css | 16 ++++++---------- tabs/firmware_flasher.html | 23 ++++++++++++++++++----- 4 files changed, 66 insertions(+), 22 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 62475fbf..62767eca 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1086,25 +1086,25 @@ "message": "Available online firmware releases - Select the correct firmware appropriate for your board." }, "firmwareFlasherNoRebootDescription": { - "message": "Enable if you are flashing board with bootloader pins shorted" + "message": "Enable if you powered your FC while the bootloader pins are jumpered or have your FC's BOOT button pressed." }, "firmwareFlasherFlashOnConnect": { "message": "Flash on connect" }, "firmwareFlasherFlashOnConnectDescription": { - "message": "Attempt to flash the board automatically (triggered by newly detected serial port)" + "message": "Attempt to flash the board automatically (triggered by newly detected serial port)." }, "firmwareFlasherFullChipErase": { "message": "Full chip erase" }, "firmwareFlasherFullChipEraseDescription": { - "message": "Wipes all configuration data currently stored on the board" + "message": "Wipes all configuration data currently stored on the board." }, "firmwareFlasherFlashDevelopmentFirmware": { "message": "Use Development Firmware" }, "firmwareFlasherFlashDevelopmentFirmwareDescription": { - "message": "Flash most recent (untested) development firmware" + "message": "Flash most recent (untested) development firmware." }, "firmwareFlasherManualBaud": { "message": "Manual baud rate" @@ -1116,7 +1116,7 @@ "message": "Show unstable releases" }, "firmwareFlasherShowDevelopmentReleasesDescription":{ - "message": "Show Release-Candidates and Development Releases" + "message": "Show Release-Candidates and Development Releases." }, "firmwareFlasherOptionLabelSelectFirmware": { "message": "Choose a Firmware / Board" @@ -1148,11 +1148,17 @@ "firmwareFlasherMessage": { "message": "Message:" }, - "firmwareFlasherWarninghead": { + "firmwareFlasherWarningHead": { "message": "Warning" }, "firmwareFlasherWarningText": { - "message": "Please do not try to flash non-cleanflight hardware with this firmware flasher.
    Do not disconnect the board or turn off your computer while flashing.

    Note: STM32 bootloader is stored in ROM, it cannot be bricked.
    Note: Auto-Connect is always disabled while you are inside firmware flasher.
    Note: Make sure you have a backup; some upgrades/downgrades will wipe your configuration.
    Note: If you have problems flashing try disconnecting all cables from your FC.

    Note: If you have lost comminication with your board then power off the board, jumper the bootloader pins, power on, enable 'No reboot sequence', enable 'Full chip erase', re-flash, then power off, remove bootloader jumper, power on and connect." + "message": "Please do not try to flash non-cleanflight hardware with this firmware flasher.
    Do not disconnect the board or turn off your computer while flashing.

    Note: STM32 bootloader is stored in ROM, it cannot be bricked.
    Note: Auto-Connect is always disabled while you are inside firmware flasher.
    Note: Make sure you have a backup; some upgrades/downgrades will wipe your configuration.
    Note: If you have problems flashing try disconnecting all cables from your FC first, try rebooting, upgrade chrome, upgrade drivers.
    " + }, + "firmwareFlasherRecoveryHead": { + "message": "Recovery / Lost communication" + }, + "firmwareFlasherRecoveryText": { + "message": "If you have lost comminication with your board follow these steps to restore communication:
    • Power off
    • Enable 'No reboot sequence', enable 'Full chip erase'.
    • Jumper the BOOT pins or hold BOOT button.
    • Power on (activity LED will NOT flash if done correctly).
    • Release BOOT button if your FC has one.
    • Flash with correct firmware (using manual baud rate if specified in your FC's manual).
    • Power off.
    • Remove BOOT jumper.
    • Power on (activity LED should flash).
    • Connect normally.
    " }, "firmwareFlasherButtonLeave": { "message": "Leave Firmware Flasher" diff --git a/main.css b/main.css index 0ea32ce1..a6280308 100644 --- a/main.css +++ b/main.css @@ -1041,6 +1041,35 @@ dialog { font-family: 'open_sansregular', Arial; } +.gui_warning { + background: #ffdddd; +} + +.gui_note { + background: #ffffdd; +} + +.gui_warning .gui_box_titlebar { + background-color: #dc0000; + background-image: linear-gradient(-45deg, rgba(255, 255, 255, .3) 10%, transparent 10%, transparent 20%, + rgba(255, 255, 255, .3) 20%, rgba(255, 255, 255, .3) 30%, transparent 30%, transparent 40%, + rgba(255, 255, 255, .3) 40%, rgba(255, 255, 255, .3) 50%, transparent 50%, transparent 60%, + rgba(255, 255, 255, .3) 60%, rgba(255, 255, 255, .3) 70%, transparent 70%, transparent 80%, + rgba(255, 255, 255, .3) 80%, rgba(255, 255, 255, .3) 90%, transparent 90%, transparent 100%, + rgba(255, 255, 255, .4) 100%, transparent); +} + +.gui_note .gui_box_titlebar { + background-color: #cccc00; + background-image: linear-gradient(-45deg, rgba(255, 255, 255, .3) 10%, transparent 10%, transparent 20%, + rgba(255, 255, 255, .3) 20%, rgba(255, 255, 255, .3) 30%, transparent 30%, transparent 40%, + rgba(255, 255, 255, .3) 40%, rgba(255, 255, 255, .3) 50%, transparent 50%, transparent 60%, + rgba(255, 255, 255, .3) 60%, rgba(255, 255, 255, .3) 70%, transparent 70%, transparent 80%, + rgba(255, 255, 255, .3) 80%, rgba(255, 255, 255, .3) 90%, transparent 90%, transparent 100%, + rgba(255, 255, 255, .4) 100%, transparent); +} + + .grey { /* background-color:#f5f5f5; */ background-color: #f9f9f9 diff --git a/tabs/firmware_flasher.css b/tabs/firmware_flasher.css index 1b586b13..6c35278a 100644 --- a/tabs/firmware_flasher.css +++ b/tabs/firmware_flasher.css @@ -17,16 +17,6 @@ /* text-shadow: 1px 0px 2px rgba(0, 0, 0, 0.9);*/ } -.red { - background-color: #dc0000; - background-image: linear-gradient(-45deg, rgba(255, 255, 255, .3) 10%, transparent 10%, transparent 20%, - rgba(255, 255, 255, .3) 20%, rgba(255, 255, 255, .3) 30%, transparent 30%, transparent 40%, - rgba(255, 255, 255, .3) 40%, rgba(255, 255, 255, .3) 50%, transparent 50%, transparent 60%, - rgba(255, 255, 255, .3) 60%, rgba(255, 255, 255, .3) 70%, transparent 70%, transparent 80%, - rgba(255, 255, 255, .3) 80%, rgba(255, 255, 255, .3) 90%, transparent 90%, transparent 100%, - rgba(255, 255, 255, .4) 100%, transparent); -} - .darkgrey { background-color: #575757; } @@ -90,6 +80,12 @@ border-radius: 4px; } +.tab-firmware_flasher ul li { + list-style: initial; + list-style-type: circle; + margin-left: 30px; +} + .tab-firmware_flasher .options { position: relative; margin-bottom: 10px; diff --git a/tabs/firmware_flasher.html b/tabs/firmware_flasher.html index 6acec086..6085b794 100755 --- a/tabs/firmware_flasher.html +++ b/tabs/firmware_flasher.html @@ -75,20 +75,33 @@ i18n_title="firmwareFlasherReleaseFileUrl" class="file" href="#" target="_blank">



    + i18n="firmwareFlasherReleaseNotes">
-
-
+
+
+ i18n="firmwareFlasherWarningHead"> +
-

+

+

+
+
+
+
+
+
+

+
+
+
From e7ef71c2440f0321a88a0f713621612093276c79 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Tue, 15 Dec 2015 00:53:01 +0100 Subject: [PATCH 9/9] Add Serial RX IBUS Support. --- tabs/configuration.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tabs/configuration.js b/tabs/configuration.js index 0f723758..be185d3b 100644 --- a/tabs/configuration.js +++ b/tabs/configuration.js @@ -267,6 +267,10 @@ TABS.configuration.initialize = function (callback, scrollPosition) { 'XBUS_MODE_B_RJ01' ]; + if (semver.gte(CONFIG.apiVersion, "1.15.0")) { + serialRXtypes.push('IBUS'); + } + var serialRX_e = $('select.serialRX'); for (var i = 0; i < serialRXtypes.length; i++) { serialRX_e.append('');