Files
PRD_TU_MP550/scripts/control_panel.gd

38 lines
1.2 KiB
GDScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

extends Panel
var unit_yau07 = Yau07.YaU07.new('ЯУ07')
func _ready() -> void:
Network.connect('yau_receive', Callable(self, '_on_data_received'))
Network.connect('yau_status_line', Callable(self, '_control_pribor'))
'''sockets_ind = [
$soc_y5/ems_g/light_ind,
$soc_y5/ug/light_ind,
$soc_y5/ukp_1/light_ind,
$soc_y5/ukp_2/light_ind]
node_power_ind = [
$soc_P1/MAA_1/light_ind,
$soc_P1/MAA_2/light_ind,
$soc_P1/IP9_50_2/light_ind,
$soc_P1/IP9_50_1/light_ind,
$soc_P1/IP12_50/light_ind,
$soc_P2/IP9_50/light_ind,
$soc_P2/IP12_50/light_ind,
$soc_y5/IP5_25/light_ind]'''
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) # Контроль сухих контактов (УГ)
## From Network status about yau-07
func _control_pribor(_yau_status:bool) -> void:
#$device.text = str(Constants.CURRENT_MODE)
$soc_y5/ay07.state = Constants.STATE_VAL.GOOD