Skip to content

Commit 80a81b6

Browse files
committed
Throw error if PP service is selected that requires WiFi, but no WiFi networks
1 parent 0db1b14 commit 80a81b6

File tree

2 files changed

+39
-36
lines changed

2 files changed

+39
-36
lines changed

Firmware/RTK_Everywhere/AP-Config/index.html

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,27 +1197,27 @@
11971197
<select name="pointPerfectService" id="pointPerfectService" class="form-dropdown mb-2">
11981198
</select>
11991199
<span class="tt" data-bs-placement="right"
1200-
title="Select the PointPerfect service the device has been registered to. Default: Disabled">
1200+
title="The device will attempt to use PointPerfect for corrections. The device must be registered through SparkFun. NTRIP/RTCM service requires WiFi. Default: Disabled">
12011201
<span class="icon-info-circle text-primary ms-2"></span>
12021202
</span>
1203-
<br>
1203+
<p id="pointPerfectServiceError" class="inlineError"></p>
12041204
</div>
12051205

1206-
<div id="ppSettingsRtcmConfig">
1206+
<div id="ppSettingsLBandNAConfig">
1207+
<div>
1208+
Days until keys expire: <p id="daysRemaining" style="display:inline;">No Keys</p>
1209+
</div>
1210+
12071211
<div class="form-check mt-3">
1208-
<label class="form-check-label" for="requestKeyUpdate">Request Key Update </label>
1212+
<label class="form-check-label" for="requestKeyUpdate"
1213+
id="pointPerfectKeyUpdateLabel">Request Key Update</label>
12091214
<input class="form-check-input" type="checkbox" value="" id="requestKeyUpdate">
12101215
<span class="tt" data-bs-placement="right"
12111216
title="When checked, the PointPerfect keys will be requested and updated at the next opportunity. Default: Disabled">
12121217
<span class="icon-info-circle text-primary ms-2"></span>
12131218
</span>
12141219
</div>
1215-
</div>
12161220

1217-
<div id="ppSettingsLBandNAConfig">
1218-
<div>
1219-
Days until keys expire: <p id="daysRemaining" style="display:inline;">No Keys</p>
1220-
</div>
12211221
<div id="geographicRegionDropdown">
12221222
<label for="geographicRegion">Geographic Region:</label>
12231223
<select name="geographicRegion" id="geographicRegion" class="form-dropdown mb-2">
@@ -1257,15 +1257,6 @@
12571257
</div>
12581258
</div>
12591259

1260-
<div class="form-check mt-3">
1261-
<label class="form-check-label" for="requestKeyUpdate">Request Key Update </label>
1262-
<input class="form-check-input" type="checkbox" value="" id="requestKeyUpdate">
1263-
<span class="tt" data-bs-placement="right"
1264-
title="When checked, the PointPerfect keys will be requested and updated at the next opportunity. Default: Disabled">
1265-
<span class="icon-info-circle text-primary ms-2"></span>
1266-
</span>
1267-
</div>
1268-
12691260
<div id="useAssistNowCheckbox">
12701261
<div class="form-check mt-3">
12711262
<label class="form-check-label" for="useAssistNow">AssistNow </label>

Firmware/RTK_Everywhere/AP-Config/src/main.js

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,7 @@ function parseIncoming(msg) {
501501
correctionsSourcePriorities.push(correctionPriority);
502502
}
503503
else {
504-
console.log("Too many corrections sources");
505-
console.log(correctionsSourceNames.length);
504+
console.log("Too many corrections sources: ", correctionsSourceNames.length);
506505
}
507506
}
508507
else if (id.includes("checkingNewFirmware")) {
@@ -922,15 +921,7 @@ function validateFields() {
922921
// }
923922

924923
//PointPerfect Config
925-
if (ge("pointPerfectService").value > 0) {
926-
value = ge("pointPerfectDeviceProfileToken").value;
927-
if (value.length > 0)
928-
checkElementString("pointPerfectDeviceProfileToken", 36, 36, "Must be 36 characters", "collapsePPConfig");
929-
}
930-
else {
931-
clearElement("pointPerfectDeviceProfileToken", "");
932-
ge("autoKeyRenewal").checked = true;
933-
}
924+
checkPointPerfectService();
934925

935926
//Port Config
936927
if (ge("enableExternalPulse").checked == true) {
@@ -1091,8 +1082,8 @@ function saveConfig() {
10911082
clearSuccess('saveBtn');
10921083
}
10931084
else {
1094-
sendData();
10951085
clearError('saveBtn');
1086+
sendData();
10961087
showSuccess('saveBtn', "Saving...");
10971088
}
10981089

@@ -1111,6 +1102,30 @@ function checkConstellations() {
11111102
clearError("gnssConstellations");
11121103
}
11131104

1105+
function checkPointPerfectService() {
1106+
if (ge("pointPerfectService").value > 0) {
1107+
value = ge("pointPerfectDeviceProfileToken").value;
1108+
if (value.length > 0)
1109+
checkElementString("pointPerfectDeviceProfileToken", 36, 36, "Must be 36 characters", "collapsePPConfig");
1110+
1111+
if (networkCount() == 0) {
1112+
showError('pointPerfectService', "This PointPerfect service requires at least one WiFi network");
1113+
ge("collapsePPConfig").classList.add('show');
1114+
ge("collapseWiFiConfig").classList.add('show');
1115+
errorCount++;
1116+
}
1117+
else {
1118+
clearError("pointPerfectService");
1119+
}
1120+
1121+
}
1122+
else {
1123+
clearElement("pointPerfectDeviceProfileToken", "");
1124+
ge("autoKeyRenewal").checked = true;
1125+
clearError("pointPerfectService");
1126+
}
1127+
}
1128+
11141129
function checkBitMapValue(id, min, max, bitMap, errorText, collapseID) {
11151130
value = ge(id).value;
11161131
mask = ge(bitMap).value;
@@ -1682,16 +1697,13 @@ document.addEventListener("DOMContentLoaded", (event) => {
16821697
});
16831698

16841699
ge("pointPerfectService").addEventListener("change", function () {
1685-
if (ge("pointPerfectService").value == 1) {
1700+
if (ge("pointPerfectService").value == 1) { //Flex RTCM
16861701
hide("ppSettingsLBandNAConfig");
1687-
show("ppSettingsRtcmConfig");
16881702
}
1689-
else if (ge("pointPerfectService").value == 2) {
1690-
hide("ppSettingsRtcmConfig");
1703+
else if (ge("pointPerfectService").value == 2) { //Flex L-Band NA
16911704
show("ppSettingsLBandNAConfig");
16921705
}
1693-
else { //"pointPerfectService").value == 0
1694-
hide("ppSettingsRtcmConfig");
1706+
else { //"pointPerfectService").value == 0 //Disabled
16951707
hide("ppSettingsLBandNAConfig");
16961708
}
16971709
});

0 commit comments

Comments
 (0)