Skip to content

Commit db5336a

Browse files
committed
Change how HAE is calculated
Fixes for #418
1 parent 4ff94e1 commit db5336a

File tree

3 files changed

+30
-51
lines changed

3 files changed

+30
-51
lines changed

Firmware/RTK_Surveyor/AP-Config/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,20 +1155,20 @@ <h2>
11551155

11561156
<div class="form-group row">
11571157
<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>
1158+
<input type="radio" name="markRadio" value="1" onClick="adjustHAE()">
1159+
<label id="calcHAEMark">Calculate HAE Mark</label>
11601160
<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.">
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.">
11621162
<span class="icon-info-circle text-primary ms-2"></span>
11631163
</span>
11641164
</span>
11651165
</div>
11661166
<div class="form-group row">
11671167
<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>
1168+
<input type="radio" name="markRadio" value="2" onClick="adjustHAE()" checked>
1169+
<label id="callHAEAPC">Calculate HAE APC</label>
11701170
<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.">
1171+
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.">
11721172
<span class="icon-info-circle text-primary ms-2"></span>
11731173
</span>
11741174
</span>

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

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -853,14 +853,10 @@ function useECEFCoordinates() {
853853
function useGeodeticCoordinates() {
854854
ge("fixedLat").value = geodeticLat;
855855
ge("fixedLong").value = geodeticLon;
856+
ge("fixedHAE_APC").value = geodeticAlt;
856857

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-
}
858+
$("input[name=markRadio][value=1]").prop('checked', true);
859+
$("input[name=markRadio][value=2]").prop('checked', false);
864860

865861
adjustHAE();
866862
}
@@ -1260,18 +1256,12 @@ function loadGeodetic() {
12601256
ge("antennaHeight").value = parts[4];
12611257
ge("antennaReferencePoint").value = parts[5];
12621258

1263-
var haeMethod = document.querySelector('input[name=markRadio]:checked').value;
1264-
var hae;
1265-
if (haeMethod == 1) {
1266-
ge("fixedHAE_APC").value = parts[3];
1267-
hae = Number(ge("fixedHAE_APC").value) - (Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000);
1268-
ge("fixedAltitude").value = hae.toFixed(3);
1269-
}
1270-
else {
1271-
ge("fixedAltitude").value = parts[3];
1272-
hae = Number(ge("fixedAltitude").value) + (Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000);
1273-
ge("fixedHAE_APC").value = hae.toFixed(3);
1274-
}
1259+
ge("fixedAltitude").value = parts[3];
1260+
1261+
$("input[name=markRadio][value=1]").prop('checked', false);
1262+
$("input[name=markRadio][value=2]").prop('checked', true);
1263+
1264+
adjustHAE();
12751265

12761266
clearError("nicknameGeodetic");
12771267
clearError("fixedLat");

Firmware/RTK_Surveyor/form.h

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -876,14 +876,10 @@ function useECEFCoordinates() {
876876
function useGeodeticCoordinates() {
877877
ge("fixedLat").value = geodeticLat;
878878
ge("fixedLong").value = geodeticLon;
879+
ge("fixedHAE_APC").value = geodeticAlt;
879880

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-
}
881+
$("input[name=markRadio][value=1]").prop('checked', true);
882+
$("input[name=markRadio][value=2]").prop('checked', false);
887883

888884
adjustHAE();
889885
}
@@ -1283,18 +1279,12 @@ function loadGeodetic() {
12831279
ge("antennaHeight").value = parts[4];
12841280
ge("antennaReferencePoint").value = parts[5];
12851281

1286-
var haeMethod = document.querySelector('input[name=markRadio]:checked').value;
1287-
var hae;
1288-
if (haeMethod == 1) {
1289-
ge("fixedHAE_APC").value = parts[3];
1290-
hae = Number(ge("fixedHAE_APC").value) - (Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000);
1291-
ge("fixedAltitude").value = hae.toFixed(3);
1292-
}
1293-
else {
1294-
ge("fixedAltitude").value = parts[3];
1295-
hae = Number(ge("fixedAltitude").value) + (Number(ge("antennaHeight").value) / 1000 + Number(ge("antennaReferencePoint").value) / 1000);
1296-
ge("fixedHAE_APC").value = hae.toFixed(3);
1297-
}
1282+
ge("fixedAltitude").value = parts[3];
1283+
1284+
$("input[name=markRadio][value=1]").prop('checked', false);
1285+
$("input[name=markRadio][value=2]").prop('checked', true);
1286+
1287+
adjustHAE();
12981288

12991289
clearError("nicknameGeodetic");
13001290
clearError("fixedLat");
@@ -1572,7 +1562,6 @@ function otaFirmwareStatus(percentComplete) {
15721562
resetComplete();
15731563
}
15741564
}
1575-
15761565
)====="; //End main.js
15771566

15781567
static const char *index_html = R"=====(
@@ -2734,20 +2723,20 @@ static const char *index_html = R"=====(
27342723

27352724
<div class="form-group row">
27362725
<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>
2726+
<input type="radio" name="markRadio" value="1" onClick="adjustHAE()">
2727+
<label id="calcHAEMark">Calculate HAE Mark</label>
27392728
<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.">
2729+
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.">
27412730
<span class="icon-info-circle text-primary ms-2"></span>
27422731
</span>
27432732
</span>
27442733
</div>
27452734
<div class="form-group row">
27462735
<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>
2736+
<input type="radio" name="markRadio" value="2" onClick="adjustHAE()" checked>
2737+
<label id="callHAEAPC">Calculate HAE APC</label>
27492738
<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.">
2739+
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.">
27512740
<span class="icon-info-circle text-primary ms-2"></span>
27522741
</span>
27532742
</span>

0 commit comments

Comments
 (0)