mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-06 20:26:12 +00:00
refactor: rename Geo Alert feature to Locator
Pure rename, no behavior change: GeoAlertScreen -> LocatorScreen (file + class), NodePrefs geo_alert_* fields -> locator_*, UITask engine functions (evaluateGeoAlert/fireGeoAlert/geoAlertDistance/geoProximityBeeper) and state -> evaluateLocator/fireLocator/locatorDistance/locatorProximityBeeper, Tools menu entry and screen header text -> "Locator", plus matching docs/README updates. NodePrefs field renames don't affect on-disk layout (DataStore serializes by position, not name). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
3c94aca602
commit
57f5346427
@@ -235,34 +235,34 @@ struct NodePrefs { // persisted to file
|
||||
uint8_t loc_share_interval_idx; // min send interval (index into locShareIntervalSecs)
|
||||
uint8_t loc_share_heartbeat_idx; // stationary heartbeat (index into locShareHeartbeatSecs)
|
||||
|
||||
// Geo-alert — a single geofence around a saved point. When enabled the device
|
||||
// Locator — a single geofence around a saved point. When enabled the device
|
||||
// watches its own GPS fix and beeps + shows an alert when it crosses into
|
||||
// (arrive) or out of (leave) the radius. The target coordinate/label is a
|
||||
// snapshot of a chosen waypoint, so the alert survives the waypoint being
|
||||
// edited or deleted. Configured from Tools › Geo Alert.
|
||||
uint8_t geo_alert_enabled; // 0=off (default), 1=armed
|
||||
uint8_t geo_alert_has_target; // 0=no target chosen yet, 1=target set
|
||||
uint8_t geo_alert_radius_idx; // index into geoAlertRadiusMeters
|
||||
uint8_t geo_alert_mode; // 0=arrive, 1=leave, 2=both
|
||||
int32_t geo_alert_lat_1e6; // target latitude (1e6-scaled; last-known for a contact)
|
||||
int32_t geo_alert_lon_1e6; // target longitude (1e6-scaled; last-known for a contact)
|
||||
char geo_alert_label[12]; // target name for the alert text (WAYPOINT_LABEL_LEN)
|
||||
// edited or deleted. Configured from Tools › Locator.
|
||||
uint8_t locator_enabled; // 0=off (default), 1=armed
|
||||
uint8_t locator_has_target; // 0=no target chosen yet, 1=target set
|
||||
uint8_t locator_radius_idx; // index into locatorRadiusMeters
|
||||
uint8_t locator_mode; // 0=arrive, 1=leave, 2=both
|
||||
int32_t locator_lat_1e6; // target latitude (1e6-scaled; last-known for a contact)
|
||||
int32_t locator_lon_1e6; // target longitude (1e6-scaled; last-known for a contact)
|
||||
char locator_label[12]; // target name for the alert text (WAYPOINT_LABEL_LEN)
|
||||
// Target can be a static waypoint or a live contact: for a contact the engine
|
||||
// re-reads the latest [LOC] position each evaluation (keyed by pubkey prefix),
|
||||
// so the geofence follows a moving person ("alert when my friend is near").
|
||||
uint8_t geo_alert_target_kind; // 0=waypoint (static), 1=live contact
|
||||
uint8_t geo_alert_key[6]; // contact pubkey prefix when target_kind==1
|
||||
uint8_t locator_target_kind; // 0=waypoint (static), 1=live contact
|
||||
uint8_t locator_key[6]; // contact pubkey prefix when target_kind==1
|
||||
|
||||
// Trail auto-pause — when tracking, automatically freeze the trail (timer +
|
||||
// sampling) after the device has sat still for this long, and resume on the
|
||||
// next real movement. 0 = off. Index into trailAutoPauseSecs.
|
||||
uint8_t trail_autopause_idx;
|
||||
|
||||
// Geo-alert proximity beeper — when on (and the alert is armed with a target),
|
||||
// Locator proximity beeper — when on (and the alert is armed with a target),
|
||||
// the device ticks while inside the radius and shortens the gap between ticks
|
||||
// the closer it gets to the target, like a homing beeper. Independent of the
|
||||
// discrete arrive/leave alert (geo_alert_mode).
|
||||
uint8_t geo_alert_beeper; // 0=off (default), 1=on
|
||||
// discrete arrive/leave alert (locator_mode).
|
||||
uint8_t locator_beeper; // 0=off (default), 1=on
|
||||
|
||||
// Single source of truth for the live-share option tables (shared by the Map
|
||||
// UI labels and the auto-send engine in UITask).
|
||||
@@ -282,17 +282,17 @@ struct NodePrefs { // persisted to file
|
||||
return H[idx < LOC_SHARE_HEARTBEAT_COUNT ? idx : 0];
|
||||
}
|
||||
|
||||
// Geo-alert option tables (shared by the Tools › Geo Alert UI labels and the
|
||||
// Locator option tables (shared by the Tools › Locator UI labels and the
|
||||
// evaluation engine in UITask).
|
||||
static const uint8_t GEO_ALERT_RADIUS_COUNT = 5;
|
||||
static uint16_t geoAlertRadiusMeters(uint8_t idx) {
|
||||
static const uint16_t R[GEO_ALERT_RADIUS_COUNT] = { 50, 100, 250, 500, 1000 };
|
||||
return R[idx < GEO_ALERT_RADIUS_COUNT ? idx : 1];
|
||||
static const uint8_t LOCATOR_RADIUS_COUNT = 5;
|
||||
static uint16_t locatorRadiusMeters(uint8_t idx) {
|
||||
static const uint16_t R[LOCATOR_RADIUS_COUNT] = { 50, 100, 250, 500, 1000 };
|
||||
return R[idx < LOCATOR_RADIUS_COUNT ? idx : 1];
|
||||
}
|
||||
static const uint8_t GEO_ALERT_MODE_COUNT = 3; // 0=arrive, 1=leave, 2=both
|
||||
static const char* geoAlertModeLabel(uint8_t m) {
|
||||
static const char* L[GEO_ALERT_MODE_COUNT] = { "Arrive", "Leave", "Both" };
|
||||
return L[m < GEO_ALERT_MODE_COUNT ? m : 0];
|
||||
static const uint8_t LOCATOR_MODE_COUNT = 3; // 0=arrive, 1=leave, 2=both
|
||||
static const char* locatorModeLabel(uint8_t m) {
|
||||
static const char* L[LOCATOR_MODE_COUNT] = { "Arrive", "Leave", "Both" };
|
||||
return L[m < LOCATOR_MODE_COUNT ? m : 0];
|
||||
}
|
||||
|
||||
// Trail auto-pause delays (seconds). 0 = off.
|
||||
|
||||
Reference in New Issue
Block a user