Skip to content

Commit 74a223e

Browse files
committed
Move station coordinate file deletion into parseIncomingSettings
Doing the deletion in updateSettingWithValue when measurementRateHz arrives no longer works because the web config only sends the changes, not the full settings
1 parent 65fc6b4 commit 74a223e

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,7 +2253,7 @@ function updateECEFList() {
22532253

22542254
$("#StationCoordinatesECEF option").each(function () {
22552255
var parts = $(this).text().split(' ');
2256-
var nickname = parts[0].substring(0, 15);
2256+
var nickname = parts[0].substring(0, 19);
22572257
$(this).text(nickname + ': ' + parts[1] + ' ' + parts[2] + ' ' + parts[3]).text;
22582258
});
22592259
}
@@ -2383,7 +2383,7 @@ function updateGeodeticList() {
23832383

23842384
$("#StationCoordinatesGeodetic option").each(function () {
23852385
var parts = $(this).text().split(' ');
2386-
var nickname = parts[0].substring(0, 15);
2386+
var nickname = parts[0].substring(0, 19);
23872387

23882388
if (parts.length >= 7) {
23892389
$(this).text(nickname + ': ' + parts[1] + ' ' + parts[2] + ' ' + parts[3]

Firmware/RTK_Everywhere/WebServer.ino

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,9 @@ bool parseIncomingSettings()
651651
char settingName[100] = {'\0'};
652652
char valueStr[150] = {'\0'}; // stationGeodetic1,ANameThatIsTooLongToBeDisplayed 40.09029479 -105.18505761 1560.089
653653

654+
bool stationGeodeticSeen = false;
655+
bool stationECEFSeen = false;
656+
654657
char *commaPtr = incomingSettings;
655658
char *headPtr = incomingSettings;
656659

@@ -678,6 +681,24 @@ bool parseIncomingSettings()
678681
if (settings.debugWebServer == true)
679682
systemPrintf("settingName: %s value: %s\r\n", settingName, valueStr);
680683

684+
// Check for first stationGeodetic
685+
if ((strstr(settingName, "stationGeodetic") != nullptr) && (!stationGeodeticSeen))
686+
{
687+
stationGeodeticSeen = true;
688+
removeFile(stationCoordinateGeodeticFileName);
689+
if (settings.debugWebServer == true)
690+
systemPrintln("Station geodetic coordinate file removed");
691+
}
692+
693+
// Check for first stationECEF
694+
if ((strstr(settingName, "stationECEF") != nullptr) && (!stationECEFSeen))
695+
{
696+
stationECEFSeen = true;
697+
removeFile(stationCoordinateECEFFileName);
698+
if (settings.debugWebServer == true)
699+
systemPrintln("Station ECEF coordinate file removed");
700+
}
701+
681702
updateSettingWithValue(false, settingName, valueStr);
682703

683704
// Avoid infinite loop if response is malformed

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,13 +1097,7 @@ SettingValueResponse updateSettingWithValue(bool inCommands, const char *setting
10971097
else if (strcmp(settingName, "measurementRateHz") == 0)
10981098
{
10991099
settings.measurementRateMs = 1000 / settingValue; // Convert Hz to ms
1100-
gnssConfigure(GNSS_CONFIG_FIX_RATE); // Request receiver to use new settings
1101-
1102-
// This is one of the first settings to be received. If seen, remove the station files.
1103-
removeFile(stationCoordinateECEFFileName);
1104-
removeFile(stationCoordinateGeodeticFileName);
1105-
if (settings.debugWebServer == true)
1106-
systemPrintln("Station coordinate files removed");
1100+
gnssConfigure(GNSS_CONFIG_FIX_RATE); // Request receiver to use new settings
11071101
knownSetting = true;
11081102
}
11091103

0 commit comments

Comments
 (0)