Show in the wizard's summary what Save leaves on

On a station left unchanged the summary read the log page's answers, which cannot express a DX cluster server or a frequency source running without a log source; it said no while Save left both on. The summary now shows the stored switches until the log page is part of the run. Ports, names, host and identifiers are reloaded on a source change, like the antenna values.

Written-by: Claude Fable 5.2
This commit is contained in:
Rsclub2_2 committed 2026-11-18 21:32:14 +01:00
1 parent 175b6350c2
commit 0d0b752bed
5 files changed
+144 -11

No files matched your search

@@ -595,4 +595,34 @@ class SetupWizardStateTest {
"the summary must not show a value that Save will not write",
)
}
@Test
fun theSummaryOfAKeptStationShowsWhatSaveLeavesOn() {
// No log source, but the DX cluster server and a frequency source are on.
val state = SetupWizardState(duplicatedWinTestStation().apply {
setLogsynch_wintestNetworkListenerEnabled(false)
setLogsynch_wintestQrgSyncEnabled(true)
setNotify_dxClusterServerEnabled(true)
})
state.chooseStationSource(WizardSource.KEEP)
state.next()
state.name = "Philipp"
state.next()
state.callsign = "DL0TEST"
state.password = "secret"
state.next()
assertEquals(WizardPage.SUMMARY, state.page)
assertTrue(state.summaryClusterServer, "Save leaves it on, so the summary must not say no")
assertTrue(state.summaryQrgFollow)
assertFalse(state.switchedOff.contains(WizardSwitch.CLUSTER_SERVER))
// Once the log page is part of the run its answers count, and what they drop is named.
state.edit(WizardPage.LOG)
state.next()
assertFalse(state.summaryClusterServer)
assertFalse(state.summaryQrgFollow)
assertTrue(state.switchedOff.containsAll(listOf(WizardSwitch.QRG_FOLLOW, WizardSwitch.CLUSTER_SERVER)))
}
}
@@ -297,4 +297,55 @@ class WizardIntegrationsTest {
answers.rotatorPort = 0
assertFalse(answers.gearComplete)
}
@Test
fun loadingAgainPutsTheDetailsBackToTheStoredOnes() {
val answers = WizardIntegrations(winTestStation())
answers.udpPort = 1
answers.wintestPort = 2
answers.wintestStationName = "typed"
answers.filePath = "/typed"
answers.rotatorHost = "typed"
answers.rotatorPort = 3
answers.airScoutPort = 4
answers.airScoutServerName = "typed"
answers.airScoutClientName = "typed"
answers.loadFresh()
assertEquals(12060, answers.udpPort)
assertEquals(9999, answers.wintestPort)
assertEquals("KST", answers.wintestStationName)
assertEquals("127.0.0.1", answers.rotatorHost)
assertEquals(12000, answers.rotatorPort)
assertEquals(9872, answers.airScoutPort)
assertEquals("AS", answers.airScoutServerName)
assertEquals("KST", answers.airScoutClientName)
answers.filePath = "/typed"
answers.rotatorPort = 3
answers.loadStored()
assertFalse(answers.filePath == "/typed", "the stored file name is back")
assertEquals(12000, answers.rotatorPort)
}
@Test
fun theStoredSwitchesAreKnownWhateverTheLogProgram() {
// The settings window lets the DX cluster server and a frequency source run without
// a log source; the page's own answers cannot express that.
val answers = WizardIntegrations(allOff {
setNotify_dxClusterServerEnabled(true)
setTrxSynch_ucxLogUDPListenerEnabled(true)
})
assertEquals(WizardLogProgram.NONE, answers.logProgram)
assertFalse(answers.clusterServer, "the page shows none of it")
assertTrue(answers.storedClusterServer)
assertTrue(answers.storedQrgFollow)
val off = WizardIntegrations(allOff())
assertFalse(off.storedClusterServer)
assertFalse(off.storedQrgFollow)
}
}