1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-17 05:15:20 +03:00

advanced tuning tab done

This commit is contained in:
Pawel Spychalski (DzikuVx) 2017-01-24 21:37:29 +01:00
parent ff95022b86
commit c977b19432
12 changed files with 282 additions and 80 deletions

View file

@ -901,11 +901,11 @@ var mspHelper = (function (gui) {
break;
case MSPCodes.MSP_POSITION_ESTIMATION_CONFIG:
POSITION_ESTIMATOR.w_z_baro_p = data.getUint16(0, true);
POSITION_ESTIMATOR.w_z_gps_p = data.getUint16(2, true);
POSITION_ESTIMATOR.w_z_gps_v = data.getUint16(4, true);
POSITION_ESTIMATOR.w_xy_gps_p = data.getUint16(6, true);
POSITION_ESTIMATOR.w_xy_gps_v = data.getUint16(8, true);
POSITION_ESTIMATOR.w_z_baro_p = data.getUint16(0, true) / 100;
POSITION_ESTIMATOR.w_z_gps_p = data.getUint16(2, true) / 100;
POSITION_ESTIMATOR.w_z_gps_v = data.getUint16(4, true) / 100;
POSITION_ESTIMATOR.w_xy_gps_p = data.getUint16(6, true) / 100;
POSITION_ESTIMATOR.w_xy_gps_v = data.getUint16(8, true) / 100;
POSITION_ESTIMATOR.gps_min_sats = data.getUint8(10);
POSITION_ESTIMATOR.use_gps_velned = data.getUint8(11);
break;
@ -1234,20 +1234,20 @@ var mspHelper = (function (gui) {
break;
case MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG:
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_baro_p));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_baro_p));
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_baro_p * 100));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_baro_p * 100));
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_gps_p));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_gps_p));
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_gps_p * 100));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_gps_p * 100));
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_gps_v));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_gps_v));
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_gps_v * 100));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_gps_v * 100));
buffer.push(lowByte(POSITION_ESTIMATOR.w_xy_gps_p));
buffer.push(highByte(POSITION_ESTIMATOR.w_xy_gps_p));
buffer.push(lowByte(POSITION_ESTIMATOR.w_xy_gps_p * 100));
buffer.push(highByte(POSITION_ESTIMATOR.w_xy_gps_p * 100));
buffer.push(lowByte(POSITION_ESTIMATOR.w_xy_gps_v));
buffer.push(highByte(POSITION_ESTIMATOR.w_xy_gps_v));
buffer.push(lowByte(POSITION_ESTIMATOR.w_xy_gps_v * 100));
buffer.push(highByte(POSITION_ESTIMATOR.w_xy_gps_v * 100));
buffer.push(POSITION_ESTIMATOR.gps_min_sats);
buffer.push(POSITION_ESTIMATOR.use_gps_velned);
@ -1987,5 +1987,21 @@ var mspHelper = (function (gui) {
}
};
self.loadPositionEstimationConfig = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
MSP.send_message(MSPCodes.MSP_POSITION_ESTIMATION_CONFIG, false, false, callback);
} else {
callback();
}
};
self.savePositionEstimationConfig = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
MSP.send_message(MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG), false, callback);
} else {
callback();
}
};
return self;
})(GUI);