mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
start cleaning up models
This commit is contained in:
parent
52deba7d4b
commit
f18ac28dc0
9 changed files with 307 additions and 268 deletions
48
app/src/main/java/com/geeksville/mesh/model/NodeDB.kt
Normal file
48
app/src/main/java/com/geeksville/mesh/model/NodeDB.kt
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package com.geeksville.mesh.model
|
||||
|
||||
import androidx.compose.mutableStateOf
|
||||
import com.geeksville.mesh.MeshUser
|
||||
import com.geeksville.mesh.NodeInfo
|
||||
import com.geeksville.mesh.Position
|
||||
|
||||
object NodeDB {
|
||||
private val testPositions = arrayOf(
|
||||
Position(32.776665, -96.796989, 35), // dallas
|
||||
Position(32.960758, -96.733521, 35), // richardson
|
||||
Position(
|
||||
32.912901,
|
||||
-96.781776,
|
||||
35
|
||||
) // north dallas
|
||||
)
|
||||
|
||||
val testNodeNoPosition = NodeInfo(
|
||||
8,
|
||||
MeshUser(
|
||||
"+16508765308".format(8),
|
||||
"Kevin MesterNoLoc",
|
||||
"KLO"
|
||||
),
|
||||
null,
|
||||
12345
|
||||
)
|
||||
|
||||
val testNodes = testPositions.mapIndexed { index, it ->
|
||||
NodeInfo(
|
||||
9 + index,
|
||||
MeshUser(
|
||||
"+165087653%02d".format(9 + index),
|
||||
"Kevin Mester$index",
|
||||
"KM$index"
|
||||
),
|
||||
it,
|
||||
12345
|
||||
)
|
||||
}
|
||||
|
||||
/// The unique ID of our node
|
||||
val myId = mutableStateOf("+16508765309")
|
||||
|
||||
/// A map from nodeid to to nodeinfo
|
||||
val nodes = mutableStateOf(testNodes.map { it.user!!.id to it }.toMap())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue