Skip to content

Commit 4204281

Browse files
authored
GPS updates (#3527)
* Remove auto_baud * Change debug to GPS_CONNECTION * Adjust signal strength scale
1 parent 26e78ed commit 4204281

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

src/css/tabs/gps.less

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
background-color: #ececec;
2424
}
2525
}
26-
progress {
26+
meter {
2727
width: 100%;
2828
border-radius: 3px;
2929
}
@@ -199,14 +199,14 @@
199199
float: left;
200200
}
201201
}
202-
progress[value] {
203-
&::-webkit-progress-bar {
202+
meter[value] {
203+
&::-webkit-meter-bar {
204204
background-color: #d2d2d2;
205205
border-radius: 2px;
206206
box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.95);
207207
box-shadow: 0 0 3px rgba(0, 0, 0, 0.25) inset;
208208
}
209-
&::-webkit-progress-value {
209+
&::-webkit-meter-value {
210210
background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, .15), rgba(0, 0, 0, .15)), -webkit-linear-gradient(left, #ffbb00, #ffbb00);
211211
border-radius: 2px;
212212
box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.25) inset;

src/js/tabs/gps.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { i18n } from "../localization";
22
import semver from 'semver';
3-
import { API_VERSION_1_43 } from '../data_storage';
3+
import { API_VERSION_1_43, API_VERSION_1_46 } from '../data_storage';
44
import GUI, { TABS } from '../gui';
55
import FC from '../fc';
66
import MSP from "../msp";
@@ -132,7 +132,10 @@ gps.initialize = async function (callback) {
132132

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

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

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

149-
gpsAutoBaudGroup.toggle(ubloxSelected || mspSelected);
152+
gpsAutoBaudGroup.toggle((ubloxSelected || mspSelected) && semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_46));
150153
gpsAutoConfigGroup.toggle(ubloxSelected || mspSelected);
151154

152155
}).prop('checked', FC.GPS_CONFIG.auto_config === 1).trigger('change');
@@ -221,7 +224,7 @@ gps.initialize = async function (callback) {
221224
<tr>
222225
<td>-</td>
223226
<td>${FC.GPS_DATA.svid[i]}</td>
224-
<td><progress value="${FC.GPS_DATA.cno[i]}" max="99"></progress></td>
227+
<td><meter value="${FC.GPS_DATA.cno[i]}" max="55"></meter></td>
225228
<td>${FC.GPS_DATA.quality[i]}</td>
226229
</tr>
227230
`);
@@ -232,7 +235,7 @@ gps.initialize = async function (callback) {
232235
<tr>
233236
<td>-</td>
234237
<td>-</td>
235-
<td><progress value="0" max="99"></progress></td>
238+
<td><meter value="0" max="55"></meter></td>
236239
<td> </td>
237240
</tr>
238241
`);
@@ -253,11 +256,11 @@ gps.initialize = async function (callback) {
253256

254257
if (FC.GPS_DATA.chn[i] >= 7) {
255258
rowContent += '<td>-</td>';
256-
rowContent += `<td><progress value="${0}" max="99"></progress></td>`;
259+
rowContent += `<td><meter value="${0}" max="55"></meter></td>`;
257260
rowContent += `<td> </td>`;
258261
} else {
259262
rowContent += `<td>${FC.GPS_DATA.svid[i]}</td>`;
260-
rowContent += `<td><progress value="${FC.GPS_DATA.cno[i]}" max="99"></progress></td>`;
263+
rowContent += `<td><meter value="${FC.GPS_DATA.cno[i]}" max="55"></meter></td>`;
261264

262265
let quality = i18n.getMessage(qualityArray[FC.GPS_DATA.quality[i] & 0x7]);
263266
let used = i18n.getMessage(usedArray[(FC.GPS_DATA.quality[i] & 0x8) >> 3]);

src/js/tabs/onboard_logging.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ onboard_logging.initialize = function (callback) {
320320
{text: "GPS_RESCUE_VELOCITY"},
321321
{text: "GPS_RESCUE_HEADING"},
322322
{text: "GPS_RESCUE_TRACKING"},
323-
{text: "GPS_UNIT_CONNECTION"},
323+
{text: "GPS_CONNECTION"},
324324
{text: "ATTITUDE"},
325325
{text: "VTX_MSP"},
326326
{text: "GPS_DOP"},

0 commit comments

Comments
 (0)