From 94b617dcc9e5350b6e75295fe5c7344f64fe8767 Mon Sep 17 00:00:00 2001 From: "Pawel Spychalski (DzikuVx)" Date: Wed, 19 Feb 2020 14:06:58 +0100 Subject: [PATCH 1/2] Rename 3D feature to REVERSIBLE_MOTORS --- _locales/en/messages.json | 12 ++++++------ js/fc.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 9294dcc4..a1a97052 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -547,7 +547,7 @@ "message": "Battery current monitoring" }, "feature3D": { - "message": "3D mode (for use with reversible ESCs)" + "message": "Reversible motors mode (for use with reversible ESCs)" }, "featureRSSI_ADC": { "message": "Analog RSSI input" @@ -751,19 +751,19 @@ "message": "Battery Capacity Unit" }, "configuration3d": { - "message": "3D" + "message": "Reversible motors" }, "configuration3dDeadbandLow": { - "message": "3D Deadband Low" + "message": "Reversible Motors Deadband Low" }, "configuration3dDeadbandHigh": { - "message": "3D Deadband High" + "message": "Reversible Motors Deadband High" }, "configuration3dNeutral": { - "message": "3D Neutral" + "message": "Reversible Motors Neutral" }, "configuration3dDeadbandThrottle": { - "message": "3D Deadband Throttle" + "message": "Reversible Motors Deadband Throttle" }, "configurationSystem": { "message": "System configuration" diff --git a/js/fc.js b/js/fc.js index bf76f629..7bf56000 100644 --- a/js/fc.js +++ b/js/fc.js @@ -553,7 +553,7 @@ var FC = { {bit: 7, group: 'gps', name: 'GPS', haveTip: true}, {bit: 10, group: 'other', name: 'TELEMETRY', showNameInTip: true}, {bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'}, - {bit: 12, group: 'other', name: '3D', showNameInTip: true}, + {bit: 12, group: 'other', name: 'REVERSIBLE_MOTORS', showNameInTip: true}, {bit: 15, group: 'other', name: 'RSSI_ADC', haveTip: true, showNameInTip: true}, {bit: 16, group: 'other', name: 'LED_STRIP', showNameInTip: true}, {bit: 17, group: 'other', name: 'DASHBOARD', showNameInTip: true}, From 8e7e83f282d9a513bc32fe3c29d06471c6c19d46 Mon Sep 17 00:00:00 2001 From: "Pawel Spychalski (DzikuVx)" Date: Wed, 19 Feb 2020 14:11:18 +0100 Subject: [PATCH 2/2] Rename 3D to REVERSIBLE_MOTORS --- js/fc.js | 12 ++++++------ js/msp/MSPHelper.js | 30 +++++++++++++++--------------- tabs/configuration.js | 16 ++++++++-------- tabs/outputs.js | 12 ++++++------ 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/js/fc.js b/js/fc.js index 7bf56000..ec7e5be0 100644 --- a/js/fc.js +++ b/js/fc.js @@ -30,7 +30,7 @@ var CONFIG, ARMING_CONFIG, FC_CONFIG, MISC, - _3D, + REVERSIBLE_MOTORS, DATAFLASH, SDCARD, BLACKBOX, @@ -419,11 +419,11 @@ var FC = { emergencyDescentRate: null }; - _3D = { - deadband3d_low: 0, - deadband3d_high: 0, - neutral3d: 0, - deadband3d_throttle: 0 + REVERSIBLE_MOTORS = { + deadband_low: 0, + deadband_high: 0, + neutral: 0, + deadband_throttle: 0 }; DATAFLASH = { diff --git a/js/msp/MSPHelper.js b/js/msp/MSPHelper.js index 2328a92a..185522d7 100644 --- a/js/msp/MSPHelper.js +++ b/js/msp/MSPHelper.js @@ -410,14 +410,14 @@ var mspHelper = (function (gui) { BATTERY_CONFIG.battery_capacity_unit = (data.getUint8(offset++) ? 'mWh' : 'mAh'); break; case MSPCodes.MSP_3D: - _3D.deadband3d_low = data.getUint16(offset, true); + REVERSIBLE_MOTORS.deadband_low = data.getUint16(offset, true); offset += 2; - _3D.deadband3d_high = data.getUint16(offset, true); + REVERSIBLE_MOTORS.deadband_high = data.getUint16(offset, true); offset += 2; - _3D.neutral3d = data.getUint16(offset, true); + REVERSIBLE_MOTORS.neutral = data.getUint16(offset, true); if (semver.lt(CONFIG.apiVersion, "1.17.0")) { offset += 2; - _3D.deadband3d_throttle = data.getUint16(offset, true); + REVERSIBLE_MOTORS.deadband_throttle = data.getUint16(offset, true); } break; case MSPCodes.MSP_MOTOR_PINS: @@ -587,7 +587,7 @@ var mspHelper = (function (gui) { RC_deadband.yaw_deadband = data.getUint8(offset++); RC_deadband.alt_hold_deadband = data.getUint8(offset++); if (semver.gte(CONFIG.apiVersion, "1.24.0")) { - _3D.deadband3d_throttle = data.getUint16(offset, true); + REVERSIBLE_MOTORS.deadband_throttle = data.getUint16(offset, true); } break; case MSPCodes.MSP_SENSOR_ALIGNMENT: @@ -1803,15 +1803,15 @@ var mspHelper = (function (gui) { break; case MSPCodes.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(REVERSIBLE_MOTORS.deadband_low)); + buffer.push(highByte(REVERSIBLE_MOTORS.deadband_low)); + buffer.push(lowByte(REVERSIBLE_MOTORS.deadband_high)); + buffer.push(highByte(REVERSIBLE_MOTORS.deadband_high)); + buffer.push(lowByte(REVERSIBLE_MOTORS.neutral)); + buffer.push(highByte(REVERSIBLE_MOTORS.neutral)); if (semver.lt(CONFIG.apiVersion, "1.17.0")) { - buffer.push(lowByte(_3D.deadband3d_throttle)); - buffer.push(highByte(_3D.deadband3d_throttle)); + buffer.push(lowByte(REVERSIBLE_MOTORS.deadband_throttle)); + buffer.push(highByte(REVERSIBLE_MOTORS.deadband_throttle)); } break; @@ -1820,8 +1820,8 @@ var mspHelper = (function (gui) { buffer.push(RC_deadband.yaw_deadband); buffer.push(RC_deadband.alt_hold_deadband); if (semver.gte(CONFIG.apiVersion, "1.24.0")) { - buffer.push(lowByte(_3D.deadband3d_throttle)); - buffer.push(highByte(_3D.deadband3d_throttle)); + buffer.push(lowByte(REVERSIBLE_MOTORS.deadband_throttle)); + buffer.push(highByte(REVERSIBLE_MOTORS.deadband_throttle)); } break; diff --git a/tabs/configuration.js b/tabs/configuration.js index 261a1c47..03d26132 100644 --- a/tabs/configuration.js +++ b/tabs/configuration.js @@ -487,11 +487,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) { SENSOR_CONFIG.opflow = $sensorOpflow.val(); }); - $('#3ddeadbandlow').val(_3D.deadband3d_low); - $('#3ddeadbandhigh').val(_3D.deadband3d_high); - $('#3dneutral').val(_3D.neutral3d); + $('#3ddeadbandlow').val(REVERSIBLE_MOTORS.deadband_low); + $('#3ddeadbandhigh').val(REVERSIBLE_MOTORS.deadband_high); + $('#3dneutral').val(REVERSIBLE_MOTORS.neutral); if (semver.lt(CONFIG.apiVersion, "1.17.0")) { - $('#3ddeadbandthrottle').val(_3D.deadband3d_throttle); + $('#3ddeadbandthrottle').val(REVERSIBLE_MOTORS.deadband_throttle); } else { $('#deadband-3d-throttle-container').remove(); } @@ -523,11 +523,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) { MISC.battery_capacity_critical = parseInt($('#battery_capacity_critical').val() * MISC.battery_capacity / 100); MISC.battery_capacity_unit = $('#battery_capacity_unit').val(); - _3D.deadband3d_low = parseInt($('#3ddeadbandlow').val()); - _3D.deadband3d_high = parseInt($('#3ddeadbandhigh').val()); - _3D.neutral3d = parseInt($('#3dneutral').val()); + REVERSIBLE_MOTORS.deadband_low = parseInt($('#3ddeadbandlow').val()); + REVERSIBLE_MOTORS.deadband_high = parseInt($('#3ddeadbandhigh').val()); + REVERSIBLE_MOTORS.neutral = parseInt($('#3dneutral').val()); if (semver.lt(CONFIG.apiVersion, "1.17.0")) { - _3D.deadband3d_throttle = ($('#3ddeadbandthrottle').val()); + REVERSIBLE_MOTORS.deadband_throttle = ($('#3ddeadbandthrottle').val()); } SENSOR_ALIGNMENT.align_mag = parseInt(orientation_mag_e.val()); diff --git a/tabs/outputs.js b/tabs/outputs.js index 7632f5af..235c14db 100644 --- a/tabs/outputs.js +++ b/tabs/outputs.js @@ -1,4 +1,4 @@ -/*global helper,MSP,MSPChainerClass,googleAnalytics,GUI,mspHelper,MOTOR_RULES,TABS,$,MSPCodes,ANALOG,MOTOR_DATA,chrome,PLATFORM_MULTIROTOR,BF_CONFIG,PLATFORM_TRICOPTER,SERVO_RULES,FC,SERVO_CONFIG,SENSOR_DATA,_3D,MISC,MIXER_CONFIG,OUTPUT_MAPPING*/ +/*global helper,MSP,MSPChainerClass,googleAnalytics,GUI,mspHelper,MOTOR_RULES,TABS,$,MSPCodes,ANALOG,MOTOR_DATA,chrome,PLATFORM_MULTIROTOR,BF_CONFIG,PLATFORM_TRICOPTER,SERVO_RULES,FC,SERVO_CONFIG,SENSOR_DATA,REVERSIBLE_MOTORS,MISC,MIXER_CONFIG,OUTPUT_MAPPING*/ 'use strict'; TABS.outputs = { @@ -506,10 +506,10 @@ TABS.outputs.initialize = function (callback) { if(self.feature3DEnabled && self.feature3DSupported) { //Arbitrary sanity checks //Note: values may need to be revisited - if(_3D.neutral3d > 1575 || _3D.neutral3d < 1425) - _3D.neutral3d = 1500; + if(REVERSIBLE_MOTORS.neutral > 1575 || REVERSIBLE_MOTORS.neutral < 1425) + REVERSIBLE_MOTORS.neutral = 1500; - $slidersInput.val(_3D.neutral3d); + $slidersInput.val(REVERSIBLE_MOTORS.neutral); } else { $slidersInput.val(MISC.mincommand); } @@ -568,7 +568,7 @@ TABS.outputs.initialize = function (callback) { // change all values to default if (self.feature3DEnabled && self.feature3DSupported) { - $slidersInput.val(_3D.neutral3d); + $slidersInput.val(REVERSIBLE_MOTORS.neutral); } else { $slidersInput.val(MISC.mincommand); } @@ -587,7 +587,7 @@ TABS.outputs.initialize = function (callback) { break; } }else{ - if( (MOTOR_DATA[i] < _3D.deadband3d_low) || (MOTOR_DATA[i] > _3D.deadband3d_high) ){ + if( (MOTOR_DATA[i] < REVERSIBLE_MOTORS.deadband_low) || (MOTOR_DATA[i] > REVERSIBLE_MOTORS.deadband_high) ){ motors_running = true; break; }