Доработка. Индикация цветом достоверности данных

This commit is contained in:
sasha80
2025-03-21 09:53:50 +03:00
parent 0ff8a2e1e5
commit 8ae5d606ad

View File

@@ -36,6 +36,7 @@ func on_line_changed_sch3(unit_sch3):
regs_input.clear()
switches_sync = false
$margin/vbox/grid1/lbl_freq.text = '<нет данных>'
$margin/vbox/grid1/lbl_freq.self_modulate = Color.CADET_BLUE
$margin/vbox/grid1/state_freq.texture = textures[STATE_VAL.NONE]
$margin/vbox/grid/state.texture = textures[STATE_VAL.NONE]
@@ -127,6 +128,7 @@ func on_input(base_addr: int, data: Array):
regs_input[base_addr + i] = data[i]
# Таблица 3.15, Регистр PowerState
$margin/vbox/grid1/lbl_freq.text = '%d' % (regs_input[4] & 0x1ff)
$margin/vbox/grid1/lbl_freq.self_modulate = Color.WHITE
$margin/vbox/grid1/state_freq.texture \
= textures[STATE_VAL.GOOD] if regs_input[4] & (1 << 15) \
else textures[STATE_VAL.ERROR]