From 71176c4869679594a0fe7d3b6c392a0aa72e31c9 Mon Sep 17 00:00:00 2001
From: TotMaxim
Date: Sun, 9 Nov 2025 16:18:31 +0300
Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B1=D1=80=D0=B0=D0=BB=20=D0=B8?=
=?UTF-8?q?=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE?=
=?UTF-8?q?=20=D0=B2=D1=8B=D0=B1=D0=BE=D1=80=D1=83=20=D0=BF=D1=80=D0=B8?=
=?UTF-8?q?=D0=B1=D0=BE=D1=80=D0=BE=D0=B2=20+=20=D0=BE=D1=82=D1=80=D0=B5?=
=?UTF-8?q?=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BB=20?=
=?UTF-8?q?=D0=BF=D0=BE=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B8?=
=?UTF-8?q?=D0=BD=D0=B4=D0=B8=D0=BA=D0=B0=D1=82=D0=BE=D1=80=D0=BE=D0=B2=20?=
=?UTF-8?q?=D0=B2=D0=BD=D0=B5=D1=88=D0=BD=D0=B5=D0=B5=20=D1=83=D0=BF=D1=80?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5,=20=D1=81=D0=BE?=
=?UTF-8?q?=D1=81=D1=82=D0=BE=D1=8F=D0=BD=D0=B8=D1=8F=20=D0=B8=20=D1=82?=
=?UTF-8?q?=D1=80=D0=B5=D0=BD=D0=B0=D0=B6=D0=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
scenes/tabs-switch/tab-switch.tscn | 10 +-
scenes/контроль/кнопка-прибора.gd | 41 ++++++++-
scenes/контроль/контроль.tscn | 142 +++++++++++------------------
3 files changed, 97 insertions(+), 96 deletions(-)
diff --git a/scenes/tabs-switch/tab-switch.tscn b/scenes/tabs-switch/tab-switch.tscn
index a148f043..8d27a501 100644
--- a/scenes/tabs-switch/tab-switch.tscn
+++ b/scenes/tabs-switch/tab-switch.tscn
@@ -81,7 +81,7 @@ metadata/_tab_index = 5
[node name="lbl_ready" type="Label" parent="."]
layout_mode = 0
-offset_left = 1503.0
+offset_left = 1504.0
offset_right = 1600.0
offset_bottom = 27.0
tooltip_text = "Готовность аппаратуры к работе"
@@ -96,8 +96,8 @@ metadata/_edit_lock_ = true
[node name="remote_control" type="Label" parent="."]
layout_mode = 2
-offset_left = 1244.0
-offset_right = 1401.0
+offset_left = 1242.0
+offset_right = 1402.0
offset_bottom = 27.0
tooltip_text = "Комплекс находится под внешним управлением"
mouse_filter = 0
@@ -106,10 +106,11 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_o1r22")
text = "Внешнее управление"
horizontal_alignment = 1
vertical_alignment = 1
+metadata/_edit_lock_ = true
[node name="тренаж_режим" type="Button" parent="."]
layout_mode = 0
-offset_left = 1404.0
+offset_left = 1405.0
offset_right = 1501.0
offset_bottom = 27.0
tooltip_text = "Задействовать режим Тренаж"
@@ -124,6 +125,7 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_imu1q")
toggle_mode = true
text = "Тренаж"
script = ExtResource("9_41d34")
+metadata/_edit_lock_ = true
[connection signal="tab_changed" from="tab_switch" to="tab_switch" method="_on_tab_changed"]
[connection signal="toggled" from="тренаж_режим" to="tab_switch" method="_on_button_trenaj_toggled"]
diff --git a/scenes/контроль/кнопка-прибора.gd b/scenes/контроль/кнопка-прибора.gd
index 8ff2c669..837c5c14 100644
--- a/scenes/контроль/кнопка-прибора.gd
+++ b/scenes/контроль/кнопка-прибора.gd
@@ -1,22 +1,55 @@
@tool
-
extends TextureButton
+
@onready var tween: Tween
@export var state_colors: Array
-func _on_toggled(toggled_on) -> void: $frame.visible = toggled_on
-func _enter_tree() -> void: $label.self_modulate = state_colors[state]
+
+func _ready():
+ toggle_mode = true
+ focus_mode = Control.FOCUS_ALL
+ connect("focus_entered", _on_focus_entered)
+ connect("focus_exited", _on_focus_exited)
+
+
+func _enter_tree() -> void:
+ if has_node("label"):
+ $label.self_modulate = state_colors[state]
+
+
func update_progress_bar(target_value) -> void:
if tween:
tween.kill()
tween = create_tween()
tween.tween_property($control_progress, "value", target_value, 0.3)
+
+func _on_toggled(toggled_on):
+ if has_node("frame"):
+ $frame.visible = toggled_on
+
+
+func _on_focus_entered():
+ button_pressed = true
+ #enter_press() TODO: Пока что без выбора прибора
+
+
+func _on_focus_exited():
+ pass
+
+
+func enter_press():
+ var enter_event = InputEventAction.new()
+ enter_event.action = "ui_accept"
+ enter_event.pressed = true
+ Input.parse_input_event(enter_event)
+
+
@export var state: int:
set(v):
v = 0 if v < 0 else v % state_colors.size()
state = v
- if is_inside_tree():
+ if is_inside_tree() and has_node("label"):
$label.self_modulate = state_colors[v]
diff --git a/scenes/контроль/контроль.tscn b/scenes/контроль/контроль.tscn
index 3b7ad7a2..c7c18794 100644
--- a/scenes/контроль/контроль.tscn
+++ b/scenes/контроль/контроль.tscn
@@ -376,17 +376,15 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/online_proc = "on_line_changed"
metadata/unit_name = ["уарэп-яу07-1н"]
[node name="label" type="Label" parent="pribor_prd_n_1"]
layout_mode = 0
offset_left = 8.0
-offset_top = -38.0
+offset_top = -40.0
offset_right = 60.0
-offset_bottom = -19.0
+offset_bottom = -21.0
text = "ПРД Н1"
horizontal_alignment = 1
vertical_alignment = 1
@@ -453,8 +451,6 @@ stretch_mode = 0
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
state = 1
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-эмс"]
metadata/online_proc = "on_line_changed"
@@ -462,9 +458,9 @@ metadata/online_proc = "on_line_changed"
self_modulate = Color(0, 1, 0, 1)
layout_mode = 0
offset_left = 15.0
-offset_top = -34.0
+offset_top = -44.0
offset_right = 91.0
-offset_bottom = -15.0
+offset_bottom = -25.0
text = "УФ"
horizontal_alignment = 1
vertical_alignment = 1
@@ -508,17 +504,15 @@ texture_normal = ExtResource("3_hhadv")
stretch_mode = 0
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = [&"уарэп-бпо-1", &"уарэп-бпо-2"]
metadata/online_proc = "online_change_arr"
[node name="label" type="Label" parent="pribor_rtr"]
layout_mode = 0
-offset_left = 12.0
-offset_top = -54.0
-offset_right = 95.0
-offset_bottom = -35.0
+offset_left = 11.0
+offset_top = -49.0
+offset_right = 94.0
+offset_bottom = -30.0
text = "РТР"
horizontal_alignment = 1
vertical_alignment = 1
@@ -540,17 +534,17 @@ patch_margin_bottom = 16
[node name="label2" type="Label" parent="pribor_rtr"]
layout_mode = 0
-offset_left = 12.0
-offset_top = -54.0
-offset_right = 95.0
-offset_bottom = -35.0
+offset_left = 11.0
+offset_top = -49.0
+offset_right = 94.0
+offset_bottom = -30.0
text = "РТР"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_rtr"]
light_mask = 3
-position = Vector2(55, -15)
+position = Vector2(53, -15)
scale = Vector2(0.625, 0.625)
sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
@@ -573,16 +567,14 @@ texture_normal = ExtResource("9_iqgf5")
stretch_mode = 0
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = [&"уарэп-афсп-левый"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_afsp_1"]
layout_mode = 0
-offset_left = 165.0
+offset_left = 175.0
offset_top = -245.0
-offset_right = 262.0
+offset_right = 272.0
offset_bottom = -225.0
scale = Vector2(5, 5)
text = "АФСП 1"
@@ -607,9 +599,9 @@ patch_margin_bottom = 16
[node name="label2" type="Label" parent="pribor_afsp_1"]
layout_mode = 0
-offset_left = 165.0
+offset_left = 175.0
offset_top = -245.0
-offset_right = 262.0
+offset_right = 272.0
offset_bottom = -225.0
scale = Vector2(5, 5)
text = "АФСП 1"
@@ -642,16 +634,14 @@ stretch_mode = 0
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = [&"уарэп-афсп-правый"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_afsp_2"]
layout_mode = 0
-offset_left = 200.0
+offset_left = 175.0
offset_top = -240.0
-offset_right = 297.0
+offset_right = 272.0
offset_bottom = -220.0
scale = Vector2(5, 5)
text = "АФСП 2"
@@ -676,9 +666,9 @@ patch_margin_bottom = 16
[node name="label2" type="Label" parent="pribor_afsp_2"]
layout_mode = 0
-offset_left = 200.0
+offset_left = 175.0
offset_top = -240.0
-offset_right = 297.0
+offset_right = 272.0
offset_bottom = -220.0
scale = Vector2(5, 5)
text = "АФСП 2"
@@ -687,7 +677,7 @@ vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_afsp_2"]
light_mask = 3
-position = Vector2(425, -40)
+position = Vector2(415, -40)
scale = Vector2(3, 3)
sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
@@ -708,17 +698,15 @@ texture_normal = ExtResource("5_kvnex")
stretch_mode = 0
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-щ3", "уарэп-спт25-1", "уарэп-спт25-2"]
metadata/online_proc = "online_change_arr"
[node name="label" type="Label" parent="pribor_uyep"]
layout_mode = 0
offset_left = 26.8566
-offset_top = -38.3276
+offset_top = -43.3276
offset_right = 66.8566
-offset_bottom = -19.3276
+offset_bottom = -24.3276
text = "У-ЭП"
horizontal_alignment = 1
vertical_alignment = 1
@@ -762,17 +750,15 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-2в"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_v_2"]
layout_mode = 0
offset_left = 14.0
-offset_top = -38.0
+offset_top = -42.0
offset_right = 66.0
-offset_bottom = -19.0
+offset_bottom = -23.0
text = "ПРД В2"
horizontal_alignment = 1
vertical_alignment = 1
@@ -839,17 +825,15 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-2н"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_n_2"]
layout_mode = 0
offset_left = 15.0
-offset_top = -38.0
+offset_top = -42.0
offset_right = 67.0
-offset_bottom = -19.0
+offset_bottom = -23.0
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 0
text = "ПРД Н2"
@@ -918,17 +902,15 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-2к"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_k_2"]
layout_mode = 0
offset_left = 17.0
-offset_top = -38.0
+offset_top = -42.0
offset_right = 69.0
-offset_bottom = -19.0
+offset_bottom = -23.0
text = "ПРД К2"
horizontal_alignment = 1
vertical_alignment = 1
@@ -983,9 +965,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1)
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1048.0
-offset_top = 802.0
+offset_top = 810.0
offset_right = 1125.0
-offset_bottom = 918.0
+offset_bottom = 926.0
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
@@ -995,17 +977,15 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-3в"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_v_3"]
layout_mode = 0
offset_left = 9.0
-offset_top = -38.0
+offset_top = -41.0
offset_right = 61.0
-offset_bottom = -19.0
+offset_bottom = -22.0
text = "ПРД В3"
horizontal_alignment = 1
vertical_alignment = 1
@@ -1060,9 +1040,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1)
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1323.0
-offset_top = 802.0
+offset_top = 810.0
offset_right = 1400.0
-offset_bottom = 918.0
+offset_bottom = 926.0
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
@@ -1072,17 +1052,15 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-3н"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_n_3"]
layout_mode = 0
offset_left = 8.0
-offset_top = -38.0
+offset_top = -43.0
offset_right = 60.0
-offset_bottom = -19.0
+offset_bottom = -24.0
text = "ПРД Н3"
horizontal_alignment = 1
vertical_alignment = 1
@@ -1137,9 +1115,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1)
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1188.0
-offset_top = 802.0
+offset_top = 810.0
offset_right = 1265.0
-offset_bottom = 918.0
+offset_bottom = 926.0
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
@@ -1149,17 +1127,15 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-3к"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_k_3"]
layout_mode = 0
offset_left = 9.0
-offset_top = -38.0
+offset_top = -42.0
offset_right = 61.0
-offset_bottom = -19.0
+offset_bottom = -23.0
text = "ПРД К3"
horizontal_alignment = 1
vertical_alignment = 1
@@ -1214,9 +1190,9 @@ tint_progress = Color(0.890196, 0.486275, 0.196078, 1)
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1328.0
-offset_top = 198.0
+offset_top = 193.0
offset_right = 1405.0
-offset_bottom = 314.0
+offset_bottom = 309.0
size_flags_horizontal = 15
size_flags_vertical = 15
toggle_mode = true
@@ -1226,17 +1202,15 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-1в"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_v_1"]
layout_mode = 0
offset_left = 8.0
-offset_top = -38.0
+offset_top = -44.0
offset_right = 60.0
-offset_bottom = -19.0
+offset_bottom = -25.0
text = "ПРД В1"
horizontal_alignment = 1
vertical_alignment = 1
@@ -1303,17 +1277,15 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-1к"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_k_1"]
layout_mode = 0
offset_left = 9.0
-offset_top = -38.0
+offset_top = -44.0
offset_right = 61.0
-offset_bottom = -19.0
+offset_bottom = -25.0
text = "ПРД К1"
horizontal_alignment = 1
vertical_alignment = 1
@@ -1379,17 +1351,15 @@ texture_normal = ExtResource("6_i1yfn")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-4в"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_v_4"]
layout_mode = 0
offset_left = 17.0
-offset_top = -38.0
+offset_top = -41.0
offset_right = 69.0
-offset_bottom = -19.0
+offset_bottom = -22.0
text = "ПРД В4"
horizontal_alignment = 1
vertical_alignment = 1
@@ -1455,17 +1425,15 @@ texture_normal = ExtResource("6_i1yfn")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-4н"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_n_4"]
layout_mode = 0
offset_left = 14.0
-offset_top = -38.0
+offset_top = -41.0
offset_right = 66.0
-offset_bottom = -19.0
+offset_bottom = -22.0
text = "ПРД Н4"
horizontal_alignment = 1
vertical_alignment = 1
@@ -1531,17 +1499,15 @@ texture_normal = ExtResource("6_i1yfn")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
-progress_max_value = 0.0
-progress_min_value = 0.0
metadata/unit_name = ["уарэп-яу07-4к"]
metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_prd_k_4"]
layout_mode = 0
offset_left = 17.0
-offset_top = -38.0
+offset_top = -40.0
offset_right = 69.0
-offset_bottom = -19.0
+offset_bottom = -21.0
text = "ПРД К4"
horizontal_alignment = 1
vertical_alignment = 1