Nil value instead zero by default

This commit is contained in:
2023-07-07 20:44:20 +03:00
parent 5d2c7e12fe
commit e42d3b5722
7 changed files with 774 additions and 472 deletions
+3 -3
View File
@@ -142,13 +142,13 @@ func updateContactorsView(msg *yabl.ContactorInternalState) {
s.Isolated,
s.DebugEnabled)
if s.ContactorReady == yabl.BOARD_READY_OK {
if s.ContactorReady != nil && *s.ContactorReady == yabl.BOARD_READY_OK {
p.TextStyle.Bg = ui.ColorClear
} else {
p.TextStyle.Bg = ui.ColorRed
}
if s.ContactorOn == yabl.ON {
if s.ContactorOn != nil && *s.ContactorOn == yabl.ON {
p.TitleStyle.Bg = ui.ColorBlue
} else {
p.TitleStyle.Bg = ui.ColorClear
@@ -227,7 +227,7 @@ func updateContactorsStateView(e *yabl.ContactorInternalErrors) {
e.Debug,
)
if e.BoardReady == yabl.BOARD_READY_OK {
if e.BoardReady != nil && *e.BoardReady == yabl.BOARD_READY_OK {
p.TextStyle.Bg = ui.ColorClear
} else {
p.TextStyle.Bg = ui.ColorRed