Исправление записи в ISA порт
This commit is contained in:
16
Main.gd
16
Main.gd
@@ -36,7 +36,7 @@ func _ready():
|
||||
# Таблица 1
|
||||
node_select = $scroll1/table1
|
||||
draw_tabl(node_select, ROWS_REGS_DATA, ROWS_REGS_DATA.size())
|
||||
node_select.set_columns_min_size([250, 150, 150, 200, 150])
|
||||
node_select.set_columns_min_size([250, 160, 150, 190, 150])
|
||||
node_select.set_node_text(0, 0, ' НЕТ СВЯЗИ С ЯУ-07')
|
||||
node_select.set_node_text(1, 0, ' IP-АДРЕС')
|
||||
node_select.set_node_text(2, 0, '10.1.1.70')
|
||||
@@ -65,7 +65,7 @@ func _ready():
|
||||
# Поле для ввода (базовый порт)
|
||||
var edit_addr = node_select.get_node2(0, 2)
|
||||
edit_addr.editable = true
|
||||
edit_addr.placeholder_text = '%x' % port_select
|
||||
edit_addr.placeholder_text = ' 0x%x' % port_select
|
||||
edit_addr.connect('text_submitted', Callable(self, '_on_written_addres'))
|
||||
|
||||
# Поле для ввода (интервал непрерывной записи)
|
||||
@@ -115,7 +115,7 @@ func _process(delta):
|
||||
|
||||
if unit.isa_ports.has(port_select):
|
||||
node_select.set_node_text(4, 1, ' %x' % unit.isa_ports[port_select])
|
||||
var isa: Array
|
||||
var isa: Array = []
|
||||
for i in unit.isa_ports:
|
||||
isa.append('%x: %x' % [i, unit.isa_ports[i]])
|
||||
node_select.set_node_text(1, 1, ' ЗАПИСАТЬ В %x' % port_select)
|
||||
@@ -134,14 +134,21 @@ func on_timer():
|
||||
poll_receive(soc_brodcast, unit, address, port)
|
||||
var fl_done = unit.cmd_state == unit.CmdState.DONE
|
||||
if state == 1 and fl_done: ## Чтение из ИСА
|
||||
unit.send_isa(unit.CmdCode.READ_ISA, [port_select, ports_wr[port_select]])
|
||||
unit.send_isa(unit.CmdCode.READ_ISA, [port_select])
|
||||
node_select.set_node_text(3, 1, ' ПРОЧИТАНО ИЗ %x' % port_select)
|
||||
state = 2
|
||||
elif state == 2 and fl_done: ## Запись в ИСА
|
||||
unit.send_isa(unit.CmdCode.WRITE_ISA, [port_select, ports_wr[port_select]])
|
||||
|
||||
if unit.isa_ports.has(port_select):
|
||||
node_select.set_node_text(4, 1, '%x' % unit.isa_ports[port_select])
|
||||
var isa: Array = []
|
||||
for i in unit.isa_ports:
|
||||
isa.append('%x: %x' % [i, unit.isa_ports[i]])
|
||||
node_select.set_node_text(1, 1, ' ЗАПИСАТЬ В %x' % port_select)
|
||||
$ISA.text = 'ISA: ' + str(isa)
|
||||
state = 1
|
||||
|
||||
var rc = unit.process(dt)
|
||||
if rc == Error.OK:
|
||||
soc_unicast.send_to(address, port, unit.tx_data.slice(0, unit.tx_len))
|
||||
@@ -167,6 +174,7 @@ func on_command_done(_unit):
|
||||
line_yau07_control.text = ' ЯУ-07 НА СВЯЗИ'
|
||||
line_yau07_control.modulate = Color(0, 1, 0, 1)
|
||||
|
||||
|
||||
## Выставить адресс для записи
|
||||
func _on_written_addres(write_addres):
|
||||
port_select = write_addres.hex_to_int()
|
||||
|
||||
@@ -24,7 +24,6 @@ theme_override_colors/font_uneditable_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 17
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_hrhif")
|
||||
theme_override_styles/read_only = SubResource("StyleBoxFlat_q1ixs")
|
||||
alignment = 1
|
||||
editable = false
|
||||
caret_blink = true
|
||||
caret_blink_interval = 0.5
|
||||
|
||||
Reference in New Issue
Block a user