fix(profiles): station hardware must follow the active profile
Every setting is per profile, amplifiers included — that is the whole point of one profile per station. But the amplifier clients were built once at startup and again only when Settings was saved, so switching profile left them on the previous profile's port. An operator with an SPE on COM9 for HF and another on COM10 for 6 m had to open Settings and press Save after every switch. Save is not a connect button; switching profile is what asks for that hardware. The amplifier is what was reported, but it was never alone: the motorized antenna, the Antenna Genius and the Tuner Genius are configured the same way and were started in the same two places. All four now restart on a profile switch, asynchronously, exactly as a save does. Rotators were already correct — their client is built per command rather than held open, so they read the active profile every time. Unconditional, like a save: comparing each device's configuration across profiles to skip a reconnect would trade a second of downtime for the chance of missing one. A test now keeps the two lists in lockstep — anything started at boot must be re-applied on a profile switch or be named, with its reason, as something that must not be.
This commit is contained in:
@@ -14120,8 +14120,9 @@ func (a *App) ActivateProfile(id int64) error {
|
||||
|
||||
// reloadAfterProfileSwitch re-applies all settings-derived state for the newly
|
||||
// active profile: lookup providers, upload-service accounts, CAT connection,
|
||||
// and the QSO recorder (audio devices). The Winkeyer stays as-is (the operator
|
||||
// connects it explicitly). The frontend reloads its panels via profile:changed.
|
||||
// the station hardware, and the QSO recorder (audio devices). The Winkeyer
|
||||
// stays as-is (the operator connects it explicitly). The frontend reloads its
|
||||
// panels via profile:changed.
|
||||
func (a *App) reloadAfterProfileSwitch() {
|
||||
a.reloadLookupProviders()
|
||||
if a.extsvc != nil {
|
||||
@@ -14131,6 +14132,21 @@ func (a *App) reloadAfterProfileSwitch() {
|
||||
// runs from ActivateProfile, a click, and a rig that is slow to release would
|
||||
// otherwise freeze the switch.
|
||||
a.restartAsync("cat", a.reloadCAT)
|
||||
// Every device below is configured PER PROFILE, and none of them used to
|
||||
// follow the profile: they were built once at startup and again only when
|
||||
// Settings was saved. An operator with an SPE on COM9 for HF and another on
|
||||
// COM10 for 6 m — one amplifier per profile, which is the whole point of
|
||||
// having two — switched profile and stayed connected to the previous port,
|
||||
// then had to open Settings and press Save to get the right one. Save is not
|
||||
// a connect button; switching profile is what asks for this hardware.
|
||||
//
|
||||
// Unconditional, exactly as a save is: the alternative is comparing every
|
||||
// device's configuration between profiles, and a needless reconnect on a
|
||||
// profile switch costs a second, while a missed one costs the amplifier.
|
||||
a.restartAsync("amp", a.startAmps)
|
||||
a.restartAsync("antenna", a.startUltrabeam)
|
||||
a.restartAsync("antgenius", a.startAntGenius)
|
||||
a.restartAsync("tuner", a.startTunerGenius)
|
||||
a.startQSORecorderIfEnabled()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user