diff --git a/PRD_MP550.tscn b/PRD_MP550.tscn index 1bcb40f..8b4f25f 100644 --- a/PRD_MP550.tscn +++ b/PRD_MP550.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=50 format=3 uid="uid://cvor2jm4xk3ha"] +[gd_scene load_steps=49 format=3 uid="uid://cvor2jm4xk3ha"] [ext_resource type="Script" path="res://scripts/PRD.gd" id="1_v273n"] [ext_resource type="Texture2D" uid="uid://cdxdluvyb5uei" path="res://table/on.png" id="2_dv7xx"] @@ -13,7 +13,6 @@ [ext_resource type="Script" path="res://scripts/ems_g.gd" id="9_g1wia"] [ext_resource type="Shader" path="res://load.gdshader" id="10_lf1xh"] [ext_resource type="PackedScene" uid="uid://bdb0bhfu7366l" path="res://kasseta-fs-kd.tscn" id="10_tdh2s"] -[ext_resource type="PackedScene" uid="uid://bnlkbbn7b4a3k" path="res://table/элемент-эмс.tscn" id="11_d60jk"] [ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://table/элемент-в.tscn" id="11_fg7ul"] [ext_resource type="Script" path="res://scripts/modul_fs.gd" id="15_b4pr1"] @@ -269,7 +268,7 @@ metadata/_edit_lock_ = true offset_left = 216.0 offset_top = 39.0 offset_right = 2420.0 -offset_bottom = 917.0 +offset_bottom = 936.0 theme = SubResource("Theme_k5ur4") theme_override_colors/font_unselected_color = Color(0, 0, 0, 0.0392157) theme_override_colors/font_selected_color = Color(0, 0, 0, 0) @@ -281,11 +280,12 @@ theme_override_styles/tab_selected = SubResource("StyleBoxTexture_k08q3") theme_override_styles/tab_hovered = SubResource("StyleBoxTexture_dklg6") theme_override_styles/tab_unselected = SubResource("StyleBoxTexture_17le6") tab_alignment = 2 -current_tab = 0 +current_tab = 1 tab_focus_mode = 0 metadata/_edit_lock_ = true [node name="PRD" type="Panel" parent="TabContainer"] +visible = false layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxTexture_7u7p7") metadata/_tab_index = 0 @@ -429,7 +429,6 @@ script = ExtResource("2_vmbyo") node_gap = Vector2(100, 50) [node name="ControlPanel" type="Panel" parent="TabContainer"] -visible = false layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxTexture_tn8m6") script = ExtResource("9_akagi") @@ -438,10 +437,10 @@ metadata/_edit_lock_ = true [node name="lbl_control" type="Label" parent="TabContainer/ControlPanel"] layout_mode = 0 -offset_left = 4.0 -offset_top = 21.0 -offset_right = 624.0 -offset_bottom = 52.0 +offset_left = 45.0 +offset_top = -37.0 +offset_right = 665.0 +offset_bottom = -6.0 theme_override_font_sizes/font_size = 22 text = "Контроль исправности прибора ПРД-Н" horizontal_alignment = 1 @@ -450,77 +449,64 @@ vertical_alignment = 1 [node name="soc_y5" type="NinePatchRect" parent="TabContainer/ControlPanel"] layout_mode = 0 offset_left = 199.0 -offset_top = 103.0 +offset_top = 10.0 offset_right = 516.0 -offset_bottom = 293.0 +offset_bottom = 200.0 texture = ExtResource("9_0r2qk") patch_margin_left = 16 patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="ref_A24" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +[node name="IP5_25" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] offset_left = 9.0 offset_top = 34.0 offset_right = 59.0 offset_bottom = 184.0 -textures = Array[Texture]([]) -fname = "ИП-25" +fname = "ИП5-25" rname = "A24" -metadata/_edit_lock_ = true -[node name="ref_A30" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +[node name="ay07" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] offset_left = 59.0 offset_top = 34.0 offset_right = 109.0 offset_bottom = 184.0 -textures = Array[Texture]([]) fname = "ЯУ-07" rname = "A30" -metadata/_edit_lock_ = true -[node name="ref_A26" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +[node name="ems_g" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] offset_left = 109.0 offset_top = 34.0 offset_right = 159.0 offset_bottom = 184.0 -textures = Array[Texture]([]) fname = "ЭМС-Г" rname = "A26" -metadata/_edit_lock_ = true -[node name="ref_A27" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +[node name="ug" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] offset_left = 159.0 offset_top = 34.0 offset_right = 209.0 offset_bottom = 184.0 -textures = Array[Texture]([]) fname = "УГ" rname = "A27" -metadata/_edit_lock_ = true -[node name="ref_A28" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] -offset_left = 209.0 -offset_top = 34.0 -offset_right = 259.0 -offset_bottom = 183.0 -textures = Array[Texture]([]) -self_size = Vector2i(50, 149) -fname = "УКП-1" -rname = "A28" -metadata/_edit_lock_ = true - -[node name="ref_A29" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +[node name="ukp_2" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] offset_left = 259.0 offset_top = 34.0 offset_right = 309.0 offset_bottom = 184.0 -textures = Array[Texture]([]) fname = "УКП-2" rname = "A29" -metadata/_edit_lock_ = true -[node name="lbl_fname" type="Label" parent="TabContainer/ControlPanel/soc_y5"] +[node name="ukp_1" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +offset_left = 210.0 +offset_top = 35.0 +offset_right = 260.0 +offset_bottom = 185.0 +fname = "УКП-1" +rname = "A28" + +[node name="Kasseta" type="Label" parent="TabContainer/ControlPanel/soc_y5"] self_modulate = Color(1, 1, 1, 0.62) layout_mode = 0 offset_left = 7.0 @@ -531,15 +517,15 @@ text = "Кассета У5" horizontal_alignment = 1 vertical_alignment = 1 -[node name="soc_fs-nkvd" parent="TabContainer/ControlPanel" instance=ExtResource("10_tdh2s")] +[node name="Kasseta_FS" parent="TabContainer/ControlPanel" instance=ExtResource("10_tdh2s")] layout_mode = 0 -offset_left = 198.0 -offset_top = 311.0 -offset_right = 516.0 -offset_bottom = 538.0 +offset_left = 200.0 +offset_top = 201.0 +offset_right = 518.0 +offset_bottom = 420.0 script = null -[node name="lbl_fname" type="Label" parent="TabContainer/ControlPanel/soc_fs-nkvd"] +[node name="Kasseta" type="Label" parent="TabContainer/ControlPanel/Kasseta_FS"] self_modulate = Color(1, 1, 1, 0.62) layout_mode = 0 offset_left = 7.0 @@ -549,115 +535,119 @@ offset_bottom = 33.0 text = "Кассета ФС-НД" horizontal_alignment = 1 vertical_alignment = 1 -metadata/_edit_lock_ = true -[node name="ref_A3" parent="TabContainer/ControlPanel/soc_fs-nkvd" instance=ExtResource("11_fg7ul")] +[node name="ref_A3" parent="TabContainer/ControlPanel/Kasseta_FS" instance=ExtResource("11_fg7ul")] offset_left = 109.0 -offset_top = 68.0 +offset_top = 41.0 offset_right = 159.0 -offset_bottom = 218.0 -textures = Array[Texture]([]) -fname = "ФС-2" +offset_bottom = 211.0 +self_size = Vector2i(50, 170) +fname = "БЛОК ФС-2" rname = "A3" -metadata/_edit_lock_ = true -[node name="ref_A1" parent="TabContainer/ControlPanel/soc_fs-nkvd" instance=ExtResource("11_fg7ul")] +[node name="ref_A1" parent="TabContainer/ControlPanel/Kasseta_FS" instance=ExtResource("11_fg7ul")] offset_left = 159.0 -offset_top = 68.0 +offset_top = 41.0 offset_right = 209.0 -offset_bottom = 218.0 -textures = Array[Texture]([]) -fname = "Модуль" +offset_bottom = 211.0 +self_size = Vector2i(50, 170) +fname = "Модуль ФС" rname = "A1" -metadata/_edit_lock_ = true -[node name="ref_A2" parent="TabContainer/ControlPanel/soc_fs-nkvd" instance=ExtResource("11_fg7ul")] +[node name="ref_A2" parent="TabContainer/ControlPanel/Kasseta_FS" instance=ExtResource("11_fg7ul")] offset_left = 209.0 -offset_top = 68.0 +offset_top = 41.0 offset_right = 259.0 -offset_bottom = 217.0 -textures = Array[Texture]([]) -self_size = Vector2i(50, 149) -fname = "Модуль" +offset_bottom = 211.0 +self_size = Vector2i(50, 170) +fname = "Модуль ФС" rname = "A2" -metadata/_edit_lock_ = true -[node name="ref_A4" parent="TabContainer/ControlPanel/soc_fs-nkvd" instance=ExtResource("11_fg7ul")] +[node name="ref_A4" parent="TabContainer/ControlPanel/Kasseta_FS" instance=ExtResource("11_fg7ul")] offset_left = 259.0 -offset_top = 68.0 +offset_top = 41.0 offset_right = 309.0 -offset_bottom = 218.0 -textures = Array[Texture]([]) -fname = "ФС-3" +offset_bottom = 211.0 +self_size = Vector2i(50, 170) +fname = "БЛОК ФС-3" rname = "A4" -metadata/_edit_lock_ = true + +[node name="Block_FS_PRD_K" parent="TabContainer/ControlPanel/Kasseta_FS" instance=ExtResource("11_fg7ul")] +offset_left = 12.0 +offset_top = 40.0 +offset_right = 62.0 +offset_bottom = 210.0 +self_size = Vector2i(50, 170) +fname = "БЛОК ФС-1" +rname = "A4" + +[node name="FS_PRD_K" parent="TabContainer/ControlPanel/Kasseta_FS" instance=ExtResource("11_fg7ul")] +offset_left = 61.0 +offset_top = 41.0 +offset_right = 111.0 +offset_bottom = 211.0 +self_size = Vector2i(50, 170) +fname = "Модуль ФС" +rname = "A1" [node name="soc_P1" type="NinePatchRect" parent="TabContainer/ControlPanel"] layout_mode = 0 -offset_left = 96.0 -offset_top = 560.0 -offset_right = 516.0 -offset_bottom = 776.0 +offset_left = 259.0 +offset_top = 427.0 +offset_right = 447.0 +offset_bottom = 643.0 texture = ExtResource("9_0r2qk") patch_margin_left = 16 patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="lbl_fname" type="Label" parent="TabContainer/ControlPanel/soc_P1"] +[node name="Kasseta" type="Label" parent="TabContainer/ControlPanel/soc_P1"] self_modulate = Color(1, 1, 1, 0.62) layout_mode = 0 offset_left = 7.0 offset_top = 8.0 -offset_right = 409.0 +offset_right = 181.0 offset_bottom = 33.0 text = "Кассета П-1" horizontal_alignment = 1 vertical_alignment = 1 -metadata/_edit_lock_ = true -[node name="ref_A23" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] -offset_left = 40.0 -offset_top = -206.0 -offset_right = 90.0 -offset_bottom = -32.0 -textures = Array[Texture]([]) +[node name="MAA_1" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +offset_left = -64.0 +offset_top = 37.0 +offset_right = -14.0 +offset_bottom = 211.0 self_size = Vector2i(50, 174) +fname = "МАА2000" +rname = "А22" -[node name="ref_A24" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] -offset_left = 40.0 -offset_top = -448.0 -offset_right = 90.0 -offset_bottom = -274.0 -textures = Array[Texture]([]) +[node name="MAA_2" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +offset_left = 203.0 +offset_top = 36.0 +offset_right = 253.0 +offset_bottom = 210.0 self_size = Vector2i(50, 174) +fname = "МАА2000" +rname = "А23" -[node name="ref_A25" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] -offset_left = 109.0 -offset_top = 34.0 -offset_right = 159.0 -offset_bottom = 208.0 -textures = Array[Texture]([]) +[node name="IP9_50_2" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +offset_left = 129.0 +offset_top = 37.0 +offset_right = 179.0 +offset_bottom = 211.0 self_size = Vector2i(50, 174) -metadata/_edit_lock_ = true +fname = "ИП9-50" +rname = "А19" -[node name="ref_A26" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] -offset_left = 159.0 -offset_top = 34.0 -offset_right = 209.0 -offset_bottom = 208.0 -textures = Array[Texture]([]) +[node name="IP9_50_1" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +offset_left = 73.0 +offset_top = 37.0 +offset_right = 123.0 +offset_bottom = 211.0 self_size = Vector2i(50, 174) -metadata/_edit_lock_ = true - -[node name="ref_A27" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] -offset_left = 209.0 -offset_top = 34.0 -offset_right = 259.0 -offset_bottom = 208.0 -textures = Array[Texture]([]) -self_size = Vector2i(50, 174) -metadata/_edit_lock_ = true +fname = "ИП9-50" +rname = "А20" [node name="ref_A28" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] visible = false @@ -667,7 +657,8 @@ offset_right = 309.0 offset_bottom = 208.0 textures = Array[Texture]([]) self_size = Vector2i(50, 174) -metadata/_edit_lock_ = true +fname = "ИП12-50" +rname = "A21" [node name="ref_A29" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] visible = false @@ -677,121 +668,66 @@ offset_right = 359.0 offset_bottom = 208.0 textures = Array[Texture]([]) self_size = Vector2i(50, 174) +fname = "ИП9-50" +rname = "А22" metadata/_edit_lock_ = true -[node name="Signal_EMS_G" type="NinePatchRect" parent="TabContainer/ControlPanel"] +[node name="IP12_50" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +offset_left = 16.0 +offset_top = 36.0 +offset_right = 66.0 +offset_bottom = 210.0 +self_size = Vector2i(50, 174) +fname = "ИП12-50" +rname = "А21" + +[node name="soc_P2" type="NinePatchRect" parent="TabContainer/ControlPanel"] layout_mode = 0 -offset_left = 536.0 -offset_top = 550.0 -offset_right = 1055.0 -offset_bottom = 777.0 +offset_left = 278.0 +offset_top = 645.0 +offset_right = 432.0 +offset_bottom = 861.0 texture = ExtResource("9_0r2qk") patch_margin_left = 16 patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="lbl_fname" type="Label" parent="TabContainer/ControlPanel/Signal_EMS_G"] +[node name="Kasseta" type="Label" parent="TabContainer/ControlPanel/soc_P2"] self_modulate = Color(1, 1, 1, 0.62) layout_mode = 0 -offset_left = 7.0 +offset_left = 8.0 offset_top = 8.0 -offset_right = 508.0 +offset_right = 142.0 offset_bottom = 33.0 -text = "ЭМС-Г" +text = "Кассета П-2" horizontal_alignment = 1 vertical_alignment = 1 -metadata/_edit_lock_ = true -[node name="ref_A22" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] -offset_left = 9.0 -offset_top = 38.0 -offset_right = 59.0 -offset_bottom = 216.0 -self_size = Vector2i(50, 178) +[node name="IP12_50" parent="TabContainer/ControlPanel/soc_P2" instance=ExtResource("11_fg7ul")] +offset_left = 81.0 +offset_top = 36.0 +offset_right = 131.0 +offset_bottom = 210.0 +self_size = Vector2i(50, 174) +fname = "ИП12-50" +rname = "A25" + +[node name="IP9_50" parent="TabContainer/ControlPanel/soc_P2" instance=ExtResource("11_fg7ul")] +offset_left = 24.0 +offset_top = 36.0 +offset_right = 74.0 +offset_bottom = 210.0 +self_size = Vector2i(50, 174) +fname = "ИП9-50" rname = "A22" -metadata/_edit_lock_ = true -[node name="ref_A23" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] -offset_left = 59.0 -offset_top = 38.0 -offset_right = 109.0 -offset_bottom = 216.0 -self_size = Vector2i(50, 178) -rname = "A23" -metadata/_edit_lock_ = true - -[node name="ref_A26" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] -offset_left = 109.0 -offset_top = 38.0 -offset_right = 159.0 -offset_bottom = 216.0 -self_size = Vector2i(50, 178) -rname = "A26" -metadata/_edit_lock_ = true - -[node name="ref_A27" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] -offset_left = 159.0 -offset_top = 38.0 -offset_right = 209.0 -offset_bottom = 216.0 -self_size = Vector2i(50, 178) -rname = "A27" -metadata/_edit_lock_ = true - -[node name="ref_A28" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] -offset_left = 209.0 -offset_top = 38.0 -offset_right = 259.0 -offset_bottom = 216.0 -self_size = Vector2i(50, 178) -rname = "A28" -metadata/_edit_lock_ = true - -[node name="ref_A29" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] -offset_left = 259.0 -offset_top = 38.0 -offset_right = 309.0 -offset_bottom = 216.0 -self_size = Vector2i(50, 178) -rname = "A29" -metadata/_edit_lock_ = true - -[node name="ref_A31" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] -offset_left = 309.0 -offset_top = 38.0 -offset_right = 359.0 -offset_bottom = 216.0 -self_size = Vector2i(50, 178) -rname = "УМ2" -metadata/_edit_lock_ = true - -[node name="ref_A32" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] -offset_left = 359.0 -offset_top = 38.0 -offset_right = 409.0 -offset_bottom = 216.0 -self_size = Vector2i(50, 178) -rname = "УМ3" -metadata/_edit_lock_ = true - -[node name="ref_A33" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] -offset_left = 409.0 -offset_top = 38.0 -offset_right = 459.0 -offset_bottom = 216.0 -self_size = Vector2i(50, 178) -rname = "A33" -metadata/_edit_lock_ = true - -[node name="ref_A34" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] -offset_left = 459.0 -offset_top = 38.0 -offset_right = 509.0 -offset_bottom = 216.0 -self_size = Vector2i(50, 178) -rname = "A33" -metadata/_edit_lock_ = true +[node name="device" type="Label" parent="TabContainer/ControlPanel"] +layout_mode = 0 +offset_left = 1451.0 +offset_top = 792.0 +offset_right = 1616.0 +offset_bottom = 847.0 [node name="EMS_G" type="Panel" parent="TabContainer"] visible = false diff --git a/scripts/PRD.gd b/scripts/PRD.gd index 66df434..7e7fb35 100644 --- a/scripts/PRD.gd +++ b/scripts/PRD.gd @@ -158,22 +158,103 @@ func _ready() -> void: node_select_fs_1.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_1')) node_select_fs_1.get_node2(1, 3).connect('text_submitted', Callable(self, '_on_set_att_1')) node_select_fs_1.get_node2(1, 2).connect('text_submitted', Callable(self, '_on_set_ferq_1')) - + node_select_fs_2.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_2')) node_select_fs_2.get_node2(1, 3).connect('text_submitted', Callable(self, '_on_set_att_2')) node_select_fs_2.get_node2(1, 2).connect('text_submitted', Callable(self, '_on_set_ferq_2')) - -func draw_control_panel_prd(mode) -> void: - for node_path in Constants.NODE_MAP: - var index = Constants.NODE_MAP[node_path] - var node = get_node(node_path) - if node: - var value = node.get("text") - if value != null: - node.text = Constants.SIGNS_PRD[mode][index] - else: - node.fname = Constants.SIGNS_PRD[mode][index] + +func draw_control_panel_prd(pribor) -> void: + if pribor == Constants.MODE.PRD_H: + # Кассета У5 + $TabContainer/ControlPanel/soc_y5/IP5_25.rname = 'А24' + $TabContainer/ControlPanel/soc_y5/ay07.rname = 'А30' + $TabContainer/ControlPanel/soc_y5/ems_g.rname = 'А26' + $TabContainer/ControlPanel/soc_y5/ug.rname = 'А27' + $TabContainer/ControlPanel/soc_y5/ukp_1.rname = 'А28' + $TabContainer/ControlPanel/soc_y5/ukp_2.rname = 'А29' + # Кассета ФС + $TabContainer/ControlPanel/Kasseta_FS/Kasseta.text = 'Кассета ФС-НД' + $TabContainer/ControlPanel/Kasseta_FS/Block_FS_PRD_K.visible = false + $TabContainer/ControlPanel/Kasseta_FS/FS_PRD_K.visible = false + $TabContainer/ControlPanel/Kasseta_FS/ref_A1.rname = 'А1' + $TabContainer/ControlPanel/Kasseta_FS/ref_A1.fname = 'Модуль ФС' + $TabContainer/ControlPanel/Kasseta_FS/ref_A3.rname = 'А3' + $TabContainer/ControlPanel/Kasseta_FS/ref_A3.fname = 'БЛОК ФС-2' + $TabContainer/ControlPanel/Kasseta_FS/ref_A2.rname = 'А2' + $TabContainer/ControlPanel/Kasseta_FS/ref_A2.fname = 'Модуль ФС' + $TabContainer/ControlPanel/Kasseta_FS/ref_A4.rname = 'А4' + $TabContainer/ControlPanel/Kasseta_FS/ref_A4.fname = 'БЛОК ФС-3' + # Кассета П-1 + $TabContainer/ControlPanel/soc_P1/IP12_50.rname = 'А21' + $TabContainer/ControlPanel/soc_P1/IP9_50_1.rname = 'А20' + $TabContainer/ControlPanel/soc_P1/IP9_50_2.rname = 'А19' + $TabContainer/ControlPanel/soc_P1/MAA_1.rname = 'А22' + $TabContainer/ControlPanel/soc_P1/MAA_2.rname = 'А23' + # Кассета П-2 + $TabContainer/ControlPanel/soc_P2.visible = false + + elif pribor == Constants.MODE.PRD_B: + # Кассета У5 + $TabContainer/ControlPanel/soc_y5/IP5_25.rname = 'А24' + $TabContainer/ControlPanel/soc_y5/ay07.rname = 'А30' + $TabContainer/ControlPanel/soc_y5/ems_g.rname = 'А26' + $TabContainer/ControlPanel/soc_y5/ug.rname = 'А27' + $TabContainer/ControlPanel/soc_y5/ukp_1.rname = 'А28' + $TabContainer/ControlPanel/soc_y5/ukp_2.rname = 'А29' + # Кассета ФС + $TabContainer/ControlPanel/Kasseta_FS/Kasseta.text = 'Кассета ФС-ВД' + $TabContainer/ControlPanel/Kasseta_FS/Block_FS_PRD_K.visible = false + $TabContainer/ControlPanel/Kasseta_FS/FS_PRD_K.visible = false + $TabContainer/ControlPanel/Kasseta_FS/ref_A1.rname = 'А1' + $TabContainer/ControlPanel/Kasseta_FS/ref_A1.fname = 'Модуль ФС' + $TabContainer/ControlPanel/Kasseta_FS/ref_A3.rname = 'А3' + $TabContainer/ControlPanel/Kasseta_FS/ref_A3.fname = 'БЛОК ФС-4' + $TabContainer/ControlPanel/Kasseta_FS/ref_A2.rname = 'А2' + $TabContainer/ControlPanel/Kasseta_FS/ref_A2.fname = 'Модуль ФС' + $TabContainer/ControlPanel/Kasseta_FS/ref_A4.rname = 'А4' + $TabContainer/ControlPanel/Kasseta_FS/ref_A4.fname = 'БЛОК ФС-5' + # Кассета П-1 + $TabContainer/ControlPanel/soc_P1/IP12_50.rname = 'А21' + $TabContainer/ControlPanel/soc_P1/IP9_50_1.rname = 'А20' + $TabContainer/ControlPanel/soc_P1/IP9_50_2.rname = 'А19' + $TabContainer/ControlPanel/soc_P1/MAA_1.rname = 'А22' + $TabContainer/ControlPanel/soc_P1/MAA_2.rname = 'А23' + # Кассета П-2 + $TabContainer/ControlPanel/soc_P2.visible = false + + elif pribor == Constants.MODE.PRD_K: + # Кассета У5 + $TabContainer/ControlPanel/soc_y5/IP5_25.rname = 'А31' + $TabContainer/ControlPanel/soc_y5/ay07.rname = 'А37' + $TabContainer/ControlPanel/soc_y5/ems_g.rname = 'А33' + $TabContainer/ControlPanel/soc_y5/ug.rname = 'А34' + $TabContainer/ControlPanel/soc_y5/ukp_1.rname = 'А35' + $TabContainer/ControlPanel/soc_y5/ukp_2.rname = 'А36' + # Кассета ФС + $TabContainer/ControlPanel/Kasseta_FS/Kasseta.text = 'Кассета ФС-КД' + $TabContainer/ControlPanel/Kasseta_FS/Block_FS_PRD_K.visible = true + $TabContainer/ControlPanel/Kasseta_FS/FS_PRD_K.visible = true + $TabContainer/ControlPanel/Kasseta_FS/ref_A1.rname = 'А3' + $TabContainer/ControlPanel/Kasseta_FS/ref_A1.fname = 'Модуль ФС' + $TabContainer/ControlPanel/Kasseta_FS/ref_A3.rname = 'А6' + $TabContainer/ControlPanel/Kasseta_FS/ref_A3.fname = 'БЛОК ФС-6' + $TabContainer/ControlPanel/Kasseta_FS/ref_A2.rname = 'А2' + $TabContainer/ControlPanel/Kasseta_FS/ref_A2.fname = 'Модуль ФС' + $TabContainer/ControlPanel/Kasseta_FS/ref_A4.rname = 'А5' + $TabContainer/ControlPanel/Kasseta_FS/ref_A4.fname = 'БЛОК ФС-7' + # Кассета П-1 + $TabContainer/ControlPanel/soc_P1/IP12_50.rname = 'А23' + $TabContainer/ControlPanel/soc_P1/IP12_50.fname = 'ИП9-50' + $TabContainer/ControlPanel/soc_P1/IP9_50_1.rname = 'А24' + $TabContainer/ControlPanel/soc_P1/IP9_50_1.fname = 'ИП9-50' + $TabContainer/ControlPanel/soc_P1/IP9_50_2.rname = 'А26' + $TabContainer/ControlPanel/soc_P1/IP9_50_2.fname = 'ИП12-50' + + $TabContainer/ControlPanel/soc_P1/MAA_1.rname = 'А27' + $TabContainer/ControlPanel/soc_P1/MAA_2.rname = 'А28' + # Кассета П-2 + $TabContainer/ControlPanel/soc_P2.visible = true ## From Network status about yau-07 @@ -237,6 +318,7 @@ func _on_data_fs_1(fs_1_data): Constants.CMD.BASE_GET_CURRENT_TEMP: if GRP == Constants.GROUP.BASE: node_select_fs_1.set_node_text(1, 5, '%.2f' % fs_1_data.decode_float(0xC) + ' °C') + #$read.text = str(fs_1_data.hex_encode()) func _on_data_fs_2(fs_2_data): diff --git a/scripts/constants.gd b/scripts/constants.gd index 65eaef1..f6d4d2f 100644 --- a/scripts/constants.gd +++ b/scripts/constants.gd @@ -1,12 +1,12 @@ extends Node -const UNICAST_PORT: int = 50003 -const UNICAST_ADDRESS: String = '10.1.1.3' +const UNICAST_PORT: int = 50014 +const UNICAST_ADDRESS: String = '10.1.1.14' const BROADCAST_PORT: int = 50000 const DEFAULT_ADDRESS: String = '10.1.1.11' const DEFAULT_PORT: String = '50011' const CONST_MIN_TEMP: int = -25 const MAXIMUM_CODE_ADC: int = 3796 -const MINIMUM_CODE_AD: int = 2660 +const MINIMUM_CODE_AD: int = 2660 const TEMP: float = 115.0 / (MAXIMUM_CODE_ADC - MINIMUM_CODE_AD) const TableNode = preload("res://table/node.tscn") const TableList = preload("res://table/node_list.tscn") @@ -59,6 +59,9 @@ const ADDRESSES: Array = [ ['ПРД-К2', '10.1.1.23', 50023, MODE.PRD_K, '10.1.2.38', '10.1.2.39', '10.1.2.33'], ['ПРД-К3', '10.1.1.33', 50033, MODE.PRD_K, '10.1.2.54', '10.1.2.55', '10.1.2.49'], ['ПРД-К4', '10.1.1.43', 50043, MODE.PRD_K, '10.1.2.70', '10.1.2.71', '10.1.2.65']] + +var CURRENT_MODE = ADDRESSES[0][3] + const INPUT_EMS_G: Array = [ '01 :34', '02 :35', @@ -99,6 +102,7 @@ const OUT_x128: Array = [ 'Откл.', '1',] const RAY_DICT: Array = [ + ' Контроль', ' -5°', ' 5°', ' 15°', @@ -117,101 +121,14 @@ const ATT_DICT: Array = [ ' 10 dB', ' 10.5 dB', ] -const SIGNS_PRD: Array = [ - ## ПРК-К - [ - ' Запрет СИ7', - ' Запрет СИ1', - 'ЛИТЕРА 7! ПРД-К', - 'СЗИ6 от УФ', - 'СЗИ7 от УФ', - 'СИ6 от ФС', - 'СИ7 от ФС', - 'СИ6 в УФ', - 'СИ7 в УФ', - 'Мод. УМ 6', - 'Мод. УМ 7', - 'ФГОЗ 6', - 'Мод. УМ 1', - 'МАА №1', - 'МАА №2', - 'ИП9-50 №1', - 'ИП9-50 №2', - 'ИП9-50 №3', - 'ИП5-25', - ], - ## ПРК-В - [ - ' Запрет СИ4', - ' Запрет СИ5', - '', - 'ЛИТЕРА 5! ПРД-В', - 'СЗИ4 от УФ', - 'СЗИ5 от УФ', - 'СИ4 от ФС', - 'СИ5 от ФС', - 'СИ4 в УФ', - 'СИ5 в УФ', - 'Мод. УМ 4', - 'Мод. УМ 5', - 'ФГОЗ 4', - 'ФГОЗ 5', - 'МАА №1', - 'МАА №2', - 'ИП9-50 №1', - 'ИП9-50 №2', - '-', - '-', - 'ИП5-25', - ], - ## ПРК-Н - [ - ' Запрет СИ3', - '', - 'ЛИТЕРА 3! ПРД-Н', - 'СИ3 от ФС', - 'СИ2 в УФ', - 'СИ3 в УФ', - 'Мод. УМ 2', - 'Мод. УМ 3', - 'ФГОЗ 3', - '-', - 'МАА №1', - 'МАА №2', - 'ИП9-50 №1', - 'ИП9-50 №2', - '-', - '-', - 'ИП5-25', - '--', - ], -] -var NODE_MAP = { - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A22': 1, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A23': 2, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A26': 3, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A27': 4, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A28': 5, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A29': 6, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A31': 7, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A32': 8, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A33': 9, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A34': 10, - 'TabContainer/ControlPanel/soc_P1/ref_A23': 11, - 'TabContainer/ControlPanel/soc_P1/ref_A24': 12, - 'TabContainer/ControlPanel/soc_P1/ref_A25': 13, - 'TabContainer/ControlPanel/soc_P1/ref_A26': 14, - 'TabContainer/ControlPanel/soc_P1/ref_A27': 15, - 'TabContainer/ControlPanel/soc_P1/ref_A28': 16, - 'TabContainer/ControlPanel/soc_P1/ref_A29': 17, - } + enum BASE_PORTS { UG = 0x100, EMS_G = 0x120, UKP_1 = 0x130, UKP_2 = 0x140, } - + enum MODE { PRD_K, PRD_B, @@ -243,7 +160,12 @@ enum STATE { DONE, IDLE, SEND, -} +} + +enum STATE_VAL { + NONE = 0, + GOOD = 1, + ERROR = 2 } var EMS_G_PORT_DATA_HOLDER: Array = [] diff --git a/scripts/control_panel.gd b/scripts/control_panel.gd index 80e2e5b..0bf2e4b 100644 --- a/scripts/control_panel.gd +++ b/scripts/control_panel.gd @@ -5,69 +5,38 @@ 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, '_on_yau_status')) + Network.connect('yau_status_line', Callable(self, '_control_pribor')) + var timer = Timer.new() + self.add_child(timer) + timer.connect('timeout', Callable(self, 'on_timer')) + timer.start(1) -func lose_connect_yau(): - for i in 4: - var sockets_ind = [$soc_y5/ref_A26/light_ind, - $soc_y5/ref_A27/light_ind, - $soc_y5/ref_A28/light_ind, - $soc_y5/ref_A29/light_ind] - sockets_ind[i].button_pressed = false - sockets_ind[i].disabled = true - - for i in 8: - var node_power_ind = [$soc_P1/ref_A23/light_ind, - $soc_P1/ref_A24/light_ind, - $soc_P1/ref_A25/light_ind, - $soc_P1/ref_A26/light_ind, - $soc_P1/ref_A27/light_ind, - $soc_P1/ref_A28/light_ind, - $soc_P1/ref_A29/light_ind, - $soc_y5/ref_A24/light_ind] - node_power_ind[i].button_pressed = false - node_power_ind[i].disabled = true + '''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) # Контроль сухих контактов (УГ) - - ## SOCKETS BOARDS - for i in 4: - var sockets_ind = [ $soc_y5/ref_A26/light_ind, - $soc_y5/ref_A27/light_ind, - $soc_y5/ref_A28/light_ind, - $soc_y5/ref_A29/light_ind] - var j = int(status_board & (1 << i) == 0) - if j == 0: - sockets_ind[i].button_pressed = true - sockets_ind[i].disabled = false - else: - sockets_ind[i].button_pressed = false - sockets_ind[i].disabled = true - - ## Блок ИП - for i in 8: - var node_power_ind = [$soc_P1/ref_A23/light_ind, - $soc_P1/ref_A24/light_ind, - $soc_P1/ref_A25/light_ind, - $soc_P1/ref_A26/light_ind, - $soc_P1/ref_A27/light_ind, - $soc_P1/ref_A28/light_ind, - $soc_P1/ref_A29/light_ind, - $soc_y5/ref_A24/light_ind] - var j = int(not(dry_contact & (1 << i) == 0)) - if j == 0: - node_power_ind[i].button_pressed = true - node_power_ind[i].disabled = false - else: - node_power_ind[i].button_pressed = false - node_power_ind[i].disabled = true ## From Network status about yau-07 -func _on_yau_status(yau_status:bool) -> void: - $soc_y5/ref_A30/light_ind.button_pressed = yau_status - $soc_y5/ref_A30/light_ind.disabled = not yau_status +func _control_pribor(yau_status:bool) -> void: + #$device.text = str(Constants.CURRENT_MODE) + $soc_y5/ay07.state = Constants.STATE_VAL.GOOD diff --git a/scripts/ems_g.gd b/scripts/ems_g.gd index 9587824..2634ad0 100644 --- a/scripts/ems_g.gd +++ b/scripts/ems_g.gd @@ -10,7 +10,7 @@ func _on_read_ems_g(): for i_input in 16: Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 1+i_input) Network.read_port_isa([Constants.BASE_PORTS.EMS_G+0xA]) - + for i_output in range(46, 62): Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, 1+i_output) Network.read_port_isa([Constants.BASE_PORTS.EMS_G+4, Constants.BASE_PORTS.EMS_G+8]) @@ -27,7 +27,7 @@ func _on_sync(): port0x124 = Constants.EMS_G_PORT_DATA_HOLDER[index][1][key] for row in 16: if (port0x124 & (1 << row)) != 0: - var chk_btn = node_select1.get_node2(tmp_device_mode-45, row+3).get_child(1, false) + var chk_btn = node_select1.get_node2(tmp_device_mode-45, row+3).get_child(1, false) chk_btn.button_pressed =true if key == 0x128: port0x128 = Constants.EMS_G_PORT_DATA_HOLDER[index][1][key] @@ -52,24 +52,24 @@ func _ready() -> void: else: column.append(Constants.TableNode) EMS_G_TABLE.append(column) - + draw_tabl(node_select1, EMS_G_TABLE, EMS_G_TABLE.size()) - + node_select1.get_node2(1, 1).text = 'x3_ВЫХ:GND' node_select1.get_node2(0, 2).text = 'x3_ВХ :GND' for i in Constants.INPUT_EMS_G.size(): node_select1.get_node2(0, i+shift+1).text = Constants.INPUT_EMS_G[i] - + for i in Constants.OUT_EMS_G.size(): node_select1.get_node2(i+shift, 1).text = Constants.OUT_EMS_G[i][1] - + for i in EMS_G_TABLE[0].size()-shift: var list = node_select1.get_node2(i+shift, 0) list.set_meta('device', Constants.OUT_EMS_G[i][0]) list.connect('item_selected', Callable(self, 'on_mode_link').bind(list)) for k in Constants.OUT_x128.size(): - list.add_item(Constants.OUT_x128[k]) - + list.add_item(Constants.OUT_x128[k]) + var columns_min_size: Array for i in EMS_G_TABLE[0].size(): if i < 2: @@ -77,13 +77,13 @@ func _ready() -> void: else: columns_min_size.append(80) node_select1.set_columns_min_size(columns_min_size) - + var parrent_NODE2 = get_parent().get_parent() parrent_NODE2.connect('read_ems_g_start', Callable(self, '_on_read_ems_g')) parrent_NODE2.connect('read_ems_g_finish', Callable(self, '_on_sync')) Network.connect('yau_receive', Callable(self, '_on_data_received')) create_link_button(node_select1, shift+1, 16+shift+1, shift, 16+shift) - + func draw_tabl(tbl, row: Array, count_row: int): for i_row in count_row: @@ -96,23 +96,23 @@ func _on_data_received(data_from_yau_07): var out_blank: int = data_from_yau_07.decode_u16(Constants.DataIndices.OUT_BLANK_PRD) var out_imp: int = data_from_yau_07.decode_u16(Constants.DataIndices.OUT_IMPULS_PRD) var parent_node2 = get_parent().get_parent() - - process_sockets_vert(in_blank, in_imp, 16, 1, parent_node2) - process_sockets_horizon(out_blank, out_imp, 16, 2, parent_node2) - - + + #process_sockets_vert(in_blank, in_imp, 16, 1, parent_node2) + #process_sockets_horizon(out_blank, out_imp, 16, 2, parent_node2) + + func process_sockets_horizon(blank: int, imp: int, count: int, col: int, parent_node2: Node): for i in count: var socket_status = node_select1.get_node2(col+i, shift).get_child(1, false) var frame_type = Constants.Frame.WORK - + if (blank & (1 << i)) != 0: frame_type = Constants.Frame.CONSTANT elif (imp & (1 << i)) != 0: frame_type = Constants.Frame.VARIABLE - + set_frame(socket_status, frame_type) - + if i == 1: set_frame(get_specific_node(parent_node2, 5), frame_type) var CI_2_UF = parent_node2.get_child(3).get_child(0).get_child(0).get_child(0).get_child(2).get_node2(1, 6).get_child(1) @@ -133,14 +133,14 @@ func process_sockets_vert(blank: int, imp: int, count: int, col: int, parent_nod for i in count: var socket_status = node_select1.get_node2(col, i + shift+1).get_child(1, false) var frame_type = Constants.Frame.WORK - + if (blank & (1 << i)) != 0: frame_type = Constants.Frame.CONSTANT elif (imp & (1 << i)) != 0: frame_type = Constants.Frame.VARIABLE - + set_frame(socket_status, frame_type) - + if i == 1: set_frame(get_specific_node(parent_node2, 1), frame_type) if i == 2: @@ -172,7 +172,7 @@ func create_link_button(node, count_rows_sart: int, count_rows_end: int, coln_st for i_colum in 16: META_EMS_G.append([INPUT+i_row, OUTPUT+i_colum]) button_link_meta[OUTPUT+i_colum] = 0 - + var count_register = 0 for i_row in range(count_rows_sart, count_rows_end): for i_col in range (coln_start, coln_end): @@ -190,7 +190,7 @@ func on_mouse_entered(meta_area): var device = meta_area.get_meta('device') var y = device[0] + 1 var x = device[1] - 45 - + for i_y in 18: for i_x in 18: if i_y <= y and i_x <= x and i_y == y: @@ -209,9 +209,9 @@ func on_mode_link(mode, list): var meta = list.get_meta('device') var address_port_wr = Constants.BASE_PORTS.EMS_G+2 Network.write_port_isa(address_port_wr, meta) # Отправка команды - + ## Формирование команды для отправкы команды на устройство - address_port_wr = Constants.BASE_PORTS.EMS_G+8 + address_port_wr = Constants.BASE_PORTS.EMS_G+8 var set_mode = 0x0000 if mode == 0 else 0x2000 if mode == 1 else 0x4000 if mode == 2 else 0x8000 Network.write_port_isa(address_port_wr, set_mode) diff --git a/scripts/network.gd b/scripts/network.gd index 69f5199..3f84ba0 100644 --- a/scripts/network.gd +++ b/scripts/network.gd @@ -279,7 +279,7 @@ func set_fs_attenuation(attenuation: float): func connect_fs_2(): if client_fs_2: disconnect_fs_2(client_fs_2) - + client_fs_2 = StreamPeerTCP.new() peerstream_fs_2 = PacketPeerStream.new() var rc = client_fs_2.connect_to_host(ip_fs_2, Constants.PORT_FS) diff --git a/scripts/nine-patch-button.gd b/scripts/nine-patch-button.gd new file mode 100644 index 0000000..a03ad20 --- /dev/null +++ b/scripts/nine-patch-button.gd @@ -0,0 +1,86 @@ +@tool + +extends PanelContainer + +func set_text(val: String): $button.set_text(val) +func set_pressed(val: bool): $button.set_pressed(val) +func set_disabled(val: bool): disabled = val +func get_text(): return $button.get_text() +func is_pressed(): return $button.is_pressed() +func is_toggle_mode(): return $button.is_toggle_mode() + + +@export var texture_state0: Texture2D = preload('res://table/элемент-в.tscn::GradientTexture2D_d3qtt'): + set(val): $state.set_texture(val) + + +@export var texture_state1: Texture2D = preload('res://table/элемент-в.tscn::GradientTexture2D_k8o6s'): + set(val): $state.set_texture(val) + + +@export var strips_rotation: float = 0.0: + set(val): + strips_rotation = val + $back.strips_rotation = deg_to_rad(val) + get: return strips_rotation + + +@export var text: String = '': + set(val): $button.set_text(val) + get: return $button.get_text() + + +@export var disabled: bool = false: + set(val): + disabled = val + $button.set_disabled(val) + $back.disabled = val + $state.modulate.a = 0.5 if val else 1.0 + get: return disabled + + +@export var pressed: bool = false: + set(val): + pressed = val + $button.set_pressed(val) + get: + return pressed + + +@export var toggle_mode: bool = false: + set(val): + toggle_mode = val + $button.set_toggle_mode(val) + get: + return toggle_mode + + +func button_connect(button_signal: String, proc: Callable): + var rc = $button.connect(button_signal, proc) + if rc != Error.OK: + push_error('возникла ошибка \"%s\" при подключении сигнала \"%s\" к обработчику \"%s\"' % [error_string(rc), button_signal, proc]) + + +func _on_resized() -> void: + $back.scale = size + $back.material.set('shader_parameter/scale', size / Vector2(20.0, 20.0)) + + +func _enter_tree() -> void: + $back.scale = size + $back.material.set('shader_parameter/scale', size / Vector2(20.0, 20.0)) + $button.set_toggle_mode(true) + $button.connect('toggled', _on_button_toggled) + + +func _exit_tree() -> void: + $button.disconnect('toggled', _on_button_toggled) + + +func set_toggle_mode(val: bool): + $button.set_toggle_mode(val) + + +func _on_button_toggled(val: bool): + if val: $state.set_texture(texture_state1) + else: $state.set_texture(texture_state0) diff --git a/table/элемент-в.tscn b/table/элемент-в.tscn index 7449675..b2ea5f0 100644 --- a/table/элемент-в.tscn +++ b/table/элемент-в.tscn @@ -1,8 +1,11 @@ -[gd_scene load_steps=15 format=3 uid="uid://p2suppildvq0"] +[gd_scene load_steps=12 format=3 uid="uid://p2suppildvq0"] +[ext_resource type="Texture2D" uid="uid://ce3qpf070wgd2" path="res://состояние-исправности-0.png" id="1_2n7he"] [ext_resource type="Texture2D" uid="uid://cgtg4gbqnuxrc" path="res://nine-patch-round.png" id="2_4b43i"] +[ext_resource type="Texture2D" uid="uid://byweg7pgt8o4h" path="res://состояние-исправности-1.png" id="2_38t58"] [ext_resource type="Shader" path="res://opt_btn.gdshader" id="2_ecsml"] [ext_resource type="Texture2D" uid="uid://dkef6xwxwdxi8" path="res://эмс-бланк.png" id="3_4kmgr"] +[ext_resource type="Texture2D" uid="uid://bvikuv0lbvou8" path="res://состояние-исправности-2.png" id="3_i2t3v"] [ext_resource type="Texture2D" uid="uid://b15flrfytxkop" path="res://эмс-бланк-пост.png" id="4_omove"] [ext_resource type="Texture2D" uid="uid://ijdfo2mml54" path="res://эмс-бланк-перем.png" id="5_jia67"] @@ -44,8 +47,8 @@ func _resize_children() -> void: $lbl_rname.position.y = margins[0] $lbl_fname.size.y = size.x $lbl_fname.position.y = size.y / 2 + $lbl_fname.size.x / 2 - $light_ind.position.x = size.x / 2 - ($light_ind.size.x * $light_ind.scale.x) / 2 - $light_ind.position.y = size.y - $light_ind.size.y * $light_ind.scale.x - margins[2] + $txr_state.position.x = size.x / 2 - ($txr_state.size.x * $txr_state.scale.x) / 2 + $txr_state.position.y = size.y - $txr_state.size.y * $txr_state.scale.x - margins[2] func _on_nine_patch_rect_resized() -> void: @@ -75,37 +78,6 @@ shader = ExtResource("2_ecsml") shader_parameter/range = 0.4 shader_parameter/color = Color(0.764706, 0.764706, 0.764706, 1) -[sub_resource type="Gradient" id="Gradient_x8k3w"] -colors = PackedColorArray(1, 1, 1, 1, 0.393086, 0.393086, 0.393085, 1) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_cgu2r"] -gradient = SubResource("Gradient_x8k3w") -width = 25 -height = 25 -fill = 1 -fill_from = Vector2(0.5, 0.5) -fill_to = Vector2(1.125, 0) - -[sub_resource type="Gradient" id="Gradient_1tk1g"] -colors = PackedColorArray(0.1, 1, 0.1, 1, 0.124744, 0.328804, 0.202483, 1) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_d3qtt"] -gradient = SubResource("Gradient_1tk1g") -width = 25 -height = 25 -fill = 1 -fill_from = Vector2(0.5, 0.5) - -[sub_resource type="Gradient" id="Gradient_6e32x"] -colors = PackedColorArray(1, 0.1, 0.1, 1, 0.329, 0.125, 0.202, 1) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_k8o6s"] -gradient = SubResource("Gradient_6e32x") -width = 25 -height = 25 -fill = 1 -fill_from = Vector2(0.5, 0.5) - [sub_resource type="SpriteFrames" id="SpriteFrames_nofpw"] animations = [{ "frames": [{ @@ -133,7 +105,7 @@ anchors_preset = 0 offset_right = 50.0 offset_bottom = 150.0 script = SubResource("GDScript_fbktk") -textures = Array[Texture]([ExtResource("2_4b43i"), ExtResource("2_4b43i"), ExtResource("2_4b43i")]) +textures = Array[Texture]([ExtResource("1_2n7he"), ExtResource("2_38t58"), ExtResource("3_i2t3v")]) metadata/ref_des = "" metadata/dec_num = "" @@ -160,19 +132,16 @@ text = "Ячейка" horizontal_alignment = 1 vertical_alignment = 1 -[node name="light_ind" type="TextureButton" parent="."] +[node name="txr_state" type="TextureRect" parent="."] material = SubResource("ShaderMaterial_45ast") layout_mode = 0 -offset_left = 13.0 -offset_top = 114.0 -offset_right = 38.0 -offset_bottom = 139.0 +offset_left = 14.0 +offset_top = 116.0 +offset_right = 238.0 +offset_bottom = 340.0 +scale = Vector2(0.1, 0.1) size_flags_vertical = 6 -toggle_mode = true -button_mask = 0 -texture_normal = SubResource("GradientTexture2D_cgu2r") -texture_pressed = SubResource("GradientTexture2D_d3qtt") -texture_disabled = SubResource("GradientTexture2D_k8o6s") +texture = ExtResource("1_2n7he") [node name="np_rect" type="NinePatchRect" parent="."] layout_mode = 0 diff --git a/состояние-исправности-0.png b/состояние-исправности-0.png new file mode 100644 index 0000000..33966d1 Binary files /dev/null and b/состояние-исправности-0.png differ diff --git a/состояние-исправности-0.png.import b/состояние-исправности-0.png.import new file mode 100644 index 0000000..4f6075b --- /dev/null +++ b/состояние-исправности-0.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ce3qpf070wgd2" +path="res://.godot/imported/состояние-исправности-0.png-5c54b931fdcaaeea20ccd26e18d4b7de.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://состояние-исправности-0.png" +dest_files=["res://.godot/imported/состояние-исправности-0.png-5c54b931fdcaaeea20ccd26e18d4b7de.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/состояние-исправности-1.png b/состояние-исправности-1.png new file mode 100644 index 0000000..755740f Binary files /dev/null and b/состояние-исправности-1.png differ diff --git a/состояние-исправности-1.png.import b/состояние-исправности-1.png.import new file mode 100644 index 0000000..0e27798 --- /dev/null +++ b/состояние-исправности-1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://byweg7pgt8o4h" +path="res://.godot/imported/состояние-исправности-1.png-3675cd90cab151ef6fac9b2e3babeb44.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://состояние-исправности-1.png" +dest_files=["res://.godot/imported/состояние-исправности-1.png-3675cd90cab151ef6fac9b2e3babeb44.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/состояние-исправности-2.png b/состояние-исправности-2.png new file mode 100644 index 0000000..d0ad198 Binary files /dev/null and b/состояние-исправности-2.png differ diff --git a/состояние-исправности-2.png.import b/состояние-исправности-2.png.import new file mode 100644 index 0000000..aa075f9 --- /dev/null +++ b/состояние-исправности-2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bvikuv0lbvou8" +path="res://.godot/imported/состояние-исправности-2.png-deccaddb215e53d76d5a2f5971888569.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://состояние-исправности-2.png" +dest_files=["res://.godot/imported/состояние-исправности-2.png-deccaddb215e53d76d5a2f5971888569.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1