roughly tested. Sending seems to be efficient, tui client keeps breaking

main
Keegan 2 years ago
parent 68aa34ee0d
commit 1f074e5792

Binary file not shown.

Binary file not shown.

@ -98,7 +98,7 @@ func (l *Listener) TUIClientDiscoveryHandler(ctx context.Context, ping *pb.TUICl
var ok bool var ok bool
coord, ok = l.Coordinators["tui"] coord, ok = l.Coordinators["tui"]
if !ok { if !ok {
logging.Debug(logging.DSpawn,"CCO 01 Created RCO") logging.Debug(logging.DSpawn,"CCO 01 Created TCO")
coord = NewTUICoordinator(l.Ip, l.Sys, l.Err) coord = NewTUICoordinator(l.Ip, l.Sys, l.Err)
l.Coordinators["tui"] = coord l.Coordinators["tui"] = coord
coord.Start() coord.Start()

@ -103,7 +103,7 @@ func (s *StatusMonitor) UpdateListener(tid, reactorId uint32) {
go s.Listen(s.ReactorChan) go s.Listen(s.ReactorChan)
} else { } else {
s.DevBuf.Buf["Devices"] = make(map[uint32]*DeviceInfo) // clearing old devices s.DevBuf.Buf["Devices"] = make(map[uint32]*DeviceInfo) // clearing old devices
if s.DevBuf.ReactorId != reactorId { if s.DevBuf.ReactorId != reactorId && s.DevBuf.ReactorId != 0{
go s.SystemViewer.RemoveListener(s.DevBuf.ReactorId, tid) go s.SystemViewer.RemoveListener(s.DevBuf.ReactorId, tid)
} }
s.DevBuf.ReactorId = reactorId s.DevBuf.ReactorId = reactorId

@ -44,7 +44,7 @@ func NewTUIManager(ip string, c *Client, sys *SystemViewer, err chan error) Gene
t.Timeout = &Timeout{Alert:alert,TO:time.Duration(2500*time.Millisecond)} // short time outs are fine because we will just rejoin t.Timeout = &Timeout{Alert:alert,TO:time.Duration(2500*time.Millisecond)} // short time outs are fine because we will just rejoin
t.Manager = m t.Manager = m
t.Ip = ip t.Ip = ip
t.StatusMon = NewStatusMonitor("TUI",t.Id,sys) t.StatusMon = NewStatusMonitor("TUI",c.Id,sys)
return t return t
} }

@ -173,11 +173,11 @@ func (d *Display) DisplayReactors(r map[uint32]*Device) {
for _, reactor := range r { for _, reactor := range r {
txt := fmt.Sprintf("%v %v", reactor.Id, reactor.Status) txt := fmt.Sprintf("%v %v", reactor.Id, reactor.Status)
indx := int(reactor.Index) indx := int(reactor.Index)
for indx + 1 >= d.ReactorList.GetItemCount() { for indx + 2 >= d.ReactorList.GetItemCount() {
// this prevent overwriting quit entry // this prevent overwriting quit entry
d.ReactorList.InsertItem(-3,txt,reactor.Data,rune(47+d.ReactorList.GetItemCount()),nil) d.ReactorList.InsertItem(-3,txt,reactor.Data,rune(47+d.ReactorList.GetItemCount()),nil)
} }
if indx + 1 < d.ReactorList.GetItemCount() { if indx + 2 < d.ReactorList.GetItemCount() {
d.ReactorList.SetItemText(indx,txt,reactor.Data) d.ReactorList.SetItemText(indx,txt,reactor.Data)
} }
} }

Loading…
Cancel
Save