1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 08:45:26 +03:00

Rename 3D to REVERSIBLE_MOTORS

This commit is contained in:
Pawel Spychalski (DzikuVx) 2020-02-19 14:11:18 +01:00
parent 94b617dcc9
commit 8e7e83f282
4 changed files with 35 additions and 35 deletions

View file

@ -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 = {

View file

@ -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;

View file

@ -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());

View file

@ -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;
}