From d850f49e65662615e42f1be5fef34065ad8a70b4 Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 18 Jun 2025 23:19:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BB=D1=83=D1=87=D0=B0=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BC=D0=BE=D1=89=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=BE=D1=82=20=D0=A3=D0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/pribor-prd-k/pribor-prd-k.tscn | 4 +- scenes/pribor-prd-k/pribor_prd_k.gd | 182 ++++++++++++++++++ scenes/pribor-prd-k/pribor_prd_k.gd.uid | 1 + scenes/pribor-prd-n/pribor-prd-n.gd | 150 ++++++++++++--- .../{pribor-prd-n.tscn => pribor_prd_n.tscn} | 135 +++++++++++-- scenes/контроль/кассета-у-5-к.tscn | 12 +- scenes/контроль/кассета-у-5-нв.tscn | 16 +- scenes/контроль/кассета-у-5.gd | 26 +-- 8 files changed, 445 insertions(+), 81 deletions(-) create mode 100644 scenes/pribor-prd-k/pribor_prd_k.gd create mode 100644 scenes/pribor-prd-k/pribor_prd_k.gd.uid rename scenes/pribor-prd-n/{pribor-prd-n.tscn => pribor_prd_n.tscn} (73%) diff --git a/scenes/pribor-prd-k/pribor-prd-k.tscn b/scenes/pribor-prd-k/pribor-prd-k.tscn index 8dfe864..610e343 100644 --- a/scenes/pribor-prd-k/pribor-prd-k.tscn +++ b/scenes/pribor-prd-k/pribor-prd-k.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=11 format=3 uid="uid://m5s87q7m66lj"] [ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="1_8dmgr"] -[ext_resource type="Script" uid="uid://6m053dpg2lbh" path="res://scenes/контроль/прибор.gd" id="1_ufjwe"] +[ext_resource type="Script" uid="uid://cwvikiygf8b1m" path="res://scenes/pribor-prd-k/pribor_prd_k.gd" id="1_tpdyp"] [ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="2_14h25"] [ext_resource type="PackedScene" uid="uid://cm5jd4gjrrpba" path="res://scenes/контроль/кассета-у-5-к.tscn" id="2_tb85r"] [ext_resource type="Script" uid="uid://dow4nqi6hbak8" path="res://scenes/контроль/кассета-у-5.gd" id="3_wip3a"] @@ -18,7 +18,7 @@ offset_left = 15.0 offset_top = 30.0 offset_right = 15.0 offset_bottom = 30.0 -script = ExtResource("1_ufjwe") +script = ExtResource("1_tpdyp") [node name="kasseta_u5" parent="." instance=ExtResource("2_tb85r")] layout_mode = 0 diff --git a/scenes/pribor-prd-k/pribor_prd_k.gd b/scenes/pribor-prd-k/pribor_prd_k.gd new file mode 100644 index 0000000..34fef09 --- /dev/null +++ b/scenes/pribor-prd-k/pribor_prd_k.gd @@ -0,0 +1,182 @@ +@tool +extends "res://scenes/контроль/прибор.gd" +var timer_03: Timer = Timer.new() +var count_packet_1:int = 0 +var power_array_1: Array = [] +var count_packet_2:int = 0 +var power_array_2: Array = [] + +enum STATE_VAL { + NONE = 0, + GOOD = 1, + ERROR = 2 } + + +func _ready() -> void: + var unit_key = settings.get_unit_key(get_meta('unit_name')[0]) + var unit_prd = network.units[unit_key] + unit_prd.connect('data_received', Callable(self, 'on_data_received')) + unit_prd.connect('line_changed', Callable(self, 'on_line_changed')) + set_default_state() + self.add_child(timer_03) + timer_03.connect('timeout', Callable(self, 'on_timer_03')) + #on_timer_03(unit_key) + + +func set_default_state() -> void: + for group in get_tree().get_nodes_in_group('power_amplifier'): + group.state = STATE_VAL.NONE + + +func on_line_changed(unit_prd: Object): + if not unit_prd.online: + set_default_state() + + +func on_data_received(unit_prd: Object): + var tree = get_tree() + if not tree: + return + + check_block_ip(unit_prd.status) + check_temperature_um(unit_prd.status) + + ## Контроль ЭМС + const IN_BLANK_PRD: int = 1 + const OUT_BLANK_PRD: int = 13 + const CI_2_OT_FS: int = 9 + const CI_3_OT_FS: int = 10 + const CI_2_B_UF: int = 1 + const CI_3_B_UF: int = 2 + + var in_blank: int = unit_prd.status.decode_u16(IN_BLANK_PRD) + var out_blank: int = unit_prd.status.decode_u16(OUT_BLANK_PRD) + + $Monitoring_panel/in_fs_1.frame = (in_blank >> CI_2_OT_FS) & 1 + $Monitoring_panel/in_fs_2.frame = (in_blank >> CI_3_OT_FS) & 1 + + $Monitoring_panel/out_ems_1.frame = (out_blank >> CI_2_B_UF) & 1 + $Monitoring_panel/out_ems_2.frame = (out_blank >> CI_3_B_UF) & 1 + + ## Мощность УМ от УКП 1 + if (in_blank >> CI_2_OT_FS) & 1: + const bit_dkm_1: int = 1 + check_dkm(unit_prd.status, bit_dkm_1) + const POWER_UKP_1: int = 31 + var arr_power_ukp_1: Array = [] + + if (unit_prd.status[0] >> 2) & 1: + for i_power in range(6): + var power_ukp_1 = unit_prd.status.decode_u16(POWER_UKP_1 + 2 * i_power) + arr_power_ukp_1.append(power_ukp_1) + + if count_packet_1 == 0: + power_array_1 = arr_power_ukp_1 + else: + for i in arr_power_ukp_1.size(): + if arr_power_ukp_1[i] > power_array_1[i]: + power_array_1[i] = arr_power_ukp_1[i] + + var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier') + for i in 6: + power_amplifier[i].value1 = '%d' % power_array_1[i] + + count_packet_1 += 1 + + ## Мощность УМ от УКП 2 + if (in_blank >> CI_3_OT_FS) & 1: + const bit_dkm_2: int = 2 + check_dkm(unit_prd.status, bit_dkm_2) + const POWER_UKP_2: int = 63 + var arr_power_ukp_2: Array = [] + + if (unit_prd.status[0] >> 2) & 1: + for i_power in range(6): + var power_ukp_2 = unit_prd.status.decode_u16(POWER_UKP_2 + 2 * i_power) + arr_power_ukp_2.append(power_ukp_2) + + if count_packet_2 == 0: + power_array_2 = arr_power_ukp_2 + else: + for i in arr_power_ukp_2.size(): + if arr_power_ukp_2[i] > power_array_2[i]: + power_array_2[i] = arr_power_ukp_2[i] + + var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier') + for i in 6: + power_amplifier[i+6].value1 = '%d' % power_array_2[i] + + count_packet_2 += 1 + + +## Проверка касет П1 и ИП МА2000 +func check_block_ip(status_prd: PackedByteArray) -> void : + var ug_online: bool = (status_prd[0] >> 1) & 1 + if ug_online: + const BYTE_DRY_CONTACT: int = 27 + const BIT_MAA2000_1: int = 0 + const BIT_MAA2000_2: int = 1 + const BIT_IP9_50_1: int = 2 + const BIT_IP9_50_2: int = 3 + const BIT_IP12_50_1: int = 4 + + var maa2000_1 = status_prd[BYTE_DRY_CONTACT] >> BIT_MAA2000_1 & 1 + var maa2000_2 = status_prd[BYTE_DRY_CONTACT] >> BIT_MAA2000_2 & 1 + var ip9_50_1 = status_prd[BYTE_DRY_CONTACT] >> BIT_IP9_50_1 & 1 + var ip9_50_2 = status_prd[BYTE_DRY_CONTACT] >> BIT_IP9_50_2 & 1 + var ip12_50_1 = status_prd[BYTE_DRY_CONTACT] >> BIT_IP12_50_1 & 1 + + $maa2000_A23.state = STATE_VAL.ERROR if maa2000_1 else STATE_VAL.GOOD + $maa2000_A22.state = STATE_VAL.ERROR if maa2000_2 else STATE_VAL.GOOD + $kasseta_P_1/ref_A20.state = STATE_VAL.ERROR if ip9_50_1 else STATE_VAL.GOOD + $kasseta_P_1/ref_A21.state = STATE_VAL.ERROR if ip9_50_2 else STATE_VAL.GOOD + $kasseta_P_1/ref_A19.state = STATE_VAL.ERROR if ip12_50_1 else STATE_VAL.GOOD + else: + $maa2000_A23.state = STATE_VAL.NONE + $maa2000_A22.state = STATE_VAL.NONE + $kasseta_P_1/ref_A19.state = STATE_VAL.NONE + $kasseta_P_1/ref_A20.state = STATE_VAL.NONE + $kasseta_P_1/ref_A21.state = STATE_VAL.NONE + + +## Проверка температур УМ от УКП +func check_temperature_um(status_prd: PackedByteArray) -> void: + const CONST_MIN_TEMP: int = -25 + const MAXIMUM_CODE_ADC: int = 3796 + const MINIMUM_CODE_AD: int = 2660 + const TEMP: float = 115.0 / (MAXIMUM_CODE_ADC - MINIMUM_CODE_AD) + const TEMPERATURE_UKP_1: int = 47 + const TEMPERATURE_UKP_2: int = 79 + var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier') + + var ukp1_online: int = (status_prd[0] >> 2) & 1 + if ukp1_online: + for i_temp in range(6): + var temperature_ukp_1: int = status_prd.decode_u16(TEMPERATURE_UKP_1 + 2 * i_temp) + var tmp_1: int = round(CONST_MIN_TEMP + (MAXIMUM_CODE_ADC - temperature_ukp_1) * TEMP + 3) + power_amplifier[i_temp].value0 = tmp_1 + + var ukp2_online = (status_prd[0] >> 3) & 1 + if ukp2_online: + for i_temp in range(6): + var temperature_ukp_2: int = status_prd.decode_u16(TEMPERATURE_UKP_2 + 2 * i_temp) + var tmp_2: int = round(CONST_MIN_TEMP + (MAXIMUM_CODE_ADC - temperature_ukp_2) * TEMP + 3) + power_amplifier[i_temp+6].value0 = tmp_2 + + +## Проверка ДКМ +func check_dkm(status_prd: PackedByteArray, bit_dkm: int) -> void: + const DKM: int = 28 + + var status_dkm = status_prd[DKM] >> bit_dkm & 1 + + if bit_dkm == 1: + $dou2_A5.state = STATE_VAL.GOOD if status_dkm else STATE_VAL.ERROR + $kasseta_FS_ND/ref_A4.state = STATE_VAL.GOOD if status_dkm else STATE_VAL.ERROR + elif bit_dkm == 2: + $dou2_A6.state = STATE_VAL.GOOD if status_dkm else STATE_VAL.ERROR + $kasseta_FS_ND/ref_A3.state = STATE_VAL.GOOD if status_dkm else STATE_VAL.ERROR + + +#func on_timer_03(unit_name): + #print(unit_name) diff --git a/scenes/pribor-prd-k/pribor_prd_k.gd.uid b/scenes/pribor-prd-k/pribor_prd_k.gd.uid new file mode 100644 index 0000000..3493cb8 --- /dev/null +++ b/scenes/pribor-prd-k/pribor_prd_k.gd.uid @@ -0,0 +1 @@ +uid://cwvikiygf8b1m diff --git a/scenes/pribor-prd-n/pribor-prd-n.gd b/scenes/pribor-prd-n/pribor-prd-n.gd index 074d17f..2d589c3 100644 --- a/scenes/pribor-prd-n/pribor-prd-n.gd +++ b/scenes/pribor-prd-n/pribor-prd-n.gd @@ -1,37 +1,116 @@ @tool extends "res://scenes/контроль/прибор.gd" +var timer_03: Timer = Timer.new() +var count_packet_1:int = 0 +var power_array_1: Array = [] +var count_packet_2:int = 0 +var power_array_2: Array = [] enum STATE_VAL { NONE = 0, GOOD = 1, ERROR = 2 } -# Called when the node enters the scene tree for the first time. + func _ready() -> void: var unit_key = settings.get_unit_key(get_meta('unit_name')[0]) var unit_prd = network.units[unit_key] unit_prd.connect('data_received', Callable(self, 'on_data_received')) unit_prd.connect('line_changed', Callable(self, 'on_line_changed')) set_default_state() + self.add_child(timer_03) + timer_03.connect('timeout', Callable(self, 'on_timer_03')) + #on_timer_03(unit_key) -func set_default_state(): +func set_default_state() -> void: for group in get_tree().get_nodes_in_group('power_amplifier'): group.state = STATE_VAL.NONE -func on_line_changed(unit_prd): +func on_line_changed(unit_prd: Object): if not unit_prd.online: set_default_state() -func on_data_received(unit_prd): - var tree = get_tree() - if not tree: +func on_data_received(unit_prd: Object): + if get_tree() == null: return - ## Касета П1 и ИП МА2000 - var ug_online = (unit_prd.status[0] >> 1) & 1 + check_block_ip(unit_prd.status) + check_temperature_um(unit_prd.status) + + ## Контроль ЭМС + const IN_BLANK_PRD: int = 1 + const OUT_BLANK_PRD: int = 13 + const CI_2_OT_FS: int = 9 + const CI_3_OT_FS: int = 10 + const CI_2_B_UF: int = 1 + const CI_3_B_UF: int = 2 + + var in_blank: int = unit_prd.status.decode_u16(IN_BLANK_PRD) + var out_blank: int = unit_prd.status.decode_u16(OUT_BLANK_PRD) + + $Monitoring_panel/in_fs_1.frame = (in_blank >> CI_2_OT_FS) & 1 + $Monitoring_panel/in_fs_2.frame = (in_blank >> CI_3_OT_FS) & 1 + + $Monitoring_panel/out_ems_1.frame = (out_blank >> CI_2_B_UF) & 1 + $Monitoring_panel/out_ems_2.frame = (out_blank >> CI_3_B_UF) & 1 + + ## Мощность УМ от УКП 1 + if (in_blank >> CI_2_OT_FS) & 1: + const bit_dkm_1: int = 1 + check_dkm(unit_prd.status, bit_dkm_1) + const POWER_UKP_1: int = 31 + var arr_power_ukp_1: Array = [] + + if (unit_prd.status[0] >> 2) & 1: + for i_power in range(6): + var power_ukp_1 = unit_prd.status.decode_u16(POWER_UKP_1 + 2 * i_power) + arr_power_ukp_1.append(power_ukp_1) + + if count_packet_1 == 0: + power_array_1 = arr_power_ukp_1 + else: + for i in arr_power_ukp_1.size(): + if arr_power_ukp_1[i] > power_array_1[i]: + power_array_1[i] = arr_power_ukp_1[i] + + var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier') + for i in 6: + power_amplifier[i].value1 = '%d' % power_array_1[i] + + count_packet_1 += 1 + + ## Мощность УМ от УКП 2 + if (in_blank >> CI_3_OT_FS) & 1: + const bit_dkm_2: int = 2 + check_dkm(unit_prd.status, bit_dkm_2) + const POWER_UKP_2: int = 63 + var arr_power_ukp_2: Array = [] + + if (unit_prd.status[0] >> 2) & 1: + for i_power in range(6): + var power_ukp_2 = unit_prd.status.decode_u16(POWER_UKP_2 + 2 * i_power) + arr_power_ukp_2.append(power_ukp_2) + + if count_packet_2 == 0: + power_array_2 = arr_power_ukp_2 + else: + for i in arr_power_ukp_2.size(): + if arr_power_ukp_2[i] > power_array_2[i]: + power_array_2[i] = arr_power_ukp_2[i] + + var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier') + for i in 6: + power_amplifier[i+6].value1 = '%d' % power_array_2[i] + + count_packet_2 += 1 + + +## Проверка касет П1 и ИП МА2000 +func check_block_ip(status_prd: PackedByteArray) -> void : + var ug_online: bool = (status_prd[0] >> 1) & 1 if ug_online: const BYTE_DRY_CONTACT: int = 27 const BIT_MAA2000_1: int = 0 @@ -40,25 +119,27 @@ func on_data_received(unit_prd): const BIT_IP9_50_2: int = 3 const BIT_IP12_50_1: int = 4 - var maa2000_1 = unit_prd.status[BYTE_DRY_CONTACT] >> BIT_MAA2000_1 & 1 - var maa2000_2 = unit_prd.status[BYTE_DRY_CONTACT] >> BIT_MAA2000_2 & 1 - var ip9_50_1 = unit_prd.status[BYTE_DRY_CONTACT] >> BIT_IP9_50_1 & 1 - var ip9_50_2 = unit_prd.status[BYTE_DRY_CONTACT] >> BIT_IP9_50_2 & 1 - var ip12_50_1 = unit_prd.status[BYTE_DRY_CONTACT] >> BIT_IP12_50_1 & 1 + var maa2000_1 = status_prd[BYTE_DRY_CONTACT] >> BIT_MAA2000_1 & 1 + var maa2000_2 = status_prd[BYTE_DRY_CONTACT] >> BIT_MAA2000_2 & 1 + var ip9_50_1 = status_prd[BYTE_DRY_CONTACT] >> BIT_IP9_50_1 & 1 + var ip9_50_2 = status_prd[BYTE_DRY_CONTACT] >> BIT_IP9_50_2 & 1 + var ip12_50_1 = status_prd[BYTE_DRY_CONTACT] >> BIT_IP12_50_1 & 1 $maa2000_A23.state = STATE_VAL.ERROR if maa2000_1 else STATE_VAL.GOOD $maa2000_A22.state = STATE_VAL.ERROR if maa2000_2 else STATE_VAL.GOOD - $kasseta_P_1/ref_A26.state = STATE_VAL.ERROR if ip9_50_1 else STATE_VAL.GOOD - $kasseta_P_1/ref_A23.state = STATE_VAL.ERROR if ip9_50_2 else STATE_VAL.GOOD - $kasseta_P_1/ref_A24.state = STATE_VAL.ERROR if ip12_50_1 else STATE_VAL.GOOD + $kasseta_P_1/ref_A20.state = STATE_VAL.ERROR if ip9_50_1 else STATE_VAL.GOOD + $kasseta_P_1/ref_A21.state = STATE_VAL.ERROR if ip9_50_2 else STATE_VAL.GOOD + $kasseta_P_1/ref_A19.state = STATE_VAL.ERROR if ip12_50_1 else STATE_VAL.GOOD else: $maa2000_A23.state = STATE_VAL.NONE $maa2000_A22.state = STATE_VAL.NONE - $kasseta_P_1/ref_A26.state = STATE_VAL.NONE - $kasseta_P_1/ref_A23.state = STATE_VAL.NONE - $kasseta_P_1/ref_A24.state = STATE_VAL.NONE + $kasseta_P_1/ref_A19.state = STATE_VAL.NONE + $kasseta_P_1/ref_A20.state = STATE_VAL.NONE + $kasseta_P_1/ref_A21.state = STATE_VAL.NONE - ## Температуры УМ + +## Проверка температур УМ от УКП +func check_temperature_um(status_prd: PackedByteArray) -> void: const CONST_MIN_TEMP: int = -25 const MAXIMUM_CODE_ADC: int = 3796 const MINIMUM_CODE_AD: int = 2660 @@ -67,27 +148,34 @@ func on_data_received(unit_prd): const TEMPERATURE_UKP_2: int = 79 var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier') - var ukp1_online: int = (unit_prd.status[0] >> 2) & 1 + var ukp1_online: int = (status_prd[0] >> 2) & 1 if ukp1_online: for i_temp in range(6): - var temperature_ukp_1: int = unit_prd.status.decode_u16(TEMPERATURE_UKP_1 + 2 * i_temp) + var temperature_ukp_1: int = status_prd.decode_u16(TEMPERATURE_UKP_1 + 2 * i_temp) var tmp_1: int = round(CONST_MIN_TEMP + (MAXIMUM_CODE_ADC - temperature_ukp_1) * TEMP + 3) power_amplifier[i_temp].value0 = tmp_1 - var ukp2_online = (unit_prd.status[0] >> 3) & 1 + var ukp2_online = (status_prd[0] >> 3) & 1 if ukp2_online: for i_temp in range(6): - var temperature_ukp_2: int = unit_prd.status.decode_u16(TEMPERATURE_UKP_2 + 2 * i_temp) + var temperature_ukp_2: int = status_prd.decode_u16(TEMPERATURE_UKP_2 + 2 * i_temp) var tmp_2: int = round(CONST_MIN_TEMP + (MAXIMUM_CODE_ADC - temperature_ukp_2) * TEMP + 3) power_amplifier[i_temp+6].value0 = tmp_2 - ## ДКМ + +## Проверка ДКМ +func check_dkm(status_prd: PackedByteArray, bit_dkm: int) -> void: const DKM: int = 28 - const bit_dkm_1: int = 1 - const bit_dkm_2: int = 2 - var status_dkm_1 = unit_prd.status[DKM] >> bit_dkm_1 & 1 - var status_dkm_2 = unit_prd.status[DKM] >> bit_dkm_2 & 1 + var status_dkm = status_prd[DKM] >> bit_dkm & 1 - $dou2_A5.state = STATE_VAL.GOOD if status_dkm_1 else STATE_VAL.ERROR - $dou2_A6.state = STATE_VAL.GOOD if status_dkm_2 else STATE_VAL.ERROR + if bit_dkm == 1: + $dou2_A5.state = STATE_VAL.GOOD if status_dkm else STATE_VAL.ERROR + $kasseta_FS_ND/ref_A4.state = STATE_VAL.GOOD if status_dkm else STATE_VAL.ERROR + elif bit_dkm == 2: + $dou2_A6.state = STATE_VAL.GOOD if status_dkm else STATE_VAL.ERROR + $kasseta_FS_ND/ref_A3.state = STATE_VAL.GOOD if status_dkm else STATE_VAL.ERROR + + +#func on_timer_03(unit_name): + #print(unit_name) diff --git a/scenes/pribor-prd-n/pribor-prd-n.tscn b/scenes/pribor-prd-n/pribor_prd_n.tscn similarity index 73% rename from scenes/pribor-prd-n/pribor-prd-n.tscn rename to scenes/pribor-prd-n/pribor_prd_n.tscn index 42d66e3..ca863ab 100644 --- a/scenes/pribor-prd-n/pribor-prd-n.tscn +++ b/scenes/pribor-prd-n/pribor_prd_n.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://dnuexoef2nnv5"] +[gd_scene load_steps=14 format=3 uid="uid://dnuexoef2nnv5"] [ext_resource type="Script" uid="uid://cto2r4ipew65m" path="res://scenes/pribor-prd-n/pribor-prd-n.gd" id="1_td743"] [ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_lpj3d"] @@ -8,6 +8,31 @@ [ext_resource type="Script" uid="uid://crpedygm3gohi" path="res://scenes/контроль/кассета.gd" id="6_b1cob"] [ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="7_dqc3e"] [ext_resource type="PackedScene" uid="uid://bkxblfoj7ejv0" path="res://scenes/контроль/блок-а.tscn" id="8_u7eqo"] +[ext_resource type="Texture2D" uid="uid://belwchvdktrw0" path="res://data/эмс-бланк.png" id="9_bnnv3"] +[ext_resource type="Texture2D" uid="uid://bwddxs24es81u" path="res://data/эмс-бланк-пост.png" id="10_is25t"] +[ext_resource type="Texture2D" uid="uid://pfoscstbm025" path="res://data/эмс-бланк-перем.png" id="11_meukj"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_bnnv3"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_xkifg"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("9_bnnv3") +}, { +"duration": 1.0, +"texture": ExtResource("10_is25t") +}, { +"duration": 1.0, +"texture": ExtResource("11_meukj") +}, { +"duration": 1.0, +"texture": null +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] [node name="pribor_prd_n" type="Control"] layout_mode = 3 @@ -113,23 +138,23 @@ text = "Кассета ФС-НД" horizontal_alignment = 1 vertical_alignment = 1 -[node name="ref_A2" parent="kasseta_FS_ND" instance=ExtResource("7_dqc3e")] +[node name="ref_A3" parent="kasseta_FS_ND" instance=ExtResource("7_dqc3e")] offset_left = 55.0 offset_top = 32.0 offset_right = 105.0 offset_bottom = 182.0 -fname = "Модуль ФС" -rname = "A1" +fname = "Блок ФС-3" +rname = "A3" -[node name="ref_A3" parent="kasseta_FS_ND" instance=ExtResource("7_dqc3e")] +[node name="ref_A1" parent="kasseta_FS_ND" instance=ExtResource("7_dqc3e")] offset_left = 105.0 offset_top = 32.0 offset_right = 155.0 offset_bottom = 182.0 -fname = "Блок ФС-2" -rname = "A3" +fname = "Модуль ФС" +rname = "A1" -[node name="ref_A4" parent="kasseta_FS_ND" instance=ExtResource("7_dqc3e")] +[node name="ref_A2" parent="kasseta_FS_ND" instance=ExtResource("7_dqc3e")] offset_left = 155.0 offset_top = 32.0 offset_right = 205.0 @@ -137,12 +162,12 @@ offset_bottom = 182.0 fname = "Модуль ФС" rname = "A2" -[node name="ref_A6" parent="kasseta_FS_ND" instance=ExtResource("7_dqc3e")] +[node name="ref_A4" parent="kasseta_FS_ND" instance=ExtResource("7_dqc3e")] offset_left = 205.0 offset_top = 32.0 offset_right = 255.0 offset_bottom = 182.0 -fname = "Блок ФС-3" +fname = "Блок ФС-2" rname = "A4" [node name="kasseta_P_1" type="NinePatchRect" parent="."] @@ -159,15 +184,15 @@ patch_margin_bottom = 16 script = ExtResource("6_b1cob") fname = "Кассета П-1" -[node name="ref_A26" parent="kasseta_P_1" instance=ExtResource("7_dqc3e")] +[node name="ref_A21" parent="kasseta_P_1" instance=ExtResource("7_dqc3e")] offset_left = 9.0 offset_top = 33.0 offset_right = 59.0 offset_bottom = 183.0 -fname = "ИП9-50" -rname = "A19" +fname = "ИП12-50" +rname = "A21" -[node name="ref_A23" parent="kasseta_P_1" instance=ExtResource("7_dqc3e")] +[node name="ref_A20" parent="kasseta_P_1" instance=ExtResource("7_dqc3e")] offset_left = 59.0 offset_top = 33.0 offset_right = 109.0 @@ -175,13 +200,13 @@ offset_bottom = 183.0 fname = "ИП9-50" rname = "A20" -[node name="ref_A24" parent="kasseta_P_1" instance=ExtResource("7_dqc3e")] +[node name="ref_A19" parent="kasseta_P_1" instance=ExtResource("7_dqc3e")] offset_left = 109.0 offset_top = 33.0 offset_right = 159.0 offset_bottom = 183.0 -fname = "ИП12-50" -rname = "A21" +fname = "ИП9-50" +rname = "A19" [node name="lbl_fname" type="Label" parent="kasseta_P_1"] self_modulate = Color(1, 1, 1, 0.62) @@ -239,10 +264,6 @@ offset_left = 485.0 offset_top = 527.0 offset_right = 652.0 offset_bottom = 622.0 -value0 = 27.0 -value1 = 56.0 -max_value0 = 100.0 -max_value1 = 100.0 value_name0 = "°C" value_name1 = "P, %" name_min_size0 = Vector2i(35, 20) @@ -353,3 +374,75 @@ name_min_size0 = Vector2i(35, 20) name_min_size1 = Vector2i(35, 20) fname = "УМ1535А" rname = "A18" + +[node name="Monitoring_panel" type="Panel" parent="."] +layout_mode = 0 +theme_override_styles/panel = SubResource("StyleBoxTexture_bnnv3") + +[node name="in_fs_1" type="AnimatedSprite2D" parent="Monitoring_panel"] +position = Vector2(454, 577) +scale = Vector2(1.2, 1.2) +sprite_frames = SubResource("SpriteFrames_xkifg") + +[node name="in_fs_1" type="Label" parent="Monitoring_panel/in_fs_1"] +offset_left = -15.1667 +offset_top = 14.0 +offset_right = 14.8333 +offset_bottom = 33.0 +theme_override_colors/font_color = Color(0.890196, 0.486275, 0.196078, 1) +theme_override_font_sizes/font_size = 10 +text = "In FS 1" +horizontal_alignment = 1 +metadata/_edit_use_anchors_ = true + +[node name="in_fs_2" type="AnimatedSprite2D" parent="Monitoring_panel"] +position = Vector2(207, 577) +scale = Vector2(1.2, 1.2) +sprite_frames = SubResource("SpriteFrames_xkifg") + +[node name="in_fs_2" type="Label" parent="Monitoring_panel/in_fs_2"] +offset_left = -15.1667 +offset_top = 14.0 +offset_right = 14.8333 +offset_bottom = 33.0 +theme_override_colors/font_color = Color(0.890196, 0.486275, 0.196078, 1) +theme_override_font_sizes/font_size = 10 +text = "In FS 2" +horizontal_alignment = 1 + +[node name="out_ems_1" type="AnimatedSprite2D" parent="Monitoring_panel"] +position = Vector2(454, 465) +scale = Vector2(1.2, 1.2) +sprite_frames = SubResource("SpriteFrames_xkifg") + +[node name="Out_ems_1" type="Label" parent="Monitoring_panel/out_ems_1"] +anchors_preset = -1 +anchor_left = 0.0185185 +anchor_right = 0.0185185 +anchor_bottom = 0.555556 +offset_left = -18.5 +offset_top = 14.0 +offset_right = 17.5 +offset_bottom = 33.0 +theme_override_colors/font_color = Color(0.890196, 0.486275, 0.196078, 1) +theme_override_font_sizes/font_size = 10 +text = "Out +ems 1" +horizontal_alignment = 1 +metadata/_edit_use_anchors_ = true + +[node name="out_ems_2" type="AnimatedSprite2D" parent="Monitoring_panel"] +position = Vector2(207, 465) +scale = Vector2(1.2, 1.2) +sprite_frames = SubResource("SpriteFrames_xkifg") + +[node name="Out_ems_1" type="Label" parent="Monitoring_panel/out_ems_2"] +offset_left = -15.1667 +offset_top = 14.0 +offset_right = 14.8333 +offset_bottom = 33.0 +theme_override_colors/font_color = Color(0.890196, 0.486275, 0.196078, 1) +theme_override_font_sizes/font_size = 10 +text = "Out +ems 2" +horizontal_alignment = 1 diff --git a/scenes/контроль/кассета-у-5-к.tscn b/scenes/контроль/кассета-у-5-к.tscn index 5f117cc..f527779 100644 --- a/scenes/контроль/кассета-у-5-к.tscn +++ b/scenes/контроль/кассета-у-5-к.tscn @@ -25,7 +25,7 @@ text = "Кассета" horizontal_alignment = 1 vertical_alignment = 1 -[node name="ref_A31" parent="." instance=ExtResource("3_wtlpi")] +[node name="ref_A24" parent="." instance=ExtResource("3_wtlpi")] offset_left = 5.0 offset_top = 32.0 offset_right = 55.0 @@ -33,7 +33,7 @@ offset_bottom = 182.0 fname = "ИП5-25" rname = "A31" -[node name="ref_A37" parent="." instance=ExtResource("3_wtlpi")] +[node name="ref_A30" parent="." instance=ExtResource("3_wtlpi")] offset_left = 55.0 offset_top = 32.0 offset_right = 105.0 @@ -41,7 +41,7 @@ offset_bottom = 182.0 fname = "ЯУ-07Б" rname = "A37" -[node name="ref_A33" parent="." instance=ExtResource("3_wtlpi")] +[node name="ref_A26" parent="." instance=ExtResource("3_wtlpi")] offset_left = 105.0 offset_top = 32.0 offset_right = 155.0 @@ -49,7 +49,7 @@ offset_bottom = 182.0 fname = "ЭМС-Г" rname = "A33" -[node name="ref_A34" parent="." instance=ExtResource("3_wtlpi")] +[node name="ref_A27" parent="." instance=ExtResource("3_wtlpi")] offset_left = 155.0 offset_top = 32.0 offset_right = 205.0 @@ -57,7 +57,7 @@ offset_bottom = 182.0 fname = "УГ" rname = "A34" -[node name="ref_A35" parent="." instance=ExtResource("3_wtlpi")] +[node name="ref_A28" parent="." instance=ExtResource("3_wtlpi")] offset_left = 205.0 offset_top = 32.0 offset_right = 255.0 @@ -65,7 +65,7 @@ offset_bottom = 182.0 fname = "УКП" rname = "A36" -[node name="ref_A36" parent="." instance=ExtResource("3_wtlpi")] +[node name="ref_A29" parent="." instance=ExtResource("3_wtlpi")] offset_left = 254.0 offset_top = 32.0 offset_right = 304.0 diff --git a/scenes/контроль/кассета-у-5-нв.tscn b/scenes/контроль/кассета-у-5-нв.tscn index d1ed6ce..c79ec09 100644 --- a/scenes/контроль/кассета-у-5-нв.tscn +++ b/scenes/контроль/кассета-у-5-нв.tscn @@ -25,7 +25,7 @@ text = "Кассета" horizontal_alignment = 1 vertical_alignment = 1 -[node name="ref_A31" parent="." instance=ExtResource("3_picsk")] +[node name="ref_A24" parent="." instance=ExtResource("3_picsk")] offset_left = 5.0 offset_top = 32.0 offset_right = 55.0 @@ -33,7 +33,7 @@ offset_bottom = 182.0 fname = "ИП5-25" rname = "A24" -[node name="ref_A37" parent="." instance=ExtResource("3_picsk")] +[node name="ref_A30" parent="." instance=ExtResource("3_picsk")] offset_left = 55.0 offset_top = 32.0 offset_right = 105.0 @@ -41,7 +41,7 @@ offset_bottom = 182.0 fname = "ЯУ-07Б" rname = "A30" -[node name="ref_A33" parent="." instance=ExtResource("3_picsk")] +[node name="ref_A26" parent="." instance=ExtResource("3_picsk")] offset_left = 105.0 offset_top = 32.0 offset_right = 155.0 @@ -49,7 +49,7 @@ offset_bottom = 182.0 fname = "ЭМС-Г" rname = "A26" -[node name="ref_A34" parent="." instance=ExtResource("3_picsk")] +[node name="ref_A27" parent="." instance=ExtResource("3_picsk")] offset_left = 155.0 offset_top = 32.0 offset_right = 205.0 @@ -57,18 +57,18 @@ offset_bottom = 182.0 fname = "УГ" rname = "A27" -[node name="ref_A35" parent="." instance=ExtResource("3_picsk")] +[node name="ref_A28" parent="." instance=ExtResource("3_picsk")] offset_left = 205.0 offset_top = 32.0 offset_right = 255.0 offset_bottom = 182.0 fname = "УКП" -rname = "A29" +rname = "A28" -[node name="ref_A36" parent="." instance=ExtResource("3_picsk")] +[node name="ref_A29" parent="." instance=ExtResource("3_picsk")] offset_left = 254.0 offset_top = 32.0 offset_right = 304.0 offset_bottom = 182.0 fname = "УКП" -rname = "A28" +rname = "A29" diff --git a/scenes/контроль/кассета-у-5.gd b/scenes/контроль/кассета-у-5.gd index c31de48..252cc41 100644 --- a/scenes/контроль/кассета-у-5.gd +++ b/scenes/контроль/кассета-у-5.gd @@ -16,12 +16,12 @@ func _ready() -> void: func set_default_state(): - $ref_A37.state = STATE_VAL.ERROR - $ref_A31.state = STATE_VAL.NONE - $ref_A33.state = STATE_VAL.NONE - $ref_A34.state = STATE_VAL.NONE - $ref_A35.state = STATE_VAL.NONE - $ref_A36.state = STATE_VAL.NONE + $ref_A30.state = STATE_VAL.ERROR # ЯУ-07Б + $ref_A24.state = STATE_VAL.NONE # ИП5-25 + $ref_A26.state = STATE_VAL.NONE # ЭМС-Г + $ref_A27.state = STATE_VAL.NONE # УГ + $ref_A28.state = STATE_VAL.NONE # УКП + $ref_A29.state = STATE_VAL.NONE # УКП func on_line_changed(unit_prd): @@ -30,19 +30,19 @@ func on_line_changed(unit_prd): func on_data_received(unit_prd): - $ref_A37.state = STATE_VAL.GOOD + $ref_A30.state = STATE_VAL.GOOD var ems_online = unit_prd.status[0] & 1 var bit_load = 4 var ems_load = (unit_prd.status[0] >> bit_load) & 1 var ug_online = (unit_prd.status[0] >> 1) & 1 - $ref_A33.state = STATE_VAL.GOOD if ems_online and ems_load else STATE_VAL.ERROR - $ref_A34.state = STATE_VAL.GOOD if ug_online else STATE_VAL.ERROR - $ref_A35.state = STATE_VAL.GOOD if (unit_prd.status[0] >> 2) & 1 else STATE_VAL.ERROR - $ref_A36.state = STATE_VAL.GOOD if (unit_prd.status[0] >> 3) & 1 else STATE_VAL.ERROR + $ref_A26.state = STATE_VAL.GOOD if ems_online and ems_load else STATE_VAL.ERROR + $ref_A27.state = STATE_VAL.GOOD if ug_online else STATE_VAL.ERROR + $ref_A28.state = STATE_VAL.GOOD if (unit_prd.status[0] >> 2) & 1 else STATE_VAL.ERROR + $ref_A29.state = STATE_VAL.GOOD if (unit_prd.status[0] >> 3) & 1 else STATE_VAL.ERROR if ug_online: var byte_dry_contact: int = 27 var bit_ip5_25: int = 7 var ip5_25 = unit_prd.status[byte_dry_contact] >> bit_ip5_25 & 1 - $ref_A31.state = STATE_VAL.ERROR if ip5_25 else STATE_VAL.GOOD + $ref_A24.state = STATE_VAL.ERROR if ip5_25 else STATE_VAL.GOOD else: - $ref_A31.state = STATE_VAL.NONE + $ref_A24.state = STATE_VAL.NONE