@@ -29,6 +29,7 @@ type View interface {
2929 SetMode (text string )
3030 SetXITActive (active bool )
3131 SetXIT (active bool , offset core.Frequency )
32+ SetTXState (ptt bool , parrotActive bool , parrotTimeLeft time.Duration )
3233 SetMyExchange (int , string )
3334 SetTheirExchange (int , string )
3435
@@ -140,6 +141,10 @@ type Controller struct {
140141 editQSO core.QSO
141142 ignoreQSOSelection bool
142143 ignoreFrequencyJump bool
144+
145+ ptt bool
146+ parrotActive bool
147+ parrotTimeLeft time.Duration
143148}
144149
145150func (c * Controller ) Notify (listener any ) {
@@ -543,15 +548,22 @@ func (c *Controller) XITActiveChanged(active bool) {
543548}
544549
545550func (c * Controller ) VFOPTTChanged (active bool ) {
546- log .Printf ("PTT active: %t" , active )
551+ c .ptt = active
552+ c .updateTXState ()
547553}
548554
549555func (c * Controller ) ParrotActive (active bool ) {
550- log .Printf ("Parrot active: %t" , active )
556+ c .parrotActive = active
557+ c .updateTXState ()
551558}
552559
553560func (c * Controller ) ParrotTimeLeft (timeLeft time.Duration ) {
554- log .Printf ("Parrot time left: %v" , timeLeft )
561+ c .parrotTimeLeft = timeLeft
562+ c .updateTXState ()
563+ }
564+
565+ func (c * Controller ) updateTXState () {
566+ c .view .SetTXState (c .ptt , c .parrotActive , c .parrotTimeLeft )
555567}
556568
557569func (c * Controller ) SendQuestion () {
@@ -968,24 +980,25 @@ func (c *Controller) EntrySelected(entry core.BandmapEntry) {
968980
969981type nullView struct {}
970982
971- func (n * nullView ) SetUTC (string ) {}
972- func (n * nullView ) SetMyCall (string ) {}
973- func (n * nullView ) SetFrequency (core.Frequency ) {}
974- func (n * nullView ) SetCallsign (string ) {}
975- func (n * nullView ) SetBand (text string ) {}
976- func (n * nullView ) SetMode (text string ) {}
977- func (n * nullView ) SetXITActive (active bool ) {}
978- func (n * nullView ) SetXIT (active bool , offset core.Frequency ) {}
979- func (n * nullView ) SetMyExchange (int , string ) {}
980- func (n * nullView ) SetTheirExchange (int , string ) {}
981- func (n * nullView ) SetMyExchangeFields ([]core.ExchangeField ) {}
982- func (n * nullView ) SetTheirExchangeFields ([]core.ExchangeField ) {}
983- func (n * nullView ) SetActiveField (core.EntryField ) {}
984- func (n * nullView ) SelectText (core.EntryField , string ) {}
985- func (n * nullView ) SetDuplicateMarker (bool ) {}
986- func (n * nullView ) SetEditingMarker (bool ) {}
987- func (n * nullView ) ShowMessage (... interface {}) {}
988- func (n * nullView ) ClearMessage () {}
983+ func (n * nullView ) SetUTC (string ) {}
984+ func (n * nullView ) SetMyCall (string ) {}
985+ func (n * nullView ) SetFrequency (core.Frequency ) {}
986+ func (n * nullView ) SetCallsign (string ) {}
987+ func (n * nullView ) SetBand (text string ) {}
988+ func (n * nullView ) SetMode (text string ) {}
989+ func (n * nullView ) SetXITActive (active bool ) {}
990+ func (n * nullView ) SetXIT (active bool , offset core.Frequency ) {}
991+ func (n * nullView ) SetTXState (ptt bool , parrotActive bool , parrotTimeLeft time.Duration ) {}
992+ func (n * nullView ) SetMyExchange (int , string ) {}
993+ func (n * nullView ) SetTheirExchange (int , string ) {}
994+ func (n * nullView ) SetMyExchangeFields ([]core.ExchangeField ) {}
995+ func (n * nullView ) SetTheirExchangeFields ([]core.ExchangeField ) {}
996+ func (n * nullView ) SetActiveField (core.EntryField ) {}
997+ func (n * nullView ) SelectText (core.EntryField , string ) {}
998+ func (n * nullView ) SetDuplicateMarker (bool ) {}
999+ func (n * nullView ) SetEditingMarker (bool ) {}
1000+ func (n * nullView ) ShowMessage (... interface {}) {}
1001+ func (n * nullView ) ClearMessage () {}
9891002
9901003type nullVFO struct {}
9911004
0 commit comments