mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-03 10:46:12 +00:00
feat(ui): Trail phase 5 — Settings › GPS gains trail interval + min-delta
Two new entries in the existing GPS section of SettingsScreen, gated by the same ENV_INCLUDE_GPS guard. LEFT/RIGHT cycles through the option table from Trail.h: - "Trail int" : 30 s / 10 s / 20 s / 1 min / 5 min / 15 min - "Trail dist": 5 m / 10 m / 25 m / 100 m Changes are stored to p->trail_interval_idx / trail_min_delta_idx and take effect on the next sampling tick in UITask::loop (already gated on those fields), so no separate apply* helper is needed. _dirty triggers the normal savePrefs on settings exit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
81766650cc
commit
30b81b6d51
@@ -60,6 +60,8 @@ class SettingsScreen : public UIScreen {
|
|||||||
// GPS section
|
// GPS section
|
||||||
SECTION_GPS,
|
SECTION_GPS,
|
||||||
GPS_INTERVAL,
|
GPS_INTERVAL,
|
||||||
|
TRAIL_INTERVAL,
|
||||||
|
TRAIL_MIN_DELTA,
|
||||||
#endif
|
#endif
|
||||||
// Contacts section
|
// Contacts section
|
||||||
SECTION_CONTACTS, DM_FILTER, ROOM_FILTER,
|
SECTION_CONTACTS, DM_FILTER, ROOM_FILTER,
|
||||||
@@ -422,6 +424,14 @@ class SettingsScreen : public UIScreen {
|
|||||||
display.print("GPS upd");
|
display.print("GPS upd");
|
||||||
display.setCursor(display.valCol(), y);
|
display.setCursor(display.valCol(), y);
|
||||||
display.print(GPS_INTERVAL_LABELS[gpsIntervalIndex()]);
|
display.print(GPS_INTERVAL_LABELS[gpsIntervalIndex()]);
|
||||||
|
} else if (item == TRAIL_INTERVAL) {
|
||||||
|
display.print("Trail int");
|
||||||
|
display.setCursor(display.valCol(), y);
|
||||||
|
display.print(TrailStore::intervalLabel(p ? p->trail_interval_idx : 0));
|
||||||
|
} else if (item == TRAIL_MIN_DELTA) {
|
||||||
|
display.print("Trail dist");
|
||||||
|
display.setCursor(display.valCol(), y);
|
||||||
|
display.print(TrailStore::minDeltaLabel(p ? p->trail_min_delta_idx : 0));
|
||||||
#endif
|
#endif
|
||||||
} else if (item == TIMEZONE) {
|
} else if (item == TIMEZONE) {
|
||||||
display.print("TimeZone");
|
display.print("TimeZone");
|
||||||
@@ -659,6 +669,22 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (_selected == TRAIL_INTERVAL && p && (left || right)) {
|
||||||
|
int idx = p->trail_interval_idx;
|
||||||
|
if (idx >= TrailStore::INTERVAL_COUNT) idx = 0;
|
||||||
|
idx = (idx + (right ? 1 : TrailStore::INTERVAL_COUNT - 1)) % TrailStore::INTERVAL_COUNT;
|
||||||
|
p->trail_interval_idx = (uint8_t)idx;
|
||||||
|
_dirty = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (_selected == TRAIL_MIN_DELTA && p && (left || right)) {
|
||||||
|
int idx = p->trail_min_delta_idx;
|
||||||
|
if (idx >= TrailStore::MIN_DELTA_COUNT) idx = 0;
|
||||||
|
idx = (idx + (right ? 1 : TrailStore::MIN_DELTA_COUNT - 1)) % TrailStore::MIN_DELTA_COUNT;
|
||||||
|
p->trail_min_delta_idx = (uint8_t)idx;
|
||||||
|
_dirty = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (_selected == TIMEZONE && p) {
|
if (_selected == TIMEZONE && p) {
|
||||||
if (right && p->tz_offset_hours < 14) { p->tz_offset_hours++; _dirty = true; return true; }
|
if (right && p->tz_offset_hours < 14) { p->tz_offset_hours++; _dirty = true; return true; }
|
||||||
|
|||||||
Reference in New Issue
Block a user