feat: clicking the status-bar amplifier chip toggles OPERATE <-> STANDBY (SPE/ACOM, optimistic flip reconciled by the poll; disabled offline) — PGXL still opens Settings, it has no standby command
This commit is contained in:
+15
-5
@@ -43,7 +43,7 @@ import {
|
||||
GetAwardDefs,
|
||||
GetUIPref, GetActiveProfile, QuitApp,
|
||||
ReportLiveActivity, LiveLastQSOAgeSec,
|
||||
GetPGXLSettings, GetPGXLStatus, GetSPEStatus, GetACOMStatus,
|
||||
GetPGXLSettings, GetPGXLStatus, GetSPEStatus, GetACOMStatus, SPESetOperate, ACOMSetOperate,
|
||||
} from '../wailsjs/go/main/App';
|
||||
import { Combobox } from '@/components/ui/combobox';
|
||||
import { applyAwardRefs } from '@/lib/awardRefs';
|
||||
@@ -5145,7 +5145,9 @@ export default function App() {
|
||||
onClick={() => { setSettingsSection('rotator'); setShowSettings(true); }}
|
||||
/>
|
||||
{/* Amplifier chip: green = OPERATE, orange = STANDBY, red = offline.
|
||||
(PGXL has no standby notion here — green when connected.) */}
|
||||
CLICK toggles OPERATE ↔ STANDBY (SPE/ACOM; optimistic flip, the 2s
|
||||
poll reconciles). The PGXL has no standby command here — its chip
|
||||
opens Settings instead, and shows green when connected. */}
|
||||
{ampCfg.enabled && (() => {
|
||||
const isPGXL = ampCfg.type === 'pgxl';
|
||||
const name = isPGXL ? 'PGXL'
|
||||
@@ -5153,12 +5155,20 @@ export default function App() {
|
||||
: `SPE ${ampSt.model || ''}`.trim();
|
||||
const dot = !ampSt.connected ? 'bg-danger' : (isPGXL || ampSt.operate) ? 'bg-success' : 'bg-warning';
|
||||
const state = !ampSt.connected ? (ampSt.last_error || 'offline') : (isPGXL ? (ampSt.state || 'connected') : ampSt.operate ? 'OPERATE' : 'STANDBY');
|
||||
const toggle = () => {
|
||||
if (isPGXL) { setSettingsSection('pgxl'); setShowSettings(true); return; }
|
||||
const want = !ampSt.operate;
|
||||
setAmpSt((s: any) => ({ ...s, operate: want }));
|
||||
(ampCfg.type.startsWith('acom') ? ACOMSetOperate(want) : SPESetOperate(want)).catch(() => {});
|
||||
};
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
title={`${name}: ${state}`}
|
||||
onClick={() => { setSettingsSection('pgxl'); setShowSettings(true); }}
|
||||
className="inline-flex items-center gap-1.5 px-2 h-5 rounded border text-[11px] transition-colors border-border hover:bg-muted cursor-pointer"
|
||||
disabled={!isPGXL && !ampSt.connected}
|
||||
title={`${name}: ${state}${!isPGXL && ampSt.connected ? (ampSt.operate ? ' — click for STANDBY' : ' — click for OPERATE') : ''}`}
|
||||
onClick={toggle}
|
||||
className={cn('inline-flex items-center gap-1.5 px-2 h-5 rounded border text-[11px] transition-colors',
|
||||
(!isPGXL && !ampSt.connected) ? 'opacity-60 cursor-default border-border' : 'border-border hover:bg-muted cursor-pointer')}
|
||||
>
|
||||
<span className={cn('size-2 rounded-full', dot)} />
|
||||
{name}
|
||||
|
||||
Reference in New Issue
Block a user