1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 16:25:22 +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:
Mark Haslinghuis 2025-02-16 01:15:51 +01:00 committed by GitHub
parent 3864cbbcfd
commit 57bc463ffe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 27 additions and 26 deletions

View file

@ -1285,7 +1285,8 @@
"message": "GPS for navigation and telemetry"
},
"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": {
"message": "Sonar"

View file

@ -88,6 +88,9 @@
width: 38px;
}
}
table {
width: fit-content;
}
}
dl.features {
dt {

View file

@ -14,7 +14,7 @@ const Features = function (config) {
{ bit: 4, group: "escMotorStop", name: "MOTOR_STOP", haveTip: true },
{ bit: 5, group: "other", name: "SERVO_TILT", haveTip: true, dependsOn: "SERVOS" },
{ 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: 10, group: "telemetry", name: "TELEMETRY", haveTip: true, dependsOn: "TELEMETRY" },
{ bit: 12, group: "3D", name: "3D", haveTip: true },

View file

@ -21,7 +21,18 @@ const VirtualFC = {
virtualFC.CONFIG.cpuTemp = 48;
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.pilotName = "BF pilot";

View file

@ -397,23 +397,11 @@ configuration.initialize = function (callback) {
// UI hooks
function checkUpdateGpsControls() {
if (FC.FEATURE_CONFIG.features.isEnabled("GPS")) {
$(".gpsSettings").show();
} else {
$(".gpsSettings").hide();
}
}
$("input.feature", features_e).change(function () {
const element = $(this);
FC.FEATURE_CONFIG.features.updateData(element);
updateTabList(FC.FEATURE_CONFIG.features);
if (element.attr("name") === "GPS") {
checkUpdateGpsControls();
}
});
$('input[id="accHardwareSwitch"]')
@ -437,8 +425,6 @@ configuration.initialize = function (callback) {
FC.BEEPER_CONFIG.beepers.updateData(element);
});
checkUpdateGpsControls();
$("a.save").on("click", function () {
// gather data that doesn't have automatic change event bound
FC.BOARD_ALIGNMENT_CONFIG.roll = parseInt($('input[name="board_align_roll"]').val());

View file

@ -80,21 +80,13 @@ gps.initialize = async function (callback) {
FC.FEATURE_CONFIG.features.generateElements(features_e);
const checkUpdateGpsControls = () => $(".gpsSettings").toggle(FC.FEATURE_CONFIG.features.isEnabled("GPS"));
$("input.feature", features_e).on("change", function () {
const element = $(this);
FC.FEATURE_CONFIG.features.updateData(element);
updateTabList(FC.FEATURE_CONFIG.features);
if (element.attr("name") === "GPS") {
checkUpdateGpsControls();
}
});
checkUpdateGpsControls();
// generate GPS
const gpsProtocols = sensorTypes().gps.elements;

View file

@ -12,7 +12,7 @@ export function updateTabList(features) {
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_transponder").toggle(features.isEnabled("TRANSPONDER"));
$("#tabs ul.mode-connected li.tab_osd").toggle(features.isEnabled("OSD"));

View file

@ -15,6 +15,14 @@
<div class="spacer_box">
<div class="gps_config">
<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">
<select class="gps_protocol">
<!-- list generated here -->