Skip to content

Commit ad7a965

Browse files
committed
Pass log file name to WiFi Config page. Correctly start new log on command.
1 parent ba6947d commit ad7a965

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

Firmware/RTK_Surveyor/AP-Config/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,6 +1842,13 @@ <h2>
18421842
</div>
18431843
</div>
18441844

1845+
<div id="logFile" class="row">
1846+
<div class="mb-2">
1847+
<label for="logFile" class="form-group box-margin20">Log file name: <span id="logFileName" style="display:inline;">SFE_Log.ubx</span>
1848+
</label>
1849+
</div>
1850+
</div>
1851+
18451852
<div class="form-group row">
18461853
<div style="margin-bottom:5px;">
18471854
<button type="button" id="startNewLog" class="btn btn-primary box-margin20"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ function parseIncoming(msg) {
128128
|| id.includes("profile7Name")
129129
|| id.includes("radioMAC")
130130
|| id.includes("deviceBTID")
131+
|| id.includes("logFileName")
131132
) {
132133
ge(id).innerHTML = val;
133134
}

Firmware/RTK_Surveyor/Form.ino

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,8 @@ void createSettingsString(char* newSettings)
631631
}
632632
stringRecord(newSettings, "espnowBroadcast", settings.espnowBroadcast);
633633

634+
stringRecord(newSettings, "logFileName", logFileName);
635+
634636
//Add ECEF and Geodetic station data
635637
for (int index = 0; index < COMMON_COORDINATES_MAX_STATIONS ; index++) //Arbitrary 50 station limit
636638
{
@@ -990,7 +992,16 @@ void updateSettingWithValue(const char *settingName, const char* settingValueStr
990992
else if (strcmp(settingName, "startNewLog") == 0)
991993
{
992994
if (settings.enableLogging == true && online.logging == true)
993-
endSD(false, true); //Close down file. A new one will be created at the next calling of updateLogs().
995+
{
996+
endLogging(false, true); //(gotSemaphore, releaseSemaphore) Close file. Reset parser stats.
997+
beginLogging(); //Create new file based on current RTC.
998+
setLoggingType(); //Determine if we are standard, PPP, or custom. Changes logging icon accordingly.
999+
1000+
char newFileNameCSV[sizeof("logFileName,") + sizeof(logFileName) + 1];
1001+
sprintf(newFileNameCSV, "logFileName,%s,", logFileName);
1002+
1003+
websocket->textAll(newFileNameCSV); //Tell the config page the name of the file we just created
1004+
}
9941005
}
9951006
else if (strcmp(settingName, "checkNewFirmware") == 0)
9961007
{

Firmware/RTK_Surveyor/form.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ function parseIncoming(msg) {
151151
|| id.includes("profile7Name")
152152
|| id.includes("radioMAC")
153153
|| id.includes("deviceBTID")
154+
|| id.includes("logFileName")
154155
) {
155156
ge(id).innerHTML = val;
156157
}
@@ -2472,7 +2473,8 @@ static const char *index_html = R"=====(
24722473
<div class="d-grid gap-2">
24732474
<button class="btn btn-primary mt-3 toggle-btn" id="baseConfig" type="button" data-toggle="collapse"
24742475
data-target="#collapseBaseConfig" aria-expanded="false" aria-controls="collapseBaseConfig"
2475-
style="display:none">
2476+
>
2477+
<!-- style="display:none"> -->
24762478
Base Configuration <i id="baseCaret" class="caret-icon bi icon-caret-down"></i>
24772479
</button>
24782480
</div>
@@ -3370,6 +3372,13 @@ static const char *index_html = R"=====(
33703372
</div>
33713373
</div>
33723374

3375+
<div id="logFile" class="row">
3376+
<div class="mb-2">
3377+
<label for="logFile" class="form-group box-margin20">Log file name: <span id="logFileName" style="display:inline;">SFE_Log.ubx</span>
3378+
</label>
3379+
</div>
3380+
</div>
3381+
33733382
<div class="form-group row">
33743383
<div style="margin-bottom:5px;">
33753384
<button type="button" id="startNewLog" class="btn btn-primary box-margin20"

0 commit comments

Comments
 (0)