Merge branch 'master' into MrD_Add-Pilot-logo-to-OSD

pull/1835/head
Darren Lines 12 months ago
commit f0b62dac2c

@ -1353,6 +1353,24 @@
"pidTuning_RatesAndExpo": {
"message": "Rates & Expo"
},
"pidTuning_RateDynamics": {
"message": "Rate Dynamics"
},
"pidTuning_RateDynamics_Sensitivity": {
"message": "Sensitivity"
},
"pidTuning_RateDynamics_Correction": {
"message": "Correction"
},
"pidTuning_RateDynamics_Weight": {
"message": "Weight"
},
"pidTuning_RateDynamics_Center": {
"message": "Center"
},
"pidTuning_RateDynamics_End": {
"message": "End"
},
"pidTuning_RollPitchRate": {
"message": "ROLL & PITCH rate"
},

@ -64,7 +64,8 @@ var CONFIG,
SAFEHOMES,
BOARD_ALIGNMENT,
CURRENT_METER_CONFIG,
FEATURES;
FEATURES,
RATE_DYNAMICS;
var FC = {
restartRequired: false,
@ -541,6 +542,15 @@ var FC = {
SETTINGS = {};
SAFEHOMES = new SafehomeCollection();
RATE_DYNAMICS = {
sensitivityCenter: null,
sensitivityEnd: null,
correctionCenter: null,
correctionEnd: null,
weightCenter: null,
weightEnd: null
};
},
getOutputUsages: function() {
return {

@ -52,6 +52,17 @@ var GUI_control = function () {
else if (navigator.appVersion.indexOf("Linux") != -1) this.operating_system = "Linux";
else if (navigator.appVersion.indexOf("X11") != -1) this.operating_system = "UNIX";
else this.operating_system = "Unknown";
this.colorTable = [
"#8ecae6",
"#2a9d8f",
"#e9c46a",
"#f4a261",
"#e76f51",
"#ef476f",
"#ffc300"
];
};
// message = string
@ -383,5 +394,89 @@ GUI_control.prototype.renderLogicConditionSelect = function ($container, logicCo
$select.val(current).change(onChange);
}
GUI_control.prototype.sliderize = function ($input, value, min, max) {
let scaledMax;
let scaledMin;
let scalingThreshold;
if ($input.data('normal-max')) {
scaledMax = max * 2;
scalingThreshold = Math.round(scaledMax * 0.8);
scaledMin = min *2;
} else {
scaledMax = max;
scaledMin = min;
scalingThreshold = scaledMax;
}
let $range = $('<input type="range" min="' + scaledMin + '" max="' + scaledMax + '" value="' + value + '"/>');
if ($input.data('step')) {
$range.attr('step', $input.data('step'));
}
$range.css({
'display': 'block',
'flex-grow': 100,
'margin-left': '1em',
'margin-right': '1em',
});
$input.attr('min', min);
$input.attr('max', max);
$input.val(parseInt(value));
$input.css({
'width': 'auto',
'min-width': '75px',
});
$input.parent().css({
'display': 'flex',
'width': '100%'
});
$range.insertAfter($input);
$input.parent().find('.helpicon').css({
'top': '5px',
'left': '-10px'
});
/*
* Update slider to input
*/
$range.on('input', function() {
let val = $(this).val();
let normalMax = parseInt($input.data('normal-max'));
if (normalMax) {
if (val <= scalingThreshold) {
val = scaleRangeInt(val, scaledMin, scalingThreshold, min, normalMax);
} else {
val = scaleRangeInt(val, scalingThreshold + 1, scaledMax, normalMax + 1, max);
}
}
$input.val(val);
});
$input.on('change', function() {
let val = $(this).val();
let newVal;
let normalMax = parseInt($input.data('normal-max'));
if (normalMax) {
if (val <= normalMax) {
newVal = scaleRangeInt(val, min, normalMax, scaledMin, scalingThreshold);
} else {
newVal = scaleRangeInt(val, normalMax + 1, max, scalingThreshold + 1, scaledMax);
}
} else {
newVal = val;
}
$range.val(newVal);
});
$input.trigger('change');
};
// initialize object into GUI variable
var GUI = new GUI_control();

@ -237,5 +237,8 @@ var MSPCodes = {
MSP2_INAV_LOGIC_CONDITIONS_SINGLE: 0x203B,
MSP2_INAV_LED_STRIP_CONFIG_EX: 0x2048,
MSP2_INAV_SET_LED_STRIP_CONFIG_EX: 0x2049
MSP2_INAV_SET_LED_STRIP_CONFIG_EX: 0x2049,
MSP2_INAV_RATE_DYNAMICS: 0x2060,
MSP2_INAV_SET_RATE_DYNAMICS: 0x2061
};

@ -1454,7 +1454,7 @@ var mspHelper = (function (gui) {
case MSPCodes.MSP2_INAV_MIXER:
MIXER_CONFIG.yawMotorDirection = data.getInt8(0);
MIXER_CONFIG.yawJumpPreventionLimit = data.getUint8(1, true);
MIXER_CONFIG.motorStopOnLow = data.getUint8(1, true);
MIXER_CONFIG.motorStopOnLow = data.getUint8(2, true);
MIXER_CONFIG.platformType = data.getInt8(3);
MIXER_CONFIG.hasFlaps = data.getInt8(4);
MIXER_CONFIG.appliedMixerPreset = data.getInt16(5, true);
@ -1558,6 +1558,19 @@ var mspHelper = (function (gui) {
console.log('Safehome points saved');
break;
case MSPCodes.MSP2_INAV_RATE_DYNAMICS:
RATE_DYNAMICS.sensitivityCenter = data.getUint8(0);
RATE_DYNAMICS.sensitivityEnd = data.getUint8(1);
RATE_DYNAMICS.correctionCenter = data.getUint8(2);
RATE_DYNAMICS.correctionEnd = data.getUint8(3);
RATE_DYNAMICS.weightCenter = data.getUint8(4);
RATE_DYNAMICS.weightEnd = data.getUint8(5);
break;
case MSPCodes.MSP2_INAV_SET_RATE_DYNAMICS:
console.log('Rate dynamics saved');
break;
default:
console.log('Unknown code detected: ' + dataHandler.code);
} else {
@ -2185,6 +2198,15 @@ var mspHelper = (function (gui) {
buffer.push(BRAKING_CONFIG.bankAngle);
break;
case MSPCodes.MSP2_INAV_SET_RATE_DYNAMICS:
buffer.push(RATE_DYNAMICS.sensitivityCenter);
buffer.push(RATE_DYNAMICS.sensitivityEnd);
buffer.push(RATE_DYNAMICS.correctionCenter);
buffer.push(RATE_DYNAMICS.correctionEnd);
buffer.push(RATE_DYNAMICS.weightCenter);
buffer.push(RATE_DYNAMICS.weightEnd);
break;
default:
return false;
}
@ -3379,6 +3401,14 @@ var mspHelper = (function (gui) {
MSP.send_message(MSPCodes.MSP2_INAV_SET_MC_BRAKING, mspHelper.crunch(MSPCodes.MSP2_INAV_SET_MC_BRAKING), false, callback);
};
self.loadRateDynamics = function (callback) {
MSP.send_message(MSPCodes.MSP2_INAV_RATE_DYNAMICS, false, false, callback);
}
self.saveRateDynamics = function (callback) {
MSP.send_message(MSPCodes.MSP2_INAV_SET_RATE_DYNAMICS, mspHelper.crunch(MSPCodes.MSP2_INAV_SET_RATE_DYNAMICS), false, callback);
}
self.loadParameterGroups = function (callback) {
MSP.send_message(MSPCodes.MSP2_COMMON_PG_LIST, false, false, function (resp) {
var groups = [];

@ -20,16 +20,6 @@ let OutputMappingCollection = function () {
const OUTPUT_TYPE_MOTOR = 0;
const OUTPUT_TYPE_SERVO = 1;
const outputColor = [
"#8ecae6",
"#2a9d8f",
"#e9c46a",
"#f4a261",
"#e76f51",
"#ef476f",
"#ffc300"
];
self.TIMER_OUTPUT_MODE_AUTO = 0;
self.TIMER_OUTPUT_MODE_MOTORS = 1;
self.TIMER_OUTPUT_MODE_SERVOS = 2;
@ -49,7 +39,7 @@ let OutputMappingCollection = function () {
self.getTimerColor = function (timer) {
let timerIndex = OUTPUT_MAPPING.getUsedTimerIds().indexOf(String(timer));
return outputColor[timerIndex % outputColor.length];
return GUI.colorTable[timerIndex % GUI.colorTable.length];
}
self.getOutputTimerColor = function (output) {

@ -85,88 +85,7 @@ var Settings = (function () {
input.attr('maxlength', s.setting.max);
} else if (input.data('presentation') == 'range') {
let scaledMax;
let scaledMin;
let scalingThreshold;
if (input.data('normal-max')) {
scaledMax = s.setting.max * 2;
scalingThreshold = Math.round(scaledMax * 0.8);
scaledMin = s.setting.min *2;
} else {
scaledMax = s.setting.max;
scaledMin = s.setting.min;
scalingThreshold = scaledMax;
}
let $range = $('<input type="range" min="' + scaledMin + '" max="' + scaledMax + '" value="' + s.value + '"/>');
if (input.data('step')) {
$range.attr('step', input.data('step'));
}
$range.css({
'display': 'block',
'flex-grow': 100,
'margin-left': '1em',
'margin-right': '1em',
});
input.attr('min', s.setting.min);
input.attr('max', s.setting.max);
input.val(parseInt(s.value));
input.css({
'width': 'auto',
'min-width': '75px',
});
input.parent().css({
'display': 'flex',
'width': '100%'
});
$range.insertAfter(input);
input.parent().find('.helpicon').css({
'top': '5px',
'left': '-10px'
});
/*
* Update slider to input
*/
$range.on('input', function() {
let val = $(this).val();
let normalMax = parseInt(input.data('normal-max'));
if (normalMax) {
if (val <= scalingThreshold) {
val = scaleRangeInt(val, scaledMin, scalingThreshold, s.setting.min, normalMax);
} else {
val = scaleRangeInt(val, scalingThreshold + 1, scaledMax, normalMax + 1, s.setting.max);
}
}
input.val(val);
});
input.on('change', function() {
let val = $(this).val();
let newVal;
let normalMax = parseInt(input.data('normal-max'));
if (normalMax) {
if (val <= normalMax) {
newVal = scaleRangeInt(val, s.setting.min, normalMax, scaledMin, scalingThreshold);
} else {
newVal = scaleRangeInt(val, normalMax + 1, s.setting.max, scalingThreshold + 1, scaledMax);
}
} else {
newVal = val;
}
$range.val(newVal);
});
input.trigger('change');
GUI.sliderize(input, s.value, s.setting.min, s.setting.max);
} else if (s.setting.type == 'float') {
input.attr('type', 'number');

@ -2275,3 +2275,7 @@ ol li {
.controlProfileHighlightActive {
background-color: #d5ebfe !important ;
}
.no-border {
border: none !important;
}

@ -285,6 +285,7 @@
| ![Home distance](/resources/osd/digital/default/24x36/357.png) | SYM_HOME_DIST | | Home distance icon | 357 | 0x165 |
| ![Crosshair centre](/resources/osd/digital/default/24x36/358.png) | SYM_AH_CH_CENTER | SYM.AH_CROSSHAIRS | Default crosshair centre | 358 | 0x166 |
| ![Flight dist rem](/resources/osd/digital/default/24x36/359.png) | SYM_FLIGHT_DIST_REMAINING | SYM.FLIGHT_DIST_REMAINING | Flight distance remaining | 359 | 0x167 |
| ![Odometer](/resources/osd/digital/default/24x36/360.png) | SYM_ODOMETER | SYM.ODOMETER | Odometer (total aircraft distance) | 360 | 0x168 |
| ![Crosshair 3](/resources/osd/digital/default/24x36/400_402.png) | SYM_AH_CH_TYPE3 | SYM.AH_CROSSHAIRS | Crosshair type 3 | 400 - 402 | 0x190 - 0x192 |
| ![Crosshair 4](/resources/osd/digital/default/24x36/403_405.png) | SYM_AH_CH_TYPE4 | SYM.AH_CROSSHAIRS | Crosshair type 4 | 403 - 405 | 0x193 - 0x195 |
| ![Crosshair 5](/resources/osd/digital/default/24x36/406_408.png) | SYM_AH_CH_TYPE5 | SYM.AH_CROSSHAIRS | Crosshair type 5 | 406 - 408 | 0x196 - 0x198 |

@ -23042,51 +23042,51 @@ MAX7456
01010101
01010101
01010101
00000000
00000000
00000000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
00000000
00000000
00000000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01000101
00000101
01000101
00100000
10100000
00100001
10001000
10001000
10001000
10001000
10001000
10001000
00100000
10100000
00100001
01000101
00000101
01000101
01010101
01010101
01010101

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

@ -23042,51 +23042,51 @@ MAX7456
01010101
01010101
01010101
00000000
00000000
00000000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
00000000
00000000
00000000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01000101
00000101
01000101
00100000
10100000
00100001
10001000
10001000
10001000
10001000
10001000
10001000
00100000
10100000
00100001
01000101
00000101
01000101
01010101
01010101
01010101

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

@ -23042,51 +23042,51 @@ MAX7456
01010101
01010101
01010101
00000000
00000000
00000000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
00000000
00000000
00000000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01000101
00000101
01000101
00100000
10100000
00100001
10001000
10001000
10001000
10001000
10001000
10001000
00100000
10100000
00100001
01000101
00000101
01000101
01010101
01010101
01010101

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

@ -23042,51 +23042,51 @@ MAX7456
01010101
01010101
01010101
00000000
00000000
00000000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
00000000
00000000
00000000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01000101
00000101
01000101
00100000
10100000
00100001
10001000
10001000
10001000
10001000
10001000
10001000
00100000
10100000
00100001
01000101
00000101
01000101
01010101
01010101
01010101

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -23042,51 +23042,51 @@ MAX7456
01010101
01010101
01010101
00000000
00000000
00000000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
00000000
00000000
00000000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01000101
00000101
01000101
00100000
10100000
00100001
10001000
10001000
10001000
10001000
10001000
10001000
00100000
10100000
00100001
01000101
00000101
01000101
01010101
01010101
01010101

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

@ -23042,51 +23042,51 @@ MAX7456
01010101
01010101
01010101
00000000
00000000
00000000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
00000000
00000000
00000000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01000101
00000101
01000101
00100000
10100000
00100001
10001000
10001000
10001000
10001000
10001000
10001000
00100000
10100000
00100001
01000101
00000101
01000101
01010101
01010101
01010101

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

@ -23042,51 +23042,51 @@ MAX7456
01010101
01010101
01010101
00000000
00000000
00000000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
00000000
00000000
00000000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01000101
00000101
01000101
00100000
10100000
00100001
10001000
10001000
10001000
10001000
10001000
10001000
00100000
10100000
00100001
01000101
00000101
01000101
01010101
01010101
01010101

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

@ -23042,51 +23042,51 @@ MAX7456
01010101
01010101
01010101
00000000
00000000
00000000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
10100010
10001010
00101000
00000000
00000000
00000000
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01000101
00000101
01000101
00100000
10100000
00100001
10001000
10001000
10001000
10001000
10001000
10001000
00100000
10100000
00100001
01000101
00000101
01000101
01010101
01010101
01010101

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -437,15 +437,15 @@
}
.pid-sliders-axis[data-axis="roll"] {
background-color: #afe4fe;
background-color: #8ecae6;
}
.pid-sliders-axis[data-axis="pitch"] {
background-color: #C4B5FF;
background-color: #00b4d8;
}
.pid-sliders-axis[data-axis="yaw"] {
background-color: #E6B6F0;
background-color: #e9c46a;
}
#pid-sliders {

@ -115,6 +115,7 @@ SYM.GROUND_COURSE = 0xDC;
SYM.ALERT = 0xDD;
SYM.CROSS_TRACK_ERROR = 0xFC;
SYM.PAN_SERVO_IS_OFFSET_L = 0x1C7;
SYM.ODOMETER = 0X168;
SYM.PILOT_LOGO_SML_L = 0x1D5;
SYM.PILOT_LOGO_SML_C = 0x1D6;
SYM.PILOT_LOGO_SML_R = 0x1D7;
@ -862,7 +863,7 @@ OSD.constants = {
},
{
name: 'PILOT_LOGO',
id: 145,
id: 146,
preview: FONT.symbol(SYM.PILOT_LOGO_SML_L) + FONT.symbol(SYM.PILOT_LOGO_SML_C) + FONT.symbol(SYM.PILOT_LOGO_SML_R)
},
{
@ -1570,6 +1571,22 @@ OSD.constants = {
}
}
},
{
name: 'ODOMETER',
id: 145,
min_version: '6.1.0',
preview: function(osd_data) {
switch (OSD.data.preferences.units) {
case 0: // Imperial
case 3: // UK
return FONT.symbol(SYM.ODOMETER) + FONT.embed_dot('00016.9') + FONT.symbol(SYM.DIST_MI);
case 4: // GA
return FONT.symbol(SYM.ODOMETER) + FONT.embed_dot('00014.7') + FONT.symbol(SYM.DIST_NM);
default: // Metric
return FONT.symbol(SYM.ODOMETER) + FONT.embed_dot('00027.2') + FONT.symbol(SYM.DIST_KM);
}
}
},
{
name: 'GPS_HDOP',
id: 31,

@ -339,6 +339,71 @@
</tbody>
</table>
</div>
<div class="clear-both"></div>
<div class="tab_subtitle" style="margin-top: 1em;" data-i18n="pidTuning_RateDynamics"></div>
<div class="clear-both"></div>
<div class="pid-sliders-axis" data-axis="roll">
<h3 data-i18n="pidTuning_RateDynamics_Sensitivity"></h3>
<div class="pid-slider-row">
<span data-i18n="pidTuning_RateDynamics_Center"></span>
<div class="number no-border">
<input id="rate_dynamics_center_sensitivity" type="number"/>
</div>
<div class="clear-both"></div>
</div>
<div class="pid-slider-row">
<span data-i18n="pidTuning_RateDynamics_End"></span>
<div class="number no-border">
<input id="rate_dynamics_end_sensitivity" type="number"/>
</div>
<div class="clear-both"></div>
</div>
</div>
<div class="pid-sliders-axis" data-axis="pitch">
<h3 data-i18n="pidTuning_RateDynamics_Correction"></h3>
<div class="pid-slider-row">
<span data-i18n="pidTuning_RateDynamics_Center"></span>
<div class="number no-border">
<input id="rate_dynamics_center_correction" type="number"/>
</div>
<div class="clear-both"></div>
</div>
<div class="pid-slider-row">
<span data-i18n="pidTuning_RateDynamics_End"></span>
<div class="number no-border">
<input id="rate_dynamics_end_correction" type="number"/>
</div>
<div class="clear-both"></div>
</div>
</div>
<div class="pid-sliders-axis" data-axis="yaw">
<h3 data-i18n="pidTuning_RateDynamics_Weight"></h3>
<div class="pid-slider-row">
<span data-i18n="pidTuning_RateDynamics_Center"></span>
<div class="number no-border">
<input id="rate_dynamics_center_weight" type="number"/>
</div>
<div class="clear-both"></div>
</div>
<div class="pid-slider-row">
<span data-i18n="pidTuning_RateDynamics_End"></span>
<div class="number no-border">
<input id="rate_dynamics_end_weight" type="number"/>
</div>
<div class="clear-both"></div>
</div>
</div>
</div>
<div id="subtab-filters" class="subtab__content">

@ -15,7 +15,8 @@ TABS.pid_tuning.initialize = function (callback) {
mspHelper.loadINAVPidConfig,
mspHelper.loadPidAdvanced,
mspHelper.loadFilterConfig,
mspHelper.loadFeatures
mspHelper.loadFeatures,
mspHelper.loadRateDynamics
];
loadChain.push(mspHelper.loadRateProfileData);
@ -92,6 +93,15 @@ TABS.pid_tuning.initialize = function (callback) {
RC_tuning.manual_roll_rate = $('#rate-manual-roll').val();
RC_tuning.manual_pitch_rate = $('#rate-manual-pitch').val();
RC_tuning.manual_yaw_rate = $('#rate-manual-yaw').val();
// Rate Dynamics
RATE_DYNAMICS.sensitivityCenter = parseInt($('#rate_dynamics_center_sensitivity').val());
RATE_DYNAMICS.sensitivityEnd = parseInt($('#rate_dynamics_end_sensitivity').val());
RATE_DYNAMICS.correctionCenter = parseInt($('#rate_dynamics_center_correction').val());
RATE_DYNAMICS.correctionEnd = parseInt($('#rate_dynamics_end_correction').val());
RATE_DYNAMICS.weightCenter = parseInt($('#rate_dynamics_center_weight').val());
RATE_DYNAMICS.weightEnd = parseInt($('#rate_dynamics_end_weight').val());
}
function hideUnusedPids(sensors_detected) {
$('.tab-pid_tuning table.pid_tuning').hide();
@ -232,6 +242,15 @@ TABS.pid_tuning.initialize = function (callback) {
axis++;
});
GUI.sliderize($('#rate_dynamics_center_sensitivity'), RATE_DYNAMICS.sensitivityCenter, 25, 175);
GUI.sliderize($('#rate_dynamics_end_sensitivity'), RATE_DYNAMICS.sensitivityEnd, 25, 175);
GUI.sliderize($('#rate_dynamics_center_correction'), RATE_DYNAMICS.correctionCenter, 10, 95);
GUI.sliderize($('#rate_dynamics_end_correction'), RATE_DYNAMICS.correctionEnd, 10, 95);
GUI.sliderize($('#rate_dynamics_center_weight'), RATE_DYNAMICS.weightCenter, 0, 95);
GUI.sliderize($('#rate_dynamics_end_weight'), RATE_DYNAMICS.weightEnd, 0, 95);
if (!FC.isRpyFfComponentUsed()) {
$('.rpy_ff').prop('disabled', 'disabled');
}
@ -270,7 +289,11 @@ TABS.pid_tuning.initialize = function (callback) {
}
function saveFilterConfig() {
MSP.send_message(MSPCodes.MSP_SET_FILTER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FILTER_CONFIG), false, saveSettings);
MSP.send_message(MSPCodes.MSP_SET_FILTER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FILTER_CONFIG), false, saveRateDynamics);
}
function saveRateDynamics() {
mspHelper.saveRateDynamics(saveSettings);
}
function saveSettings() {

Loading…
Cancel
Save