User Story #49 » 0013-feat-host-expose-ConstellationFrameState-as-a-StateF.patch
| androidApp/src/main/java/com/aether/mofe/platform/MofeEngineHost.kt | ||
|---|---|---|
|
import com.aether.mofe.engine.MultiObserverFusionEngine
|
||
|
import com.aether.mofe.engine.MultilaterationSolver
|
||
|
import com.aether.mofe.model.AnchorHealth
|
||
|
import com.aether.mofe.model.ConstellationFrameState
|
||
|
import com.aether.mofe.model.DeviceId
|
||
|
import com.aether.mofe.model.FusedState
|
||
|
import com.aether.mofe.model.InterAnchorLinkReport
|
||
| ... | ... | |
|
* the mesh-health UI, refreshed on the maintenance tick. null until a calibration exists. */
|
||
|
val antennaDelays: StateFlow<AntennaDelayCalibrator.Result?> = _antennaDelays.asStateFlow()
|
||
|
private val _constellationFrame = MutableStateFlow(ConstellationFrameState.CONVERGING)
|
||
|
/** Frame-lock lifecycle for the mesh-health UI, refreshed on the maintenance tick:
|
||
|
* CONVERGING → LOCKED (stable) ⇄ RESOLVING_MOTION (an anchor was bumped/moved) / RESOLVING
|
||
|
* (an anchor dropped, healing). Advertises frame-stability degradation and its recovery. */
|
||
|
val constellationFrame: StateFlow<ConstellationFrameState> = _constellationFrame.asStateFlow()
|
||
|
/** Instrumentation + state capture — the engine's multi-observer fusion output,
|
||
|
* surfaced to logcat AND to the flows above for the HUD/health pane to consume. */
|
||
|
private val logListener = object : MofeListener {
|
||
| ... | ... | |
|
.getOrDefault(InterAnchorLinkReport.EMPTY)
|
||
|
// Latest antenna-delay calibration for the mesh-health UI.
|
||
|
_antennaDelays.value = runCatching { eng.antennaDelayCalibration() }.getOrNull()
|
||
|
// Frame-lock lifecycle (LOCKED / RESOLVING_MOTION / …) for the mesh-health UI.
|
||
|
_constellationFrame.value = runCatching { eng.constellationFrameState() }
|
||
|
.getOrDefault(ConstellationFrameState.CONVERGING)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
- « Previous
- 1
- 2
- Next »