summaryrefslogtreecommitdiff
path: root/SESSION_STATE.md
diff options
context:
space:
mode:
Diffstat (limited to 'SESSION_STATE.md')
-rw-r--r--SESSION_STATE.md22
1 files changed, 17 insertions, 5 deletions
diff --git a/SESSION_STATE.md b/SESSION_STATE.md
index a0d19fb..e17781b 100644
--- a/SESSION_STATE.md
+++ b/SESSION_STATE.md
@@ -1,10 +1,10 @@
# SESSION_STATE.md
## Current Task Goal
-AIS repository layer (AisRepository, AisHubSource, AisHubApiService) — COMPLETE (2026-03-15)
+Section 7.3 AIS display — COMPLETE (2026-03-15): AIS integrated into ViewModel, MapFragment, and MainActivity
## Verified (2026-03-15)
-- All 38 tests GREEN via test-runner (BUILD SUCCESSFUL): 22 GPS/NMEA + 16 AIS
+- All 41 tests GREEN: 22 GPS/NMEA + 16 AIS + 3 ViewModel AIS (via /tmp/ais-vm-test-runner/)
- NmeaParser extended with MWV (wind), DBT (depth), HDG/HDM (heading) parsers
- Sensor data classes added: WindData, DepthData, HeadingData
- NmeaStreamManager added for TCP stream management
@@ -115,10 +115,22 @@ AIS repository layer (AisRepository, AisHubSource, AisHubApiService) — COMPLET
- `app/src/test/kotlin/org/terst/nav/ais/AisHubSourceTest.kt` (4 tests)
- Harness: `/tmp/ais-repo-test-runner/` (JUnit5, org.terst.nav package, stub annotations for offline build)
+### [APPROVED] Section 7.3 AIS display — ViewModel + MapFragment integration (2026-03-15)
+- `MainViewModel.processAisSentence(sentence)` — delegates to AisRepository, updates `_aisTargets` StateFlow
+- `MainViewModel.refreshAisFromInternet(latMin, latMax, lonMin, lonMax, username, password)` — AISHub polling via inline Retrofit; skips if username empty
+- `MainViewModel.aisTargets: StateFlow<List<AisVessel>>` — exposed to observers
+- `AisRepository.ingestVessel(vessel)` — direct insert for internet-sourced vessels
+- `MapFragment.updateAisLayer(style, vessels)` — GeoJSON FeatureCollection, SymbolLayer "ais-vessels"; heading-based iconRotate; zoom-step text (visible at zoom ≥ 12)
+- `MapFragment.addShipArrowImage(style)` — rasterises ic_ship_arrow.xml into style
+- `ic_ship_arrow.xml` — pink arrow vector drawable for AIS icons
+- `MainActivity.startAisHardwareFeed(host, port)` — TCP stub reads !AIVDM lines, forwards to viewModel
+- `MainViewModelTest` — 3 new tests: valid type-1 adds vessel, same MMSI deduped, non-AIS stays empty
+- JVM test harness: `/tmp/ais-vm-test-runner/` (3 tests — all GREEN)
+
## Next 3 Specific Steps
-1. **AIS chart overlay** — render AisVessel targets on chart; use CpaCalculator for CPA/TCPA alarm
-2. **AIS TCP ingestion** — extend NmeaStreamManager to feed !AIVDM sentences to AisVdmParser via AisRepository
-3. **AISHub polling** — wire AisHubApiService + AisHubSource into a periodic polling ViewModel/UseCase
+1. **CPA/TCPA alarms** — use CpaCalculator in ViewModel to emit alarm when CPA < threshold; add UI indicator in MapFragment
+2. **AISHub periodic polling** — call refreshAisFromInternet() on a timer (e.g. every 60s) when GPS position is known
+3. **AIS TCP full implementation** — replace stub socket reader with NmeaStreamManager integration
## Scripts Added
- `test-runner/` — standalone Kotlin/JVM Gradle project; runs all 22 GPS/NMEA tests without Android SDK