Skip to content

Commit c912242

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

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

Firmware/RTK_Surveyor/Form.ino

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

651+
stringRecord(newSettings, "logFileName", logFileName);
652+
651653
//Add ECEF and Geodetic station data
652654
for (int index = 0; index < COMMON_COORDINATES_MAX_STATIONS ; index++) //Arbitrary 50 station limit
653655
{
@@ -1007,7 +1009,16 @@ void updateSettingWithValue(const char *settingName, const char* settingValueStr
10071009
else if (strcmp(settingName, "startNewLog") == 0)
10081010
{
10091011
if (settings.enableLogging == true && online.logging == true)
1010-
endSD(false, true); //Close down file. A new one will be created at the next calling of updateLogs().
1012+
{
1013+
endLogging(false, true); //(gotSemaphore, releaseSemaphore) Close file. Reset parser stats.
1014+
beginLogging(); //Create new file based on current RTC.
1015+
setLoggingType(); //Determine if we are standard, PPP, or custom. Changes logging icon accordingly.
1016+
1017+
char newFileNameCSV[sizeof("logFileName,") + sizeof(logFileName) + 1];
1018+
snprintf(newFileNameCSV, sizeof(newFileNameCSV), "logFileName,%s,", logFileName);
1019+
1020+
websocket->textAll(newFileNameCSV); //Tell the config page the name of the file we just created
1021+
}
10111022
}
10121023
else if (strcmp(settingName, "checkNewFirmware") == 0)
10131024
{

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)