Merge pull request #926 from iNavFlight/dzikuvx-feature-3d-rename

Rename feature 3D to REVERSIBLE_MOTORS
pull/932/head
Paweł Spychalski 5 years ago committed by GitHub
commit 39a5266cc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -547,7 +547,7 @@
"message": "Battery current monitoring" "message": "Battery current monitoring"
}, },
"feature3D": { "feature3D": {
"message": "3D mode (for use with reversible ESCs)" "message": "Reversible motors mode (for use with reversible ESCs)"
}, },
"featureRSSI_ADC": { "featureRSSI_ADC": {
"message": "Analog RSSI input" "message": "Analog RSSI input"
@ -751,19 +751,19 @@
"message": "Battery Capacity Unit" "message": "Battery Capacity Unit"
}, },
"configuration3d": { "configuration3d": {
"message": "3D" "message": "Reversible motors"
}, },
"configuration3dDeadbandLow": { "configuration3dDeadbandLow": {
"message": "3D Deadband Low" "message": "Reversible Motors Deadband Low"
}, },
"configuration3dDeadbandHigh": { "configuration3dDeadbandHigh": {
"message": "3D Deadband High" "message": "Reversible Motors Deadband High"
}, },
"configuration3dNeutral": { "configuration3dNeutral": {
"message": "3D Neutral" "message": "Reversible Motors Neutral"
}, },
"configuration3dDeadbandThrottle": { "configuration3dDeadbandThrottle": {
"message": "3D Deadband Throttle" "message": "Reversible Motors Deadband Throttle"
}, },
"configurationSystem": { "configurationSystem": {
"message": "System configuration" "message": "System configuration"

@ -30,7 +30,7 @@ var CONFIG,
ARMING_CONFIG, ARMING_CONFIG,
FC_CONFIG, FC_CONFIG,
MISC, MISC,
_3D, REVERSIBLE_MOTORS,
DATAFLASH, DATAFLASH,
SDCARD, SDCARD,
BLACKBOX, BLACKBOX,
@ -419,11 +419,11 @@ var FC = {
emergencyDescentRate: null emergencyDescentRate: null
}; };
_3D = { REVERSIBLE_MOTORS = {
deadband3d_low: 0, deadband_low: 0,
deadband3d_high: 0, deadband_high: 0,
neutral3d: 0, neutral: 0,
deadband3d_throttle: 0 deadband_throttle: 0
}; };
DATAFLASH = { DATAFLASH = {
@ -553,7 +553,7 @@ var FC = {
{bit: 7, group: 'gps', name: 'GPS', haveTip: true}, {bit: 7, group: 'gps', name: 'GPS', haveTip: true},
{bit: 10, group: 'other', name: 'TELEMETRY', showNameInTip: true}, {bit: 10, group: 'other', name: 'TELEMETRY', showNameInTip: true},
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'}, {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: 15, group: 'other', name: 'RSSI_ADC', haveTip: true, showNameInTip: true},
{bit: 16, group: 'other', name: 'LED_STRIP', showNameInTip: true}, {bit: 16, group: 'other', name: 'LED_STRIP', showNameInTip: true},
{bit: 17, group: 'other', name: 'DASHBOARD', showNameInTip: true}, {bit: 17, group: 'other', name: 'DASHBOARD', showNameInTip: true},

@ -410,14 +410,14 @@ var mspHelper = (function (gui) {
BATTERY_CONFIG.battery_capacity_unit = (data.getUint8(offset++) ? 'mWh' : 'mAh'); BATTERY_CONFIG.battery_capacity_unit = (data.getUint8(offset++) ? 'mWh' : 'mAh');
break; break;
case MSPCodes.MSP_3D: case MSPCodes.MSP_3D:
_3D.deadband3d_low = data.getUint16(offset, true); REVERSIBLE_MOTORS.deadband_low = data.getUint16(offset, true);
offset += 2; offset += 2;
_3D.deadband3d_high = data.getUint16(offset, true); REVERSIBLE_MOTORS.deadband_high = data.getUint16(offset, true);
offset += 2; offset += 2;
_3D.neutral3d = data.getUint16(offset, true); REVERSIBLE_MOTORS.neutral = data.getUint16(offset, true);
if (semver.lt(CONFIG.apiVersion, "1.17.0")) { if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
offset += 2; offset += 2;
_3D.deadband3d_throttle = data.getUint16(offset, true); REVERSIBLE_MOTORS.deadband_throttle = data.getUint16(offset, true);
} }
break; break;
case MSPCodes.MSP_MOTOR_PINS: case MSPCodes.MSP_MOTOR_PINS:
@ -587,7 +587,7 @@ var mspHelper = (function (gui) {
RC_deadband.yaw_deadband = data.getUint8(offset++); RC_deadband.yaw_deadband = data.getUint8(offset++);
RC_deadband.alt_hold_deadband = data.getUint8(offset++); RC_deadband.alt_hold_deadband = data.getUint8(offset++);
if (semver.gte(CONFIG.apiVersion, "1.24.0")) { if (semver.gte(CONFIG.apiVersion, "1.24.0")) {
_3D.deadband3d_throttle = data.getUint16(offset, true); REVERSIBLE_MOTORS.deadband_throttle = data.getUint16(offset, true);
} }
break; break;
case MSPCodes.MSP_SENSOR_ALIGNMENT: case MSPCodes.MSP_SENSOR_ALIGNMENT:
@ -1803,15 +1803,15 @@ var mspHelper = (function (gui) {
break; break;
case MSPCodes.MSP_SET_3D: case MSPCodes.MSP_SET_3D:
buffer.push(lowByte(_3D.deadband3d_low)); buffer.push(lowByte(REVERSIBLE_MOTORS.deadband_low));
buffer.push(highByte(_3D.deadband3d_low)); buffer.push(highByte(REVERSIBLE_MOTORS.deadband_low));
buffer.push(lowByte(_3D.deadband3d_high)); buffer.push(lowByte(REVERSIBLE_MOTORS.deadband_high));
buffer.push(highByte(_3D.deadband3d_high)); buffer.push(highByte(REVERSIBLE_MOTORS.deadband_high));
buffer.push(lowByte(_3D.neutral3d)); buffer.push(lowByte(REVERSIBLE_MOTORS.neutral));
buffer.push(highByte(_3D.neutral3d)); buffer.push(highByte(REVERSIBLE_MOTORS.neutral));
if (semver.lt(CONFIG.apiVersion, "1.17.0")) { if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
buffer.push(lowByte(_3D.deadband3d_throttle)); buffer.push(lowByte(REVERSIBLE_MOTORS.deadband_throttle));
buffer.push(highByte(_3D.deadband3d_throttle)); buffer.push(highByte(REVERSIBLE_MOTORS.deadband_throttle));
} }
break; break;
@ -1820,8 +1820,8 @@ var mspHelper = (function (gui) {
buffer.push(RC_deadband.yaw_deadband); buffer.push(RC_deadband.yaw_deadband);
buffer.push(RC_deadband.alt_hold_deadband); buffer.push(RC_deadband.alt_hold_deadband);
if (semver.gte(CONFIG.apiVersion, "1.24.0")) { if (semver.gte(CONFIG.apiVersion, "1.24.0")) {
buffer.push(lowByte(_3D.deadband3d_throttle)); buffer.push(lowByte(REVERSIBLE_MOTORS.deadband_throttle));
buffer.push(highByte(_3D.deadband3d_throttle)); buffer.push(highByte(REVERSIBLE_MOTORS.deadband_throttle));
} }
break; break;

@ -487,11 +487,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
SENSOR_CONFIG.opflow = $sensorOpflow.val(); SENSOR_CONFIG.opflow = $sensorOpflow.val();
}); });
$('#3ddeadbandlow').val(_3D.deadband3d_low); $('#3ddeadbandlow').val(REVERSIBLE_MOTORS.deadband_low);
$('#3ddeadbandhigh').val(_3D.deadband3d_high); $('#3ddeadbandhigh').val(REVERSIBLE_MOTORS.deadband_high);
$('#3dneutral').val(_3D.neutral3d); $('#3dneutral').val(REVERSIBLE_MOTORS.neutral);
if (semver.lt(CONFIG.apiVersion, "1.17.0")) { if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
$('#3ddeadbandthrottle').val(_3D.deadband3d_throttle); $('#3ddeadbandthrottle').val(REVERSIBLE_MOTORS.deadband_throttle);
} else { } else {
$('#deadband-3d-throttle-container').remove(); $('#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_critical = parseInt($('#battery_capacity_critical').val() * MISC.battery_capacity / 100);
MISC.battery_capacity_unit = $('#battery_capacity_unit').val(); MISC.battery_capacity_unit = $('#battery_capacity_unit').val();
_3D.deadband3d_low = parseInt($('#3ddeadbandlow').val()); REVERSIBLE_MOTORS.deadband_low = parseInt($('#3ddeadbandlow').val());
_3D.deadband3d_high = parseInt($('#3ddeadbandhigh').val()); REVERSIBLE_MOTORS.deadband_high = parseInt($('#3ddeadbandhigh').val());
_3D.neutral3d = parseInt($('#3dneutral').val()); REVERSIBLE_MOTORS.neutral = parseInt($('#3dneutral').val());
if (semver.lt(CONFIG.apiVersion, "1.17.0")) { 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()); SENSOR_ALIGNMENT.align_mag = parseInt(orientation_mag_e.val());

@ -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'; 'use strict';
TABS.outputs = { TABS.outputs = {
@ -506,10 +506,10 @@ TABS.outputs.initialize = function (callback) {
if(self.feature3DEnabled && self.feature3DSupported) { if(self.feature3DEnabled && self.feature3DSupported) {
//Arbitrary sanity checks //Arbitrary sanity checks
//Note: values may need to be revisited //Note: values may need to be revisited
if(_3D.neutral3d > 1575 || _3D.neutral3d < 1425) if(REVERSIBLE_MOTORS.neutral > 1575 || REVERSIBLE_MOTORS.neutral < 1425)
_3D.neutral3d = 1500; REVERSIBLE_MOTORS.neutral = 1500;
$slidersInput.val(_3D.neutral3d); $slidersInput.val(REVERSIBLE_MOTORS.neutral);
} else { } else {
$slidersInput.val(MISC.mincommand); $slidersInput.val(MISC.mincommand);
} }
@ -568,7 +568,7 @@ TABS.outputs.initialize = function (callback) {
// change all values to default // change all values to default
if (self.feature3DEnabled && self.feature3DSupported) { if (self.feature3DEnabled && self.feature3DSupported) {
$slidersInput.val(_3D.neutral3d); $slidersInput.val(REVERSIBLE_MOTORS.neutral);
} else { } else {
$slidersInput.val(MISC.mincommand); $slidersInput.val(MISC.mincommand);
} }
@ -587,7 +587,7 @@ TABS.outputs.initialize = function (callback) {
break; break;
} }
}else{ }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; motors_running = true;
break; break;
} }

Loading…
Cancel
Save