mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-25 17:25:16 +03:00
Improve configuration for MSP GNSS (#4344)
* Improve configuration for MSP GNSS * Move gps feature to gps tab * Add virtualFC build options * GPS for everyone * Add more virtual options * Add tooltip manually * Update tooltip
This commit is contained in:
parent
3864cbbcfd
commit
57bc463ffe
8 changed files with 27 additions and 26 deletions
|
@ -1285,7 +1285,8 @@
|
||||||
"message": "GPS for navigation and telemetry"
|
"message": "GPS for navigation and telemetry"
|
||||||
},
|
},
|
||||||
"featureGPSTip": {
|
"featureGPSTip": {
|
||||||
"message": "Configure port scenario first"
|
"message": "Enable / Disable GPS data. If GPS cannot be enabled, check that a Port is assigned to GPS in the Ports Tab",
|
||||||
|
"description": "Message that pops up to describe the GPS feature"
|
||||||
},
|
},
|
||||||
"featureSONAR": {
|
"featureSONAR": {
|
||||||
"message": "Sonar"
|
"message": "Sonar"
|
||||||
|
|
|
@ -88,6 +88,9 @@
|
||||||
width: 38px;
|
width: 38px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
table {
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dl.features {
|
dl.features {
|
||||||
dt {
|
dt {
|
||||||
|
|
|
@ -14,7 +14,7 @@ const Features = function (config) {
|
||||||
{ bit: 4, group: "escMotorStop", name: "MOTOR_STOP", haveTip: true },
|
{ bit: 4, group: "escMotorStop", name: "MOTOR_STOP", haveTip: true },
|
||||||
{ bit: 5, group: "other", name: "SERVO_TILT", haveTip: true, dependsOn: "SERVOS" },
|
{ bit: 5, group: "other", name: "SERVO_TILT", haveTip: true, dependsOn: "SERVOS" },
|
||||||
{ bit: 6, group: "other", name: "SOFTSERIAL", haveTip: true },
|
{ bit: 6, group: "other", name: "SOFTSERIAL", haveTip: true },
|
||||||
{ bit: 7, group: "other", name: "GPS", haveTip: true, dependsOn: "GPS" },
|
{ bit: 7, group: "gps", name: "GPS", dependsOn: "GPS" },
|
||||||
{ bit: 9, group: "other", name: "SONAR", haveTip: true, dependsOn: "RANGEFINDER" },
|
{ bit: 9, group: "other", name: "SONAR", haveTip: true, dependsOn: "RANGEFINDER" },
|
||||||
{ bit: 10, group: "telemetry", name: "TELEMETRY", haveTip: true, dependsOn: "TELEMETRY" },
|
{ bit: 10, group: "telemetry", name: "TELEMETRY", haveTip: true, dependsOn: "TELEMETRY" },
|
||||||
{ bit: 12, group: "3D", name: "3D", haveTip: true },
|
{ bit: 12, group: "3D", name: "3D", haveTip: true },
|
||||||
|
|
|
@ -21,7 +21,18 @@ const VirtualFC = {
|
||||||
virtualFC.CONFIG.cpuTemp = 48;
|
virtualFC.CONFIG.cpuTemp = 48;
|
||||||
|
|
||||||
virtualFC.CONFIG.buildInfo = "now";
|
virtualFC.CONFIG.buildInfo = "now";
|
||||||
virtualFC.CONFIG.buildOptions = [];
|
virtualFC.CONFIG.buildOptions = [
|
||||||
|
"USE_ESC_SENSOR",
|
||||||
|
"USE_DASHBOARD",
|
||||||
|
"USE_GPS",
|
||||||
|
"USE_LED_STRIP",
|
||||||
|
"USE_OSD",
|
||||||
|
"USE_SOFTSERIAL",
|
||||||
|
"USE_SONAR",
|
||||||
|
"USE_TELEMETRY",
|
||||||
|
"USE_SERVOS",
|
||||||
|
"USE_TRANSPONDER",
|
||||||
|
];
|
||||||
|
|
||||||
virtualFC.CONFIG.craftName = "BetaFlight";
|
virtualFC.CONFIG.craftName = "BetaFlight";
|
||||||
virtualFC.CONFIG.pilotName = "BF pilot";
|
virtualFC.CONFIG.pilotName = "BF pilot";
|
||||||
|
|
|
@ -397,23 +397,11 @@ configuration.initialize = function (callback) {
|
||||||
|
|
||||||
// UI hooks
|
// UI hooks
|
||||||
|
|
||||||
function checkUpdateGpsControls() {
|
|
||||||
if (FC.FEATURE_CONFIG.features.isEnabled("GPS")) {
|
|
||||||
$(".gpsSettings").show();
|
|
||||||
} else {
|
|
||||||
$(".gpsSettings").hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$("input.feature", features_e).change(function () {
|
$("input.feature", features_e).change(function () {
|
||||||
const element = $(this);
|
const element = $(this);
|
||||||
|
|
||||||
FC.FEATURE_CONFIG.features.updateData(element);
|
FC.FEATURE_CONFIG.features.updateData(element);
|
||||||
updateTabList(FC.FEATURE_CONFIG.features);
|
updateTabList(FC.FEATURE_CONFIG.features);
|
||||||
|
|
||||||
if (element.attr("name") === "GPS") {
|
|
||||||
checkUpdateGpsControls();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input[id="accHardwareSwitch"]')
|
$('input[id="accHardwareSwitch"]')
|
||||||
|
@ -437,8 +425,6 @@ configuration.initialize = function (callback) {
|
||||||
FC.BEEPER_CONFIG.beepers.updateData(element);
|
FC.BEEPER_CONFIG.beepers.updateData(element);
|
||||||
});
|
});
|
||||||
|
|
||||||
checkUpdateGpsControls();
|
|
||||||
|
|
||||||
$("a.save").on("click", function () {
|
$("a.save").on("click", function () {
|
||||||
// gather data that doesn't have automatic change event bound
|
// gather data that doesn't have automatic change event bound
|
||||||
FC.BOARD_ALIGNMENT_CONFIG.roll = parseInt($('input[name="board_align_roll"]').val());
|
FC.BOARD_ALIGNMENT_CONFIG.roll = parseInt($('input[name="board_align_roll"]').val());
|
||||||
|
|
|
@ -80,21 +80,13 @@ gps.initialize = async function (callback) {
|
||||||
|
|
||||||
FC.FEATURE_CONFIG.features.generateElements(features_e);
|
FC.FEATURE_CONFIG.features.generateElements(features_e);
|
||||||
|
|
||||||
const checkUpdateGpsControls = () => $(".gpsSettings").toggle(FC.FEATURE_CONFIG.features.isEnabled("GPS"));
|
|
||||||
|
|
||||||
$("input.feature", features_e).on("change", function () {
|
$("input.feature", features_e).on("change", function () {
|
||||||
const element = $(this);
|
const element = $(this);
|
||||||
|
|
||||||
FC.FEATURE_CONFIG.features.updateData(element);
|
FC.FEATURE_CONFIG.features.updateData(element);
|
||||||
updateTabList(FC.FEATURE_CONFIG.features);
|
updateTabList(FC.FEATURE_CONFIG.features);
|
||||||
|
|
||||||
if (element.attr("name") === "GPS") {
|
|
||||||
checkUpdateGpsControls();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
checkUpdateGpsControls();
|
|
||||||
|
|
||||||
// generate GPS
|
// generate GPS
|
||||||
const gpsProtocols = sensorTypes().gps.elements;
|
const gpsProtocols = sensorTypes().gps.elements;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ export function updateTabList(features) {
|
||||||
isExpertModeEnabled && FC.CONFIG?.buildOptions?.includes("USE_SERVOS"),
|
isExpertModeEnabled && FC.CONFIG?.buildOptions?.includes("USE_SERVOS"),
|
||||||
);
|
);
|
||||||
|
|
||||||
$("#tabs ul.mode-connected li.tab_gps").toggle(features.isEnabled("GPS"));
|
$("#tabs ul.mode-connected li.tab_gps").toggle(FC.CONFIG?.buildOptions?.includes("USE_GPS"));
|
||||||
$("#tabs ul.mode-connected li.tab_led_strip").toggle(features.isEnabled("LED_STRIP"));
|
$("#tabs ul.mode-connected li.tab_led_strip").toggle(features.isEnabled("LED_STRIP"));
|
||||||
$("#tabs ul.mode-connected li.tab_transponder").toggle(features.isEnabled("TRANSPONDER"));
|
$("#tabs ul.mode-connected li.tab_transponder").toggle(features.isEnabled("TRANSPONDER"));
|
||||||
$("#tabs ul.mode-connected li.tab_osd").toggle(features.isEnabled("OSD"));
|
$("#tabs ul.mode-connected li.tab_osd").toggle(features.isEnabled("OSD"));
|
||||||
|
|
|
@ -15,6 +15,14 @@
|
||||||
<div class="spacer_box">
|
<div class="spacer_box">
|
||||||
<div class="gps_config">
|
<div class="gps_config">
|
||||||
<div>
|
<div>
|
||||||
|
<div class="select line">
|
||||||
|
<table>
|
||||||
|
<tbody class="features gps">
|
||||||
|
<!-- table generated here -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="helpicon cf_tip" i18n_title="featureGPSTip"></div>
|
||||||
|
</div>
|
||||||
<div class="select line">
|
<div class="select line">
|
||||||
<select class="gps_protocol">
|
<select class="gps_protocol">
|
||||||
<!-- list generated here -->
|
<!-- list generated here -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue