Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPS updates #3527

Merged
merged 3 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/css/tabs/gps.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
background-color: #ececec;
}
}
progress {
meter {
width: 100%;
border-radius: 3px;
}
Expand Down Expand Up @@ -199,14 +199,14 @@
float: left;
}
}
progress[value] {
&::-webkit-progress-bar {
meter[value] {
&::-webkit-meter-bar {
background-color: #d2d2d2;
border-radius: 2px;
box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.95);
box-shadow: 0 0 3px rgba(0, 0, 0, 0.25) inset;
}
&::-webkit-progress-value {
&::-webkit-meter-value {
background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, .15), rgba(0, 0, 0, .15)), -webkit-linear-gradient(left, #ffbb00, #ffbb00);
border-radius: 2px;
box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.25) inset;
Expand Down
17 changes: 10 additions & 7 deletions src/js/tabs/gps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { i18n } from "../localization";
import semver from 'semver';
import { API_VERSION_1_43 } from '../data_storage';
import { API_VERSION_1_43, API_VERSION_1_46 } from '../data_storage';
import GUI, { TABS } from '../gui';
import FC from '../fc';
import MSP from "../msp";
Expand Down Expand Up @@ -132,7 +132,10 @@ gps.initialize = async function (callback) {

}).val(FC.GPS_CONFIG.provider).change();

gpsAutoBaudElement.prop('checked', FC.GPS_CONFIG.auto_baud === 1);
// auto_baud is no longer used in API 1.46
if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_46)) {
gpsAutoBaudElement.prop('checked', FC.GPS_CONFIG.auto_baud === 1);
}

gpsAutoConfigElement.on('change', function () {
const checked = $(this).is(":checked");
Expand All @@ -146,7 +149,7 @@ gps.initialize = async function (callback) {
const enableSbasVisible = checked && ubloxSelected;
gpsUbloxSbasGroup.toggle(enableSbasVisible);

gpsAutoBaudGroup.toggle(ubloxSelected || mspSelected);
gpsAutoBaudGroup.toggle((ubloxSelected || mspSelected) && semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_46));
gpsAutoConfigGroup.toggle(ubloxSelected || mspSelected);

}).prop('checked', FC.GPS_CONFIG.auto_config === 1).trigger('change');
Expand Down Expand Up @@ -221,7 +224,7 @@ gps.initialize = async function (callback) {
<tr>
<td>-</td>
<td>${FC.GPS_DATA.svid[i]}</td>
<td><progress value="${FC.GPS_DATA.cno[i]}" max="99"></progress></td>
<td><meter value="${FC.GPS_DATA.cno[i]}" max="55"></meter></td>
<td>${FC.GPS_DATA.quality[i]}</td>
</tr>
`);
Expand All @@ -232,7 +235,7 @@ gps.initialize = async function (callback) {
<tr>
<td>-</td>
<td>-</td>
<td><progress value="0" max="99"></progress></td>
<td><meter value="0" max="55"></meter></td>
<td> </td>
</tr>
`);
Expand All @@ -253,11 +256,11 @@ gps.initialize = async function (callback) {

if (FC.GPS_DATA.chn[i] >= 7) {
rowContent += '<td>-</td>';
rowContent += `<td><progress value="${0}" max="99"></progress></td>`;
rowContent += `<td><meter value="${0}" max="55"></meter></td>`;
rowContent += `<td> </td>`;
} else {
rowContent += `<td>${FC.GPS_DATA.svid[i]}</td>`;
rowContent += `<td><progress value="${FC.GPS_DATA.cno[i]}" max="99"></progress></td>`;
rowContent += `<td><meter value="${FC.GPS_DATA.cno[i]}" max="55"></meter></td>`;

let quality = i18n.getMessage(qualityArray[FC.GPS_DATA.quality[i] & 0x7]);
let used = i18n.getMessage(usedArray[(FC.GPS_DATA.quality[i] & 0x8) >> 3]);
Expand Down
2 changes: 1 addition & 1 deletion src/js/tabs/onboard_logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ onboard_logging.initialize = function (callback) {
{text: "GPS_RESCUE_VELOCITY"},
{text: "GPS_RESCUE_HEADING"},
{text: "GPS_RESCUE_TRACKING"},
{text: "GPS_UNIT_CONNECTION"},
{text: "GPS_CONNECTION"},
{text: "ATTITUDE"},
{text: "VTX_MSP"},
{text: "GPS_DOP"},
Expand Down