full sync ems g

This commit is contained in:
2024-12-18 14:07:32 +03:00
parent 250d7c3c91
commit 4575a4ba18

View File

@@ -60,6 +60,7 @@ func _ready() -> void:
func _process(delta: float) -> void:
last_update_time += delta
poll_receive(soc_brodcast)
poll_receive(soc_unicast)
state_machine()
match unit.process(delta):
Error.OK: soc_unicast.send_to(address, port, unit.tx_data.slice(0, unit.tx_len))
@@ -70,10 +71,8 @@ func state_machine():
var fl_done = (unit.cmd_state == unit.CmdState.DONE)
## Режим ожидания
if state == Constants.STATE.WAIT and fl_done:
if send_array.size():
state = Constants.STATE.READ_ISA if send_array[0][0] == 'rd' else Constants.STATE.WRITE_ISA
## Режим чтения из ИСА
elif state == Constants.STATE.READ_ISA and fl_done:
var ports_read = send_array.pop_front()
@@ -88,7 +87,7 @@ func state_machine():
elif state == Constants.STATE.DONE and fl_done:
emit_signal('yau_read_isa', unit.isa_ports)
state = Constants.STATE.WAIT
func on_line_changed(_unit) -> void:
emit_signal('yau_status_line', unit.online)