1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-17 13:25:24 +03:00

Add Galileo and Home Point once to GPS

This commit is contained in:
Miguel Angel Mulero Martinez 2019-11-06 19:25:56 +01:00
parent e69c904730
commit ce044622a2
6 changed files with 69 additions and 7 deletions

View file

@ -1378,6 +1378,22 @@
"configurationGPSAutoConfig": {
"message": "Auto Config"
},
"configurationGPSGalileo": {
"message": "Use Galileo",
"description": "Option to use Galileo in the GPS configuration"
},
"configurationGPSGalileoHelp": {
"message": "When enabled, this removes the QZSS system (Japanese) and replaces it for the Galileo system (European).",
"description": "Help text for the option to use Galileo in the GPS configuration"
},
"configurationGPSHomeOnce": {
"message": "Set Home Point Once",
"description": "Option to set the Home Point with the first arm only, not with each arm in the GPS Configuration"
},
"configurationGPSHomeOnceHelp": {
"message": "When enabled, only the first arm after the battery is connected will be used as home point. If not enabled, every time the quad is armed, the home point will be updated.",
"description": "Help text for the option to set the Home Point with the first arm only, not with each arm in the GPS Configuration"
},
"configurationGPSHelp": {
"message": "<strong>Note:</strong> Remember to configure a Serial Port (via Ports tab) when using GPS feature."
},

View file

@ -109,6 +109,13 @@
border: 1px solid var(--subtleAccent);
}
.tab-configuration .gps .select > div:first-child {
float: left;
height: 20px;
margin-right: 15px;
margin-left: 3px;
}
.tab-configuration .gps span {
line-height: 20px;
}

View file

@ -301,6 +301,8 @@ var FC = {
ublox_sbas: 0,
auto_config: 0,
auto_baud: 0,
home_point_once: false,
ublox_use_galileo: false,
};
COMPASS_CONFIG = {

View file

@ -423,6 +423,11 @@ MspHelper.prototype.process_data = function(dataHandler) {
if (semver.gte(CONFIG.apiVersion, "1.34.0")) {
GPS_CONFIG.auto_config = data.readU8();
GPS_CONFIG.auto_baud = data.readU8();
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
GPS_CONFIG.home_point_once = data.readU8() !== 0;
GPS_CONFIG.ublox_use_galileo = data.readU8() !== 0;
}
}
break;
case MSPCodes.MSP_GPS_RESCUE:
@ -1693,6 +1698,11 @@ MspHelper.prototype.crunch = function(code) {
if (semver.gte(CONFIG.apiVersion, "1.34.0")) {
buffer.push8(GPS_CONFIG.auto_config)
.push8(GPS_CONFIG.auto_baud);
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
buffer.push8(GPS_CONFIG.home_point_once ? 1 : 0)
.push8(GPS_CONFIG.ublox_use_galileo ? 1 : 0);
}
}
break;
case MSPCodes.MSP_SET_GPS_RESCUE:

View file

@ -709,11 +709,24 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
gps_protocol_e.append('<option value="' + i + '">' + gpsProtocols[i] + '</option>');
}
const gps_ublox_galileo_e = $('.gps_ublox_galileo');
gps_protocol_e.change(function () {
GPS_CONFIG.provider = parseInt($(this).val());
});
gps_protocol_e.val(GPS_CONFIG.provider);
const enableGalileoVisible = semver.gte(CONFIG.apiVersion, "1.43.0") && GPS_CONFIG.provider === gpsProtocols.indexOf('UBLOX');
gps_ublox_galileo_e.toggle(enableGalileoVisible);
});
gps_protocol_e.val(GPS_CONFIG.provider).change();
$('input[name="gps_ublox_galileo"]').change(function() {
GPS_CONFIG.ublox_use_galileo = $(this).is(':checked');
}).prop('checked', GPS_CONFIG.ublox_use_galileo).change();
$('.gps_home_once').toggle(semver.gte(CONFIG.apiVersion, "1.43.0"));
$('input[name="gps_home_once"]').change(function() {
GPS_CONFIG.home_point_once = $(this).is(':checked');
}).prop('checked', GPS_CONFIG.home_point_once).change();
$('input[name="gps_auto_baud"]').prop('checked', GPS_CONFIG.auto_baud == 1);
$('input[name="gps_auto_config"]').prop('checked', GPS_CONFIG.auto_config == 1);

View file

@ -535,31 +535,45 @@
<p i18n="configurationGPSHelp"></p>
</div>
<div class="line">
<div class="select line">
<select class="gps_protocol">
<!-- list generated here -->
</select>
<span i18n="configurationGPSProtocol"></span>
</div>
<div class="line">
<div class="select line">
<select class="gps_baudrate">
<!-- list generated here -->
</select>
<span i18n="configurationGPSBaudrate"></span>
</div>
<div class="select gps_auto_baud">
<div style="float: left; height: 20px; margin-right: 15px; margin-left: 3px;">
<div>
<input type="checkbox" name="gps_auto_baud" class="toggle" />
</div>
<span class="freelabel" i18n="configurationGPSAutoBaud"></span>
</div>
<div class="select gps_auto_config">
<div style="float: left; height: 20px; margin-right: 15px; margin-left: 3px;">
<div>
<input type="checkbox" name="gps_auto_config" class="toggle" />
</div>
<span class="freelabel" i18n="configurationGPSAutoConfig"></span>
</div>
<div class="line">
<div class="select gps_ublox_galileo">
<div>
<input type="checkbox" name="gps_ublox_galileo" class="toggle" />
</div>
<span class="freelabel" i18n="configurationGPSGalileo" />
<div class="helpicon cf_tip" i18n_title="configurationGPSGalileoHelp"></div>
</div>
<div class="select gps_home_once">
<div>
<input type="checkbox" name="gps_home_once" class="toggle" />
</div>
<span class="freelabel" i18n="configurationGPSHomeOnce" />
<div class="helpicon cf_tip" i18n_title="configurationGPSHomeOnceHelp"></div>
</div>
<div class="select line">
<select class="gps_ubx_sbas">
<!-- list generated here -->
</select>