Skip to content

Commit 1232080

Browse files
committed
do not mess with the visuals
1 parent 8fe87ec commit 1232080

13 files changed

Lines changed: 6 additions & 281 deletions

File tree

manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"SupportedInMultiActions": true,
103103
"PropertyInspectorPath": "pi/sendmorse.html",
104104
"Controllers": ["Keypad"],
105-
"States": [{ "Title": "CW" }]
105+
"States": [{ "Title": "Send CW" }]
106106
},
107107
{
108108
"Name": "Set Antenna",
@@ -126,7 +126,7 @@
126126
"SupportedInMultiActions": true,
127127
"PropertyInspectorPath": "pi/setfrequency.html",
128128
"Controllers": ["Keypad"],
129-
"States": [{ "Title": "Freq" }]
129+
"States": [{ "Title": "f" }]
130130
},
131131
{
132132
"Name": "Set Frequency (rel)",
@@ -138,7 +138,7 @@
138138
"SupportedInMultiActions": true,
139139
"PropertyInspectorPath": "pi/setfrequencyrelative.html",
140140
"Controllers": ["Keypad"],
141-
"States": [{ "Title": "Freq Rel" }]
141+
"States": [{ "Title": "f rel" }]
142142
},
143143
{
144144
"Name": "Set Function",

pkg/action/antenna.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,6 @@ func (a *SetAntenna) parseSettings(settings map[string]any) (hl.VFO, int, int) {
5454
return hl.VFO(vfo), antenna, option
5555
}
5656

57-
func (a *SetAntenna) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
58-
a.UpdateVisual(payload)
59-
return nil
60-
}
61-
62-
func (a *SetAntenna) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
63-
_, antenna, _ := a.parseSettings(payload.Settings)
64-
title := "Ant"
65-
if antenna > 0 {
66-
title = "Ant " + strconv.Itoa(antenna)
67-
}
68-
a.deck.SetTitle(a.context, title, sdk.HardwareAndSoftware)
69-
return nil
70-
}
71-
7257
func (a *SetAntenna) KeyDown(payload *sdk.ReceivedEventPayload) error {
7358
vfo, antenna, option := a.parseSettings(payload.Settings)
7459
if vfo == "" || antenna == 0 {

pkg/action/frequency.go

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212
)
1313

1414
const (
15-
FrequencyDialUUID = "com.thecodingflow.hamlibplugin.frequencydial"
16-
SetFrequencyUUID = "com.thecodingflow.hamlibplugin.setfrequency"
17-
SetFrequencyRelativeUUID = "com.thecodingflow.hamlibplugin.setfrequencyrelative"
15+
FrequencyDialUUID = "com.thecodingflow.hamlibplugin.frequencydial"
16+
SetFrequencyUUID = "com.thecodingflow.hamlibplugin.setfrequency"
17+
SetFrequencyRelativeUUID = "com.thecodingflow.hamlibplugin.setfrequencyrelative"
1818
)
1919

2020
func init() {
@@ -57,20 +57,6 @@ func (a *FrequencyDial) parseSettings(settings map[string]any) (hl.VFO, hl.Frequ
5757
return hl.VFO(vfo), hl.Frequency(tuningStep)
5858
}
5959

60-
func (a *FrequencyDial) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
61-
a.UpdateVisual(payload)
62-
return nil
63-
}
64-
65-
func (a *FrequencyDial) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
66-
vfo, _ := a.parseSettings(payload.Settings)
67-
if vfo == "" {
68-
vfo = "VFO"
69-
}
70-
a.deck.SetTitle(a.context, string(vfo), sdk.HardwareAndSoftware)
71-
return nil
72-
}
73-
7460
func (a *FrequencyDial) DialRotate(payload *sdk.ReceivedEventPayload) error {
7561
if !a.clientLock.TryLock() {
7662
atomic.AddInt32(&a.queuedTicks, int32(payload.Ticks))
@@ -165,17 +151,6 @@ func (a *SetFrequency) parseSettings(settings map[string]any) (hl.VFO, hl.Freque
165151
return hl.VFO(vfo), hl.Frequency(frequency)
166152
}
167153

168-
func (a *SetFrequency) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
169-
a.UpdateVisual(payload)
170-
return nil
171-
}
172-
173-
func (a *SetFrequency) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
174-
title := "Freq"
175-
a.deck.SetTitle(a.context, title, sdk.HardwareAndSoftware)
176-
return nil
177-
}
178-
179154
func (a *SetFrequency) KeyDown(payload *sdk.ReceivedEventPayload) error {
180155
vfo, frequency := a.parseSettings(payload.Settings)
181156
if vfo == "" || frequency == 0 {
@@ -223,16 +198,6 @@ func (a *SetFrequencyRelative) parseSettings(settings map[string]any) (hl.VFO, h
223198
return hl.VFO(vfo), hl.Frequency(offset), hl.VFO(refVFO)
224199
}
225200

226-
func (a *SetFrequencyRelative) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
227-
a.UpdateVisual(payload)
228-
return nil
229-
}
230-
231-
func (a *SetFrequencyRelative) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
232-
a.deck.SetTitle(a.context, "Freq Rel", sdk.HardwareAndSoftware)
233-
return nil
234-
}
235-
236201
func (a *SetFrequencyRelative) KeyDown(payload *sdk.ReceivedEventPayload) error {
237202
vfo, offset, refVFO := a.parseSettings(payload.Settings)
238203
if vfo == "" || refVFO == "" {

pkg/action/func.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,6 @@ func (a *SetFunc) parseSettings(settings map[string]any) (hl.VFO, hl.Function, b
5353
return hl.VFO(vfo), hl.Function(function), status
5454
}
5555

56-
func (a *SetFunc) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
57-
a.UpdateVisual(payload)
58-
return nil
59-
}
60-
61-
func (a *SetFunc) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
62-
_, function, _ := a.parseSettings(payload.Settings)
63-
if function == "" {
64-
function = "Func"
65-
}
66-
a.deck.SetTitle(a.context, string(function), sdk.HardwareAndSoftware)
67-
return nil
68-
}
69-
7056
func (a *SetFunc) KeyDown(payload *sdk.ReceivedEventPayload) error {
7157
vfo, function, status := a.parseSettings(payload.Settings)
7258
if vfo == "" || function == "" {
@@ -106,20 +92,6 @@ func (a *ToggleFunc) parseSettings(settings map[string]any) (hl.VFO, hl.Function
10692
return hl.VFO(vfo), hl.Function(function)
10793
}
10894

109-
func (a *ToggleFunc) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
110-
a.UpdateVisual(payload)
111-
return nil
112-
}
113-
114-
func (a *ToggleFunc) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
115-
_, function := a.parseSettings(payload.Settings)
116-
if function == "" {
117-
function = "Func"
118-
}
119-
a.deck.SetTitle(a.context, string(function), sdk.HardwareAndSoftware)
120-
return nil
121-
}
122-
12395
func (a *ToggleFunc) KeyDown(payload *sdk.ReceivedEventPayload) error {
12496
vfo, function := a.parseSettings(payload.Settings)
12597
if vfo == "" || function == "" {

pkg/action/level.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,6 @@ func (a *SetLevel) parseSettings(settings map[string]any) (hl.VFO, hl.Level, flo
5555
return hl.VFO(vfo), hl.Level(level), value
5656
}
5757

58-
func (a *SetLevel) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
59-
a.UpdateVisual(payload)
60-
return nil
61-
}
62-
63-
func (a *SetLevel) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
64-
_, level, _ := a.parseSettings(payload.Settings)
65-
if level == "" {
66-
level = "Level"
67-
}
68-
a.deck.SetTitle(a.context, string(level), sdk.HardwareAndSoftware)
69-
return nil
70-
}
71-
7258
func (a *SetLevel) KeyDown(payload *sdk.ReceivedEventPayload) error {
7359
vfo, level, value := a.parseSettings(payload.Settings)
7460
if vfo == "" || level == "" {
@@ -120,20 +106,6 @@ func (a *LevelEncoder) parseSettings(settings map[string]any) (hl.VFO, hl.Level,
120106
return hl.VFO(vfo), hl.Level(level), step
121107
}
122108

123-
func (a *LevelEncoder) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
124-
a.UpdateVisual(payload)
125-
return nil
126-
}
127-
128-
func (a *LevelEncoder) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
129-
_, level, _ := a.parseSettings(payload.Settings)
130-
if level == "" {
131-
level = "Level"
132-
}
133-
a.deck.SetTitle(a.context, string(level), sdk.HardwareAndSoftware)
134-
return nil
135-
}
136-
137109
func (a *LevelEncoder) DialRotate(payload *sdk.ReceivedEventPayload) error {
138110
if !a.clientLock.TryLock() {
139111
atomic.AddInt32(&a.queuedTicks, int32(payload.Ticks))

pkg/action/morse.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ func (a *SendMorse) parseSettings(settings map[string]any) string {
3838
return text
3939
}
4040

41-
func (a *SendMorse) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
42-
a.UpdateVisual(payload)
43-
return nil
44-
}
45-
46-
func (a *SendMorse) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
47-
a.deck.SetTitle(a.context, "CW", sdk.HardwareAndSoftware)
48-
return nil
49-
}
50-
5141
func (a *SendMorse) KeyDown(payload *sdk.ReceivedEventPayload) error {
5242
text := a.parseSettings(payload.Settings)
5343
if text == "" {
@@ -75,16 +65,6 @@ func NewStopMorse(context string, client RigClient, deck Deck) Action {
7565
}
7666
}
7767

78-
func (a *StopMorse) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
79-
a.UpdateVisual(payload)
80-
return nil
81-
}
82-
83-
func (a *StopMorse) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
84-
a.deck.SetTitle(a.context, "Stop CW", sdk.HardwareAndSoftware)
85-
return nil
86-
}
87-
8868
func (a *StopMorse) KeyDown(payload *sdk.ReceivedEventPayload) error {
8969
err := a.client.StopMorse()
9070
if err != nil {

pkg/action/parm.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,6 @@ func (a *SetParm) parseSettings(settings map[string]any) (hl.Parameter, string)
4141
return hl.Parameter(parameter), value
4242
}
4343

44-
func (a *SetParm) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
45-
a.UpdateVisual(payload)
46-
return nil
47-
}
48-
49-
func (a *SetParm) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
50-
parameter, _ := a.parseSettings(payload.Settings)
51-
if parameter == "" {
52-
parameter = "Parm"
53-
}
54-
a.deck.SetTitle(a.context, string(parameter), sdk.HardwareAndSoftware)
55-
return nil
56-
}
57-
5844
func (a *SetParm) KeyDown(payload *sdk.ReceivedEventPayload) error {
5945
parameter, value := a.parseSettings(payload.Settings)
6046
if parameter == "" {

pkg/action/powerstat.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ func (a *PowerStat) parseSettings(settings map[string]any) hl.PowerStatus {
4444
return hl.PowerStatus(status)
4545
}
4646

47-
func (a *PowerStat) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
48-
a.UpdateVisual(payload)
49-
return nil
50-
}
51-
52-
func (a *PowerStat) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
53-
status := a.parseSettings(payload.Settings)
54-
title := powerStatusTitle(status)
55-
a.deck.SetTitle(a.context, title, sdk.HardwareAndSoftware)
56-
return nil
57-
}
58-
5947
func (a *PowerStat) KeyDown(payload *sdk.ReceivedEventPayload) error {
6048
status := a.parseSettings(payload.Settings)
6149

@@ -80,16 +68,6 @@ func NewOnOff(context string, client RigClient, deck Deck) Action {
8068
}
8169
}
8270

83-
func (a *OnOff) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
84-
a.UpdateVisual(payload)
85-
return nil
86-
}
87-
88-
func (a *OnOff) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
89-
a.deck.SetTitle(a.context, "On/Off", sdk.HardwareAndSoftware)
90-
return nil
91-
}
92-
9371
func (a *OnOff) KeyDown(payload *sdk.ReceivedEventPayload) error {
9472
current, err := a.client.GetPowerStatus()
9573
if err != nil {
@@ -110,18 +88,3 @@ func (a *OnOff) KeyDown(payload *sdk.ReceivedEventPayload) error {
11088
}
11189
return nil
11290
}
113-
114-
func powerStatusTitle(status hl.PowerStatus) string {
115-
switch status {
116-
case hl.PowerOff:
117-
return "Off"
118-
case hl.PowerOn:
119-
return "On"
120-
case hl.PowerStandby:
121-
return "Standby"
122-
case hl.PowerOperate:
123-
return "Operate"
124-
default:
125-
return "Power"
126-
}
127-
}

pkg/action/ritxit.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,6 @@ func (a *OffsetEncoder) parseSettings(settings map[string]any) (hl.VFO, hl.Frequ
9292
return hl.VFO(vfo), hl.Frequency(step)
9393
}
9494

95-
func (a *OffsetEncoder) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
96-
a.UpdateVisual(payload)
97-
return nil
98-
}
99-
100-
func (a *OffsetEncoder) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
101-
a.deck.SetTitle(a.context, a.accessor.name, sdk.HardwareAndSoftware)
102-
return nil
103-
}
104-
10595
func (a *OffsetEncoder) DialRotate(payload *sdk.ReceivedEventPayload) error {
10696
if !a.clientLock.TryLock() {
10797
atomic.AddInt32(&a.queuedTicks, int32(payload.Ticks))

pkg/action/selectmode.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,6 @@ func (a *SelectMode) parseSettings(settings map[string]any) (hl.VFO, hl.Mode) {
3939
return hl.VFO(vfo), hl.Mode(mode)
4040
}
4141

42-
func (a *SelectMode) DidReceiveSettings(payload *sdk.ReceivedEventPayload) error {
43-
a.UpdateVisual(payload)
44-
return nil
45-
}
46-
47-
func (a *SelectMode) UpdateVisual(payload *sdk.ReceivedEventPayload) error {
48-
_, mode := a.parseSettings(payload.Settings)
49-
if mode == "" {
50-
mode = "Mode"
51-
}
52-
a.deck.SetTitle(a.context, string(mode), sdk.HardwareAndSoftware)
53-
return nil
54-
}
55-
5642
func (a *SelectMode) KeyDown(payload *sdk.ReceivedEventPayload) error {
5743
vfo, mode := a.parseSettings(payload.Settings)
5844
if vfo == "" || mode == "" {

0 commit comments

Comments
 (0)