исправление морды
This commit is contained in:
@@ -7,11 +7,6 @@ func _ready() -> void:
|
||||
Network.connect('yau_receive', Callable(self, '_on_data_received'))
|
||||
Network.connect('yau_status_line', Callable(self, '_control_pribor'))
|
||||
|
||||
var timer = Timer.new()
|
||||
self.add_child(timer)
|
||||
timer.connect('timeout', Callable(self, 'on_timer'))
|
||||
timer.start(1)
|
||||
|
||||
'''sockets_ind = [
|
||||
$soc_y5/ems_g/light_ind,
|
||||
$soc_y5/ug/light_ind,
|
||||
@@ -32,11 +27,11 @@ func on_timer(unit):
|
||||
print(unit)
|
||||
|
||||
func _on_data_received(data_from_yau_07):
|
||||
var status_board = data_from_yau_07.decode_u8(Constants.DataIndices.STATUS_BOARD)
|
||||
var dry_contact: int = data_from_yau_07.decode_u16(Constants.DataIndices.DRY_CONTACT) # Контроль сухих контактов (УГ)
|
||||
var _status_board = data_from_yau_07.decode_u8(Constants.DataIndices.STATUS_BOARD)
|
||||
var _dry_contact: int = data_from_yau_07.decode_u16(Constants.DataIndices.DRY_CONTACT) # Контроль сухих контактов (УГ)
|
||||
|
||||
|
||||
## From Network status about yau-07
|
||||
func _control_pribor(yau_status:bool) -> void:
|
||||
func _control_pribor(_yau_status:bool) -> void:
|
||||
#$device.text = str(Constants.CURRENT_MODE)
|
||||
$soc_y5/ay07.state = Constants.STATE_VAL.GOOD
|
||||
|
||||
@@ -97,8 +97,8 @@ func _on_data_received(data_from_yau_07):
|
||||
var out_imp: int = data_from_yau_07.decode_u16(Constants.DataIndices.OUT_IMPULS_PRD)
|
||||
var parent_node2 = get_parent().get_parent()
|
||||
|
||||
#process_sockets_vert(in_blank, in_imp, 16, 1, parent_node2)
|
||||
#process_sockets_horizon(out_blank, out_imp, 16, 2, parent_node2)
|
||||
process_sockets_vert(in_blank, in_imp, 16, 1, parent_node2)
|
||||
process_sockets_horizon(out_blank, out_imp, 16, 2, parent_node2)
|
||||
|
||||
|
||||
func process_sockets_horizon(blank: int, imp: int, count: int, col: int, parent_node2: Node):
|
||||
@@ -113,20 +113,18 @@ func process_sockets_horizon(blank: int, imp: int, count: int, col: int, parent_
|
||||
|
||||
set_frame(socket_status, frame_type)
|
||||
|
||||
if i == 1:
|
||||
set_frame(get_specific_node(parent_node2, 5), frame_type)
|
||||
if i == 1: # СИ_2_в_УФ
|
||||
var CI_2_UF = parent_node2.get_child(3).get_child(0).get_child(0).get_child(0).get_child(2).get_node2(1, 6).get_child(1)
|
||||
set_frame(CI_2_UF, frame_type)
|
||||
if i == 2:
|
||||
set_frame(get_specific_node(parent_node2, 6), frame_type)
|
||||
if i == 2: # СИ_3_в_УФ
|
||||
var CI_3_UF = parent_node2.get_child(3).get_child(0).get_child(0).get_child(1).get_child(2).get_node2(1, 6).get_child(1)
|
||||
set_frame(CI_3_UF, frame_type)
|
||||
if i == 4:
|
||||
set_frame(get_specific_node(parent_node2, 7), frame_type)
|
||||
if i == 5:
|
||||
set_frame(get_specific_node(parent_node2, 8), frame_type)
|
||||
if i == 9:
|
||||
set_frame(get_specific_node(parent_node2, 9), frame_type)
|
||||
if i == 4: # Модуляция_УМ_2
|
||||
pass
|
||||
if i == 5: # Модуляция_УМ_3
|
||||
pass
|
||||
if i == 9: # ФГОЗ_3
|
||||
pass
|
||||
|
||||
|
||||
func process_sockets_vert(blank: int, imp: int, count: int, col: int, parent_node2: Node):
|
||||
@@ -141,24 +139,18 @@ func process_sockets_vert(blank: int, imp: int, count: int, col: int, parent_nod
|
||||
|
||||
set_frame(socket_status, frame_type)
|
||||
|
||||
if i == 1:
|
||||
set_frame(get_specific_node(parent_node2, 1), frame_type)
|
||||
if i == 2:
|
||||
set_frame(get_specific_node(parent_node2, 2), frame_type)
|
||||
if i == 9:
|
||||
set_frame(get_specific_node(parent_node2, 3), frame_type)
|
||||
if i == 1: # СЗИ_2_от_УФ
|
||||
pass
|
||||
if i == 2: # СЗИ_3_от_УФ
|
||||
pass
|
||||
if i == 9: # СИ_2_от_ФС
|
||||
var CI_2_FS = parent_node2.get_child(3).get_child(0).get_child(0).get_child(0).get_child(0).get_node2(1, 6).get_child(1)
|
||||
set_frame(CI_2_FS, frame_type)
|
||||
if i == 10:
|
||||
set_frame(get_specific_node(parent_node2, 4), frame_type)
|
||||
if i == 10: # СИ_3_от_ФС
|
||||
var CI_3_FS = parent_node2.get_child(3).get_child(0).get_child(0).get_child(1).get_child(0).get_node2(1, 6).get_child(1)
|
||||
set_frame(CI_3_FS, frame_type)
|
||||
|
||||
|
||||
func get_specific_node(parent_node2: Node, child_index: int)-> Node:
|
||||
return parent_node2.get_child(3, false).get_child(1).get_child(4).get_child(child_index).get_child(3)
|
||||
|
||||
|
||||
func set_frame(node: Node, val: int): node.set_frame(val)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user