From 7666d606ff2f83bad01dec2be1021dae6e06b819 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Sat, 11 Oct 2025 23:44:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BE=D1=81=D1=82=D0=BE=D1=8F=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20"=D0=BD=D0=B0=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B8"?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=BD=D0=B5=D1=88=D0=BD=D0=B8?= =?UTF-8?q?=D1=85=20=D0=BF=D0=BE=D0=B4=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/контроль/контроль.tscn | 36 ++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/scenes/контроль/контроль.tscn b/scenes/контроль/контроль.tscn index 114376f0..9b4ddf43 100644 --- a/scenes/контроль/контроль.tscn +++ b/scenes/контроль/контроль.tscn @@ -69,17 +69,22 @@ func _ready(): pribor_node.set_button_group(group) pribor_node.connect('button_down', Callable(self, 'on_pribor_press').bind(pribor_path, header_text, pribor_node)) var conn_node = pribor_node.get_node('connect_pribor') - var pribor_meta = pribor_node.get_meta('unit_name', []) + var unit_names = pribor_node.get_meta('unit_name', []) var pribor_proc = pribor_node.get_meta('online_proc', '') if pribor_proc == '': continue - if pribor_meta.size(): - for i in pribor_meta.size(): - var unit_pribor = network.get_unit_instance(pribor_meta[i]) - unit_pribor.connect('line_changed', Callable(self, pribor_proc).bind(conn_node, pribor_meta)) - for unit_name in null_units_names: - var unit_instance = network.get_unit_instance(unit_name) - unit_instance.connect('line_changed', on_line_changed) + if not unit_names.size(): + continue + for i in unit_names.size(): + var unit_instance: = network.get_unit_instance(unit_names[i]) + unit_instance.connect('line_changed', Callable(self, pribor_proc).bind(conn_node, unit_names)) + # Пиктограммы приборов, которые отображают состояние подключения только + for pribor_node in get_tree().get_nodes_in_group('pribor_pics'): + var unit_name = pribor_node.get_meta('unit_name') + var unit_instance: = network.get_unit_instance(unit_name) + var conn_node: = pribor_node.get_node('connect_pribor') + unit_instance.connect('line_changed', on_line_changed.bind(conn_node)) + signaller.conn(signaller.режим_работа, on_mode_changed) signaller.conn(signaller.режим_журнал, on_mode_changed) signaller.conn(signaller.режим_настройки, on_mode_changed) @@ -145,7 +150,7 @@ grow_vertical = 2 script = SubResource("GDScript_iqgf5") metadata/_edit_lock_ = true -[node name="capsrpb" type="TextureRect" parent="."] +[node name="capsrpb" type="TextureRect" parent="." groups=["pribor_pics"]] editor_description = "Кнопка для отображения внешних соединений." self_modulate = Color(0.788235, 0.788235, 0.788235, 1) layout_mode = 0 @@ -159,6 +164,7 @@ size_flags_vertical = 15 texture = ExtResource("2_oysma") script = ExtResource("2_8r80x") unit_name = &"уарэп-капсрпб" +metadata/unit_name = &"уарэп-капсрпб" [node name="label" type="Label" parent="capsrpb"] layout_mode = 0 @@ -178,7 +184,7 @@ scale = Vector2(2.6, 2.6) sprite_frames = SubResource("SpriteFrames_foasq") script = ExtResource("11_u7tym") -[node name="5p28" type="TextureRect" parent="."] +[node name="5p28" type="TextureRect" parent="." groups=["pribor_pics"]] editor_description = "Кнопка для отображения внешних соединений." self_modulate = Color(0.788235, 0.788235, 0.788235, 1) layout_mode = 0 @@ -192,6 +198,7 @@ size_flags_vertical = 15 texture = ExtResource("2_oysma") script = ExtResource("2_8r80x") unit_name = &"уарэп-5п28" +metadata/unit_name = &"уарэп-5п28" [node name="label" type="Label" parent="5p28"] layout_mode = 0 @@ -212,7 +219,7 @@ sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 script = ExtResource("11_u7tym") -[node name="akng" type="TextureRect" parent="."] +[node name="akng" type="TextureRect" parent="." groups=["pribor_pics"]] editor_description = "Кнопка для отображения внешних соединений." self_modulate = Color(0.788235, 0.788235, 0.788235, 1) layout_mode = 0 @@ -226,6 +233,7 @@ size_flags_vertical = 15 texture = ExtResource("2_oysma") script = ExtResource("2_8r80x") unit_name = &"навигация" +metadata/unit_name = &"навигация" [node name="label" type="Label" parent="akng"] layout_mode = 0 @@ -246,7 +254,7 @@ sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 script = ExtResource("11_u7tym") -[node name="maps" type="TextureRect" parent="."] +[node name="maps" type="TextureRect" parent="." groups=["pribor_pics"]] editor_description = "Кнопка для отображения внешних соединений." self_modulate = Color(0.788235, 0.788235, 0.788235, 1) layout_mode = 0 @@ -260,6 +268,7 @@ size_flags_vertical = 15 texture = ExtResource("2_oysma") script = ExtResource("2_8r80x") unit_name = &"уарэп-карта" +metadata/unit_name = &"уарэп-карта" [node name="label" type="Label" parent="maps"] layout_mode = 0 @@ -280,7 +289,7 @@ sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 script = ExtResource("11_u7tym") -[node name="trassa" type="TextureRect" parent="."] +[node name="trassa" type="TextureRect" parent="." groups=["pribor_pics"]] editor_description = "Кнопка для отображения внешних соединений." self_modulate = Color(0.788235, 0.788235, 0.788235, 1) layout_mode = 0 @@ -294,6 +303,7 @@ size_flags_vertical = 15 texture = ExtResource("2_oysma") script = ExtResource("2_8r80x") unit_name = &"уарэп-трасса" +metadata/unit_name = &"уарэп-трасса" [node name="label" type="Label" parent="trassa"] layout_mode = 0