MeshHudViewModel

class MeshHudViewModel(poseProvider: CameraPoseProvider, phoneLocationProvider: PhoneLocationProvider, pressureProvider: PhonePressureProvider, magneticFieldProvider: MagneticFieldProvider, nodeRepository: NodeRepository, packetRepository: PacketRepository, meshLogRepository: MeshLogRepository, tracerouteResponseProvider: TracerouteResponseProvider, tracerouteSnapshotRepository: TracerouteSnapshotRepository, mapPrefs: MapPrefs, notificationPrefs: NotificationPrefs, localeUnitsProvider: LocaleUnitsProvider, dispatchers: CoroutineDispatchers, surveyCells: SignalSurveyCellSource) : ViewModel(source)

Constructors

Link copied to clipboard
constructor(poseProvider: CameraPoseProvider, phoneLocationProvider: PhoneLocationProvider, pressureProvider: PhonePressureProvider, magneticFieldProvider: MagneticFieldProvider, nodeRepository: NodeRepository, packetRepository: PacketRepository, meshLogRepository: MeshLogRepository, tracerouteResponseProvider: TracerouteResponseProvider, tracerouteSnapshotRepository: TracerouteSnapshotRepository, mapPrefs: MapPrefs, notificationPrefs: NotificationPrefs, localeUnitsProvider: LocaleUnitsProvider, dispatchers: CoroutineDispatchers, surveyCells: SignalSurveyCellSource)

Properties

Link copied to clipboard
val coachSeen: StateFlow<Boolean>

True once the user has dismissed the first-run coaching.

Link copied to clipboard
val geofenceAlertOptIns: StateFlow<Set<Int>>

Waypoint ids of foreign geofences the user opted in to crossing alerts for, as the map's dialog shows them.

Link copied to clipboard
val pose: StateFlow<CameraPoseState>

The camera's pose, always referenced to magnetic north like the rotation vector: a source that already gives true north is turned back by the declination, which every target, the tape and the radar then add once.

Link copied to clipboard
val route: StateFlow<HudRoute?>

The traceroute in view, if one was opened, as legs of points from here.

Link copied to clipboard
val surveyTiles: StateFlow<List<HudSurveyTile>>

The signal survey's visible squares laid on the ground around the phone, farthest first.

Link copied to clipboard
val targets: StateFlow<MeshHudTargets>
Link copied to clipboard
val track: StateFlow<HudTrack?>

The position track in view, if one was opened, as breadcrumbs from here.

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun openFor(nodeNum: Int?)

Opens the view for nodeNum, from that node's detail, compass, track or traceroute: the finder points at it, and only it and the nodes its track or route names are shown. Null opens the whole mesh, as from the map.

Link copied to clipboard
fun setGeofenceAlertOptIn(waypointId: Int, enabled: Boolean)
Link copied to clipboard
Link copied to clipboard
fun showTraceroute(destNum: Int?, requestId: Int?, logUuid: String?)

Draws traceroute requestId to destNum in the air; logUuid names its logged response when known.

Link copied to clipboard
fun showTrack(nodeNum: Int?)

Draws nodeNum's position track, or clears it when null.

Link copied to clipboard
fun toggleFocus(subject: HudSubject)

Focuses the finder on subject, or clears the focus when it is already the one focused.