Skip to content

Commit 1675bb4

Browse files
committed
Fix for #771
1 parent 7aa3b4e commit 1675bb4

File tree

2 files changed

+812
-789
lines changed

2 files changed

+812
-789
lines changed

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

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,25 +1368,41 @@ function loadGeodetic() {
13681368
var val = ge("StationCoordinatesGeodetic").value;
13691369
if (val > "") {
13701370
var parts = recordsGeodetic[val].split(' ');
1371-
ge("nicknameGeodetic").value = parts[0];
1372-
ge("fixedLatText").value = parts[1];
1373-
ge("fixedLongText").value = parts[2];
1374-
ge("antennaHeight").value = parts[4];
1375-
ge("antennaReferencePoint").value = parts[5];
1371+
var numParts = parts.length;
1372+
if (numParts >= 6) {
1373+
var latParts = (numParts - 4) / 2;
1374+
ge("nicknameGeodetic").value = parts[0];
1375+
ge("fixedLatText").value = parts[1];
1376+
if (latParts > 1) {
1377+
for (let moreParts = 1; moreParts < latParts; moreParts++) {
1378+
ge("fixedLatText").value += ' ' + parts[moreParts + 1];
1379+
}
1380+
}
1381+
ge("fixedLongText").value = parts[1 + latParts];
1382+
if (latParts > 1) {
1383+
for (let moreParts = 1; moreParts < latParts; moreParts++) {
1384+
ge("fixedLongText").value += ' ' + parts[moreParts + 1 + latParts];
1385+
}
1386+
}
1387+
ge("fixedAltitude").value = parts[numParts - 3];
1388+
ge("antennaHeight").value = parts[numParts - 2];
1389+
ge("antennaReferencePoint").value = parts[numParts - 1];
13761390

1377-
ge("fixedAltitude").value = parts[3];
1391+
$("input[name=markRadio][value=1]").prop('checked', false);
1392+
$("input[name=markRadio][value=2]").prop('checked', true);
13781393

1379-
$("input[name=markRadio][value=1]").prop('checked', false);
1380-
$("input[name=markRadio][value=2]").prop('checked', true);
1394+
adjustHAE();
13811395

1382-
adjustHAE();
1383-
1384-
clearError("nicknameGeodetic");
1385-
clearError("fixedLatText");
1386-
clearError("fixedLongText");
1387-
clearError("fixedAltitude");
1388-
clearError("antennaHeight");
1389-
clearError("antennaReferencePoint");
1396+
clearError("nicknameGeodetic");
1397+
clearError("fixedLatText");
1398+
clearError("fixedLongText");
1399+
clearError("fixedAltitude");
1400+
clearError("antennaHeight");
1401+
clearError("antennaReferencePoint");
1402+
}
1403+
else {
1404+
console.log("stationGeodetic split error");
1405+
}
13901406
}
13911407
}
13921408

0 commit comments

Comments
 (0)