mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-07 04:57:23 +00:00
feat(map): award filters with boundary overlay in grid mode
- Grid-mode top bar replaced with award filter chips (All/DXCC/VUCC/ WAPC/WAJA/WAZ/WAS) showing live progress (count/target) - New AwardBoundaryOverlay renders real administrative boundaries (provinces/prefectures/CQ zones/states/countries) with the VUCC visual language: yellow boundary lines, green fill for worked regions, labels - Boundary assets packaged from public GeoJSON (DataV China, Japan land, HB9HIL CQ zones, Natural Earth states/countries) with ADIF match keys: WAPC province codes, WAJA ADIF prefecture numbers, US state abbrs, ARRL DXCC entity codes - GridQso extended with dxcc/country/cqz/state parsed from LoTW report (qso_qsldetail); AwardCalculator derives six-award progress; STATE is interpreted per DXCC entity (ADIF 'STATE depends on DXCC') - Grid-mode toggle pill floated at map top-right (Grid mode / Satellite mode) - New tests: AwardCalculatorTest (9 cases), LoTW award-field parsing (3 cases)
This commit is contained in:
1 parent
cce9209b3d
commit
4a33d1b19a
17 files changed
+891
-15
No files matched your search
+15
-1
@@ -156,6 +156,10 @@ class LoTWRepository : ILoTWRepository {
|
||||
var mode = ""
|
||||
var bandUp = ""
|
||||
var bandDown = ""
|
||||
var dxcc: Int? = null
|
||||
var country: String? = null
|
||||
var cqz: Int? = null
|
||||
var state: String? = null
|
||||
val gridsInRecord = mutableListOf<String>()
|
||||
|
||||
fun emitRecord() {
|
||||
@@ -163,7 +167,8 @@ class LoTWRepository : ILoTWRepository {
|
||||
val epochMs = adifTimestampToEpoch(qsoDate, timeOn)
|
||||
val qso = com.rtbishop.look4sat.core.domain.model.GridQso(
|
||||
call = call, epochMs = epochMs, satName = satName,
|
||||
mode = mode, bandUp = bandUp, bandDown = bandDown
|
||||
mode = mode, bandUp = bandUp, bandDown = bandDown,
|
||||
dxcc = dxcc, country = country, cqz = cqz, state = state
|
||||
)
|
||||
for (grid in gridsInRecord) {
|
||||
result.getOrPut(grid) { mutableListOf() }.add(qso)
|
||||
@@ -173,6 +178,7 @@ class LoTWRepository : ILoTWRepository {
|
||||
fun resetRecord() {
|
||||
propMode = null; call = ""; qsoDate = ""; timeOn = ""
|
||||
satName = ""; mode = ""; bandUp = ""; bandDown = ""
|
||||
dxcc = null; country = null; cqz = null; state = null
|
||||
gridsInRecord.clear()
|
||||
}
|
||||
|
||||
@@ -199,6 +205,14 @@ class LoTWRepository : ILoTWRepository {
|
||||
bandUp = adifValue(line).uppercase()
|
||||
line.startsWith("<BAND:") && !line.startsWith("<BAND_RX:") ->
|
||||
bandDown = adifValue(line).uppercase()
|
||||
line.startsWith("<DXCC:") ->
|
||||
dxcc = adifValue(line).toIntOrNull()
|
||||
line.startsWith("<COUNTRY:") ->
|
||||
country = adifValue(line).ifBlank { null }
|
||||
line.startsWith("<CQZ:") ->
|
||||
cqz = adifValue(line).toIntOrNull()
|
||||
line.startsWith("<STATE:") ->
|
||||
state = adifValue(line).trim().ifBlank { null }
|
||||
line.startsWith("<GRIDSQUARE:") || line.startsWith("<VUCC_GRIDS:") -> {
|
||||
// VUCC_GRIDS holds a comma-separated list of grids
|
||||
// ("EN52en,EN53fa"), up to four for contacts spanning
|
||||
|
||||
@@ -199,7 +199,12 @@ class SettingsRepo(
|
||||
satName = o.optString("s"),
|
||||
mode = o.optString("m"),
|
||||
bandUp = o.optString("bu"),
|
||||
bandDown = o.optString("bd")
|
||||
bandDown = o.optString("bd"),
|
||||
// New award fields: absent in pre-award data -> null.
|
||||
dxcc = o.optInt("dx", 0).takeIf { it > 0 },
|
||||
country = o.optString("cty").ifBlank { null },
|
||||
cqz = o.optInt("cq", 0).takeIf { it > 0 },
|
||||
state = o.optString("st").ifBlank { null }
|
||||
)
|
||||
}
|
||||
if (list.isNotEmpty()) result[grid] = list
|
||||
@@ -223,6 +228,10 @@ class SettingsRepo(
|
||||
.put("m", q.mode)
|
||||
.put("bu", q.bandUp)
|
||||
.put("bd", q.bandDown)
|
||||
.put("dx", q.dxcc ?: 0)
|
||||
.put("cty", q.country ?: "")
|
||||
.put("cq", q.cqz ?: 0)
|
||||
.put("st", q.state ?: "")
|
||||
)
|
||||
}
|
||||
root.put(grid, array)
|
||||
|
||||
Reference in new issue
Block a user