Show telemetry GPS fixes on the map and add a map location request
Telemetry replies carried a GPS fix that was only shown on the telemetry screen, so the map kept the node at its last advert position. The fix now updates the contact and survives radio contact refreshes until the node adverts again (compared on the node's own advert clock). The map node card gains an "Update location" button for companions and sensors; repeaters and rooms only share GPS with logged-in admins, so they don't get it.
This commit is contained in:
1 parent
d2eff6eb78
commit
f0144ca959
44 files changed
+780
-19
No files matched your search
@@ -22,6 +22,12 @@ class Contact {
|
||||
final bool isActive;
|
||||
final Uint8List? rawPacket;
|
||||
|
||||
/// Set while [latitude]/[longitude]/[lastSeen] come from a telemetry reply
|
||||
/// rather than an advert: the advert timestamp that fix superseded. A
|
||||
/// radio refresh carrying that same advert keeps the fix; a newer advert
|
||||
/// replaces it.
|
||||
final DateTime? telemetryFixAdvertSeen;
|
||||
|
||||
Contact({
|
||||
required this.publicKey,
|
||||
required this.name,
|
||||
@@ -39,6 +45,7 @@ class Contact {
|
||||
DateTime? lastMessageAt,
|
||||
this.isActive = true,
|
||||
this.rawPacket,
|
||||
this.telemetryFixAdvertSeen,
|
||||
}) : lastMessageAt = lastMessageAt ?? lastSeen;
|
||||
|
||||
/// Cached: it backs ==, hashCode and the per-frame contact lookups, and
|
||||
@@ -105,6 +112,8 @@ class Contact {
|
||||
DateTime? lastModified,
|
||||
bool? isActive,
|
||||
Uint8List? rawPacket,
|
||||
DateTime? telemetryFixAdvertSeen,
|
||||
bool clearTelemetryFix = false,
|
||||
}) {
|
||||
return Contact(
|
||||
publicKey: publicKey ?? this.publicKey,
|
||||
@@ -127,6 +136,9 @@ class Contact {
|
||||
lastModified: lastModified ?? this.lastModified,
|
||||
isActive: isActive ?? this.isActive,
|
||||
rawPacket: rawPacket ?? this.rawPacket,
|
||||
telemetryFixAdvertSeen: clearTelemetryFix
|
||||
? null
|
||||
: (telemetryFixAdvertSeen ?? this.telemetryFixAdvertSeen),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user