From 80e6884979fa3182502c70ef285858943189cfe0 Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 6 Feb 2025 15:45:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20PRD=20=D0=BF=D0=B0=D0=BD?= =?UTF-8?q?=D0=B5=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PRD_MP550.tscn | 66 +------------------------------------------- scripts/PRD.gd | 35 ++++++++++------------- scripts/constants.gd | 13 +++++++-- scripts/ems_g.gd | 8 ++++-- scripts/network.gd | 4 +-- table/node_list.tscn | 1 + 6 files changed, 35 insertions(+), 92 deletions(-) diff --git a/PRD_MP550.tscn b/PRD_MP550.tscn index 25bd654..ee5c21a 100644 --- a/PRD_MP550.tscn +++ b/PRD_MP550.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=53 format=3 uid="uid://cvor2jm4xk3ha"] +[gd_scene load_steps=50 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"] @@ -120,18 +120,6 @@ gradient = SubResource("Gradient_ki0n7") fill_from = Vector2(0.474359, 0.5) metadata/_snap_enabled = true -[sub_resource type="Gradient" id="Gradient_jlp41"] -colors = PackedColorArray(0, 0.647059, 0, 1, 0, 0.266667, 0, 1) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_u3yy8"] -gradient = SubResource("Gradient_jlp41") -fill = 1 -fill_from = Vector2(0.5, 0.5) -fill_to = Vector2(1.145, 0) - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_otisn"] -texture = SubResource("GradientTexture2D_u3yy8") - [sub_resource type="ShaderMaterial" id="ShaderMaterial_2pxu2"] shader = ExtResource("8_12mng") shader_parameter/color_signal = Color(0.588242, 0.466356, 0, 1) @@ -382,49 +370,6 @@ custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxTexture_1as41") -[node name="yau_07b" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_3_5_7"] -visible = false -custom_minimum_size = Vector2(250, 200) -layout_mode = 2 - -[node name="LABEL2" type="Label" parent="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b"] -layout_mode = 2 -text = "ЛИТЕРА 3! ПРД-Н!" - -[node name="Zapret2" type="Button" parent="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b"] -custom_minimum_size = Vector2(180, 25) -layout_mode = 2 -focus_mode = 0 -mouse_default_cursor_shape = 2 -theme_override_styles/pressed = SubResource("StyleBoxTexture_otisn") -toggle_mode = true -text = " Запрет СИ3" -metadata/dev_num = 49 - -[node name="Modul_um_2" type="Button" parent="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b"] -layout_mode = 2 -focus_mode = 0 -mouse_default_cursor_shape = 2 -theme_override_styles/pressed = SubResource("StyleBoxTexture_otisn") -toggle_mode = true -text = " Модуляция УМ 3" -metadata/dev_num = 52 - -[node name="fgos_2" type="Button" parent="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b"] -layout_mode = 2 -focus_mode = 0 -mouse_default_cursor_shape = 2 -theme_override_styles/pressed = SubResource("StyleBoxTexture_otisn") -toggle_mode = true -text = "ФГОЗ 3" -metadata/dev_num = 56 - -[node name="Ray_set_2" type="OptionButton" parent="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b"] -layout_mode = 2 - -[node name="att_set_2" type="OptionButton" parent="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b"] -layout_mode = 2 - [node name="yau07b_control" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_3_5_7"] layout_mode = 2 script = ExtResource("2_vmbyo") @@ -467,10 +412,6 @@ scale = Vector2(21.8765, 21.6782) texture = SubResource("GradientTexture2D_0pk2o") metadata/_edit_lock_ = true -[node name="litera_1" type="GridContainer" parent="TabContainer/PRD/body_grid"] -visible = false -layout_mode = 2 - [node name="select_dev" type="GridContainer" parent="TabContainer/PRD"] layout_mode = 2 offset_left = 16.0 @@ -1047,11 +988,6 @@ text = "Сохранить все настройки" [connection signal="pressed" from="Background/side_panel/save_config" to="." method="_on_save_config"] [connection signal="pressed" from="Background/side_panel/load_config" to="." method="_on_load_config"] [connection signal="pressed" from="read_isa" to="." method="_on_read_isa_pressed"] -[connection signal="toggled" from="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Zapret2" to="." method="_on_zapret2"] -[connection signal="toggled" from="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Modul_um_2" to="." method="_on_modul_um_2"] -[connection signal="toggled" from="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/fgos_2" to="." method="_on_fgos_2"] -[connection signal="item_selected" from="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Ray_set_2" to="." method="_on_btn_ray_2"] -[connection signal="item_selected" from="TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/att_set_2" to="." method="_on_attenuator_2"] [connection signal="pressed" from="TabContainer/Modul_fs/set_space/set_ferq" to="TabContainer/Modul_fs" method="_on_set_ferq"] [connection signal="pressed" from="TabContainer/Modul_fs/set_space/set_att2" to="TabContainer/Modul_fs" method="_on_set_att"] [connection signal="pressed" from="TabContainer/Modul_fs/manage_panel/con" to="TabContainer/Modul_fs" method="_on_start"] diff --git a/scripts/PRD.gd b/scripts/PRD.gd index 1959c84..adfe5f7 100644 --- a/scripts/PRD.gd +++ b/scripts/PRD.gd @@ -13,7 +13,6 @@ var isa_from_yau07b: Dictionary = {} var JSOON = JSON.new() var status_pribor = null var save_path = "D://PRD-TU-MP550//" - var need_port: Array = [ 0x122, 0x124, @@ -45,7 +44,7 @@ func _ready() -> void: # Таблица ЯУ-07б var node_select_yau_07b = $TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control - draw_tabl(node_select_yau_07b, Constants.ROWS_YAU_07B, Constants.ROWS_YAU_07B.size()) + draw_tabl(node_select_yau_07b, Constants.ROWS_YAU_07B_1, Constants.ROWS_YAU_07B_1.size()) node_select_yau_07b.set_columns_min_size([160, 120]) node_select_yau_07b.set_node_text(0, 0, 'ПРД-Н') node_select_yau_07b.set_node_text(1, 0, 'Литера_2') @@ -53,9 +52,10 @@ func _ready() -> void: node_select_yau_07b.set_node_text(0, 2, 'Модуляция УМ_2') node_select_yau_07b.set_node_text(0, 3, 'Положение луча') node_select_yau_07b.set_node_text(0, 4, 'Аттенюатор') + node_select_yau_07b.set_node_text(0, 6, 'СИ 2 в УФ') var node_select_yau_07b_2 = $TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control - draw_tabl(node_select_yau_07b_2, Constants.ROWS_YAU_07B, Constants.ROWS_YAU_07B.size()) + draw_tabl(node_select_yau_07b_2, Constants.ROWS_YAU_07B_2, Constants.ROWS_YAU_07B_2.size()) node_select_yau_07b_2.set_columns_min_size([160, 120]) node_select_yau_07b_2.set_node_text(0, 0, 'ПРД-Н') node_select_yau_07b_2.set_node_text(1, 0, 'Литера_3') @@ -64,12 +64,13 @@ func _ready() -> void: node_select_yau_07b_2.set_node_text(0, 3, 'Положение луча') node_select_yau_07b_2.set_node_text(0, 4, 'Аттенюатор') node_select_yau_07b_2.set_node_text(0, 5, 'ФГОЗ 3') + node_select_yau_07b_2.set_node_text(0, 6, 'СИ 3 в УФ') #Таблица ФС var node_select_fs_1 = $TabContainer/PRD/body_grid/litera_2_4_6/fs_control draw_tabl(node_select_fs_1, Constants.ROWS_FS, Constants.ROWS_FS.size()) node_select_fs_1.set_columns_min_size([120, 120, 150]) - node_select_fs_1.set_node_text(0, 0, 'ПРД-Н') + node_select_fs_1.set_node_text(0, 0, 'Модуль ФС') node_select_fs_1.set_node_text(1, 0, 'Литера_2') node_select_fs_1.set_node_text(0, 1, 'Состояние') node_select_fs_1.set_node_text(0, 2, 'Частота') @@ -78,12 +79,12 @@ func _ready() -> void: node_select_fs_1.get_node2(1, 3).editable = true node_select_fs_1.set_node_text(0, 4, 'Генератор') node_select_fs_1.set_node_text(0, 5, 'fpga') - node_select_fs_1.set_node_text(0, 6, 'СИ 2 ОТ ФС') + node_select_fs_1.set_node_text(0, 6, 'СИ 2 от ФС') var node_select_fs_2 = $TabContainer/PRD/body_grid/litera_3_5_7/fs_control draw_tabl(node_select_fs_2, Constants.ROWS_FS, Constants.ROWS_FS.size()) node_select_fs_2.set_columns_min_size([120, 120, 150]) - node_select_fs_2.set_node_text(0, 0, 'ПРД-Н') + node_select_fs_2.set_node_text(0, 0, 'Модуль ФС') node_select_fs_2.set_node_text(1, 0, 'Литера_3') node_select_fs_2.set_node_text(0, 1, 'Состояние') node_select_fs_2.set_node_text(0, 2, 'Частота') @@ -92,7 +93,7 @@ func _ready() -> void: node_select_fs_2.get_node2(1, 3).editable = true node_select_fs_2.set_node_text(0, 4, 'Генератор') node_select_fs_2.set_node_text(0, 5, 'fpga') - node_select_fs_2.set_node_text(0, 6, 'СИ 3 ОТ ФС') + node_select_fs_2.set_node_text(0, 6, 'СИ 3 от ФС') # Выбор прибора для подключения var node_select_device = $TabContainer/PRD/select_dev @@ -308,6 +309,7 @@ func _on_emsg_select() -> void: func _on_mfs_select() -> void: set_tab_and_buttons(3, 'select_fs') + func _on_save_config(): var da = DirAccess.open(save_path) var base_path = save_path + "save//" @@ -341,10 +343,8 @@ func _save_selected_file(file_path: String): else: other_data[key] = item[1] param_ems_g[item[0]] = regist - var item_id = item[0] # Переменные для сохранения var ems_g_file = file_path - var ems_g_path = save_path + ems_g_file var other_name = "others" + "-" + status_pribor var other_path = save_path + other_name var other_names = other_name @@ -414,15 +414,6 @@ func on_btn_select(intem_from_sector: int) -> void: _on_start_fs_2() -func fill_item(node: Node, i_column: int, i_row: int, arr: Dictionary, select: int = 0) -> void: - var optionbutton = node.get_node2(i_column, i_row) as OptionButton - for key in arr.keys(): - var item_text = key + " - " + str(arr[key]) - optionbutton.add_item(item_text) - if select < arr.size(): - optionbutton.select(select) - - func _on_zapret1(toggled_on: bool) -> void: var meta = 48 Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta) @@ -458,10 +449,10 @@ func _on_modul_um_2(item_from_ray_1: int): 2: 0x4000, 3: 0x8000, } - var modul_um = modul_um_values.get(item_from_ray_1, 0) Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, modul_um) + ## Включение/отключение сигнала ФГОЗ func _on_fgos_2(toggled_on: bool): var meta = 56 @@ -475,7 +466,11 @@ func _on_btn_ray_1(item_from_ray_1: int) -> void: if isa_from_yau07b.has(Constants.BASE_PORTS.UG+6): var mask = 0x7 Network.write_port_isa(Constants.BASE_PORTS.UG+6, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+6], item_from_ray_1, mask)) - + Network.read_port_isa([Constants.BASE_PORTS.UG+6]) + else: + print_debug('В ISA отсутствует данные в \"%x\" порту' % (Constants.BASE_PORTS.UG+0x6)) + + ## Регулировка положением луча 2 func _on_btn_ray_2(item_from_ray_2: int) -> void: if isa_from_yau07b.has(Constants.BASE_PORTS.UG+8): diff --git a/scripts/constants.gd b/scripts/constants.gd index 81b2c1e..11fe86a 100644 --- a/scripts/constants.gd +++ b/scripts/constants.gd @@ -21,14 +21,22 @@ const ROWS_REGS_DATA: Array = [ [TableNode, TableNode], [TableNode, TableNode], [TableNode, TableNode]] -const ROWS_YAU_07B: Array = [ +const ROWS_YAU_07B_1: Array = [ + [TableNode, TableNode], + [TableNode, Switch], + [TableNode, TableList], + [TableNode, TableList], + [TableNode, TableList], + [TableNode, TableNode], + [TableNode, SocketStatus]] +const ROWS_YAU_07B_2: Array = [ [TableNode, TableNode], [TableNode, Switch], [TableNode, TableList], [TableNode, TableList], [TableNode, TableList], [TableNode, Switch], - [TableNode, TableNode]] + [TableNode, SocketStatus]] const ROWS_FS: Array = [ [TableNode, TableNode, TableNode], [TableNode, TableNode, TableNode], @@ -178,7 +186,6 @@ const SIGNS_PRD: Array = [ ], ] var NODE_MAP = { - 'TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Zapret2': 0, 'TabContainer/ControlPanel/Signal_EMS_G/ref_A22': 1, 'TabContainer/ControlPanel/Signal_EMS_G/ref_A23': 2, 'TabContainer/ControlPanel/Signal_EMS_G/ref_A26': 3, diff --git a/scripts/ems_g.gd b/scripts/ems_g.gd index 6638700..0821155 100644 --- a/scripts/ems_g.gd +++ b/scripts/ems_g.gd @@ -139,12 +139,16 @@ func process_sockets_vert(blank: int, imp: int, count: int, col: int, parent_nod if i == 1: set_frame(get_specific_node(parent_node2, 1), 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) + set_frame(CI_2_UF, frame_type) if i == 2: set_frame(get_specific_node(parent_node2, 2), frame_type) + var CI_3_UF = parent_node2.get_child(3).get_child(0).get_child(0).get_child(1).get_child(2).get_node2(1, 6).get_child(1) + set_frame(CI_3_UF, frame_type) if i == 9: set_frame(get_specific_node(parent_node2, 3), frame_type) - var CI_2 = parent_node2.get_child(3).get_child(0).get_child(0).get_child(0).get_child(0).get_node2(1, 6).get_child(1) - set_frame(CI_2, frame_type) + var CI_2_FS = parent_node2.get_child(3).get_child(0).get_child(0).get_child(0).get_child(0).get_node2(1, 6).get_child(1) + set_frame(CI_2_FS, frame_type) if i == 10: set_frame(get_specific_node(parent_node2, 4), frame_type) diff --git a/scripts/network.gd b/scripts/network.gd index 268f1c5..ed952d6 100644 --- a/scripts/network.gd +++ b/scripts/network.gd @@ -132,8 +132,8 @@ func _process(delta: float) -> void: if client_fs_1: poll_receive_fs(client_fs_1) - if client_fs_2: - poll_receive_fs_2(client_fs_2) + #if client_fs_2: + #poll_receive_fs_2(client_fs_2) poll_receive_yau07(soc_brodcast) poll_receive_yau07(soc_unicast) diff --git a/table/node_list.tscn b/table/node_list.tscn index aa57005..bf5ecf8 100644 --- a/table/node_list.tscn +++ b/table/node_list.tscn @@ -6,3 +6,4 @@ offset_bottom = 25.0 focus_mode = 0 mouse_default_cursor_shape = 2 alignment = 1 +expand_icon = true