|
|
@ -3,7 +3,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
var helper = helper || {};
|
|
|
|
var helper = helper || {};
|
|
|
|
|
|
|
|
|
|
|
|
helper.defaultsDialog = (function() {
|
|
|
|
helper.defaultsDialog = (function () {
|
|
|
|
|
|
|
|
|
|
|
|
let publicScope = {},
|
|
|
|
let publicScope = {},
|
|
|
|
privateScope = {};
|
|
|
|
privateScope = {};
|
|
|
@ -203,7 +203,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "dterm_lpf_hz",
|
|
|
|
key: "dterm_lpf_hz",
|
|
|
|
value: 40
|
|
|
|
value: 10
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "d_boost_factor",
|
|
|
|
key: "d_boost_factor",
|
|
|
@ -263,7 +263,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "nav_fw_pos_xy_p",
|
|
|
|
key: "nav_fw_pos_xy_p",
|
|
|
|
value: 50
|
|
|
|
value: 60
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "fw_turn_assist_pitch_gain",
|
|
|
|
key: "fw_turn_assist_pitch_gain",
|
|
|
@ -287,7 +287,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "fw_ff_pitch",
|
|
|
|
key: "fw_ff_pitch",
|
|
|
|
value: 60
|
|
|
|
value: 80
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "fw_p_roll",
|
|
|
|
key: "fw_p_roll",
|
|
|
@ -315,7 +315,11 @@ helper.defaultsDialog = (function() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "imu_acc_ignore_rate",
|
|
|
|
key: "imu_acc_ignore_rate",
|
|
|
|
value: 10
|
|
|
|
value: 9
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "imu_acc_ignore_slope",
|
|
|
|
|
|
|
|
value: 5
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "airmode_type",
|
|
|
|
key: "airmode_type",
|
|
|
@ -346,7 +350,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
value: 1500
|
|
|
|
value: 1500
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
"features":[
|
|
|
|
"features": [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bit: 4, // Enable MOTOR_STOP
|
|
|
|
bit: 4, // Enable MOTOR_STOP
|
|
|
|
state: true
|
|
|
|
state: true
|
|
|
@ -377,7 +381,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "dterm_lpf_hz",
|
|
|
|
key: "dterm_lpf_hz",
|
|
|
|
value: 40
|
|
|
|
value: 10
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "d_boost_factor",
|
|
|
|
key: "d_boost_factor",
|
|
|
@ -437,7 +441,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "nav_fw_pos_xy_p",
|
|
|
|
key: "nav_fw_pos_xy_p",
|
|
|
|
value: 50
|
|
|
|
value: 60
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "fw_turn_assist_pitch_gain",
|
|
|
|
key: "fw_turn_assist_pitch_gain",
|
|
|
@ -476,21 +480,13 @@ helper.defaultsDialog = (function() {
|
|
|
|
value: 35
|
|
|
|
value: 35
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "fw_p_yaw",
|
|
|
|
key: "imu_acc_ignore_rate",
|
|
|
|
value: 20
|
|
|
|
value: 9
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "fw_i_yaw",
|
|
|
|
key: "imu_acc_ignore_slope",
|
|
|
|
value: 5
|
|
|
|
value: 5
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "fw_ff_yaw",
|
|
|
|
|
|
|
|
value: 100
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "imu_acc_ignore_rate",
|
|
|
|
|
|
|
|
value: 10
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "airmode_type",
|
|
|
|
key: "airmode_type",
|
|
|
|
value: "STICK_CENTER_ONCE"
|
|
|
|
value: "STICK_CENTER_ONCE"
|
|
|
@ -520,7 +516,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
value: 1500
|
|
|
|
value: 1500
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
"features":[
|
|
|
|
"features": [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bit: 4, // Enable MOTOR_STOP
|
|
|
|
bit: 4, // Enable MOTOR_STOP
|
|
|
|
state: true
|
|
|
|
state: true
|
|
|
@ -618,7 +614,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
publicScope.init = function() {
|
|
|
|
publicScope.init = function () {
|
|
|
|
mspHelper.getSetting("applied_defaults").then(privateScope.onInitSettingReturned);
|
|
|
|
mspHelper.getSetting("applied_defaults").then(privateScope.onInitSettingReturned);
|
|
|
|
$container = $("#defaults-wrapper");
|
|
|
|
$container = $("#defaults-wrapper");
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -658,7 +654,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
GUI.log(chrome.i18n.getMessage('configurationEepromSaved'));
|
|
|
|
GUI.log(chrome.i18n.getMessage('configurationEepromSaved'));
|
|
|
|
|
|
|
|
|
|
|
|
if (selectedDefaultPreset.reboot) {
|
|
|
|
if (selectedDefaultPreset.reboot) {
|
|
|
|
GUI.tab_switch_cleanup(function() {
|
|
|
|
GUI.tab_switch_cleanup(function () {
|
|
|
|
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, function () {
|
|
|
|
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, function () {
|
|
|
|
//noinspection JSUnresolvedVariable
|
|
|
|
//noinspection JSUnresolvedVariable
|
|
|
|
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
|
|
|
|
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
|
|
|
@ -671,7 +667,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
privateScope.onPresetClick = function(event) {
|
|
|
|
privateScope.onPresetClick = function (event) {
|
|
|
|
$container.hide();
|
|
|
|
$container.hide();
|
|
|
|
let selectedDefaultPreset = data[$(event.currentTarget).data("index")];
|
|
|
|
let selectedDefaultPreset = data[$(event.currentTarget).data("index")];
|
|
|
|
if (selectedDefaultPreset && selectedDefaultPreset.settings) {
|
|
|
|
if (selectedDefaultPreset && selectedDefaultPreset.settings) {
|
|
|
@ -682,7 +678,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
privateScope.render = function() {
|
|
|
|
privateScope.render = function () {
|
|
|
|
let $place = $container.find('.defaults-dialog__options');
|
|
|
|
let $place = $container.find('.defaults-dialog__options');
|
|
|
|
$place.html("");
|
|
|
|
$place.html("");
|
|
|
|
for (let i in data) {
|
|
|
|
for (let i in data) {
|
|
|
@ -703,7 +699,7 @@ helper.defaultsDialog = (function() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
privateScope.onInitSettingReturned = function(promise) {
|
|
|
|
privateScope.onInitSettingReturned = function (promise) {
|
|
|
|
if (promise.value > 0) {
|
|
|
|
if (promise.value > 0) {
|
|
|
|
return; //Defaults were applied, we can just ignore
|
|
|
|
return; //Defaults were applied, we can just ignore
|
|
|
|
}
|
|
|
|
}
|
|
|
|