From 31cd2de3d38e95439c56f932a51a8c54b0cf2335 Mon Sep 17 00:00:00 2001 From: NightHawk32 Date: Wed, 11 Nov 2015 16:05:24 -0500 Subject: [PATCH 01/10] Added 3D configuration parameters so they don't have to be changed in the CLI --- _locales/en/messages.json | 15 +++++++++++++++ js/data_storage.js | 7 +++++++ js/msp.js | 22 ++++++++++++++++++++++ tabs/configuration.html | 32 ++++++++++++++++++++++++++++++++ tabs/configuration.js | 24 +++++++++++++++++++++--- 5 files changed, 97 insertions(+), 3 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 51114e7d..a4ae1028 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -503,6 +503,21 @@ "configurationBatteryMultiwiiCurrent": { "message": "Enable support for legacy Multiwii MSP current output" }, + "configuration3d": { + "message": "3D" + }, + "configuration3dDeadbandLow": { + "message": "3D Deadband Low" + }, + "configuration3dDeadbandHigh": { + "message": "3D Deadband High" + }, + "configuration3dNeutral": { + "message": "3D Neutral" + }, + "configuration3dDeadbandThrottle": { + "message": "3D Deadband Throttle" + }, "configurationSystem": { "message": "System configuration" }, diff --git a/js/data_storage.js b/js/data_storage.js index 53f87245..82ad2dad 100755 --- a/js/data_storage.js +++ b/js/data_storage.js @@ -165,6 +165,13 @@ var MISC = { vbatwarningcellvoltage: 0 }; +var _3D = { + deadband3d_low: 0, + deadband3d_high: 0, + neutral3d: 0, + deadband3d_throttle: 0 +}; + var DATAFLASH = { ready: false, sectors: 0, diff --git a/js/msp.js b/js/msp.js index 1cdc18c0..35f5e74b 100644 --- a/js/msp.js +++ b/js/msp.js @@ -52,6 +52,7 @@ var MSP_codes = { MSP_WP: 118, MSP_BOXIDS: 119, MSP_SERVO_CONFIGURATIONS: 120, + MSP_3D: 124, MSP_SET_RAW_RC: 200, MSP_SET_RAW_GPS: 201, @@ -67,6 +68,7 @@ var MSP_codes = { MSP_SET_HEAD: 211, MSP_SET_SERVO_CONFIGURATION: 212, MSP_SET_MOTOR: 214, + MSP_SET_3D: 217, // MSP_BIND: 240, @@ -409,6 +411,16 @@ var MSP = { MISC.vbatmaxcellvoltage = data.getUint8(offset++, 1) / 10; // 10-50 MISC.vbatwarningcellvoltage = data.getUint8(offset++, 1) / 10; // 10-50 break; + case MSP_codes.MSP_3D: + var offset = 0; + _3D.deadband3d_low = data.getUint16(offset, 1); + offset += 2; + _3D.deadband3d_high = data.getUint16(offset, 1); + offset += 2; + _3D.neutral3d = data.getUint16(offset, 1); + offset += 2; + _3D.deadband3d_throttle = data.getUint16(offset, 1); + break; case MSP_codes.MSP_MOTOR_PINS: console.log(data); break; @@ -1129,6 +1141,16 @@ MSP.crunch = function (code) { } } break; + case MSP_codes.MSP_SET_3D: + buffer.push(lowByte(_3D.deadband3d_low)); + buffer.push(highByte(_3D.deadband3d_low)); + buffer.push(lowByte(_3D.deadband3d_high)); + 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)); + break; default: return false; diff --git a/tabs/configuration.html b/tabs/configuration.html index a53226a0..26094a1e 100644 --- a/tabs/configuration.html +++ b/tabs/configuration.html @@ -241,6 +241,7 @@ +
@@ -303,6 +304,34 @@

+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
@@ -320,6 +349,9 @@
+
+ +
diff --git a/tabs/configuration.js b/tabs/configuration.js index 6118d461..076d2323 100755 --- a/tabs/configuration.js +++ b/tabs/configuration.js @@ -27,7 +27,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) { } function load_misc() { - MSP.send_message(MSP_codes.MSP_MISC, false, false, load_acc_trim); + MSP.send_message(MSP_codes.MSP_MISC, false, false, load_3d); + } + + function load_3d() { + MSP.send_message(MSP_codes.MSP_3D, false, false, load_acc_trim); } function load_acc_trim() { @@ -312,7 +316,12 @@ TABS.configuration.initialize = function (callback, scrollPosition) { $('input[name="currentscale"]').val(BF_CONFIG.currentscale); $('input[name="currentoffset"]').val(BF_CONFIG.currentoffset); $('input[name="multiwiicurrentoutput"]').prop('checked', MISC.multiwiicurrentoutput); - + + //fill 3D + $('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); // UI hooks $('input[name="looptime"]').change(function() { @@ -383,6 +392,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) { MISC.vbatmaxcellvoltage = parseFloat($('input[name="maxcellvoltage"]').val()); MISC.vbatwarningcellvoltage = parseFloat($('input[name="warningcellvoltage"]').val()); MISC.vbatscale = parseInt($('input[name="voltagescale"]').val()); + + _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()); BF_CONFIG.currentscale = parseInt($('input[name="currentscale"]').val()); BF_CONFIG.currentoffset = parseInt($('input[name="currentoffset"]').val()); @@ -397,7 +411,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) { } function save_misc() { - MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_acc_trim); + MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_3d); + } + + function save_3d() { + MSP.send_message(MSP_codes.MSP_SET_3D, MSP.crunch(MSP_codes.MSP_SET_3D), false, save_acc_trim); } function save_acc_trim() { From d183f19369afa31208a498cacdbaa344ec8ca027 Mon Sep 17 00:00:00 2001 From: NightHawk32 Date: Thu, 12 Nov 2015 16:00:07 -0500 Subject: [PATCH 02/10] In case you deactivate the motor-control it checks now if 3D is activated and resets the throttle to the proper neutral value. --- tabs/motors.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tabs/motors.js b/tabs/motors.js index 57d94a85..5f619c9d 100644 --- a/tabs/motors.js +++ b/tabs/motors.js @@ -12,7 +12,15 @@ TABS.motors.initialize = function (callback) { } function get_arm_status() { - MSP.send_message(MSP_codes.MSP_STATUS, false, false, get_motor_data); + MSP.send_message(MSP_codes.MSP_STATUS, false, false, load_config); + } + + function load_config() { + MSP.send_message(MSP_codes.MSP_BF_CONFIG, false, false, load_3d); + } + + function load_3d() { + MSP.send_message(MSP_codes.MSP_3D, false, false, get_motor_data); } function update_arm_status() { @@ -341,7 +349,12 @@ TABS.motors.initialize = function (callback) { $('div.sliders input').prop('disabled', true); // change all values to default - $('div.sliders input').val(MISC.mincommand); + if (! bit_check(BF_CONFIG.features,12)) { + $('div.sliders input').val(MISC.mincommand); + } else { + $('div.sliders input').val(_3D.neutral3d); + } + // trigger change event so values are sent to mcu $('div.sliders input').trigger('input'); From 09100c8ebaa46146a9c6b727f001e14542cdf3fc Mon Sep 17 00:00:00 2001 From: NightHawk32 Date: Thu, 12 Nov 2015 16:22:04 -0500 Subject: [PATCH 03/10] Adapted the check for running motors in the motor control for 3D. --- tabs/motors.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tabs/motors.js b/tabs/motors.js index 5f619c9d..4d9424c7 100644 --- a/tabs/motors.js +++ b/tabs/motors.js @@ -365,10 +365,17 @@ TABS.motors.initialize = function (callback) { var motors_running = false; for (var i = 0; i < MOTOR_DATA.length; i++) { - if (MOTOR_DATA[i] > MISC.mincommand) { - motors_running = true; - break; - } + if( ! bit_check(BF_CONFIG.features,12) ){ + if (MOTOR_DATA[i] > MISC.mincommand) { + motors_running = true; + break; + } + }else{ + if( (MOTOR_DATA[i] < _3D.deadband3d_low) || (MOTOR_DATA[i] > _3D.deadband3d_high) ){ + motors_running = true; + break; + } + } } if (motors_running) { From 34a45e0b9b17d85ce4497ffb69d924751a1d1b7c Mon Sep 17 00:00:00 2001 From: Albert Kravcov Date: Sun, 15 Nov 2015 16:33:37 +0100 Subject: [PATCH 04/10] Fixing tab area (when log is open) = now scrollable. Also fixed: receiverMSP Button --- main.css | 28 +++++++++++++-------------- main.js | 6 +++--- tabs/receiver_msp.css | 44 +++++++++++++++++++++++++++++++++++++----- tabs/receiver_msp.html | 5 ++++- 4 files changed, 59 insertions(+), 24 deletions(-) diff --git a/main.css b/main.css index c0c0852b..05d93f78 100644 --- a/main.css +++ b/main.css @@ -111,9 +111,9 @@ input[type="number"]::-webkit-inner-spin-button { } .headerbar { - height:110px; - width:100%; - background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.15)); + height:110px; + width:100%; + background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.15)); } @@ -512,6 +512,13 @@ input[type="number"]::-webkit-inner-spin-button { background-color: #2e2e2e; } +.tab_container.logopen { + height: calc(100% - 235px); + overflow-x: hidden; + overflow-y: auto; +} + + #tabs { font-size: 13px; } @@ -523,7 +530,6 @@ input[type="number"]::-webkit-inner-spin-button { #tabs.logopen ul { /* Cause the height to shrink to contain its floated contents while log is open */ - } .header-wrapper .mode-connected { @@ -885,13 +891,8 @@ dialog { } .content_wrapper { - /* leave 20px side padding always */ - /*padding: 0 20px 0 20px; - for testing: */ - padding: 20px; - position: relative; - /*float: left; - width:calc(100% - 40px);*/ + padding: 20px; + position: relative; } .content_toolbar { @@ -1097,9 +1098,6 @@ dialog { } .fixed_band .save_btn a { - /* line-height:20px; - padding:3px 13px 5px 13px; - */ margin-top: 9px; margin-bottom: 0px; margin-right: 20px; @@ -1353,7 +1351,7 @@ dialog { border-radius: 3px; color: #fff; font-size: 10px; - } + } .fixfalse { background-color: #e60000; diff --git a/main.js b/main.js index 0a79479c..29613a01 100644 --- a/main.js +++ b/main.js @@ -367,8 +367,8 @@ $("#showlog").on('click', function() { if ( state ) { $("#log").animate({height: 27}, 200); $("#log").removeClass('active'); - $("#content").removeClass('logopen'); - $("#tabs").removeClass('logopen'); + $("#content").removeClass('logopen'); + $(".tab_container").removeClass('logopen'); $("#scrollicon").removeClass('active'); state = false; @@ -376,7 +376,7 @@ $("#showlog").on('click', function() { $("#log").animate({height: 111}, 200); $("#log").addClass('active'); $("#content").addClass('logopen'); - $("#tabs").addClass('logopen'); + $(".tab_container").addClass('logopen'); $("#scrollicon").addClass('active'); state = true; diff --git a/tabs/receiver_msp.css b/tabs/receiver_msp.css index 18231ee1..1c16f6c5 100644 --- a/tabs/receiver_msp.css +++ b/tabs/receiver_msp.css @@ -98,10 +98,44 @@ body { left: -65px; } -.button-enable { - padding: 0.5em; - font-size: 110%; - margin-left: auto; - margin-right: auto; +a { + text-decoration: none; + color: #000; + font-family: 'open_sanssemibold', Arial; +} + +a:hover { + text-decoration: none; +} + +.button-enable a { + /* common styles for content toolbar buttons */ + margin-top: 0px; + margin-bottom: 0px; + margin-left: 0px; + background-color: #59aa29; + border-radius: 3px; + border: 1px solid #4c8829; + color: #fff; + float: left; + font-family: 'open_sansbold', Arial; + font-size: 12px; + text-shadow: 0px 1px rgba(0, 0, 0, 0.25); display: block; + cursor: pointer; + transition: all ease 0.2s; + padding: 0px; + padding-left: 9px; + padding-right: 9px; + line-height: 28px; +} + +.button-enable a:hover { + background-color: #6ac435; + transition: all ease 0.2s; +} +.button-enable a:active { + background-color: #4d9324; + transition: all ease 0.0s; + box-shadow: inset 0px 1px 5px rgba(0, 0, 0, 0.35); } \ No newline at end of file diff --git a/tabs/receiver_msp.html b/tabs/receiver_msp.html index c569ca31..9aa396bd 100644 --- a/tabs/receiver_msp.html +++ b/tabs/receiver_msp.html @@ -1,5 +1,6 @@ + @@ -56,7 +57,9 @@ This feature does not guarantee reliable control of your craft. Serious injury is likely to result if propellers are left on.

- +
\ No newline at end of file From ac79a1e65d7e9b50a0a84bae660e7799485e1177 Mon Sep 17 00:00:00 2001 From: Albert Kravcov Date: Sun, 15 Nov 2015 16:51:04 +0100 Subject: [PATCH 05/10] fixed dataflash buttons --- tabs/dataflash.css | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/tabs/dataflash.css b/tabs/dataflash.css index 209481d3..01ebdb04 100644 --- a/tabs/dataflash.css +++ b/tabs/dataflash.css @@ -122,8 +122,42 @@ .tab-dataflash dialog .buttons { position: static; margin-top: 2em; - overflow: hidden; - width: auto; + float: left; +} + +.tab-dataflash .buttons a { + margin-top: 9px; + margin-bottom: 0px; + margin-right: 10px; + background-color: #59aa29; + border-radius: 3px; + border: 1px solid #4c8829; + color: #fff; + float: left; + font-family: 'open_sansbold', Arial; + font-size: 12px; + text-shadow: 0px 1px rgba(0, 0, 0, 0.25); + display: block; + cursor: pointer; + transition: all ease 0.2s; + padding: 0px; + padding-left: 9px; + padding-right: 9px; + line-height: 28px; +} + +.tab-dataflash .buttons a:hover { + background-color: #6ac435; + border: 1px solid #4d9324; + text-shadow: 0px 1px rgba(0, 0, 0, 0.25); + color: #fff; + transition: all ease 0.2s; +} + +.tab-dataflash .buttons a:active { + background-color: #4d9324; + transition: all ease 0.0s; + box-shadow: inset 0px 1px 5px rgba(0, 0, 0, 0.35); } .tab-dataflash dialog h3 { From 9ef8e56be161903e9e66e0e78edf4c9ff6409446 Mon Sep 17 00:00:00 2001 From: skaman82 Date: Mon, 16 Nov 2015 14:13:59 +0100 Subject: [PATCH 06/10] Changing min height to 600 --- eventPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventPage.js b/eventPage.js index bca1916f..cf8d4bbc 100755 --- a/eventPage.js +++ b/eventPage.js @@ -11,7 +11,7 @@ function startApplication() { frame: 'chrome', innerBounds: { minWidth: 1024, - minHeight: 700 + minHeight: 600 } }, function (createdWindow) { createdWindow.contentWindow.addEventListener('load', function () { From f298ba3ccb0afa5f71f4c6ad9d9dd7185d0291ce Mon Sep 17 00:00:00 2001 From: skaman82 Date: Mon, 16 Nov 2015 14:48:45 +0100 Subject: [PATCH 07/10] Additional changes to support screen height of 600px --- main.css | 30 +++++++++--------------------- tabs/setup.css | 2 -- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/main.css b/main.css index 05d93f78..b16ce9a8 100644 --- a/main.css +++ b/main.css @@ -360,27 +360,6 @@ input[type="number"]::-webkit-inner-spin-button { background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.45)); } -/* -#documentation-controls { - float: right; - height: 22px; - line-height: 22px; - margin-right: 10px; -} - - -#button-documentation { - float: left; - padding: 0 12px 0 12px; - height: 18px; - line-height: 18px; - background-color: #ffcb18; - color: #000; - font-weight: bold; - border: solid 1px #c0c0c0; - display: none; -} -*/ #options { float: right; width: 20px; @@ -1472,3 +1451,12 @@ dialog { overflow-y: auto; } } + +@media only screen and (max-height: 700px) , only screen and (max-device-height: 700px) { + +.tab_container { + overflow-x: hidden; + overflow-y: auto; +} + + } diff --git a/tabs/setup.css b/tabs/setup.css index 4bb8c372..c43122b5 100644 --- a/tabs/setup.css +++ b/tabs/setup.css @@ -14,7 +14,6 @@ border-radius: 5px; border: 1px solid #e4e4e4; margin-bottom: 10px; - /* min-height:400px; */ } .attitude_info { @@ -173,7 +172,6 @@ #interactive_block { position: absolute; width: calc(75% - 20px); - min-height: 300px; height: calc(100% - 218px); } } \ No newline at end of file From e5ccefa35bf58e435690ebb74d95c8b7ece87904 Mon Sep 17 00:00:00 2001 From: skaman82 Date: Mon, 16 Nov 2015 15:20:12 +0100 Subject: [PATCH 08/10] resizing the app for 1024x600 res --- eventPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventPage.js b/eventPage.js index cf8d4bbc..a321e4e9 100755 --- a/eventPage.js +++ b/eventPage.js @@ -11,7 +11,7 @@ function startApplication() { frame: 'chrome', innerBounds: { minWidth: 1024, - minHeight: 600 + minHeight: 550 } }, function (createdWindow) { createdWindow.contentWindow.addEventListener('load', function () { From d9f65d50d33d3c4ed374a3658db26c8dfc1d6f98 Mon Sep 17 00:00:00 2001 From: Albert Kravcov Date: Sun, 15 Nov 2015 17:16:14 +0100 Subject: [PATCH 09/10] PID Tab: moving english text into json file --- _locales/en/messages.json | 24 ++++++++++++++++++++++++ tabs/pid_tuning.html | 16 ++++++++-------- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 2c8b3e56..d3f83a30 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1203,6 +1203,30 @@ "controlAxisAux8": { "message": "AUX 8" }, + "pid_label_basic": { + "message": "Basic/Acro" + }, + "pid_label_level": { + "message": "Angle/Horizon" + }, + "pid_label_alt": { + "message": "Barometer & Sonar/Altitude" + }, + "pid_label_mag": { + "message": "Magnometer/Heading" + }, + "pid_label_gps": { + "message": "GPS Navigation" + }, + "pid_level_labelP": { + "message": "Strength (Angle)" + }, + "pid_level_labelI": { + "message": "Strength (Horizon)" + }, + "pid_level_labelD": { + "message": "Transition (Horizon)" + }, "pidHelp1": { "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." }, diff --git a/tabs/pid_tuning.html b/tabs/pid_tuning.html index ce0e5eb1..9a3a6672 100755 --- a/tabs/pid_tuning.html +++ b/tabs/pid_tuning.html @@ -39,7 +39,7 @@ @@ -67,7 +67,7 @@
-
Basic/Acro
+
@@ -88,7 +88,7 @@
-
Barometer & Sonar/Altitude
+
@@ -102,7 +102,7 @@
-
Magnometer/Heading
+
@@ -134,14 +134,14 @@ From 57baf8707c9f9170f169b258acbf929f08eb8875 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Mon, 16 Nov 2015 21:33:00 +0000 Subject: [PATCH 10/10] Update some i18n labels to use the correct casing (camelCase) and the correct prefix "pidTuning". The prefixes generally seems to match the tab source files. --- _locales/en/messages.json | 16 ++++++++-------- tabs/pid_tuning.html | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index d3f83a30..f590c8d3 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1203,28 +1203,28 @@ "controlAxisAux8": { "message": "AUX 8" }, - "pid_label_basic": { + "pidTuningBasic": { "message": "Basic/Acro" }, - "pid_label_level": { + "pidTuningLevel": { "message": "Angle/Horizon" }, - "pid_label_alt": { + "pidTuningAltitude": { "message": "Barometer & Sonar/Altitude" }, - "pid_label_mag": { + "pidTuningMag": { "message": "Magnometer/Heading" }, - "pid_label_gps": { + "pidTuningGps": { "message": "GPS Navigation" }, - "pid_level_labelP": { + "pidTuningLevelP": { "message": "Strength (Angle)" }, - "pid_level_labelI": { + "pidTuningLevelI": { "message": "Strength (Horizon)" }, - "pid_level_labelD": { + "pidTuningLevelD": { "message": "Transition (Horizon)" }, "pidHelp1": { diff --git a/tabs/pid_tuning.html b/tabs/pid_tuning.html index 9a3a6672..3d6ae3f3 100755 --- a/tabs/pid_tuning.html +++ b/tabs/pid_tuning.html @@ -39,7 +39,7 @@
-
GPS Navigation
+
- Angle/Horizon +
-
Strength (Angle)
-
Strength (Horizon)
-
Transition (Horizon)
+
+
+
@@ -67,7 +67,7 @@
-
+
@@ -88,7 +88,7 @@
-
+
@@ -102,7 +102,7 @@
-
+
@@ -134,14 +134,14 @@
-
+
-
+
-
-
-
+
+
+