From 60bfeed194e8fe34769140fc22b48090b73aa53c Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Thu, 24 Mar 2016 14:50:24 +0100 Subject: [PATCH 01/18] Fix unable to reconnect after disconnecting when CLI was active. --- tabs/cli.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tabs/cli.js b/tabs/cli.js index 8fee1fa94..39645bcfb 100644 --- a/tabs/cli.js +++ b/tabs/cli.js @@ -221,5 +221,6 @@ TABS.cli.cleanup = function (callback) { GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() { if (callback) callback(); }, 1000); // if we dont allow enough time to reboot, CRC of "first" command sent will fail, keep an eye for this one + CONFIGURATOR.cliActive = false; }); }; From c0038b43cceb56ca48ee9ab36a907d73d6555b3b Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Thu, 24 Mar 2016 14:51:13 +0100 Subject: [PATCH 02/18] Force a cleanup when a serial device is lost, this happens when VCP targets reboot. --- js/serial.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/serial.js b/js/serial.js index ff432d1ed..17214f186 100644 --- a/js/serial.js +++ b/js/serial.js @@ -105,7 +105,11 @@ var serial = { break; case 'device_lost': - // TODO + if (GUI.connected_to || GUI.connecting_to) { + $('a.connect').click(); + } else { + self.disconnect(); + } break; case 'disconnected': From a924e06c1bd8a28479b4d0ab33086920690ba943 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Thu, 24 Mar 2016 16:02:54 +0100 Subject: [PATCH 03/18] Fix unable to enable LTM telemetry via ports tab. --- js/msp.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/js/msp.js b/js/msp.js index 266280928..085785498 100644 --- a/js/msp.js +++ b/js/msp.js @@ -139,8 +139,17 @@ var MSP = { '250000', ], - serialPortFunctions: // in LSB bit order - ['MSP', 'GPS', 'TELEMETRY_FRSKY', 'TELEMETRY_HOTT', 'TELEMETRY_MSP', 'TELEMETRY_SMARTPORT', 'RX_SERIAL', 'BLACKBOX'], + serialPortFunctions: { + 'MSP': 0, + 'GPS': 1, + 'TELEMETRY_FRSKY': 2, + 'TELEMETRY_HOTT': 3, + 'TELEMETRY_MSP': 4, + 'TELEMETRY_LTM': 4, // LTM replaced MSP + 'TELEMETRY_SMARTPORT': 5, + 'RX_SERIAL': 6, + 'BLACKBOX': 7, + }, read: function (readInfo) { var data = new Uint8Array(readInfo.data); @@ -1617,9 +1626,12 @@ MSP.sendLedStripConfig = function(onCompleteCallback) { MSP.serialPortFunctionMaskToFunctions = function(functionMask) { var functions = []; - for (var index = 0; index < MSP.serialPortFunctions.length; index++) { - if (bit_check(functionMask, index)) { - functions.push(MSP.serialPortFunctions[index]); + var keys = Object.keys(MSP.serialPortFunctions); + for (var index = 0; index < keys.length; index++) { + var key = keys[index]; + var bit = MSP.serialPortFunctions[key]; + if (bit_check(functionMask, bit)) { + functions.push(key); } } return functions; @@ -1627,8 +1639,10 @@ MSP.serialPortFunctionMaskToFunctions = function(functionMask) { MSP.serialPortFunctionsToMask = function(functions) { var mask = 0; + var keys = Object.keys(MSP.serialPortFunctions); for (var index = 0; index < functions.length; index++) { - var bitIndex = MSP.serialPortFunctions.indexOf(functions[index]); + var key = functions[index]; + var bitIndex = MSP.serialPortFunctions[key]; if (bitIndex >= 0) { mask = bit_set(mask, bitIndex); } From 81a49d48b243c14745e0ccf5dd0514587f249994 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Fri, 1 Apr 2016 12:32:19 +0200 Subject: [PATCH 04/18] changes to support MSP API 1.17 (removal of 3d deadband configuration via MSP_3D/MSP_SET_3D) At somepoint we can add the support for the updated MSP_DEADBAND/MSP_SET_DEADBAND commands. --- js/msp.js | 13 +++++++++---- tabs/configuration.html | 2 +- tabs/configuration.js | 10 ++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/js/msp.js b/js/msp.js index 085785498..1129052ae 100644 --- a/js/msp.js +++ b/js/msp.js @@ -444,8 +444,11 @@ var MSP = { _3D.deadband3d_high = data.getUint16(offset, 1); offset += 2; _3D.neutral3d = data.getUint16(offset, 1); - offset += 2; - _3D.deadband3d_throttle = data.getUint16(offset, 1); + + if (semver.lt(CONFIG.apiVersion, "1.17.0")) { + offset += 2; + _3D.deadband3d_throttle = data.getUint16(offset, 1); + } break; case MSP_codes.MSP_MOTOR_PINS: console.log(data); @@ -1330,8 +1333,10 @@ MSP.crunch = function (code) { buffer.push(highByte(_3D.deadband3d_high)); buffer.push(lowByte(_3D.neutral3d)); buffer.push(highByte(_3D.neutral3d)); - buffer.push(lowByte(_3D.deadband3d_throttle)); - buffer.push(highByte(_3D.deadband3d_throttle)); + if (semver.lt(CONFIG.apiVersion, "1.17.0")) { + buffer.push(lowByte(_3D.deadband3d_throttle)); + buffer.push(highByte(_3D.deadband3d_throttle)); + } break; case MSP_codes.MSP_SET_RC_DEADBAND: diff --git a/tabs/configuration.html b/tabs/configuration.html index 10e658414..89b2224fe 100644 --- a/tabs/configuration.html +++ b/tabs/configuration.html @@ -433,7 +433,7 @@ i18n="configuration3dNeutral"> -
+
diff --git a/tabs/configuration.js b/tabs/configuration.js index d7e7694bd..d9e22a9bf 100644 --- a/tabs/configuration.js +++ b/tabs/configuration.js @@ -407,7 +407,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) { $('input[name="3ddeadbandlow"]').val(_3D.deadband3d_low); $('input[name="3ddeadbandhigh"]').val(_3D.deadband3d_high); $('input[name="3dneutral"]').val(_3D.neutral3d); - $('input[name="3ddeadbandthrottle"]').val(_3D.deadband3d_throttle); + if (semver.lt(CONFIG.apiVersion, "1.17.0")) { + $('input[name="3ddeadbandthrottle"]').val(_3D.deadband3d_throttle); + } else { + $('.3ddeadbandthrottle').hide(); + } } // UI hooks @@ -487,7 +491,9 @@ TABS.configuration.initialize = function (callback, scrollPosition) { _3D.deadband3d_low = parseInt($('input[name="3ddeadbandlow"]').val()); _3D.deadband3d_high = parseInt($('input[name="3ddeadbandhigh"]').val()); _3D.neutral3d = parseInt($('input[name="3dneutral"]').val()); - _3D.deadband3d_throttle = ($('input[name="3ddeadbandthrottle"]').val()); + if (semver.lt(CONFIG.apiVersion, "1.17.0")) { + _3D.deadband3d_throttle = ($('input[name="3ddeadbandthrottle"]').val()); + } SENSOR_ALIGNMENT.align_gyro = parseInt(orientation_gyro_e.val()); From b4da6e6ab1cac596327c0b38e2dea5fca89652c8 Mon Sep 17 00:00:00 2001 From: gael Date: Mon, 18 Apr 2016 22:41:51 +0200 Subject: [PATCH 05/18] Fix issue #363: max failsafe_delay should be 200 Update max value in html file --- tabs/failsafe.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabs/failsafe.html b/tabs/failsafe.html index 1b0951b0f..84dda7498 100644 --- a/tabs/failsafe.html +++ b/tabs/failsafe.html @@ -89,7 +89,7 @@
-
From a6807d5945b2a7619309336ab7fcc52ab6d9b02d Mon Sep 17 00:00:00 2001 From: gael Date: Mon, 18 Apr 2016 23:19:07 +0200 Subject: [PATCH 06/18] Issue #153 finer mag_declination in GUI Allow declination to be set exactly in degrees,minutes (therefore uses exactly the same value as in CLI instead of rounding it) --- js/msp.js | 6 +++--- tabs/configuration.html | 2 +- tabs/configuration.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/msp.js b/js/msp.js index 1129052ae..a064b1c52 100644 --- a/js/msp.js +++ b/js/msp.js @@ -430,7 +430,7 @@ var MSP = { MISC.multiwiicurrentoutput = data.getUint8(offset++); MISC.rssi_channel = data.getUint8(offset++); MISC.placeholder2 = data.getUint8(offset++); - MISC.mag_declination = data.getInt16(offset, 1) / 10; // -18000-18000 + MISC.mag_declination = data.getInt16(offset, 1) / 100; // -18000-18000 offset += 2; MISC.vbatscale = data.getUint8(offset++, 1); // 10-200 MISC.vbatmincellvoltage = data.getUint8(offset++, 1) / 10; // 10-50 @@ -1232,8 +1232,8 @@ MSP.crunch = function (code) { buffer.push(MISC.multiwiicurrentoutput); buffer.push(MISC.rssi_channel); buffer.push(MISC.placeholder2); - buffer.push(lowByte(Math.round(MISC.mag_declination * 10))); - buffer.push(highByte(Math.round(MISC.mag_declination * 10))); + buffer.push(lowByte(Math.round(MISC.mag_declination * 100))); + buffer.push(highByte(Math.round(MISC.mag_declination * 100))); buffer.push(MISC.vbatscale); buffer.push(Math.round(MISC.vbatmincellvoltage * 10)); buffer.push(Math.round(MISC.vbatmaxcellvoltage * 10)); diff --git a/tabs/configuration.html b/tabs/configuration.html index 89b2224fe..ccc59b23d 100644 --- a/tabs/configuration.html +++ b/tabs/configuration.html @@ -384,7 +384,7 @@
-
diff --git a/tabs/configuration.js b/tabs/configuration.js index d9e22a9bf..2c3ca833d 100644 --- a/tabs/configuration.js +++ b/tabs/configuration.js @@ -363,7 +363,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) { $('input[name="pitch"]').val(CONFIG.accelerometerTrims[0]); // fill magnetometer - $('input[name="mag_declination"]').val(MISC.mag_declination); + $('input[name="mag_declination"]').val(MISC.mag_declination.toFixed(2)); //fill motor disarm params and FC loop time if(semver.gte(CONFIG.apiVersion, "1.8.0")) { From 0518ed6993c0df30ed53e9f0ffd21bbb840acfcd Mon Sep 17 00:00:00 2001 From: gael Date: Wed, 20 Apr 2016 01:38:23 +0200 Subject: [PATCH 07/18] Issue #74: Show battery & statuses in top bar - Battery voltage appears as a horizontal bar - Autodetection of battery type is used to calculate the bar min, max & alarm values according to the battery configuration parameters. - Color changes to red when battery level goes under the alarm setting - Armed, failsafe and Serial Link status icons below battery voltage monitor - Change calibration button contents to "Calibrating" during calibration --- _locales/en/messages.json | 9 ++ images/icons/cf_icon_armed_active.svg | 16 +++ images/icons/cf_icon_armed_grey.svg | 16 +++ images/icons/cf_icon_bat_grey.svg | 14 +++ images/icons/cf_icon_failsafe_active.svg | 14 +++ images/icons/cf_icon_failsafe_grey.svg | 18 +-- images/icons/cf_icon_link_active.svg | 18 +++ images/icons/cf_icon_link_grey.svg | 18 +++ js/msp.js | 5 + js/serial_backend.js | 142 ++++++++++++++++++----- main.css | 114 +++++++++++++++++- main.html | 15 ++- tabs/setup.css | 45 +++++++ tabs/setup.html | 22 +++- tabs/setup.js | 9 +- 15 files changed, 434 insertions(+), 41 deletions(-) create mode 100644 images/icons/cf_icon_armed_active.svg create mode 100644 images/icons/cf_icon_armed_grey.svg create mode 100644 images/icons/cf_icon_bat_grey.svg create mode 100644 images/icons/cf_icon_failsafe_active.svg create mode 100644 images/icons/cf_icon_link_active.svg create mode 100644 images/icons/cf_icon_link_grey.svg diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 32f9f0479..d75f43ad8 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1620,5 +1620,14 @@ }, "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" + }, + "mainHelpArmed": { + "message": "Motor Arming" + }, + "mainHelpFailsafe": { + "message": "Failsafe Mode" + }, + "mainHelpLink": { + "message": "Serial Link Status" } } diff --git a/images/icons/cf_icon_armed_active.svg b/images/icons/cf_icon_armed_active.svg new file mode 100644 index 000000000..b76fab7ec --- /dev/null +++ b/images/icons/cf_icon_armed_active.svg @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/images/icons/cf_icon_armed_grey.svg b/images/icons/cf_icon_armed_grey.svg new file mode 100644 index 000000000..7ae1904a8 --- /dev/null +++ b/images/icons/cf_icon_armed_grey.svg @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/images/icons/cf_icon_bat_grey.svg b/images/icons/cf_icon_bat_grey.svg new file mode 100644 index 000000000..bbde28202 --- /dev/null +++ b/images/icons/cf_icon_bat_grey.svg @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/images/icons/cf_icon_failsafe_active.svg b/images/icons/cf_icon_failsafe_active.svg new file mode 100644 index 000000000..e3ecd3695 --- /dev/null +++ b/images/icons/cf_icon_failsafe_active.svg @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/images/icons/cf_icon_failsafe_grey.svg b/images/icons/cf_icon_failsafe_grey.svg index dd586e1f2..70dbbc494 100644 --- a/images/icons/cf_icon_failsafe_grey.svg +++ b/images/icons/cf_icon_failsafe_grey.svg @@ -1,11 +1,15 @@ - + + viewBox="28 -43 141.7 141.7" style="enable-background:new 28 -43 141.7 141.7;" xml:space="preserve"> + - + - + \ No newline at end of file diff --git a/images/icons/cf_icon_link_active.svg b/images/icons/cf_icon_link_active.svg new file mode 100644 index 000000000..edbeeef5e --- /dev/null +++ b/images/icons/cf_icon_link_active.svg @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/images/icons/cf_icon_link_grey.svg b/images/icons/cf_icon_link_grey.svg new file mode 100644 index 000000000..d2c0a0275 --- /dev/null +++ b/images/icons/cf_icon_link_grey.svg @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/js/msp.js b/js/msp.js index 1129052ae..baae3c193 100644 --- a/js/msp.js +++ b/js/msp.js @@ -128,6 +128,9 @@ var MSP = { ledDirectionLetters: ['n', 'e', 's', 'w', 'u', 'd'], // in LSB bit order ledFunctionLetters: ['i', 'w', 'f', 'a', 't', 'r', 'c'], // in LSB bit order + last_received_timestamp: null, + analog_last_received_timestamp: null, + supportedBaudRates: [ // 0 based index. 'AUTO', '9600', @@ -233,6 +236,7 @@ var MSP = { console.log('Unknown state detected: ' + this.state); } } + this.last_received_timestamp = Date.now(); }, process_data: function (code, message_buffer, message_length) { var data = new DataView(message_buffer, 0); // DataView (allowing us to view arrayBuffer as struct/union) @@ -330,6 +334,7 @@ var MSP = { ANALOG.mAhdrawn = data.getUint16(1, 1); ANALOG.rssi = data.getUint16(3, 1); // 0-1023 ANALOG.amperage = data.getInt16(5, 1) / 100; // A + this.analog_last_received_timestamp = Date.now(); break; case MSP_codes.MSP_RC_TUNING: var offset = 0; diff --git a/js/serial_backend.js b/js/serial_backend.js index cef54589f..a3fa4afb3 100755 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -264,7 +264,9 @@ function onConnect() { port_picker.hide(); var dataflash = $('#dataflash_wrapper_global'); - dataflash.show(); + dataflash.show(); + + startLiveDataRefreshTimer(); } @@ -286,6 +288,9 @@ function onClosed(result) { var dataflash = $('#dataflash_wrapper_global'); dataflash.hide(); + + var battery = $('#quad-status_wrapper'); + battery.hide(); } function read_serial(info) { @@ -339,7 +344,7 @@ function sensor_status(sensors_detected) { if (have_sensor(sensors_detected, 'mag')) { $('.mag', e_sensor_status).addClass('on'); - $('.magicon', e_sensor_status).addClass('active'); + $('.magicon', e_sensor_status).addClass('active'); } else { $('.mag', e_sensor_status).removeClass('on'); $('.magicon', e_sensor_status).removeClass('active'); @@ -347,7 +352,7 @@ function sensor_status(sensors_detected) { if (have_sensor(sensors_detected, 'gps')) { $('.gps', e_sensor_status).addClass('on'); - $('.gpsicon', e_sensor_status).addClass('active'); + $('.gpsicon', e_sensor_status).addClass('active'); } else { $('.gps', e_sensor_status).removeClass('on'); $('.gpsicon', e_sensor_status).removeClass('active'); @@ -385,34 +390,117 @@ function highByte(num) { function lowByte(num) { return 0x00FF & num; -}function update_dataflash_global() { - var supportsDataflash = DATAFLASH.totalSize > 0; - if (supportsDataflash){ +} + +function update_dataflash_global() { + var supportsDataflash = DATAFLASH.totalSize > 0; + if (supportsDataflash){ - $(".noflash_global").css({ - display: 'none' - }); + $(".noflash_global").css({ + display: 'none' + }); - $(".dataflash-contents_global").css({ - display: 'block' - }); + $(".dataflash-contents_global").css({ + display: 'block' + }); - $(".dataflash-free_global").css({ - width: (100-(DATAFLASH.totalSize - DATAFLASH.usedSize) / DATAFLASH.totalSize * 100) + "%", - display: 'block' - }); - $(".dataflash-free_global div").text('Dataflash: free ' + formatFilesize(DATAFLASH.totalSize - DATAFLASH.usedSize)); - } else { - $(".noflash_global").css({ - display: 'block' - }); - - $(".dataflash-contents_global").css({ - display: 'none' - }); - } - + $(".dataflash-free_global").css({ + width: (100-(DATAFLASH.totalSize - DATAFLASH.usedSize) / DATAFLASH.totalSize * 100) + "%", + display: 'block' + }); + $(".dataflash-free_global div").text('Dataflash: free ' + formatFilesize(DATAFLASH.totalSize - DATAFLASH.usedSize)); + } else { + $(".noflash_global").css({ + display: 'block' + }); + + $(".dataflash-contents_global").css({ + display: 'none' + }); + } + +} + +function startLiveDataRefreshTimer() { + // live data refresh + GUI.timeout_add('data_refresh', function () { update_live_status(); }, 100); +} + +function update_live_status() { + + var statuswrapper = $('#quad-status_wrapper'); + + $(".quad-status-contents").css({ + display: 'inline-block' + }); + + if (GUI.active_tab != 'cli') { + MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false); + MSP.send_message(MSP_codes.MSP_STATUS, false, false); + MSP.send_message(MSP_codes.MSP_ANALOG, false, false); + } + + var active = ((Date.now() - MSP.analog_last_received_timestamp) < 300); + + for (var i = 0; i < AUX_CONFIG.length; i++) { + if (AUX_CONFIG[i] == 'ARM') { + if (bit_check(CONFIG.mode, i)) + $(".armedicon").css({ + 'background-image': 'url(images/icons/cf_icon_armed_active.svg)' + }); + else + $(".armedicon").css({ + 'background-image': 'url(images/icons/cf_icon_armed_grey.svg)' + }); + } + if (AUX_CONFIG[i] == 'FAILSAFE') { + if (bit_check(CONFIG.mode, i)) + $(".failsafeicon").css({ + 'background-image': 'url(images/icons/cf_icon_failsafe_active.svg)' + }); + else + $(".failsafeicon").css({ + 'background-image': 'url(images/icons/cf_icon_failsafe_grey.svg)' + }); + } } + if (ANALOG != undefined) { + var nbCells = Math.floor(ANALOG.voltage / MISC.vbatmaxcellvoltage) + 1; + if (ANALOG.voltage == 0) + nbCells = 1; + + var min = MISC.vbatmincellvoltage * nbCells; + var max = MISC.vbatmaxcellvoltage * nbCells; + var warn = MISC.vbatwarningcellvoltage * nbCells; + + $(".battery-status").css({ + width: ((ANALOG.voltage - min) / (max - min) * 100) + "%", + display: 'inline-block' + }); + + if (active) { + $(".linkicon").css({ + 'background-image': 'url(images/icons/cf_icon_link_active.svg)' + }); + } else { + $(".linkicon").css({ + 'background-image': 'url(images/icons/cf_icon_link_grey.svg)' + }); + } + + if (ANALOG.voltage < warn) { + $(".battery-status").css('background-color', '#D42133'); + } else { + $(".battery-status").css('background-color', '#59AA29'); + } + + $(".battery-legend").text(ANALOG.voltage + " V"); + } + + statuswrapper.show(); + GUI.timeout_remove('data_refresh'); + startLiveDataRefreshTimer(); +} function specificByte(num, pos) { return 0x000000FF & (num >> (8 * pos)); diff --git a/main.css b/main.css index 2a2e890fe..4a13a23be 100644 --- a/main.css +++ b/main.css @@ -1478,7 +1478,7 @@ dialog { margin-top: 20px; width:125px; float: right; - margin-right: 20px; + margin-right: 10px; line-height: 12px; height: 33px; border-radius: 5px; @@ -1566,6 +1566,116 @@ dialog { } + + + +/* Battery element styling*/ + +#quad-status_wrapper { + display:none; + color: white; + font-size: 10px; + margin-top: 20px; + width: 90px; + float: right; + margin-right: 20px; + line-height: 12px; + height: 67px; + border-radius: 5px; + border: 1px solid #272727; + box-shadow: 0px 1px 0px rgba(92, 92, 92, 0.5); + background-color: #434343; + background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.55)); + text-shadow: 0px 1px rgba(0, 0, 0, 1.0); +} + +.quad-status-contents { + display: none; + margin-top: 14px; + margin-left: 7px; + height: 15px; + width: 40px; +} + + +.battery-legend { + display: inline; + position: relative; + top: -5px; + margin-top: 0px; + left: 0; + right: 0; + width: 40px; + text-align: left; + color: silver; + margin-left: -3px; +} + +.quad-status-contents progress::-webkit-progress-bar { + height: 12px; + background-color: #eee; +} + +.quad-status-contents progress::-webkit-progress-value { + background-color: #bcf; +} + +.battery-status { + height: 15px; + position: relative; + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.20); + border-radius: 2px; + background-color: #59AA29; + border-radius: 4px; +} + +.battery-icon { + background-image: url(images/icons/cf_icon_bat_grey.svg); + background-size: contain; + background-position: center; + display: inline-block; + height: 41px; + width: 60px; + transition: none; + margin-top: -5px; +} + + + +.armedicon, +.failsafeicon, +.linkicon { + float: left; + margin-left: 8px; + margin-right: 2px; + margin-top: 6px; + display: block; + height: 18px; + width: 18px; + opacity: 0.8; + background-size: contain; + background-position: center; + transition: none; +} + +.armedicon { + background-image: url(images/icons/cf_icon_armed_grey.svg); +} +.failsafeicon { + background-image: url(images/icons/cf_icon_failsafe_grey.svg); +} + +.linkicon { + background-image: url(images/icons/cf_icon_link_grey.svg); +} + +.bottomStatusIcons { + background-color: #272727; + height: 31px; +} + + + @media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) { .content_wrapper { @@ -1679,4 +1789,4 @@ input { overflow-y: auto; } - } \ No newline at end of file +} \ No newline at end of file diff --git a/main.html b/main.html index 14783c82a..b2c1a81be 100755 --- a/main.html +++ b/main.html @@ -132,7 +132,7 @@
-
No dataflash
chip found
+
No dataflash
chip found
  • Dataflash: free space
    @@ -172,6 +172,19 @@
+
+
+
+
+
+
+
Battery voltage
+
+
+
+
+
+
diff --git a/tabs/setup.css b/tabs/setup.css index 79796fd45..97e5e4424 100644 --- a/tabs/setup.css +++ b/tabs/setup.css @@ -205,4 +205,49 @@ width: calc(75% - 20px); height: calc(100% - 218px); } +} + +#accel_calib_running { + display: none; + + width: 100%; + position: relative; + margin-bottom: 0px; + margin-top: 0px; + float: left; + + padding: 5px 0px 5px 0px; + text-align: center; + background-color: #fff; + border-radius: 4px; + border: 1px solid #59aa29; + color: #59aa29; + font-family: 'open_sanssemibold', Arial; + font-size: 12px; + line-height: 13px; + transition: all ease 0.2s; + text-decoration:none; + +} + +#mag_calib_running { + display: none; + + width: 100%; + position: relative; + margin-bottom: 0px; + margin-top: 0px; + float: left; + + padding: 5px 0px 5px 0px; + text-align: center; + background-color: #fff; + border-radius: 4px; + border: 1px solid #59aa29; + color: #59aa29; + font-family: 'open_sanssemibold', Arial; + font-size: 12px; + line-height: 13px; + transition: all ease 0.2s; + text-decoration:none; } \ No newline at end of file diff --git a/tabs/setup.html b/tabs/setup.html index 6cd323084..2af365ded 100644 --- a/tabs/setup.html +++ b/tabs/setup.html @@ -9,11 +9,27 @@
- +
+ +
+ +
+
+

Calibrating...

+
+
- +
+ +
+ +
+
+

Calibrating...

+
+
diff --git a/tabs/setup.js b/tabs/setup.js index 6223cd126..b5d8084e8 100755 --- a/tabs/setup.js +++ b/tabs/setup.js @@ -74,14 +74,17 @@ TABS.setup.initialize = function (callback) { GUI.interval_pause('setup_data_pull'); MSP.send_message(MSP_codes.MSP_ACC_CALIBRATION, false, false, function () { GUI.log(chrome.i18n.getMessage('initialSetupAccelCalibStarted')); + $('#accel_calib_running').show(); + $('#accel_calib_rest').hide(); }); GUI.timeout_add('button_reset', function () { GUI.interval_resume('setup_data_pull'); GUI.log(chrome.i18n.getMessage('initialSetupAccelCalibEnded')); - self.removeClass('calibrating'); + $('#accel_calib_running').hide(); + $('#accel_calib_rest').show(); }, 2000); } }); @@ -94,11 +97,15 @@ TABS.setup.initialize = function (callback) { MSP.send_message(MSP_codes.MSP_MAG_CALIBRATION, false, false, function () { GUI.log(chrome.i18n.getMessage('initialSetupMagCalibStarted')); + $('#mag_calib_running').show(); + $('#mag_calib_rest').hide(); }); GUI.timeout_add('button_reset', function () { GUI.log(chrome.i18n.getMessage('initialSetupMagCalibEnded')); self.removeClass('calibrating'); + $('#mag_calib_running').hide(); + $('#mag_calib_rest').show(); }, 30000); } }); From 469d174c6896d2b70a87d6940e191cbd0d9a849c Mon Sep 17 00:00:00 2001 From: gael Date: Wed, 20 Apr 2016 22:04:36 +0200 Subject: [PATCH 08/18] Apply old mag_declination method for API < 1.18 --- js/msp.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/js/msp.js b/js/msp.js index a064b1c52..d465f31f6 100644 --- a/js/msp.js +++ b/js/msp.js @@ -429,8 +429,11 @@ var MSP = { MISC.gps_ubx_sbas = data.getInt8(offset++); MISC.multiwiicurrentoutput = data.getUint8(offset++); MISC.rssi_channel = data.getUint8(offset++); - MISC.placeholder2 = data.getUint8(offset++); - MISC.mag_declination = data.getInt16(offset, 1) / 100; // -18000-18000 + MISC.placeholder2 = data.getUint8(offset++); + if (semver.lt(CONFIG.apiVersion, "1.18.0")) + MISC.mag_declination = data.getInt16(offset, 1) / 10; // -1800-1800 + else + MISC.mag_declination = data.getInt16(offset, 1) / 100; // -18000-18000 offset += 2; MISC.vbatscale = data.getUint8(offset++, 1); // 10-200 MISC.vbatmincellvoltage = data.getUint8(offset++, 1) / 10; // 10-50 @@ -1232,8 +1235,13 @@ MSP.crunch = function (code) { buffer.push(MISC.multiwiicurrentoutput); buffer.push(MISC.rssi_channel); buffer.push(MISC.placeholder2); - buffer.push(lowByte(Math.round(MISC.mag_declination * 100))); - buffer.push(highByte(Math.round(MISC.mag_declination * 100))); + if (semver.lt(CONFIG.apiVersion, "1.18.0")) { + buffer.push(lowByte(Math.round(MISC.mag_declination * 10))); + buffer.push(highByte(Math.round(MISC.mag_declination * 10))); + } else { + buffer.push(lowByte(Math.round(MISC.mag_declination * 100))); + buffer.push(highByte(Math.round(MISC.mag_declination * 100))); + } buffer.push(MISC.vbatscale); buffer.push(Math.round(MISC.vbatmincellvoltage * 10)); buffer.push(Math.round(MISC.vbatmaxcellvoltage * 10)); From c85f41ad3da88a9abece0031f3a0ba3f446e3309 Mon Sep 17 00:00:00 2001 From: gael Date: Thu, 21 Apr 2016 00:42:58 +0200 Subject: [PATCH 09/18] Battery icon; visual improvement Thanks to @skaman82 --- main.css | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/main.css b/main.css index 4a13a23be..3c575cfe6 100644 --- a/main.css +++ b/main.css @@ -1591,17 +1591,18 @@ dialog { .quad-status-contents { display: none; - margin-top: 14px; - margin-left: 7px; - height: 15px; + margin-top: 10px; + margin-left: 14px; + height: 10px; width: 40px; + /* width: 30px; */ } .battery-legend { display: inline; position: relative; - top: -5px; + top: -2px; margin-top: 0px; left: 0; right: 0; @@ -1621,12 +1622,13 @@ dialog { } .battery-status { - height: 15px; + height: 11px; position: relative; box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.20); - border-radius: 2px; + border-radius: 0px; background-color: #59AA29; - border-radius: 4px; + /* border-radius: 4px; */ + margin-top: 0px; } .battery-icon { @@ -1634,14 +1636,13 @@ dialog { background-size: contain; background-position: center; display: inline-block; - height: 41px; + height: 30px; width: 60px; - transition: none; - margin-top: -5px; + transition: none; + margin-top: 4px; + background-repeat: no-repeat; } - - .armedicon, .failsafeicon, .linkicon { @@ -1672,6 +1673,9 @@ dialog { .bottomStatusIcons { background-color: #272727; height: 31px; + margin-top: 2px; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; } From a8143e11c16f6c3c460c7e5bdd6efc46aced2368 Mon Sep 17 00:00:00 2001 From: "Konstantin Sharlaimov (DigitalEntity)" Date: Fri, 6 May 2016 21:04:31 +1000 Subject: [PATCH 10/18] Support for MAVLink telemetry --- _locales/en/messages.json | 3 +++ js/msp.js | 1 + tabs/ports.js | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 32f9f0479..a0b308448 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -723,6 +723,9 @@ "portsFunction_TELEMETRY_LTM": { "message": "LTM" }, + "portsFunction_TELEMETRY_MAVLINK": { + "message": "MAVLink" + }, "portsFunction_TELEMETRY_MSP": { "message": "MSP" }, diff --git a/js/msp.js b/js/msp.js index 1129052ae..5a3c59b99 100644 --- a/js/msp.js +++ b/js/msp.js @@ -149,6 +149,7 @@ var MSP = { 'TELEMETRY_SMARTPORT': 5, 'RX_SERIAL': 6, 'BLACKBOX': 7, + 'TELEMETRY_MAVLINK': 8, }, read: function (readInfo) { diff --git a/tabs/ports.js b/tabs/ports.js index 23d48fcd8..0efec8019 100644 --- a/tabs/ports.js +++ b/tabs/ports.js @@ -25,6 +25,11 @@ TABS.ports.initialize = function (callback, scrollPosition) { functionRules.push(mspFunctionRule); } + if (semver.gte(CONFIG.apiVersion, "1.18.0")) { + var mavlinkFunctionRule = {name: 'TELEMETRY_MAVLINK', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1}; + functionRules.push(mavlinkFunctionRule); + } + for (var i = 0; i < functionRules.length; i++) { functionRules[i].displayName = chrome.i18n.getMessage('portsFunction_' + functionRules[i].name); } From ef0484a072097b44632731040a4c916c5468ec93 Mon Sep 17 00:00:00 2001 From: skaman82 Date: Fri, 6 May 2016 22:57:48 +0200 Subject: [PATCH 11/18] cleanup for #74 --- main.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.css b/main.css index 3c575cfe6..c843e9fe2 100644 --- a/main.css +++ b/main.css @@ -1594,7 +1594,7 @@ dialog { margin-top: 10px; margin-left: 14px; height: 10px; - width: 40px; + width: 30px; /* width: 30px; */ } @@ -1609,7 +1609,7 @@ dialog { width: 40px; text-align: left; color: silver; - margin-left: -3px; + margin-left: -8px; } .quad-status-contents progress::-webkit-progress-bar { From 6bc33430156996b78cbb463ef642507aee1f2c74 Mon Sep 17 00:00:00 2001 From: skaman82 Date: Fri, 6 May 2016 23:11:45 +0200 Subject: [PATCH 12/18] Removing calibration status animation --- tabs/setup.css | 8 +++++++- tabs/setup.html | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tabs/setup.css b/tabs/setup.css index 97e5e4424..32a39bd99 100644 --- a/tabs/setup.css +++ b/tabs/setup.css @@ -250,4 +250,10 @@ line-height: 13px; transition: all ease 0.2s; text-decoration:none; -} \ No newline at end of file +} + +.data-loading-setup { + width: 100%; + height: 100%; + +} diff --git a/tabs/setup.html b/tabs/setup.html index 2af365ded..2152c9208 100644 --- a/tabs/setup.html +++ b/tabs/setup.html @@ -15,7 +15,7 @@
-
+

Calibrating...

@@ -26,7 +26,7 @@
-
+

Calibrating...

From 6c964164e472e6128b6c42352d628415035663d8 Mon Sep 17 00:00:00 2001 From: gael Date: Sun, 8 May 2016 15:24:29 +0200 Subject: [PATCH 13/18] Support LED cmds GPS, RSSI & Blink in configurator Implement initial support for new LED commands implemented in CF PR 2101. --- js/msp.js | 2 +- tabs/led_strip.css | 21 +++++++++++++++++++++ tabs/led_strip.html | 3 +++ tabs/led_strip.js | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/js/msp.js b/js/msp.js index 1129052ae..f99454851 100644 --- a/js/msp.js +++ b/js/msp.js @@ -126,7 +126,7 @@ var MSP = { unsupported: 0, ledDirectionLetters: ['n', 'e', 's', 'w', 'u', 'd'], // in LSB bit order - ledFunctionLetters: ['i', 'w', 'f', 'a', 't', 'r', 'c'], // in LSB bit order + ledFunctionLetters: ['i', 'w', 'f', 'a', 't', 'r', 'c', 'g', 's', 'b'], // in LSB bit order supportedBaudRates: [ // 0 based index. 'AUTO', diff --git a/tabs/led_strip.css b/tabs/led_strip.css index 4a4783d20..d6263cff5 100644 --- a/tabs/led_strip.css +++ b/tabs/led_strip.css @@ -72,6 +72,24 @@ border-color: black; } +.tab-led-strip .gPoint.function-g { /* GPS */ + background: green; + box-shadow: inset 0 0 30px rgba(0, 0, 0, .7); + border-color: rgb(52, 155, 255); +} + +.tab-led-strip .gPoint.function-s { /* RSSI */ + background: brown; + box-shadow: inset 0 0 30px rgba(0, 0, 0, .7); + border-color: rgb(52, 155, 255); +} + +.tab-led-strip .gPoint.function-b { /* Blink */ + background: white; + box-shadow: inset 0 0 30px rgba(0, 0, 0, .7); + border-color: rgb(52, 155, 255); +} + .tab-led-strip .gPoint.function-i.function-f { background: linear-gradient(to bottom, yellow 0%,yellow 50%,rgb(50, 205, 50) 50%, rgb(50, 205, 50) 100%); } @@ -171,6 +189,9 @@ .tab-led-strip .functions .function-c.btnOn { background: linear-gradient( to bottom right, rgba(255, 0, 0, .5) 0%, rgba(255, 255, 0, 0.5) 15%, rgba(0, 255, 0, .5) 30%, rgba(0, 255, 255, .5) 50%, rgba(0, 0, 255, .5) 65%, rgba(255, 0, 255, .5) 80%, rgba(255, 0, 0, .5) 100%); } +.tab-led-strip .functions .function-g.btnOn {background: green;} +.tab-led-strip .functions .function-s.btnOn {background: brown;} +.tab-led-strip .functions .function-b.btnOn {background: white;} .tab-led-strip .color-1 {background: white;} .tab-led-strip .color-2 {background: red;} diff --git a/tabs/led_strip.html b/tabs/led_strip.html index 8ee3b4614..1117bb6ab 100644 --- a/tabs/led_strip.html +++ b/tabs/led_strip.html @@ -45,6 +45,9 @@ + + +
LED Orientation and Color
diff --git a/tabs/led_strip.js b/tabs/led_strip.js index a29c77a7b..f64b65c0a 100644 --- a/tabs/led_strip.js +++ b/tabs/led_strip.js @@ -2,7 +2,7 @@ TABS.led_strip = { wireMode: false, - functions: ['w', 'f', 'i', 'a', 't', 'r', 'c'], + functions: ['w', 'f', 'i', 'a', 't', 'r', 'c', 'g', 's', 'b'], directions: ['n', 'e', 's', 'w', 'u', 'd'], }; From 3d513aff52fdae8202bb2a84ecd0d2045db415ce Mon Sep 17 00:00:00 2001 From: gael Date: Sun, 8 May 2016 23:34:48 +0200 Subject: [PATCH 14/18] Hide new LED buttons when msp version < 1.18.0 --- tabs/led_strip.html | 6 +++--- tabs/led_strip.js | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tabs/led_strip.html b/tabs/led_strip.html index 1117bb6ab..081e3de6c 100644 --- a/tabs/led_strip.html +++ b/tabs/led_strip.html @@ -45,9 +45,9 @@ - - - + + +
LED Orientation and Color
diff --git a/tabs/led_strip.js b/tabs/led_strip.js index f64b65c0a..10bd1de85 100644 --- a/tabs/led_strip.js +++ b/tabs/led_strip.js @@ -288,6 +288,10 @@ TABS.led_strip.initialize = function (callback, scrollPosition) { }); + if (CONFIG.apiVersion < '1.18.0') { + $(".extra_functions").hide(); + } + GUI.content_ready(callback); } From 8ff238bf140b72fc779ff2a2bfd017e8f3417a39 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Thu, 12 May 2016 14:16:59 +0200 Subject: [PATCH 15/18] Update boards.js with some known boards. --- js/boards.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/boards.js b/js/boards.js index 05e1d8fdb..f2f65f38e 100644 --- a/js/boards.js +++ b/js/boards.js @@ -52,6 +52,18 @@ var BOARD_DEFINITIONS = [ name: "SP Racing F3 Mini", identifier: "SRFM", vcp: true + }, { + name: "SP Racing F3 EVO", + identifier: "SPEV", + vcp: true + }, { + name: "Alienflight F3", + identifier: "AFF3", + vcp: true + }, { + name: "ImmersionRC Fusion F3", + identifier: "IFF3", + vcp: false }, { name: "MotoLab", identifier: "MOTO", From aba4569e506223d6822ff083c43013b981a6cd95 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Thu, 12 May 2016 14:20:21 +0200 Subject: [PATCH 16/18] display date warning after 91 days. --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index 6c734a940..126122e5e 100644 --- a/main.js +++ b/main.js @@ -36,7 +36,7 @@ $(document).ready(function () { } // check release time to inform people in case they are running old release - if (CONFIGURATOR.releaseDate > (new Date().getTime() - (86400000 * 60))) { // 1 day = 86400000 miliseconds, * 60 = 2 month window + if (CONFIGURATOR.releaseDate > (new Date().getTime() - (86400000 * 91))) { // 1 day = 86400000 miliseconds, * 91 = 3 month window console.log('Application version is valid for another: ' + Math.round((CONFIGURATOR.releaseDate - (new Date().getTime() - (86400000 * 60))) / 86400000) + ' days'); } else { console.log('Application version expired'); From ce7f572ed3e5494af12bff805057cfc7be9b2159 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Thu, 12 May 2016 14:20:37 +0200 Subject: [PATCH 17/18] prepare for release. --- js/data_storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/data_storage.js b/js/data_storage.js index 9542afc75..c4e2026b5 100755 --- a/js/data_storage.js +++ b/js/data_storage.js @@ -1,7 +1,7 @@ 'use strict'; var CONFIGURATOR = { - 'releaseDate': 1456164608903, // new Date().getTime() - Mon Feb 22 2016 19:10:05 GMT+0100 + 'releaseDate': 1463055533515, // new Date().getTime() - Thu May 12 2016 14:19:06 GMT+0200 // all versions are specified and compared using semantic versioning http://semver.org/ 'apiVersionAccepted': '1.2.1', From 0a3eec8301df74873ca798b38594235bb845a90e Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Thu, 12 May 2016 14:23:46 +0200 Subject: [PATCH 18/18] prepare for release --- changelog.html | 7 ++++++- manifest.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.html b/changelog.html index 49e77f533..f675e490f 100644 --- a/changelog.html +++ b/changelog.html @@ -1,4 +1,9 @@ -2015.12.15 - 1.2.1 - cleanflight +2016.05.12 - 1.2.2 - cleanflight +
    +
  • Better support for some USB VCP targets.
  • +
  • Support for MAVLink telemetry.
  • +
+2016.02.22 - 1.2.1 - cleanflight
  • Add links to STM VCP Drivers and Zadig.
  • Update recovery procedure on Firmware Flasher page.
  • diff --git a/manifest.json b/manifest.json index 3cd820acd..2ecf6ab2b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "minimum_chrome_version": "38", - "version": "1.2.1", + "version": "1.2.2", "author": "Hydra", "name": "Cleanflight - Configurator", "short_name": "cleanflight",