SignalSurveyViewModel

Constructors

Link copied to clipboard
constructor(repository: SignalSurveyRepository, visibility: SignalSurveyVisibility, cellSource: SignalSurveyCellSource, nodeRepository: NodeRepository)

Properties

Link copied to clipboard
val cells: StateFlow<List<SurveyCellUi>>

The squares to draw, sized for the map's zoom. Empty while the map draws a heatmap instead.

Link copied to clipboard
val heatPoints: StateFlow<List<SurveyCellUi>>

The points of the heatmap: one per street-level square, so a long stop in one spot adds no more heat than a pass through it. Empty while the map draws squares.

Link copied to clipboard
val selectedCell: StateFlow<SurveyCellUi?>
Link copied to clipboard
val selectedLinks: StateFlow<SurveyLinks>

Lines from the tapped square to each node heard directly there that shares a position, ending where that node says it is (at the precision it chose), nearest first.

Link copied to clipboard
val state: StateFlow<SignalSurveyUiState>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
suspend fun csv(sessionId: Long, startedAtMillis: Long): ByteArray?

The CSV of the session sessionId that started at startedAtMillis. The start time pins it to one radio: ids repeat across radios, and the radio can change while a file picker is open.

Link copied to clipboard
fun delete(sessionId: Long)
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun selectCell(id: String?)

Selects the square id names, by its session and center, so the selection survives the map zooming.

Link copied to clipboard
fun setCamera(zoom: Double, latitude: Double)

Tells the overlay how far the map is zoomed, in 256 px tile zoom levels, so squares stay large enough to see.

Link copied to clipboard
fun setHeatmap(heatmap: Boolean)
Link copied to clipboard
fun setRecording(recording: Boolean)
Link copied to clipboard
fun setVisible(sessionId: Long, visible: Boolean)