Skip to content

Commit 5a19cbb

Browse files
committed
Add radio button to control HAE Mark calculations
Feature #418
1 parent f6c01a7 commit 5a19cbb

File tree

3 files changed

+106
-38
lines changed

3 files changed

+106
-38
lines changed

Firmware/RTK_Surveyor/AP-Config/index.html

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ <h2>
10131013
<div class="form-group row">
10141014
<div class="box-margin40 col-sm-8 col-8 col-form-label">
10151015
<button type="button" id="useECEFCoordinates" class="btn btn-primary box-margin20"
1016-
onClick="useECEFCoordinates()">Paste Current XYZ</button>
1016+
onClick="useECEFCoordinates()">Load ECEF From ZED</button>
10171017
<span class="tt" data-bs-placement="right"
10181018
title="Puts the current ECEF coordinates into the fixed X/Y/Z boxes.">
10191019
<span class="icon-info-circle text-primary ms-2"></span>
@@ -1110,8 +1110,8 @@ <h2>
11101110
<div class="form-group row">
11111111
<div class="box-margin40 col-sm-8 col-8 col-form-label">
11121112
<button type="button" id="useGeodeticCoordinates"
1113-
class="btn btn-primary box-margin20" onClick="useGeodeticCoordinates()">Paste
1114-
Current LLh</button>
1113+
class="btn btn-primary box-margin20" onClick="useGeodeticCoordinates()">Load LLh
1114+
From ZED</button>
11151115
<span class="tt" data-bs-placement="right"
11161116
title="Puts the current LLh into the fixed LLh boxes.">
11171117
<span class="icon-info-circle text-primary ms-2"></span>
@@ -1142,9 +1142,9 @@ <h2>
11421142
<label for="fixedAltitude" class="box-margin40 col-sm-3 col-6 col-form-label">HAE
11431143
Mark/Alt(m):
11441144
<span class="tt" data-bs-placement="right"
1145-
title="Height Above Ellipsoid of the mark. This is the coordinate or altitude of the mark or monument on the ground.">
1146-
<span class="icon-info-circle text-primary ms-2"></span>
1147-
</span>
1145+
title="Height Above Ellipsoid of the mark. This is the coordinate or altitude of the mark or monument on the ground.">
1146+
<span class="icon-info-circle text-primary ms-2"></span>
1147+
</span>
11481148
</label>
11491149
<div class="col-sm-4 col-4">
11501150
<input type="number" class="form-control" id="fixedAltitude">
@@ -1153,15 +1153,27 @@ <h2>
11531153
<p id="fixedAltitudeError" class="inlineError"></p>
11541154
</div>
11551155

1156-
<div class="form-check box-margin40">
1157-
<label class="form-check-label" for="adjustHAEMark">Adjust Mark</label>
1158-
<input class="form-check-input" type="checkbox" value="" id="adjustHAEMark"
1159-
onClick="adjustHAE()">
1160-
<span class="tt" data-bs-placement="right"
1161-
title="If enabled, HAE Mark is calculated by *subtracting* the entered Antenna Height and ARP from the altitude reported by the GNSS receiver. This is handy when measuring a mark with a known pole height and ARP, but unknown mark elevation. Note: The HAE Mark value is always recorded to the Commonly Used Coordinates table.">
1162-
<span class="icon-info-circle text-primary ms-2"></span>
1156+
<div class="form-group row">
1157+
<span style="display:inline; margin-left:40px;">
1158+
<input type="radio" name="markRadio" value="2" onClick="adjustHAE()" checked>
1159+
<label id="callHAEAPC">Calculate HAE APC</label>
1160+
<span class="tt" data-bs-placement="right"
1161+
title="If enabled, HAE APC is calculated by *adding* the entered Antenna Height and ARP to the altitude reported by the GNSS receiver. Note: The HAE Mark value is always recorded to the Commonly Used Coordinates table.">
1162+
<span class="icon-info-circle text-primary ms-2"></span>
1163+
</span>
11631164
</span>
11641165
</div>
1166+
<div class="form-group row">
1167+
<span style="display:inline; margin-left:40px;">
1168+
<input type="radio" name="markRadio" value="1" onClick="adjustHAE()">
1169+
<label id="calcHAEMark">Calculate HAE Mark</label>
1170+
<span class="tt" data-bs-placement="right"
1171+
title="If enabled, HAE Mark is calculated by *subtracting* the entered Antenna Height and ARP from the altitude reported by the GNSS receiver. This is handy when measuring a mark with a known pole height and ARP, but unknown mark elevation. Note: The HAE Mark value is always recorded to the Commonly Used Coordinates table.">
1172+
<span class="icon-info-circle text-primary ms-2"></span>
1173+
</span>
1174+
</span>
1175+
</div>
1176+
11651177

11661178
<div class="form-group row">
11671179
<label for="antennaHeight" class="box-margin40 col-sm-3 col-5 col-form-label">Antenna

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

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -853,9 +853,16 @@ function useECEFCoordinates() {
853853
function useGeodeticCoordinates() {
854854
ge("fixedLat").value = geodeticLat;
855855
ge("fixedLong").value = geodeticLon;
856-
ge("fixedAltitude").value = geodeticAlt;
857-
var hae = Number(ge("fixedAltitude").value) + Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000
858-
ge("fixedHAE_APC").value = hae.toFixed(3);
856+
857+
var haeMethod = document.querySelector('input[name=markRadio]:checked').value;
858+
if (haeMethod == 1) {
859+
ge("fixedHAE_APC").value = geodeticAlt;
860+
}
861+
else {
862+
ge("fixedAltitude").value = geodeticAlt;
863+
}
864+
865+
adjustHAE();
859866
}
860867

861868
function startNewLog() {
@@ -962,6 +969,16 @@ document.addEventListener("DOMContentLoaded", (event) => {
962969
if (ge("fixedBaseCoordinateTypeGeo").checked) {
963970
hide("ecefConfig");
964971
show("geodeticConfig");
972+
973+
if (platformPrefix == "Facet") {
974+
ge("antennaReferencePoint").value = 61.4;
975+
}
976+
else if (platformPrefix == "Facet L-Band") {
977+
ge("antennaReferencePoint").value = 69.0;
978+
}
979+
else {
980+
ge("antennaReferencePoint").value = 0.0;
981+
}
965982
}
966983
});
967984

@@ -1085,6 +1102,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
10851102
ge("fixedHAE_APC").addEventListener("change", function () {
10861103
adjustHAE();
10871104
});
1105+
10881106
})
10891107

10901108
function addECEF() {
@@ -1215,8 +1233,10 @@ function deleteGeodetic() {
12151233
}
12161234

12171235
function adjustHAE() {
1236+
1237+
var haeMethod = document.querySelector('input[name=markRadio]:checked').value;
12181238
var hae;
1219-
if (ge("adjustHAEMark").checked) {
1239+
if (haeMethod == 1) {
12201240
ge("fixedHAE_APC").disabled = false;
12211241
ge("fixedAltitude").disabled = true;
12221242
hae = Number(ge("fixedHAE_APC").value) - (Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000);
@@ -1237,16 +1257,18 @@ function loadGeodetic() {
12371257
ge("nicknameGeodetic").value = parts[0];
12381258
ge("fixedLat").value = parts[1];
12391259
ge("fixedLong").value = parts[2];
1240-
ge("fixedAltitude").value = parts[3];
12411260
ge("antennaHeight").value = parts[4];
12421261
ge("antennaReferencePoint").value = parts[5];
12431262

1263+
var haeMethod = document.querySelector('input[name=markRadio]:checked').value;
12441264
var hae;
1245-
if (ge("adjustHAEMark").checked) {
1265+
if (haeMethod == 1) {
1266+
ge("fixedHAE_APC").value = parts[3];
12461267
hae = Number(ge("fixedHAE_APC").value) - (Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000);
12471268
ge("fixedAltitude").value = hae.toFixed(3);
12481269
}
12491270
else {
1271+
ge("fixedAltitude").value = parts[3];
12501272
hae = Number(ge("fixedAltitude").value) + (Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000);
12511273
ge("fixedHAE_APC").value = hae.toFixed(3);
12521274
}

Firmware/RTK_Surveyor/form.h

Lines changed: 53 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -876,9 +876,16 @@ function useECEFCoordinates() {
876876
function useGeodeticCoordinates() {
877877
ge("fixedLat").value = geodeticLat;
878878
ge("fixedLong").value = geodeticLon;
879-
ge("fixedAltitude").value = geodeticAlt;
880-
var hae = Number(ge("fixedAltitude").value) + Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000
881-
ge("fixedHAE_APC").value = hae.toFixed(3);
879+
880+
var haeMethod = document.querySelector('input[name=markRadio]:checked').value;
881+
if (haeMethod == 1) {
882+
ge("fixedHAE_APC").value = geodeticAlt;
883+
}
884+
else {
885+
ge("fixedAltitude").value = geodeticAlt;
886+
}
887+
888+
adjustHAE();
882889
}
883890

884891
function startNewLog() {
@@ -985,6 +992,16 @@ document.addEventListener("DOMContentLoaded", (event) => {
985992
if (ge("fixedBaseCoordinateTypeGeo").checked) {
986993
hide("ecefConfig");
987994
show("geodeticConfig");
995+
996+
if (platformPrefix == "Facet") {
997+
ge("antennaReferencePoint").value = 61.4;
998+
}
999+
else if (platformPrefix == "Facet L-Band") {
1000+
ge("antennaReferencePoint").value = 69.0;
1001+
}
1002+
else {
1003+
ge("antennaReferencePoint").value = 0.0;
1004+
}
9881005
}
9891006
});
9901007

@@ -1108,6 +1125,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
11081125
ge("fixedHAE_APC").addEventListener("change", function () {
11091126
adjustHAE();
11101127
});
1128+
11111129
})
11121130

11131131
function addECEF() {
@@ -1238,8 +1256,10 @@ function deleteGeodetic() {
12381256
}
12391257

12401258
function adjustHAE() {
1259+
1260+
var haeMethod = document.querySelector('input[name=markRadio]:checked').value;
12411261
var hae;
1242-
if (ge("adjustHAEMark").checked) {
1262+
if (haeMethod == 1) {
12431263
ge("fixedHAE_APC").disabled = false;
12441264
ge("fixedAltitude").disabled = true;
12451265
hae = Number(ge("fixedHAE_APC").value) - (Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000);
@@ -1260,16 +1280,18 @@ function loadGeodetic() {
12601280
ge("nicknameGeodetic").value = parts[0];
12611281
ge("fixedLat").value = parts[1];
12621282
ge("fixedLong").value = parts[2];
1263-
ge("fixedAltitude").value = parts[3];
12641283
ge("antennaHeight").value = parts[4];
12651284
ge("antennaReferencePoint").value = parts[5];
12661285

1286+
var haeMethod = document.querySelector('input[name=markRadio]:checked').value;
12671287
var hae;
1268-
if (ge("adjustHAEMark").checked) {
1288+
if (haeMethod == 1) {
1289+
ge("fixedHAE_APC").value = parts[3];
12691290
hae = Number(ge("fixedHAE_APC").value) - (Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000);
12701291
ge("fixedAltitude").value = hae.toFixed(3);
12711292
}
12721293
else {
1294+
ge("fixedAltitude").value = parts[3];
12731295
hae = Number(ge("fixedAltitude").value) + (Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000);
12741296
ge("fixedHAE_APC").value = hae.toFixed(3);
12751297
}
@@ -2570,7 +2592,7 @@ static const char *index_html = R"=====(
25702592
<div class="form-group row">
25712593
<div class="box-margin40 col-sm-8 col-8 col-form-label">
25722594
<button type="button" id="useECEFCoordinates" class="btn btn-primary box-margin20"
2573-
onClick="useECEFCoordinates()">Paste Current XYZ</button>
2595+
onClick="useECEFCoordinates()">Load ECEF From ZED</button>
25742596
<span class="tt" data-bs-placement="right"
25752597
title="Puts the current ECEF coordinates into the fixed X/Y/Z boxes.">
25762598
<span class="icon-info-circle text-primary ms-2"></span>
@@ -2667,8 +2689,8 @@ static const char *index_html = R"=====(
26672689
<div class="form-group row">
26682690
<div class="box-margin40 col-sm-8 col-8 col-form-label">
26692691
<button type="button" id="useGeodeticCoordinates"
2670-
class="btn btn-primary box-margin20" onClick="useGeodeticCoordinates()">Paste
2671-
Current LLh</button>
2692+
class="btn btn-primary box-margin20" onClick="useGeodeticCoordinates()">Load LLh
2693+
From ZED</button>
26722694
<span class="tt" data-bs-placement="right"
26732695
title="Puts the current LLh into the fixed LLh boxes.">
26742696
<span class="icon-info-circle text-primary ms-2"></span>
@@ -2699,9 +2721,9 @@ static const char *index_html = R"=====(
26992721
<label for="fixedAltitude" class="box-margin40 col-sm-3 col-6 col-form-label">HAE
27002722
Mark/Alt(m):
27012723
<span class="tt" data-bs-placement="right"
2702-
title="Height Above Ellipsoid of the mark. This is the coordinate or altitude of the mark or monument on the ground.">
2703-
<span class="icon-info-circle text-primary ms-2"></span>
2704-
</span>
2724+
title="Height Above Ellipsoid of the mark. This is the coordinate or altitude of the mark or monument on the ground.">
2725+
<span class="icon-info-circle text-primary ms-2"></span>
2726+
</span>
27052727
</label>
27062728
<div class="col-sm-4 col-4">
27072729
<input type="number" class="form-control" id="fixedAltitude">
@@ -2710,15 +2732,27 @@ static const char *index_html = R"=====(
27102732
<p id="fixedAltitudeError" class="inlineError"></p>
27112733
</div>
27122734

2713-
<div class="form-check box-margin40">
2714-
<label class="form-check-label" for="adjustHAEMark">Adjust Mark</label>
2715-
<input class="form-check-input" type="checkbox" value="" id="adjustHAEMark"
2716-
onClick="adjustHAE()">
2717-
<span class="tt" data-bs-placement="right"
2718-
title="If enabled, HAE Mark is calculated by *subtracting* the entered Antenna Height and ARP from the altitude reported by the GNSS receiver. This is handy when measuring a mark with a known pole height and ARP, but unknown mark elevation. Note: The HAE Mark value is always recorded to the Commonly Used Coordinates table.">
2719-
<span class="icon-info-circle text-primary ms-2"></span>
2735+
<div class="form-group row">
2736+
<span style="display:inline; margin-left:40px;">
2737+
<input type="radio" name="markRadio" value="2" onClick="adjustHAE()" checked>
2738+
<label id="callHAEAPC">Calculate HAE APC</label>
2739+
<span class="tt" data-bs-placement="right"
2740+
title="If enabled, HAE APC is calculated by *adding* the entered Antenna Height and ARP to the altitude reported by the GNSS receiver. Note: The HAE Mark value is always recorded to the Commonly Used Coordinates table.">
2741+
<span class="icon-info-circle text-primary ms-2"></span>
2742+
</span>
27202743
</span>
27212744
</div>
2745+
<div class="form-group row">
2746+
<span style="display:inline; margin-left:40px;">
2747+
<input type="radio" name="markRadio" value="1" onClick="adjustHAE()">
2748+
<label id="calcHAEMark">Calculate HAE Mark</label>
2749+
<span class="tt" data-bs-placement="right"
2750+
title="If enabled, HAE Mark is calculated by *subtracting* the entered Antenna Height and ARP from the altitude reported by the GNSS receiver. This is handy when measuring a mark with a known pole height and ARP, but unknown mark elevation. Note: The HAE Mark value is always recorded to the Commonly Used Coordinates table.">
2751+
<span class="icon-info-circle text-primary ms-2"></span>
2752+
</span>
2753+
</span>
2754+
</div>
2755+
27222756

27232757
<div class="form-group row">
27242758
<label for="antennaHeight" class="box-margin40 col-sm-3 col-5 col-form-label">Antenna

0 commit comments

Comments
 (0)