diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 9d676e08..38291298 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -266,7 +266,7 @@ "defaultSupportSubline2": { "message": "Developer" }, - "defaultSupport": { + "defaultSupport": { "message": "For support please search the forums first or contact your vendor.

" }, "defaultSupport1": { @@ -284,6 +284,7 @@ "defaultSupport5": { "message": "Join via WebClient" }, + "initialSetupBackupAndRestoreApiVersion": { "message": "Backup and restore functionality disabled. You have firmware with API version $1, backup and restore requires $2. Please backup your settings via the CLI, see Cleanflight documentation for procedure." }, @@ -441,8 +442,6 @@ "configurationFeatureDescription": { "message": "Description" }, - - "configurationMixer": { "message": "Mixer" }, @@ -452,23 +451,21 @@ "configurationReceiver": { "message": "Receiver Mode" }, - "configurationFailsafe": { - "message": "Receiver failsafe" - }, "configurationRSSI": { "message": "RSSI (Signal Strength)" }, + "configurationRSSIHelp": { + "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." + }, "configurationEscFeatures": { "message": "ESC/Motor Features" }, "configurationFeaturesHelp": { "message": "Note: Not all combinations of features are valid. When the flight controller firmware detects invalid feature combinations conflicting features will be disabled.
Note: Configure serial ports before enabling the features that will use the ports." }, - "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": { "message": "Board and Sensor Alignment" }, @@ -498,7 +495,7 @@ }, "configurationDisarmKillSwitch": { "message": "Disarm motors regardless of throttle value (When arming via AUX channel)" - }, + }, "configurationThrottleMinimum": { "message": "Minimum Throttle" }, @@ -508,9 +505,6 @@ "configurationThrottleMaximum": { "message": "Maximum Throttle" }, - "configurationThrottleFailsafe": { - "message": "Failsafe Throttle" - }, "configurationThrottleMinimumCommand": { "message": "Minimum Command" }, @@ -541,7 +535,7 @@ "configurationBatteryMultiwiiCurrent": { "message": "Enable support for legacy Multiwii MSP current output" }, - "configuration3d": { + "configuration3d": { "message": "3D" }, "configuration3dDeadbandLow": { @@ -583,7 +577,6 @@ "configurationGPSHelp": { "message": "Note: Remember to configure a Serial Port (via Ports tab) when using GPS feature." }, - "configurationSerialRX": { "message": "Serial Receiver Provider" }, @@ -621,6 +614,9 @@ "portsFunction_TELEMETRY_HOTT": { "message": "HoTT" }, + "portsFunction_TELEMETRY_LTM": { + "message": "LTM" + }, "portsFunction_TELEMETRY_MSP": { "message": "MSP" }, @@ -942,7 +938,6 @@ "servosFirmwareUpgradeRequired": { "message": "Servos requires firmware >= 1.10.0." }, - "servosChangeDirection": { "message": "Change Direction in TX To Match" }, @@ -1135,6 +1130,7 @@ "dataflashFileWriteFailed": { "message": "Failed to write to the file you selected, are the permissions on that folder okay?" }, + "firmwareFlasherReleaseSummaryHead": { "message": "Release info" }, @@ -1191,25 +1187,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" @@ -1218,10 +1214,10 @@ "message": "Manual selection of baud rate for boards that don't support the default speed or for flashing via bluetooth." }, "firmwareFlasherShowDevelopmentReleases":{ - "message": "Show unstable releases" + "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" @@ -1253,11 +1249,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 (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 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: " }, "firmwareFlasherButtonLeave": { "message": "Leave Firmware Flasher" @@ -1284,6 +1286,7 @@ "ledStripEepromSaved": { "message": "EEPROM saved" }, + "controlAxisRoll": { "message": "Roll" }, @@ -1344,6 +1347,7 @@ "controlAxisAux16": { "message": "AUX 16" }, + "pidTuningBasic": { "message": "Basic/Acro" }, @@ -1367,14 +1371,89 @@ }, "pidTuningLevelD": { "message": "Transition (Horizon)" - }, - "pidHelp1": { + }, + "pidTuningLevelHelp": { "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 is going out of range or if it is suffering RF interference." - }, "configHelp2": { "message": "Arbitrary board rotation in degrees, to allow mounting it sideways / upside down / rotated etc. When running external sensors, use the sensor alignments (Gyro, Acc, Mag) to define sensor position independent from board orientation. " + }, + "failsafeFeaturesHelpOld": { + "message": "Failsafe configuration has changed considerably. Use Cleanflight v1.12.0+ 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 e50b19d7..8fee9873 100644 --- a/js/backup_restore.js +++ b/js/backup_restore.js @@ -105,6 +105,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(); @@ -132,6 +137,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(); } @@ -514,8 +524,9 @@ function configuration_restore(callback) { } if (compareVersions(migratedVersion, '0.66.0') && !compareVersions(configuration.apiVersion, '1.15.0')) { - // api 1.14 exposes deadband and yaw_deadband + // api 1.14 exposes deadband and yaw_deadband + for (var profileIndex = 0; profileIndex < configuration.profiles.length; profileIndex++) { if (configuration.profile[profileIndex].RCcontrols == undefined) { @@ -530,6 +541,51 @@ function configuration_restore(callback) { appliedMigrationsCount++; } + // 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])); } @@ -645,6 +701,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() { @@ -656,6 +717,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() { @@ -708,4 +772,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 fc8ce422..d6c54aec 100755 --- a/js/data_storage.js +++ b/js/data_storage.js @@ -179,9 +179,32 @@ var DATAFLASH = { usedSize: 0 }; +<<<<<<< HEAD var RC_controls = { deadband: 0, yaw_deadband: 0, alt_hold_deadband: 0, alt_hold_fast_change: 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 = []; +>>>>>>> cleanflight/development 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 e2d84c6e..7c56788e 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, @@ -766,6 +772,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); @@ -777,6 +784,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 = []; @@ -863,7 +920,15 @@ var MSP = { case MSP_codes.MSP_SET_RESET_CURR_PID: console.log('Current PID profile reset'); 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 { @@ -1049,7 +1114,7 @@ MSP.crunch = function (code) { buffer.push(lowByte(RC_tuning.dynamic_THR_breakpoint)); buffer.push(highByte(RC_tuning.dynamic_THR_breakpoint)); } - if (semver.gte(CONFIG.apiVersion, "1.10.0")) { + if (semver.gte(CONFIG.apiVersion, "1.10.0")) { buffer.push(Math.round(RC_tuning.RC_YAW_EXPO * 100)); } break; @@ -1105,6 +1170,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 0f5384e5..6cf8becb 100644 --- a/main.css +++ b/main.css @@ -726,6 +726,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); } @@ -1038,6 +1045,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 @@ -1307,7 +1343,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%; @@ -1469,7 +1505,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 9f042554..5d9b9c19 100755 --- a/main.html +++ b/main.html @@ -25,6 +25,7 @@ + @@ -75,6 +76,7 @@ + @@ -180,36 +182,26 @@
    -
  • -
  • -
  • +
  • +
  • +
  • -
  • -
  • +
  • +
  • Failsafe
  • +
  • -
  • -
  • +
  • +
  • -
  • -
  • -
  • +
  • +
  • +
  • -
  • +
-
-
-
-
-
- - - - - - - - - - - -
-
- -
-
-
@@ -314,8 +290,14 @@
+<<<<<<< HEAD
+======= +
+ +
+>>>>>>> cleanflight/development
diff --git a/tabs/configuration.js b/tabs/configuration.js index bd4d8355..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(''); @@ -318,7 +322,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 +408,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(); +}; 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"> +
-

+

+

+
+
+
+
+
+
+

+
+
+
diff --git a/tabs/pid_tuning.html b/tabs/pid_tuning.html index 4782e60f..c03e49e3 100755 --- a/tabs/pid_tuning.html +++ b/tabs/pid_tuning.html @@ -135,7 +135,7 @@
- +
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); 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());