mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
fix: logbook mode display + bottom-sheet dialogs
- displayMode no longer trusts a stale submode for non-MFSK modes: FM/CW/SSB records (including ones persisted with the old default submode=FT4) now show their real mode; only MODE=MFSK uses the FT4 submode. QsoRecord defaults changed mode=MFSK->FM, submode=FT4->''. - LoTW report bridge sets submode=FT4 for MODE=MFSK so confirmations still match local FT4 records. - Logbook and LoTW upload config dialogs now use SharedDialog (bottom-sheet), matching the LoTW confirmed-grids dialog style.
This commit is contained in:
1 parent
e606afb0f3
commit
238511aa78
7 files changed
+136
-120
No files matched your search
+3
@@ -14,6 +14,9 @@ fun GridQso.toConfirmedRecord(accountCallsign: String): QsoRecord = QsoRecord(
|
||||
band = bandUp,
|
||||
rxBand = bandDown,
|
||||
mode = mode,
|
||||
// On satellites, MODE=MFSK means FT4 (ADIF pairing); keep the sub-mode so
|
||||
// confirmations match local FT4 records (mode=MFSK, submode=FT4).
|
||||
submode = if (mode.equals("MFSK", true)) "FT4" else "",
|
||||
satelliteName = satName,
|
||||
propagationMode = "SAT",
|
||||
status = QsoStatus.COMPLETE,
|
||||
|
||||
+6
-1
@@ -44,7 +44,12 @@ fun QsoRecord.withConfirmation(confirmed: QsoRecord): QsoRecord = copy(
|
||||
)
|
||||
|
||||
val QsoRecord.displayMode: String
|
||||
get() = submode.ifBlank { mode }.trim().uppercase(Locale.US)
|
||||
get() {
|
||||
// Satellite FT4 is MODE=MFSK + SUBMODE=FT4; any other mode keeps its own
|
||||
// label even when a stale submode default ("FT4") was persisted.
|
||||
val label = if (mode.equals("MFSK", true) && submode.isNotBlank()) submode else mode
|
||||
return label.trim().uppercase(Locale.US)
|
||||
}
|
||||
|
||||
val QsoRecord.isSatellite: Boolean
|
||||
get() = propagationMode.equals("SAT", true) || (propagationMode.isBlank() && satelliteName.isNotBlank())
|
||||
|
||||
@@ -25,8 +25,8 @@ data class QsoRecord(
|
||||
val rxFrequencyHz: Long? = null,
|
||||
val band: String = "",
|
||||
val rxBand: String = "",
|
||||
val mode: String = "MFSK",
|
||||
val submode: String = "FT4",
|
||||
val mode: String = "FM",
|
||||
val submode: String = "",
|
||||
val satelliteName: String = "",
|
||||
val transponderName: String = "",
|
||||
val satelliteMode: String = "",
|
||||
|
||||
+10
@@ -123,4 +123,14 @@ class LogbookMergeTest {
|
||||
assertEquals("FT4", ft4.displayMode)
|
||||
assertEquals("FM", local.displayMode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun displayMode_ignoresStaleSubmodeForOtherModes() {
|
||||
// Regression: records persisted with the old default submode="FT4" must not
|
||||
// show FT4 when the actual mode is FM/CW/SSB.
|
||||
val staleFm = QsoRecord(startUtcMillis = 0, theirCallsign = "x", myCallsign = "y", mode = "FM", submode = "FT4")
|
||||
val staleCw = QsoRecord(startUtcMillis = 0, theirCallsign = "x", myCallsign = "y", mode = "CW", submode = "FT4")
|
||||
assertEquals("FM", staleFm.displayMode)
|
||||
assertEquals("CW", staleCw.displayMode)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user