Отладка констант

This commit is contained in:
QAMuser
2024-10-09 11:58:03 +03:00
parent b501a60e5b
commit b7359c5fab
2 changed files with 15 additions and 9 deletions

16
Main.gd
View File

@@ -94,7 +94,15 @@ func poll_receive(sock: Socket) -> bool: ## Приёмник
var rx_data = sock.get_packet()
var addr_receive = sock.get_packet_ip()
var port_receive = sock.get_packet_port()
$BROADCAST.text = 'BROADCAST: ' + str(rx_data)
if rx_data:
$BROADCAST.text = 'BROADCAST: ' + str(rx_data)
var line_yau07_control = node_select.get_node2(0, 0)
line_yau07_control.text = ' ЯУ-07Б НА СВЯЗИ'
line_yau07_control.modulate = Color(0, 1, 0, 1)
else:
var line_yau07_control = node_select.get_node2(0, 0)
line_yau07_control.text = ' НЕТ СВЯЗИ С ЯУ-07'
line_yau07_control.modulate = Color(1, 0, 0, 1)
if (address == addr_receive) and (port == port_receive):
unit.parse(rx_data)
return false
@@ -128,12 +136,10 @@ func on_timer() -> void:
func on_line_changed(_unit) -> void:
print_debug()
if unit.online:
var line_yau07_control = node_select.get_node2(0, 0)
line_yau07_control.text = ' ЯУ-07Б НА СВЯЗИ'
var line_yau07_control = node_select.get_node2(0, 1)
line_yau07_control.modulate = Color(0, 1, 0, 1)
else:
var line_yau07_control = node_select.get_node2(0, 0)
line_yau07_control.text = ' НЕТ СВЯЗИ С ЯУ-07'
var line_yau07_control = node_select.get_node2(0, 1)
line_yau07_control.modulate = Color(1, 0, 0, 1)
var light_interval = node_select.get_node2(1, 2)
light_interval.modulate = Color(0.5, 0.5, 0.5, 1)

View File

@@ -2,11 +2,11 @@ extends Node
const TableNode = preload("res://table/node.tscn")
var file = FileAccess.open("user://constants.txt", FileAccess.READ)
const UNICAST_PORT: int = 50003
const UNICAST_ADDRESS: String = '10.1.1.3'
const UNICAST_ADDRESS: String = '10.1.1.14'
const BROADCAST_PORT: int = 50000
var DEFAULT_ADDRESS: String = file.get_line()
var DEFAULT_PORT: String = file.get_line()
var BASE_ADDR: int = int(file.get_line())
var DEFAULT_ADDRESS: String = file.get_line() if file else '10.1.1.70'
var DEFAULT_PORT: String = file.get_line() if file else '50070'
var BASE_ADDR: int = int(file.get_line()) if file else 0x100
const ROWS_REGS_DATA: Array = [
[TableNode, TableNode, TableNode, TableNode, TableNode],
[TableNode, TableNode, TableNode, TableNode, TableNode],