CF/BF - Delete unused angleAtMin/Max from configurator to match API

1.33.0
10.3.x-maintenance
Hydra 2017-03-23 21:17:47 +00:00 committed by Michael Keller
parent 49100d29bd
commit 5f0149d161
4 changed files with 26 additions and 13 deletions

View File

@ -98,13 +98,13 @@ var MSPCodes = {
MSP_WP: 118, // Not used
MSP_BOXIDS: 119,
MSP_SERVO_CONFIGURATIONS: 120,
MSP_MOTOR_3D_CONFIG: 124,
MSP_MOTOR_3D_CONFIG: 124,
MSP_RC_DEADBAND: 125,
MSP_SENSOR_ALIGNMENT: 126,
MSP_LED_STRIP_MODECOLOR: 127,
MSP_VOLTAGE_METERS: 128,
MSP_CURRENT_METERS: 129,
MSP_CURRENT_METERS: 129,
MSP_BATTERY_STATE: 130,
MSP_MOTOR_CONFIG: 131,
MSP_GPS_CONFIG: 132,
@ -131,7 +131,7 @@ var MSPCodes = {
MSP_SET_HEADING: 211, // Not used
MSP_SET_SERVO_CONFIGURATION: 212,
MSP_SET_MOTOR: 214,
MSP_SET_MOTOR_3D_CONFIG: 217,
MSP_SET_MOTOR_3D_CONFIG: 217,
MSP_SET_RC_DEADBAND: 218,
MSP_SET_RESET_CURR_PID: 219,
MSP_SET_SENSOR_ALIGNMENT: 220,

View File

@ -377,8 +377,24 @@ MspHelper.prototype.process_data = function(dataHandler) {
case MSPCodes.MSP_SERVO_CONFIGURATIONS:
SERVO_CONFIG = []; // empty the array as new data is coming in
if (semver.gte(CONFIG.apiVersion, "1.33.0")) {
if (data.byteLength % 12 == 0) {
for (var i = 0; i < data.byteLength; i += 12) {
var arr = {
'min': data.readU16(),
'max': data.readU16(),
'middle': data.readU16(),
'rate': data.read8(),
'angleAtMin': -90,
'angleAtMax': 90,
'indexOfChannelToForward': data.readU8(),
'reversedInputSources': data.readU32()
};
if (semver.gte(CONFIG.apiVersion, "1.12.0")) {
SERVO_CONFIG.push(arr);
}
}
} else if (semver.gte(CONFIG.apiVersion, "1.12.0")) {
if (data.byteLength % 14 == 0) {
for (var i = 0; i < data.byteLength; i += 14) {
var arr = {
@ -1479,9 +1495,12 @@ MspHelper.prototype.sendServoConfigurations = function(onCompleteCallback) {
.push16(servoConfiguration.min)
.push16(servoConfiguration.max)
.push16(servoConfiguration.middle)
.push8(servoConfiguration.rate)
.push8(servoConfiguration.angleAtMin)
.push8(servoConfiguration.angleAtMax);
.push8(servoConfiguration.rate);
if (semver.gte(CONFIG.apiVersion, "1.33.0")) {
buffer.push8(servoConfiguration.angleAtMin)
.push8(servoConfiguration.angleAtMax);
}
var out = servoConfiguration.indexOfChannelToForward;
if (out == undefined) {

View File

@ -12,8 +12,6 @@
<th i18n="servosMid"></th>
<th i18n="servosMin"></th>
<th i18n="servosMax"></th>
<th class="wide" i18n="servosAngleAtMin"></th>
<th class="wide" i18n="servosAngleAtMax"></th>
<th class="short">CH1</th>
<th class="short">CH2</th>
<th class="short">CH3</th>

View File

@ -66,8 +66,6 @@ TABS.servos.initialize = function (callback) {
<td class="middle"><input type="number" min="500" max="2500" value="' + SERVO_CONFIG[obj].middle + '" /></td>\
<td class="min"><input type="number" min="500" max="2500" value="' + SERVO_CONFIG[obj].min +'" /></td>\
<td class="max"><input type="number" min="500" max="2500" value="' + SERVO_CONFIG[obj].max +'" /></td>\
<td class="angleAtMin"><input type="number" min="-90" max="0" value="' + (-SERVO_CONFIG[obj].angleAtMin) +'" /></td>\
<td class="angleAtMax"><input type="number" min="0" max="90" value="' + SERVO_CONFIG[obj].angleAtMax +'" /></td>\
' + servoCheckbox + '\
<td class="direction">\
</td>\
@ -121,8 +119,6 @@ TABS.servos.initialize = function (callback) {
SERVO_CONFIG[info.obj].middle = parseInt($('.middle input', this).val());
SERVO_CONFIG[info.obj].min = parseInt($('.min input', this).val());
SERVO_CONFIG[info.obj].max = parseInt($('.max input', this).val());
SERVO_CONFIG[info.obj].angleAtMin = -parseInt($('.angleAtMin input', this).val());
SERVO_CONFIG[info.obj].angleAtMax = parseInt($('.angleAtMax input', this).val());
var val = parseInt($('.direction select', this).val());
SERVO_CONFIG[info.obj].rate = val;