Отладка констант
This commit is contained in:
16
Main.gd
16
Main.gd
@@ -94,7 +94,15 @@ func poll_receive(sock: Socket) -> bool: ## Приёмник
|
|||||||
var rx_data = sock.get_packet()
|
var rx_data = sock.get_packet()
|
||||||
var addr_receive = sock.get_packet_ip()
|
var addr_receive = sock.get_packet_ip()
|
||||||
var port_receive = sock.get_packet_port()
|
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):
|
if (address == addr_receive) and (port == port_receive):
|
||||||
unit.parse(rx_data)
|
unit.parse(rx_data)
|
||||||
return false
|
return false
|
||||||
@@ -128,12 +136,10 @@ func on_timer() -> void:
|
|||||||
func on_line_changed(_unit) -> void:
|
func on_line_changed(_unit) -> void:
|
||||||
print_debug()
|
print_debug()
|
||||||
if unit.online:
|
if unit.online:
|
||||||
var line_yau07_control = node_select.get_node2(0, 0)
|
var line_yau07_control = node_select.get_node2(0, 1)
|
||||||
line_yau07_control.text = ' ЯУ-07Б НА СВЯЗИ'
|
|
||||||
line_yau07_control.modulate = Color(0, 1, 0, 1)
|
line_yau07_control.modulate = Color(0, 1, 0, 1)
|
||||||
else:
|
else:
|
||||||
var line_yau07_control = node_select.get_node2(0, 0)
|
var line_yau07_control = node_select.get_node2(0, 1)
|
||||||
line_yau07_control.text = ' НЕТ СВЯЗИ С ЯУ-07'
|
|
||||||
line_yau07_control.modulate = Color(1, 0, 0, 1)
|
line_yau07_control.modulate = Color(1, 0, 0, 1)
|
||||||
var light_interval = node_select.get_node2(1, 2)
|
var light_interval = node_select.get_node2(1, 2)
|
||||||
light_interval.modulate = Color(0.5, 0.5, 0.5, 1)
|
light_interval.modulate = Color(0.5, 0.5, 0.5, 1)
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ extends Node
|
|||||||
const TableNode = preload("res://table/node.tscn")
|
const TableNode = preload("res://table/node.tscn")
|
||||||
var file = FileAccess.open("user://constants.txt", FileAccess.READ)
|
var file = FileAccess.open("user://constants.txt", FileAccess.READ)
|
||||||
const UNICAST_PORT: int = 50003
|
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
|
const BROADCAST_PORT: int = 50000
|
||||||
var DEFAULT_ADDRESS: String = file.get_line()
|
var DEFAULT_ADDRESS: String = file.get_line() if file else '10.1.1.70'
|
||||||
var DEFAULT_PORT: String = file.get_line()
|
var DEFAULT_PORT: String = file.get_line() if file else '50070'
|
||||||
var BASE_ADDR: int = int(file.get_line())
|
var BASE_ADDR: int = int(file.get_line()) if file else 0x100
|
||||||
const ROWS_REGS_DATA: Array = [
|
const ROWS_REGS_DATA: Array = [
|
||||||
[TableNode, TableNode, TableNode, TableNode, TableNode],
|
[TableNode, TableNode, TableNode, TableNode, TableNode],
|
||||||
[TableNode, TableNode, TableNode, TableNode, TableNode],
|
[TableNode, TableNode, TableNode, TableNode, TableNode],
|
||||||
|
|||||||
Reference in New Issue
Block a user