Skip to content

Commit

Permalink
adding first heard date too
Browse files Browse the repository at this point in the history
  • Loading branch information
72A12F4E committed Jul 10, 2024
1 parent 3bf4438 commit a16ad9a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -7365,6 +7365,9 @@
}
}
}
},
"First heard" : {

},
"Five Minutes" : {

Expand Down
6 changes: 4 additions & 2 deletions Meshtastic/Persistence/UpdateCoreData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ func upsertNodeInfoPacket (packet: MeshPacket, context: NSManagedObjectContext)
let newNode = NodeInfoEntity(context: context)
newNode.id = Int64(packet.from)
newNode.num = Int64(packet.from)
newNode.firstHeard = Date(timeIntervalSince1970: TimeInterval(Int64(packet.rxTime)))
newNode.lastHeard = Date(timeIntervalSince1970: TimeInterval(Int64(packet.rxTime)))
if packet.rxTime != 0 {
newNode.firstHeard = Date(timeIntervalSince1970: TimeInterval(Int64(packet.rxTime)))
newNode.lastHeard = Date(timeIntervalSince1970: TimeInterval(Int64(packet.rxTime)))
}
newNode.snr = packet.rxSnr
newNode.rssi = packet.rxRssi
newNode.viaMqtt = packet.viaMqtt
Expand Down
15 changes: 15 additions & 0 deletions Meshtastic/Views/Nodes/Helpers/NodeDetail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,21 @@ struct NodeDetail: View {
}
}

if let firstHeard = node.firstHeard {
HStack {
Label {
Text("First heard")
} icon: {
Image(systemName: "clock")
.symbolRenderingMode(.multicolor)
}
Spacer()

LastHeardText(lastHeard: firstHeard)
.textSelection(.enabled)
}
}

if let lastHeard = node.lastHeard {
HStack {
Label {
Expand Down

0 comments on commit a16ad9a

Please sign in to comment.