From 94f0eccaa11047726edc1f264db30aa62d652318 Mon Sep 17 00:00:00 2001 From: TotMaxim Date: Mon, 10 Nov 2025 10:23:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=D0=BD=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=B8=D0=B7=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=BE=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=B8=20=D0=BF=D0=BE=D0=B7=D0=B8=D1=86=D0=B8=D1=8E=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D0=B1=D0=BE=D1=80=D0=BE=D0=B2=20=D0=B2=20=D1=81?= =?UTF-8?q?=D1=86=D0=B5=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/pribor-prd-n/pribor-prd-n.gd | 2 +- scenes/pribor-prd-v/pribor-prd-v.gd | 2 +- scenes/контроль/контроль.tscn | 130 ++++++++++++++-------------- scripts/pribor-prd.gd | 17 +++- 4 files changed, 83 insertions(+), 68 deletions(-) diff --git a/scenes/pribor-prd-n/pribor-prd-n.gd b/scenes/pribor-prd-n/pribor-prd-n.gd index ed21bc0..c6e07ce 100644 --- a/scenes/pribor-prd-n/pribor-prd-n.gd +++ b/scenes/pribor-prd-n/pribor-prd-n.gd @@ -152,7 +152,7 @@ func on_line_changed(unit_pribor: Object) -> void: set_default_state() -func on_mode_changed(in_tree: bool) -> void: +func on_mode_changed(_in_tree: bool) -> void: print_debug('Выход из сцены') #if not in_tree: #mashine_timer.stop() diff --git a/scenes/pribor-prd-v/pribor-prd-v.gd b/scenes/pribor-prd-v/pribor-prd-v.gd index 1b99101..3f7d40c 100644 --- a/scenes/pribor-prd-v/pribor-prd-v.gd +++ b/scenes/pribor-prd-v/pribor-prd-v.gd @@ -153,7 +153,7 @@ func on_line_changed(unit_pribor: Object) -> void: set_default_state() -func on_mode_changed(in_tree: bool) -> void: +func on_mode_changed(_in_tree: bool) -> void: print_debug('Выход из сцены') #if not in_tree: #mashine_timer.stop() diff --git a/scenes/контроль/контроль.tscn b/scenes/контроль/контроль.tscn index c7c1879..0f29107 100644 --- a/scenes/контроль/контроль.tscn +++ b/scenes/контроль/контроль.tscn @@ -364,9 +364,9 @@ script = ExtResource("11_u7tym") editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1048.0 -offset_top = 193.0 +offset_top = 179.0 offset_right = 1125.0 -offset_bottom = 309.0 +offset_bottom = 295.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -439,9 +439,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1183.0 -offset_top = 565.0 +offset_top = 558.0 offset_right = 1294.0 -offset_bottom = 750.0 +offset_bottom = 743.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -492,9 +492,9 @@ script = ExtResource("11_u7tym") editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1058.0 -offset_top = 595.0 +offset_top = 588.0 offset_right = 1164.0 -offset_bottom = 751.0 +offset_bottom = 744.0 pivot_offset = Vector2(-10, -65) size_flags_horizontal = 15 size_flags_vertical = 15 @@ -554,9 +554,9 @@ script = ExtResource("11_u7tym") editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1053.0 -offset_top = 432.0 +offset_top = 425.0 offset_right = 1886.0 -offset_bottom = 1072.0 +offset_bottom = 1065.0 scale = Vector2(0.2, 0.2) pivot_offset = Vector2(-10, -65) size_flags_horizontal = 15 @@ -620,9 +620,9 @@ script = ExtResource("11_u7tym") editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1243.0 -offset_top = 432.0 +offset_top = 425.0 offset_right = 2076.0 -offset_bottom = 1072.0 +offset_bottom = 1065.0 scale = Vector2(0.2, 0.2) pivot_offset = Vector2(-10, -65) size_flags_horizontal = 15 @@ -687,9 +687,9 @@ script = ExtResource("11_u7tym") editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1313.0 -offset_top = 565.0 +offset_top = 558.0 offset_right = 1407.0 -offset_bottom = 751.0 +offset_bottom = 744.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -738,9 +738,9 @@ script = ExtResource("11_u7tym") editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1440.0 -offset_top = 680.0 +offset_top = 687.0 offset_right = 1517.0 -offset_bottom = 796.0 +offset_bottom = 803.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -755,9 +755,9 @@ metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_v_2"] layout_mode = 0 -offset_left = 14.0 +offset_left = 11.0 offset_top = -42.0 -offset_right = 66.0 +offset_right = 63.0 offset_bottom = -23.0 text = "ПРД В2" horizontal_alignment = 1 @@ -780,7 +780,7 @@ patch_margin_bottom = 16 [node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_v_2"] light_mask = 3 -position = Vector2(40, -10) +position = Vector2(37, -10) scale = Vector2(0.625, 0.625) sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 @@ -813,9 +813,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1440.0 -offset_top = 345.0 +offset_top = 322.0 offset_right = 1517.0 -offset_bottom = 461.0 +offset_bottom = 438.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -830,9 +830,9 @@ metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_n_2"] layout_mode = 0 -offset_left = 15.0 +offset_left = 11.0 offset_top = -42.0 -offset_right = 67.0 +offset_right = 63.0 offset_bottom = -23.0 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 0 @@ -857,7 +857,7 @@ patch_margin_bottom = 16 [node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_n_2"] light_mask = 3 -position = Vector2(40, -10) +position = Vector2(37, -10) scale = Vector2(0.625, 0.625) sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 @@ -890,9 +890,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1440.0 -offset_top = 515.0 +offset_top = 504.0 offset_right = 1517.0 -offset_bottom = 631.0 +offset_bottom = 620.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -907,9 +907,9 @@ metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_k_2"] layout_mode = 0 -offset_left = 17.0 +offset_left = 11.0 offset_top = -42.0 -offset_right = 69.0 +offset_right = 63.0 offset_bottom = -23.0 text = "ПРД К2" horizontal_alignment = 1 @@ -932,7 +932,7 @@ patch_margin_bottom = 16 [node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_k_2"] light_mask = 3 -position = Vector2(43, -10) +position = Vector2(37, -10) scale = Vector2(0.625, 0.625) sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 @@ -965,9 +965,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1048.0 -offset_top = 810.0 +offset_top = 803.0 offset_right = 1125.0 -offset_bottom = 926.0 +offset_bottom = 919.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -1007,7 +1007,7 @@ patch_margin_bottom = 16 [node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_v_3"] light_mask = 3 -position = Vector2(34, -10) +position = Vector2(35, -10) scale = Vector2(0.625, 0.625) sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 @@ -1016,9 +1016,9 @@ script = ExtResource("11_u7tym") [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_v_3"] visible = false layout_mode = 0 -offset_left = -4.0 +offset_left = -8.0 offset_top = 124.0 -offset_right = 89.0 +offset_right = 85.0 offset_bottom = 134.0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -1040,9 +1040,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1323.0 -offset_top = 810.0 +offset_top = 803.0 offset_right = 1400.0 -offset_bottom = 926.0 +offset_bottom = 919.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -1091,9 +1091,9 @@ script = ExtResource("11_u7tym") [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_n_3"] visible = false layout_mode = 0 -offset_left = -4.0 +offset_left = -7.0 offset_top = 124.0 -offset_right = 89.0 +offset_right = 86.0 offset_bottom = 134.0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -1115,9 +1115,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1188.0 -offset_top = 810.0 +offset_top = 803.0 offset_right = 1265.0 -offset_bottom = 926.0 +offset_bottom = 919.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -1166,9 +1166,9 @@ script = ExtResource("11_u7tym") [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_k_3"] visible = false layout_mode = 0 -offset_left = -4.0 +offset_left = -8.0 offset_top = 124.0 -offset_right = 89.0 +offset_right = 85.0 offset_bottom = 134.0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -1190,9 +1190,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1328.0 -offset_top = 193.0 +offset_top = 179.0 offset_right = 1405.0 -offset_bottom = 309.0 +offset_bottom = 295.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -1265,9 +1265,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1183.0 -offset_top = 193.0 +offset_top = 179.0 offset_right = 1260.0 -offset_bottom = 309.0 +offset_bottom = 295.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -1339,10 +1339,10 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) [node name="pribor_prd_v_4" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 -offset_left = 946.0 -offset_top = 345.0 -offset_right = 1023.0 -offset_bottom = 461.0 +offset_left = 940.0 +offset_top = 322.0 +offset_right = 1017.0 +offset_bottom = 438.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -1356,9 +1356,9 @@ metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_v_4"] layout_mode = 0 -offset_left = 17.0 +offset_left = 15.0 offset_top = -41.0 -offset_right = 69.0 +offset_right = 67.0 offset_bottom = -22.0 text = "ПРД В4" horizontal_alignment = 1 @@ -1390,9 +1390,9 @@ script = ExtResource("11_u7tym") [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_v_4"] visible = false layout_mode = 0 -offset_left = -4.0 +offset_left = -6.0 offset_top = 124.0 -offset_right = 89.0 +offset_right = 87.0 offset_bottom = 134.0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -1414,9 +1414,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 941.0 -offset_top = 685.0 +offset_top = 687.0 offset_right = 1018.0 -offset_bottom = 801.0 +offset_bottom = 803.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -1464,9 +1464,9 @@ script = ExtResource("11_u7tym") [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_n_4"] visible = false layout_mode = 0 -offset_left = -4.0 +offset_left = -8.0 offset_top = 124.0 -offset_right = 89.0 +offset_right = 85.0 offset_bottom = 134.0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -1487,10 +1487,10 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1) [node name="pribor_prd_k_4" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 -offset_left = 946.0 -offset_top = 515.0 -offset_right = 1023.0 -offset_bottom = 631.0 +offset_left = 941.0 +offset_top = 504.0 +offset_right = 1018.0 +offset_bottom = 620.0 size_flags_horizontal = 15 size_flags_vertical = 15 toggle_mode = true @@ -1504,9 +1504,9 @@ metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_prd_k_4"] layout_mode = 0 -offset_left = 17.0 +offset_left = 14.0 offset_top = -40.0 -offset_right = 69.0 +offset_right = 66.0 offset_bottom = -21.0 text = "ПРД К4" horizontal_alignment = 1 @@ -1529,7 +1529,7 @@ patch_margin_bottom = 16 [node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_k_4"] light_mask = 3 -position = Vector2(42, -10) +position = Vector2(39, -10) scale = Vector2(0.625, 0.625) sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 @@ -1538,9 +1538,9 @@ script = ExtResource("11_u7tym") [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_k_4"] visible = false layout_mode = 0 -offset_left = -4.0 +offset_left = -8.0 offset_top = 124.0 -offset_right = 89.0 +offset_right = 85.0 offset_bottom = 134.0 size_flags_horizontal = 3 size_flags_vertical = 3 diff --git a/scripts/pribor-prd.gd b/scripts/pribor-prd.gd index 74e97e4..ec2753a 100644 --- a/scripts/pribor-prd.gd +++ b/scripts/pribor-prd.gd @@ -499,6 +499,11 @@ class TestPRD extends Node: signaller.conn(signaller.start_contol_device, Callable(self, '_on_start_contol_device')) interfer.connect('interfer_resized', Callable(self, 'on_interfer_resized')) unit_prd.connect('data_received', Callable(self, 'on_data_received')) + signaller.connect('режим_работа', Callable(self, 'on_mode_changed').bind(false)) + signaller.connect('режим_журнал', Callable(self, 'on_mode_changed').bind(false)) + signaller.connect('режим_эмс', Callable(self, 'on_mode_changed').bind(false)) + signaller.connect('режим_настройки', Callable(self, 'on_mode_changed').bind(false)) + signaller.connect('режим_контроль', Callable(self, 'on_mode_changed').bind(true)) func on_interfer_resized(ecms_dic: Dictionary) -> void: @@ -562,7 +567,17 @@ class TestPRD extends Node: add_child(machine_timer) machine_timer.connect('timeout', Callable(self, 'on_state_mashine')) - + + func on_mode_changed(in_tree: bool) -> void: + if not in_tree: + progress_value = 0 + machine_timer.stop() + state = STATE_MACHINE.INIT + _handle_fs_turn_off_state() + #prd_v_module.cmd_array.append([unit_prd_v.CmdCode.WRITE_ISA, [constants_v.ADDR_UG_LITERA_1, ug_work_1, constants_v.ADDR_UG_LITERA_2, ug_work_2]]) + else: + pass + func _process_dkm_status(status: PackedByteArray) -> void: if not control_results.has(_get_current_fs_key()):