add read array for state machine

This commit is contained in:
2024-12-13 17:33:56 +03:00
parent 1065d20553
commit 82459cdac7
4 changed files with 30 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
extends Node2D
signal read_ems_g()
#var unit = Yau07.YaU07.new('ЯУ07')
var flag_mode = Constants.ADDRESSES[0][3]
var broadcast_packet: PackedByteArray
@@ -9,7 +10,6 @@ var flag_yau_control: bool
var CONTROL_TABLE: Array
func _ready() -> void:
# Таблица УКП_1
node_select1 = $TabContainer/PRD/scroll1/table1
@@ -72,8 +72,8 @@ func _on_yau_status(yau_status):
func _on_read_isa(unit_isa_ports):
var isa: Array = []
for i in unit_isa_ports:
isa.append('%x: %x' % [i, unit_isa_ports[i]])
$ISA.text = 'ISA: ' + str(unit_isa_ports)
isa.append('%x: %s' % [i, unit_isa_ports[i]])
$ISA.text = 'ISA: ' + str(isa)
## Рисует таблицу
@@ -219,6 +219,7 @@ func _on_control_button() -> void:
func _on_emsg_select() -> void:
emit_signal('read_ems_g')
$TabContainer.current_tab = 2
$Background/side_panel/select_ems_g.button_pressed = true
$Background/side_panel/select_control.button_pressed = false
@@ -244,16 +245,14 @@ func fill_item(node, i_column: int, i_row: int, arr: Dictionary, select: int = 0
func _on_zapret(toggled_on: bool, meta) -> void:
var send_array: Array = []
var address_port_wr = 0x122
var ports_wr: Dictionary = {address_port_wr : meta.get_meta('litera')} ## СИ2, СИ4, СИ6 = 0x30, СИ3, СИ5, СИ7 = 0x31, СИ1 = 0x2F
var ports_wr: Dictionary = {0x122 : meta.get_meta('litera')} ## СИ2, СИ4, СИ6 = 0x30, СИ3, СИ5, СИ7 = 0x31, СИ1 = 0x2F
Network.send_array.append(ports_wr)
ports_wr = {}
address_port_wr = 0x128
ports_wr[address_port_wr] = 0x4000 if toggled_on else 0x0
ports_wr[0x128] = 0x4000 if toggled_on else 0x0
Network.send_array.append(ports_wr)
func _on_read_isa_pressed() -> void:
Network.flag_read_isa = true
Network.read_array.append(0x122)
Network.read_array.append(0x128)