diff --git a/PRD_MP550.tscn b/PRD_MP550.tscn index 0b919ea..ee5c21a 100644 --- a/PRD_MP550.tscn +++ b/PRD_MP550.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=51 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"] @@ -95,17 +95,7 @@ bg_color = Color(0.356863, 0.278431, 0.356863, 1) [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_7u7p7"] -[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="StyleBoxTexture" id="StyleBoxTexture_1as41"] [sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_723du"] size = Vector2(1600, 1200) @@ -120,7 +110,8 @@ script/source = "extends Sprite2D [sub_resource type="ShaderMaterial" id="ShaderMaterial_dgiai"] shader = ExtResource("4_uy5o2") shader_parameter/color_signal = Color(0.588235, 0.466667, 0, 1) -shader_parameter/turn = 0.735 +shader_parameter/turn = 0.785 +shader_parameter/inner_radius = 0.32 [sub_resource type="Gradient" id="Gradient_ki0n7"] @@ -132,7 +123,8 @@ metadata/_snap_enabled = true [sub_resource type="ShaderMaterial" id="ShaderMaterial_2pxu2"] shader = ExtResource("8_12mng") shader_parameter/color_signal = Color(0.588242, 0.466356, 0, 1) -shader_parameter/turn = 0.735 +shader_parameter/turn = 0.785 +shader_parameter/inner_radius = 0.32 [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_tn8m6"] @@ -151,6 +143,9 @@ shader_parameter/color4 = Color(0, 0, 0, 0) shader_parameter/opacity = 0.218 shader_parameter/turn = 0.785 +[sub_resource type="Theme" id="Theme_yblys"] +CheckBox/font_sizes/font_size = 14 + [node name="Node2D" type="Node2D"] script = ExtResource("1_v273n") @@ -217,6 +212,7 @@ toggle_mode = true text = "Модуль ФС" [node name="save_config" type="Button" parent="Background/side_panel"] +layout_mode = 0 offset_top = 832.0 offset_right = 216.0 offset_bottom = 868.0 @@ -227,6 +223,7 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y") text = "Сохранить" [node name="load_config" type="Button" parent="Background/side_panel"] +layout_mode = 0 offset_top = 872.0 offset_right = 216.0 offset_bottom = 908.0 @@ -293,104 +290,38 @@ metadata/_edit_lock_ = true [node name="body_grid" type="GridContainer" parent="TabContainer/PRD"] layout_mode = 0 -offset_left = 651.0 -offset_top = -14.0 -offset_right = 1664.0 -offset_bottom = 690.0 +offset_left = 376.0 +offset_top = -4.0 +offset_right = 1648.0 +offset_bottom = 718.0 [node name="litera_2_4_6" type="GridContainer" parent="TabContainer/PRD/body_grid"] clip_contents = true custom_minimum_size = Vector2(700, 300) layout_mode = 2 size_flags_horizontal = 3 -columns = 3 +columns = 5 -[node name="module_fs" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_2_4_6"] -custom_minimum_size = Vector2(250, 250) +[node name="fs_control" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_2_4_6"] +custom_minimum_size = Vector2(350, 0) layout_mode = 2 +script = ExtResource("2_vmbyo") +metadata/_edit_lock_ = true -[node name="LABEL" type="Label" parent="TabContainer/PRD/body_grid/litera_2_4_6/module_fs"] +[node name="space" type="Panel" parent="TabContainer/PRD/body_grid/litera_2_4_6"] +custom_minimum_size = Vector2(50, 0) layout_mode = 2 -text = "ЛИТЕРА 2! ПРД-Н!" +theme_override_styles/panel = SubResource("StyleBoxTexture_1as41") -[node name="con" type="Button" parent="TabContainer/PRD/body_grid/litera_2_4_6/module_fs"] +[node name="yau07b_control" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_2_4_6"] layout_mode = 2 -size_flags_horizontal = 0 -size_flags_vertical = 4 -text = " Подключение " +script = ExtResource("2_vmbyo") +metadata/_edit_lock_ = true -[node name="ip_connect" type="Label" parent="TabContainer/PRD/body_grid/litera_2_4_6/module_fs/con"] -layout_mode = 0 -offset_top = 32.0 -offset_right = 118.0 -offset_bottom = 55.0 - -[node name="get_freq" type="Button" parent="TabContainer/PRD/body_grid/litera_2_4_6/module_fs"] -layout_mode = 2 -size_flags_horizontal = 0 -text = " Получить н/ч " - -[node name="freq_ind" type="Label" parent="TabContainer/PRD/body_grid/litera_2_4_6/module_fs/get_freq"] -layout_mode = 0 -offset_top = 32.0 -offset_right = 106.0 -offset_bottom = 55.0 - -[node name="get_att" type="Button" parent="TabContainer/PRD/body_grid/litera_2_4_6/module_fs"] -layout_mode = 2 -size_flags_horizontal = 0 -text = " Получить att " - -[node name="att_ind" type="Label" parent="TabContainer/PRD/body_grid/litera_2_4_6/module_fs/get_att"] -layout_mode = 0 -offset_top = 32.0 -offset_right = 105.0 -offset_bottom = 55.0 - -[node name="get_gen_status" type="Button" parent="TabContainer/PRD/body_grid/litera_2_4_6/module_fs"] -layout_mode = 2 -size_flags_horizontal = 0 -toggle_mode = true -text = "Переключатель генератора " - -[node name="status_ind" type="Label" parent="TabContainer/PRD/body_grid/litera_2_4_6/module_fs/get_gen_status"] -layout_mode = 0 -offset_top = 33.0 -offset_right = 84.0 -offset_bottom = 56.0 - -[node name="yau_07b" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_2_4_6"] -custom_minimum_size = Vector2(250, 200) -layout_mode = 2 - -[node name="LABEL" type="Label" parent="TabContainer/PRD/body_grid/litera_2_4_6/yau_07b"] -layout_mode = 2 -text = "ЛИТЕРА 2! ПРД-Н!" - -[node name="Zapret" type="Button" parent="TabContainer/PRD/body_grid/litera_2_4_6/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 = " Запрет СИ2" -metadata/dev_num = 48 - -[node name="Modul_um_1" type="Button" parent="TabContainer/PRD/body_grid/litera_2_4_6/yau_07b"] -layout_mode = 2 -focus_mode = 0 -mouse_default_cursor_shape = 2 -theme_override_styles/pressed = SubResource("StyleBoxTexture_otisn") -toggle_mode = true -text = " Модуляция УМ 2" -metadata/dev_num = 51 - -[node name="Ray_set_1" type="OptionButton" parent="TabContainer/PRD/body_grid/litera_2_4_6/yau_07b"] -layout_mode = 2 - -[node name="att_set_1" type="OptionButton" parent="TabContainer/PRD/body_grid/litera_2_4_6/yau_07b"] +[node name="space2" type="Panel" parent="TabContainer/PRD/body_grid/litera_2_4_6"] +custom_minimum_size = Vector2(50, 0) layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxTexture_1as41") [node name="table_ukp_1" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_2_4_6"] layout_mode = 2 @@ -399,7 +330,7 @@ metadata/_edit_lock_ = true [node name="PSK" type="Sprite2D" parent="TabContainer/PRD/body_grid/litera_2_4_6"] material = ExtResource("3_3syd3") -position = Vector2(664, 11) +position = Vector2(914, 5) scale = Vector2(0.247968, 0.234167) texture = SubResource("PlaceholderTexture2D_723du") offset = Vector2(800, 600) @@ -426,102 +357,28 @@ metadata/_edit_lock_ = true [node name="litera_3_5_7" type="GridContainer" parent="TabContainer/PRD/body_grid"] custom_minimum_size = Vector2(500, 350) layout_mode = 2 -columns = 3 +columns = 5 -[node name="module_fs" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_3_5_7"] -custom_minimum_size = Vector2(250, 250) +[node name="fs_control" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_3_5_7"] +custom_minimum_size = Vector2(350, 0) layout_mode = 2 +script = ExtResource("2_vmbyo") +metadata/_edit_lock_ = true -[node name="LABEL" type="Label" parent="TabContainer/PRD/body_grid/litera_3_5_7/module_fs"] +[node name="space" type="Panel" parent="TabContainer/PRD/body_grid/litera_3_5_7"] +custom_minimum_size = Vector2(50, 0) layout_mode = 2 -text = "ЛИТЕРА 2! ПРД-Н!" +theme_override_styles/panel = SubResource("StyleBoxTexture_1as41") -[node name="con" type="Button" parent="TabContainer/PRD/body_grid/litera_3_5_7/module_fs"] +[node name="yau07b_control" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_3_5_7"] layout_mode = 2 -size_flags_horizontal = 0 -text = " Подключение " +script = ExtResource("2_vmbyo") +metadata/_edit_lock_ = true -[node name="ip_connect" type="Label" parent="TabContainer/PRD/body_grid/litera_3_5_7/module_fs/con"] -layout_mode = 0 -offset_top = 32.0 -offset_right = 118.0 -offset_bottom = 55.0 - -[node name="get_freq" type="Button" parent="TabContainer/PRD/body_grid/litera_3_5_7/module_fs"] -layout_mode = 2 -size_flags_horizontal = 0 -text = " Получить н/ч " - -[node name="freq_ind" type="Label" parent="TabContainer/PRD/body_grid/litera_3_5_7/module_fs/get_freq"] -layout_mode = 0 -offset_top = 32.0 -offset_right = 106.0 -offset_bottom = 55.0 - -[node name="get_att" type="Button" parent="TabContainer/PRD/body_grid/litera_3_5_7/module_fs"] -layout_mode = 2 -size_flags_horizontal = 0 -text = " Получить att " - -[node name="att_ind" type="Label" parent="TabContainer/PRD/body_grid/litera_3_5_7/module_fs/get_att"] -layout_mode = 0 -offset_top = 32.0 -offset_right = 105.0 -offset_bottom = 55.0 - -[node name="get_gen_status" type="Button" parent="TabContainer/PRD/body_grid/litera_3_5_7/module_fs"] -layout_mode = 2 -size_flags_horizontal = 0 -toggle_mode = true -text = "Переключатель генератора " - -[node name="status_ind" type="Label" parent="TabContainer/PRD/body_grid/litera_3_5_7/module_fs/get_gen_status"] -layout_mode = 0 -offset_top = 33.0 -offset_right = 84.0 -offset_bottom = 56.0 - -[node name="yau_07b" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_3_5_7"] -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"] +[node name="space2" type="Panel" parent="TabContainer/PRD/body_grid/litera_3_5_7"] +custom_minimum_size = Vector2(50, 0) layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxTexture_1as41") [node name="table_ukp_2" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_3_5_7"] layout_mode = 2 @@ -530,7 +387,7 @@ metadata/_edit_lock_ = true [node name="PSK2" type="Sprite2D" parent="TabContainer/PRD/body_grid/litera_3_5_7"] material = ExtResource("3_3syd3") -position = Vector2(665, 10) +position = Vector2(914, -6) scale = Vector2(0.247968, 0.234167) texture = SubResource("PlaceholderTexture2D_723du") offset = Vector2(800, 600) @@ -555,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 @@ -757,22 +610,20 @@ vertical_alignment = 1 metadata/_edit_lock_ = true [node name="ref_A23" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] -offset_left = 9.0 -offset_top = 34.0 -offset_right = 59.0 -offset_bottom = 208.0 +offset_left = 40.0 +offset_top = -206.0 +offset_right = 90.0 +offset_bottom = -32.0 textures = Array[Texture]([]) self_size = Vector2i(50, 174) -metadata/_edit_lock_ = true [node name="ref_A24" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] -offset_left = 59.0 -offset_top = 34.0 -offset_right = 109.0 -offset_bottom = 208.0 +offset_left = 40.0 +offset_top = -448.0 +offset_right = 90.0 +offset_bottom = -274.0 textures = Array[Texture]([]) self_size = Vector2i(50, 174) -metadata/_edit_lock_ = true [node name="ref_A25" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] offset_left = 109.0 @@ -802,6 +653,7 @@ self_size = Vector2i(50, 174) metadata/_edit_lock_ = true [node name="ref_A28" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +visible = false offset_left = 259.0 offset_top = 34.0 offset_right = 309.0 @@ -811,6 +663,7 @@ self_size = Vector2i(50, 174) metadata/_edit_lock_ = true [node name="ref_A29" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +visible = false offset_left = 309.0 offset_top = 34.0 offset_right = 359.0 @@ -819,16 +672,6 @@ textures = Array[Texture]([]) self_size = Vector2i(50, 174) metadata/_edit_lock_ = true -[node name="ref_A30" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] -offset_left = 359.0 -offset_top = 34.0 -offset_right = 409.0 -offset_bottom = 208.0 -textures = Array[Texture]([]) -self_size = Vector2i(50, 174) -rname = "A30" -metadata/_edit_lock_ = true - [node name="Signal_EMS_G" type="NinePatchRect" parent="TabContainer/ControlPanel"] layout_mode = 0 offset_left = 536.0 @@ -1130,6 +973,14 @@ offset_right = 1102.0 offset_bottom = 226.0 text = "Темп" +[node name="save_other" type="CheckBox" parent="."] +offset_left = 2.0 +offset_top = 799.0 +offset_right = 215.0 +offset_bottom = 827.0 +theme = SubResource("Theme_yblys") +text = "Сохранить все настройки" + [connection signal="pressed" from="Background/side_panel/select_prd" to="." method="_on_prd_select"] [connection signal="pressed" from="Background/side_panel/select_control" to="." method="_on_control_button"] [connection signal="pressed" from="Background/side_panel/select_ems_g" to="." method="_on_emsg_select"] @@ -1137,23 +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="pressed" from="TabContainer/PRD/body_grid/litera_2_4_6/module_fs/con" to="TabContainer/Modul_fs" method="_on_start"] -[connection signal="pressed" from="TabContainer/PRD/body_grid/litera_2_4_6/module_fs/get_freq" to="TabContainer/Modul_fs" method="_on_send_pressed"] -[connection signal="pressed" from="TabContainer/PRD/body_grid/litera_2_4_6/module_fs/get_att" to="TabContainer/Modul_fs" method="_on_get_att"] -[connection signal="toggled" from="TabContainer/PRD/body_grid/litera_2_4_6/module_fs/get_gen_status" to="TabContainer/Modul_fs" method="_on_get_status"] -[connection signal="toggled" from="TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/Zapret" to="." method="_on_zapret1"] -[connection signal="toggled" from="TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/Modul_um_1" to="." method="_on_modul_um_1"] -[connection signal="item_selected" from="TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/Ray_set_1" to="." method="_on_btn_ray_1"] -[connection signal="item_selected" from="TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/att_set_1" to="." method="_on_attenuator_1"] -[connection signal="pressed" from="TabContainer/PRD/body_grid/litera_3_5_7/module_fs/con" to="TabContainer/Modul_fs" method="_on_start"] -[connection signal="pressed" from="TabContainer/PRD/body_grid/litera_3_5_7/module_fs/get_freq" to="TabContainer/Modul_fs" method="_on_send_pressed"] -[connection signal="pressed" from="TabContainer/PRD/body_grid/litera_3_5_7/module_fs/get_att" to="TabContainer/Modul_fs" method="_on_get_att"] -[connection signal="toggled" from="TabContainer/PRD/body_grid/litera_3_5_7/module_fs/get_gen_status" to="TabContainer/Modul_fs" method="_on_get_status"] -[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/Shaders/ray.gdshader b/Shaders/ray.gdshader index 15b4318..57ce05e 100644 --- a/Shaders/ray.gdshader +++ b/Shaders/ray.gdshader @@ -2,9 +2,9 @@ shader_type canvas_item; uniform vec4 color_signal: source_color; uniform float turn = 0.785; +uniform float inner_radius = 0.32; const float outer_radius = 0.109; -const float inner_radius = 0.82; const float zoom = 100.0; const float speed = 2.1; const float size = 9.0; diff --git a/Shaders/shader_edu.tres b/Shaders/shader_edu.tres index ceb45ae..1c3c4d8 100644 --- a/Shaders/shader_edu.tres +++ b/Shaders/shader_edu.tres @@ -6,3 +6,4 @@ shader = ExtResource("1_mtift") shader_parameter/color_signal = null shader_parameter/turn = 0.785 +shader_parameter/inner_radius = 0.32 diff --git a/ems_1 b/ems_1 new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/ems_1 @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..5d06ac2 --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,64 @@ +[preset.0] + +name="Windows Desktop" +platform="Windows Desktop" +runnable=true +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +binary_format/architecture="x86_64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +application/export_angle=0 +application/export_d3d12=0 +application/d3d12_agility_sdk_multiarch=true +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" diff --git a/project.godot b/project.godot index 842c8be..3dda21a 100644 --- a/project.godot +++ b/project.godot @@ -31,6 +31,10 @@ gdscript/warnings/unused_signal=0 window/size/viewport_width=1900 window/size/viewport_height=940 +[editor] + +run/main_run_args="-- testsave-path" + [rendering] renderer/rendering_method="gl_compatibility" diff --git a/ray_2.gdshader b/ray_2.gdshader index 15b4318..57ce05e 100644 --- a/ray_2.gdshader +++ b/ray_2.gdshader @@ -2,9 +2,9 @@ shader_type canvas_item; uniform vec4 color_signal: source_color; uniform float turn = 0.785; +uniform float inner_radius = 0.32; const float outer_radius = 0.109; -const float inner_radius = 0.82; const float zoom = 100.0; const float speed = 2.1; const float size = 9.0; diff --git a/scripts/PRD.gd b/scripts/PRD.gd index e7067b1..adfe5f7 100644 --- a/scripts/PRD.gd +++ b/scripts/PRD.gd @@ -2,7 +2,7 @@ extends Node2D signal read_ems_g_start() signal read_ems_g_finish() - +var unit_fs = Fs.FGOS.new() var flag_mode = Constants.ADDRESSES[0][3] var broadcast_packet: PackedByteArray var node_select1: Node @@ -10,9 +10,24 @@ var node_select2: Node var flag_yau_control: bool var CONTROL_TABLE: Array 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, + 0x126, + 0x128, + 0x12A +] func _ready() -> void: + # Считывание аргументов с консоли (путь сохранения) + var args = OS.get_cmdline_user_args() + for i in range(args.size()): + if args[i] == "testsave-path" and i + 1 < args.size(): + save_path = args[i + 1] + break # Таблица УКП_1 node_select1 = $TabContainer/PRD/body_grid/litera_2_4_6/table_ukp_1 draw_tabl(node_select1, Constants.ROWS_REGS_DATA, Constants.ROWS_REGS_DATA.size()) @@ -22,11 +37,64 @@ func _ready() -> void: # Таблица УКП_2 node_select2 = $TabContainer/PRD/body_grid/litera_3_5_7/table_ukp_2 - draw_tabl(node_select2, Constants.ROWS_UKP2_DATA, Constants.ROWS_UKP2_DATA.size()) + draw_tabl(node_select2, Constants.ROWS_REGS_DATA, Constants.ROWS_REGS_DATA.size()) node_select2.set_columns_min_size([120, 120]) node_select2.set_node_text(0, 0, 'Мощность') node_select2.set_node_text(1, 0, 'Температура') + # Таблица ЯУ-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_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') + node_select_yau_07b.set_node_text(0, 1, 'Запрет СИ_2') + 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_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') + node_select_yau_07b_2.set_node_text(0, 1, 'Запрет СИ_3') + node_select_yau_07b_2.set_node_text(0, 2, 'Модуляция УМ_3') + 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(1, 0, 'Литера_2') + node_select_fs_1.set_node_text(0, 1, 'Состояние') + node_select_fs_1.set_node_text(0, 2, 'Частота') + node_select_fs_1.get_node2(1, 2).placeholder_text = '500' + node_select_fs_1.set_node_text(0, 3, 'Аттенюатор') + 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 от ФС') + + 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(1, 0, 'Литера_3') + node_select_fs_2.set_node_text(0, 1, 'Состояние') + node_select_fs_2.set_node_text(0, 2, 'Частота') + node_select_fs_2.get_node2(1, 2).placeholder_text = '500' + node_select_fs_2.set_node_text(0, 3, 'Аттенюатор') + 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 от ФС') + # Выбор прибора для подключения var node_select_device = $TabContainer/PRD/select_dev draw_tabl(node_select_device, Constants.SELECT_DEVICE, Constants.SELECT_DEVICE.size()) @@ -40,21 +108,47 @@ func _ready() -> void: node_select_device.get_node2(0,0).text = 'ПРИБОР' node_select_device.set_columns_min_size([100, 100]) + # Получаем имя выбранного прибора + if Constants.ADDRESSES.size() > 0: + get_select_device.select(0) + status_pribor = get_select_device.get_item_text(0).strip_edges().substr(4) + + ## Заполненение списка модуляции УМ + for key in Constants.OUT_x128: + node_select_yau_07b.get_node2(1, 2).add_item(key) + node_select_yau_07b_2.get_node2(1, 2).add_item(key) + ## Заполненение списка направления луча for key in Constants.RAY_DICT: - $TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/Ray_set_1.add_item(key) - $TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Ray_set_2.add_item(key) + node_select_yau_07b.get_node2(1, 3).add_item(key) + node_select_yau_07b_2.get_node2(1, 3).add_item(key) ## Заполненение списка аттенюатора for key in Constants.ATT_DICT: - $TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/att_set_1.add_item(key) - $TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/att_set_2.add_item(key) - + node_select_yau_07b.get_node2(1, 4).add_item(key) + node_select_yau_07b_2.get_node2(1, 4).add_item(key) + draw_control_panel_prd(Constants.ADDRESSES[0][3]) Network.connect('yau_status_line', Callable(self, '_on_yau_status')) Network.connect('yau_receive', Callable(self, '_on_data_received')) Network.connect('yau_read_isa', Callable(self, '_on_read_isa')) + Network.connect('data_from_fs_1', Callable(self, '_on_data_fs_1')) + Network.connect('data_from_fs_2', Callable(self, '_on_data_fs_2')) + + node_select_yau_07b.get_node2(1, 1).get_child(1, false).connect('toggled', Callable(self, '_on_zapret1')) + node_select_yau_07b.get_node2(1, 2).connect('item_selected', Callable(self, '_on_modul_um_1')) + node_select_yau_07b.get_node2(1, 3).connect('item_selected', Callable(self, '_on_btn_ray_1')) + node_select_yau_07b.get_node2(1, 4).connect('item_selected', Callable(self, '_on_attenuator_1')) + + node_select_yau_07b_2.get_node2(1, 1).get_child(1, false).connect('toggled', Callable(self, '_on_zapret2')) + node_select_yau_07b_2.get_node2(1, 2).connect('item_selected', Callable(self, '_on_modul_um_2')) + node_select_yau_07b_2.get_node2(1, 3).connect('item_selected', Callable(self, '_on_btn_ray_2')) + node_select_yau_07b_2.get_node2(1, 4).connect('item_selected', Callable(self, '_on_attenuator_2')) + node_select_yau_07b_2.get_node2(1, 5).get_child(1, false).connect('toggled', Callable(self, '_on_fgos_2')) + + node_select_fs_1.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_1')) + node_select_fs_2.get_node2(1, 4).get_child(1, false).connect('toggled', Callable(self, '_on_get_status_2')) func draw_control_panel_prd(mode) -> void: @@ -98,8 +192,59 @@ func _on_read_isa(unit_isa_ports: Dictionary) -> void: if isa_data.has(Constants.BASE_PORTS.UG+6): $TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/turn', 0.735 + 0.025 * (isa_data[0x106] & 0x7)) + $TabContainer/PRD/body_grid/litera_2_4_6/PSK/ray_1.material.set('shader_parameter/inner_radius', 0.8 - 0.01 * (isa_data[0x106] & 0x38)) if isa_data.has(Constants.BASE_PORTS.UG+8): $TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/turn', 0.735 + 0.025 * (isa_data[0x108] & 0x7)) + $TabContainer/PRD/body_grid/litera_3_5_7/PSK2/ray_2.material.set('shader_parameter/inner_radius', 0.8 - 0.01 * (isa_data[0x108] & 0x38)) + + +func _on_data_fs_1(fs_1_data): + var node_select_fs_1 = $TabContainer/PRD/body_grid/litera_2_4_6/fs_control + var GRP = fs_1_data.decode_u8(0x0) + var CMD = fs_1_data.decode_u8(0x1) + match CMD: + Constants.CMD.READ_CARRIER: + if GRP == Constants.GROUP.BASE: + node_select_fs_1.set_node_text(2, 2, str(fs_1_data.decode_u64(0xC)) + ' Гц') + Constants.CMD.READ_ATT: + if GRP == Constants.GROUP.RF: + node_select_fs_1.set_node_text(2, 3, '-' + str(fs_1_data.decode_float(0x18)) + ' dB') + Constants.CMD.READ_GEN_STATUS: + if GRP == Constants.GROUP.GENERATOR: + if fs_1_data.decode_u32(0xC) == 0: + node_select_fs_1.set_node_text(2, 4, 'Включен') + node_select_fs_1.get_node2(2, 4).modulate = Color.AQUAMARINE + else: + node_select_fs_1.set_node_text(2, 4, 'Выключен') + node_select_fs_1.get_node2(2, 4).modulate = Color.CRIMSON + 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): + var node_select_fs_2 = $TabContainer/PRD/body_grid/litera_3_5_7/fs_control + var GRP = fs_2_data.decode_u8(0x0) + var CMD = fs_2_data.decode_u8(0x1) + match CMD: + Constants.CMD.READ_CARRIER: + if GRP == Constants.GROUP.BASE: + node_select_fs_2.set_node_text(2, 2, str(fs_2_data.decode_u64(0xC)) + ' Гц') + Constants.CMD.READ_ATT: + if GRP == Constants.GROUP.RF: + node_select_fs_2.set_node_text(2, 3, '-' + str(fs_2_data.decode_float(0x18)) + ' dB') + Constants.CMD.READ_GEN_STATUS: + if GRP == Constants.GROUP.GENERATOR: + if fs_2_data.decode_u32(0xC) == 0: + node_select_fs_2.set_node_text(2, 4, 'Включен') + node_select_fs_2.get_node2(2, 4).modulate = Color.AQUAMARINE + else: + node_select_fs_2.set_node_text(2, 4, 'Выключен') + node_select_fs_2.get_node2(2, 4).modulate = Color.CRIMSON + Constants.CMD.BASE_GET_CURRENT_TEMP: + if GRP == Constants.GROUP.BASE: + node_select_fs_2.set_node_text(1, 5, '%.2f' % fs_2_data.decode_float(0xC) + ' °C') ## Рисует таблицу @@ -124,25 +269,25 @@ func _on_data_received(data_from_yau_07): ## УКП - for i in range(8): ## Мощность от УКП_1 + for i in range(6): ## Мощность от УКП_1 var power_ukp_1 = data_from_yau_07.decode_u16(Constants.DataIndices.POWER_UKP_1 + 2 * i) node_select1.set_node_text(0, i+1, '%d' % power_ukp_1) - for i in range(8): ## Температура от УКП_1 + for i in range(6): ## Температура от УКП_1 var temperature_ukp_1 = data_from_yau_07.decode_u16(Constants.DataIndices.TEMPERATURE_UKP_1 + 2 * i) var TMP = Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_ukp_1) * Constants.TEMP - node_select1.set_node_text(1, i+1, '%d' % TMP) + node_select1.set_node_text(1, i+1, '%d °С' % TMP) - for i_pow in range(8): ## Мощность от УКП_2 + for i_pow in range(6): ## Мощность от УКП_2 if len(data_from_yau_07) > Constants.DataIndices.POWER_UKP_2 + 2 * i_pow: var power_ukp_2 = data_from_yau_07.decode_u16(Constants.DataIndices.POWER_UKP_2 + 2 * i_pow) node_select2.set_node_text(0, i_pow+1, '%d' % power_ukp_2) - for row in range(8): ## Температура от УКП_2 + for row in range(6): ## Температура от УКП_2 if len(data_from_yau_07) > Constants.DataIndices.TEMPERATURE_UKP_2 + 2 * row: var temperature_ukp_2 = data_from_yau_07.decode_u16(Constants.DataIndices.TEMPERATURE_UKP_2 + 2 * row) var TMP = Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_ukp_2) * Constants.TEMP - node_select2.set_node_text(1, row+1, '%d' % TMP) + node_select2.set_node_text(1, row+1, '%d °С' % TMP) func set_frame(node: Node, val: int): node.set_frame(val) @@ -166,12 +311,87 @@ func _on_mfs_select() -> void: func _on_save_config(): - print('Тебе сюда') - + var da = DirAccess.open(save_path) + var base_path = save_path + "save//" + if da == null: + return + else: + da.dir_exists(base_path) + da.make_dir_recursive(base_path) + var file_dialog = FileDialog.new() + file_dialog.title = "Сохранить файл как" + file_dialog.set_size(Vector2(600, 400)) + file_dialog.mode = FileDialog.FILE_MODE_SAVE_FILE + file_dialog.current_dir = base_path + file_dialog.set_current_file("ЭМС-Г" + "-" + status_pribor) + file_dialog.connect("file_selected", Callable(self, "_save_selected_file")) + add_child(file_dialog) + file_dialog.popup_centered() + + +func _save_selected_file(file_path: String): + var data = Constants.EMS_G_PORT_DATA_HOLDER + var param_ems_g: Dictionary = {} + var other_data: Dictionary = {} + # Формируем словари + for item in data: + var regist: Dictionary = {} + regist[0x122] = item[0] + for key in item[1]: + if key in need_port: + regist[key] = item[1][key] + else: + other_data[key] = item[1] + param_ems_g[item[0]] = regist + # Переменные для сохранения + var ems_g_file = file_path + var other_name = "others" + "-" + status_pribor + var other_path = save_path + other_name + var other_names = other_name + var other_counter = 1 + var dir = DirAccess.open(file_path.get_base_dir()) + # Сохранение данных ЭМС-Г + var file = FileAccess.open(ems_g_file, FileAccess.WRITE) + if file != null: + file.store_string(JSON.stringify(param_ems_g)) + file.close() + # Сохранение данных других + var save_other = $save_other.is_pressed() + if save_other: + while dir.file_exists(other_names): + other_names = other_name + "_" + str(other_counter) + other_path = save_path + other_names + other_counter += 1 + var other_file = FileAccess.open(other_path, FileAccess.WRITE) + if other_file != null: + other_file.store_string(JSON.stringify(other_data)) + other_file.close() + + +func _on_file_selected(file_path: String): + var file = FileAccess.open(file_path, FileAccess.READ) + # Проверка на открытие/чтение файла + if file != OK: + return + var file_content = file.get_as_text() + file.close() + var json = JSON.new() + var data = json.parse(file_content) + # Проверка на разбор содержимого файла + if data.error != OK: + return + Constants.EMS_G_PORT_DATA_HOLDER = data.result + func _on_load_config(): - print('тебе сюда') - + var file_dialog = FileDialog.new() + var base_path = save_path + "save//" + file_dialog.set_title("Выберите файл") + file_dialog.set_size(Vector2(600, 400)) + file_dialog.access = FileDialog.ACCESS_FILESYSTEM + file_dialog.current_dir = base_path + add_child(file_dialog) + file_dialog.popup_centered() func set_tab_and_buttons(tab_index: int, button_name: String) -> void: @@ -190,91 +410,97 @@ func on_btn_select(intem_from_sector: int) -> void: Network.on_command_change_device(meta) flag_mode = meta[2] draw_control_panel_prd(flag_mode) - - -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) + _on_start_fs_1() + _on_start_fs_2() func _on_zapret1(toggled_on: bool) -> void: - var meta = $TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/Zapret.get_meta('dev_num') + var meta = 48 Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta) var zapret_mode = 0x4000 if toggled_on else 0x0 Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, zapret_mode) func _on_zapret2(toggled_on: bool) -> void: - var meta = $TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Zapret2.get_meta('dev_num') + var meta = 49 Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta) var zapret_mode = 0x4000 if toggled_on else 0x0 Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, zapret_mode) -func _on_modul_um_1(toggled_on: bool): - var meta = $TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/Modul_um_1.get_meta('dev_num') +func _on_modul_um_1(item_from_ray_1: int): + var meta = 51 Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta) - var modul_um = 0x2000 if toggled_on else 0x0 + var modul_um_values = { + 1: 0x2000, + 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_modul_um_2(toggled_on: bool): - var meta = $TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Modul_um_2.get_meta('dev_num') +func _on_modul_um_2(item_from_ray_1: int): + var meta = 52 Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta) - var modul_um = 0x2000 if toggled_on else 0x0 + var modul_um_values = { + 1: 0x2000, + 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 = $TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/fgos_2.get_meta('dev_num') + var meta = 56 Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta) var modul_um = 0x2000 if toggled_on else 0x0 Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, modul_um) -#func _on_fgos_2(toggled_on: bool): - #var meta = $TabContainer/PRD/Grid/Modul_um_2.get_meta('dev_num') - #Network.write_port_isa(Constants.BASE_PORTS.EMS_G+2, meta) - #var modul_um = 0x2000 if toggled_on else 0x0 - #Network.write_port_isa(Constants.BASE_PORTS.EMS_G+8, modul_um) - - ## Регулировка положением луча 1 func _on_btn_ray_1(item_from_ray_1: int) -> void: if isa_from_yau07b.has(Constants.BASE_PORTS.UG+6): - Network.write_port_isa(Constants.BASE_PORTS.UG+6, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+6], item_from_ray_1, 7)) + 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): - Network.write_port_isa(Constants.BASE_PORTS.UG+8, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+8], item_from_ray_2, 7)) + var mask = 0x7 + Network.write_port_isa(Constants.BASE_PORTS.UG+8, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+8], item_from_ray_2, mask)) Network.read_port_isa([Constants.BASE_PORTS.UG+8]) else: print_debug('В ISA отсутствует данные в \"%x\" порту' % (Constants.BASE_PORTS.UG+0x8)) +## Регулировка аттенюатора луча 1 func _on_attenuator_1(item_from_att_1: int) -> void: if isa_from_yau07b.has(Constants.BASE_PORTS.UG+6): - Network.write_port_isa(Constants.BASE_PORTS.UG+6, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+6], item_from_att_1 << 3, 0x38)) + var mask = 0x38 + Network.write_port_isa(Constants.BASE_PORTS.UG+6, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+6], item_from_att_1 << 3, mask)) Network.read_port_isa([Constants.BASE_PORTS.UG+6]) else: print_debug('В ISA отсутствует данные в \"%x\" порту' % (Constants.BASE_PORTS.UG+0x6)) + +## Регулировка аттенюатора луча 2 func _on_attenuator_2(item_from_att_1: int) -> void: if isa_from_yau07b.has(Constants.BASE_PORTS.UG+8): - Network.write_port_isa(Constants.BASE_PORTS.UG+8, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+8], item_from_att_1 << 3, 0x38)) + var mask = 0x38 + Network.write_port_isa(Constants.BASE_PORTS.UG+8, set_bits(isa_from_yau07b[Constants.BASE_PORTS.UG+8], item_from_att_1 << 3, mask)) Network.read_port_isa([Constants.BASE_PORTS.UG+8]) else: print_debug('В ISA отсутствует данные в \"%x\" порту' % (Constants.BASE_PORTS.UG+0x8)) + func _on_read_isa_pressed() -> void: Network.read_port_isa([Constants.BASE_PORTS.EMS_G+2, Constants.BASE_PORTS.EMS_G+4, Constants.BASE_PORTS.EMS_G+8]) @@ -285,3 +511,35 @@ func _on_read_isa_pressed() -> void: ## [param m] - Маска изменяемых бит func set_bits(v, a, m): return (~m) & v | a & m + + +func _on_start_fs_1(): + unit_fs.start_session() + unit_fs.base_get_current_temp() + + +func _on_start_fs_2(): + unit_fs.start_session() + unit_fs.base_get_current_temp() + + +func _on_get_status_1(toggled_btn): + var inverted_state = not toggled_btn + unit_fs.set_gen_state(inverted_state) + unit_fs.get_gen_state() + + +func _on_get_status_2(toggled_btn): + var inverted_state = not toggled_btn + unit_fs.set_gen_state(inverted_state) + unit_fs.get_gen_state() + + +func _on_set_ferq(): + var freq = int($set_space/write_to_set_freq.get_text()) * 1_000_000 + unit_fs.set_carrier(freq) + + +func _on_set_att(): + var att = float($set_space/write_to_set_att.get_text()) + unit_fs.set_att_batch(att) diff --git a/scripts/constants.gd b/scripts/constants.gd index f3ad916..11fe86a 100644 --- a/scripts/constants.gd +++ b/scripts/constants.gd @@ -20,24 +20,36 @@ const ROWS_REGS_DATA: Array = [ [TableNode, TableNode], [TableNode, TableNode], [TableNode, TableNode], - [TableNode, TableNode], - [TableNode, TableNode], [TableNode, TableNode]] -const ROWS_UKP2_DATA: 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, TableNode], - [TableNode, TableNode], - [TableNode, TableNode], - [TableNode, TableNode], - [TableNode, TableNode], - [TableNode, TableNode]] + [TableNode, Switch], + [TableNode, TableList], + [TableNode, TableList], + [TableNode, TableList], + [TableNode, Switch], + [TableNode, SocketStatus]] +const ROWS_FS: Array = [ + [TableNode, TableNode, TableNode], + [TableNode, TableNode, TableNode], + [TableNode, TableNode, TableNode], + [TableNode, TableNode, TableNode], + [TableNode, Switch, TableNode], + [TableNode, TableNode, TableNode], + [TableNode, SocketStatus, TableNode]] const ADDRESSES: Array = [ ['ПРД-Н1', '10.1.1.11', 50011, MODE.PRD_H, '10.1.2.18', '10.1.2.19', ''], ['ПРД-Н2', '10.1.1.21', 50021, MODE.PRD_H, '10.1.2.34', '10.1.2.35', ''], ['ПРД-Н3', '10.1.1.31', 50031, MODE.PRD_H, '10.1.2.50', '10.1.2.51', ''], - ['ПРД-Н4', '10.1.1.41', 50041, MODE.PRD_H, '10.1.2.67', '10.1.2.67', ''], + ['ПРД-Н4', '10.1.1.41', 50041, MODE.PRD_H, '10.1.2.66', '10.1.2.67', ''], ['ПРД-В1', '10.1.1.12', 50012, MODE.PRD_B, '10.1.2.20', '10.1.2.21', ''], ['ПРД-В2', '10.1.1.22', 50022, MODE.PRD_B, '10.1.2.36', '10.1.2.37', ''], ['ПРД-В3', '10.1.1.32', 50032, MODE.PRD_B, '10.1.2.52', '10.1.2.53', ''], @@ -86,13 +98,13 @@ const OUT_x128: Array = [ '0', '1',] const RAY_DICT: Array = [ - ' Контроль', ' -5°', ' 5°', ' 15°', ' 25°', ' 35°', ' 45°', + ' Контроль', ] const ATT_DICT: Array = [ ' 0 db', @@ -107,10 +119,8 @@ const ATT_DICT: Array = [ const SIGNS_PRD: Array = [ ## ПРК-К [ - ' Запрет СИ6', ' Запрет СИ7', ' Запрет СИ1', - 'ЛИТЕРА 6! ПРД-К', 'ЛИТЕРА 7! ПРД-К', 'СЗИ6 от УФ', 'СЗИ7 от УФ', @@ -126,9 +136,7 @@ const SIGNS_PRD: Array = [ 'МАА №2', 'ИП9-50 №1', 'ИП9-50 №2', - 'ИП12-50 №1', 'ИП9-50 №3', - 'ИП12-50 №2', 'ИП5-25', ], ## ПРК-В @@ -136,7 +144,6 @@ const SIGNS_PRD: Array = [ ' Запрет СИ4', ' Запрет СИ5', '', - 'ЛИТЕРА 4! ПРД-В', 'ЛИТЕРА 5! ПРД-В', 'СЗИ4 от УФ', 'СЗИ5 от УФ', @@ -152,21 +159,15 @@ const SIGNS_PRD: Array = [ 'МАА №2', 'ИП9-50 №1', 'ИП9-50 №2', - 'ИП12-50 №1', '-', '-', 'ИП5-25', ], ## ПРК-Н [ - ' Запрет СИ2', ' Запрет СИ3', '', - 'ЛИТЕРА 2! ПРД-Н', 'ЛИТЕРА 3! ПРД-Н', - 'СЗИ2 от УФ', - 'СЗИ3 от УФ', - 'СИ2 от ФС', 'СИ3 от ФС', 'СИ2 в УФ', 'СИ3 в УФ', @@ -178,35 +179,30 @@ const SIGNS_PRD: Array = [ 'МАА №2', 'ИП9-50 №1', 'ИП9-50 №2', - 'ИП12-50 №1', '-', '-', 'ИП5-25', + '--', ], ] var NODE_MAP = { - 'TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/Zapret': 0, - 'TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/Zapret2': 1, - 'TabContainer/PRD/body_grid/litera_2_4_6/yau_07b/LABEL': 3, - 'TabContainer/PRD/body_grid/litera_3_5_7/yau_07b/LABEL2': 4, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A22': 5, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A23': 6, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A26': 7, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A27': 8, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A28': 9, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A29': 10, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A31': 11, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A32': 12, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A33': 13, - 'TabContainer/ControlPanel/Signal_EMS_G/ref_A34': 14, - 'TabContainer/ControlPanel/soc_P1/ref_A23': 15, - 'TabContainer/ControlPanel/soc_P1/ref_A24': 16, - 'TabContainer/ControlPanel/soc_P1/ref_A25': 17, - 'TabContainer/ControlPanel/soc_P1/ref_A26': 18, - 'TabContainer/ControlPanel/soc_P1/ref_A27': 19, - 'TabContainer/ControlPanel/soc_P1/ref_A28': 20, - 'TabContainer/ControlPanel/soc_P1/ref_A29': 21, - 'TabContainer/ControlPanel/soc_P1/ref_A30': 22, + '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, diff --git a/scripts/ems_g.gd b/scripts/ems_g.gd index e4bdd0b..0821155 100644 --- a/scripts/ems_g.gd +++ b/scripts/ems_g.gd @@ -139,10 +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_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) @@ -151,17 +157,9 @@ func get_specific_node(parent_node2: Node, child_index: int)-> Node: return parent_node2.get_child(3, false).get_child(1).get_child(4).get_child(child_index).get_child(3) -func _process(_delta: float) -> void: - pass - - func set_frame(node: Node, val: int): node.set_frame(val) -func set_init(): - pass - - ## Создает связь между кнопками func create_link_button(node, count_rows_sart: int, count_rows_end: int, coln_start: int, coln_end: int): ## META_EMS_G[[Номер входа, Номер выхода]] diff --git a/scripts/modul_fs.gd b/scripts/modul_fs.gd index a102c00..d59cbab 100644 --- a/scripts/modul_fs.gd +++ b/scripts/modul_fs.gd @@ -15,7 +15,7 @@ func _process(_delta: float) -> void: func _enter_tree() -> void: # Подключаем сигналы к методам Network.connect('data_send', _on_data_send) - Network.connect('data_received', _on_data_received) + Network.connect('data_from_fs_1', _on_data_received) Network.connect('port_opened', _on_port_changed.bind(Color.GREEN)) Network.connect('port_closed', _on_port_changed.bind(Color.GRAY)) Network.connect('port_error', _on_port_changed.bind(Color.RED)) @@ -56,7 +56,6 @@ func _on_data_received(data: PackedByteArray): $read.text = str(data.hex_encode()) - func _on_send_pressed() -> void: unit_fs.get_carrier() diff --git a/scripts/network.gd b/scripts/network.gd index f613950..ed952d6 100644 --- a/scripts/network.gd +++ b/scripts/network.gd @@ -18,15 +18,24 @@ var ip_fs_1: String = Constants.ADDRESSES[0][4] var command_stack: Array var state_fs = Constants.STATE.IDLE var client_fs_1: StreamPeer -var peerstream: PacketPeer +var peerstream_fs_1: PacketPeer + +var ip_fs_2: String = Constants.ADDRESSES[0][5] +var command_stack_fs_2: Array +var state_fs_2 = Constants.STATE.IDLE +var client_fs_2: StreamPeer +var peerstream_fs_2: PacketPeer signal yau_status_line(_status) ## Вызывается когда меняется состояние связи с ячейкой signal yau_receive(_data_from_yau) signal yau_read_isa(_unit_isa_ports) signal data_send() -signal data_received(data:PackedByteArray) +signal data_send_2() +signal data_from_fs_1(data:PackedByteArray) +signal data_from_fs_2(data:PackedByteArray) signal port_opened(port_name: String) +signal port_opened_2(port_name: String) signal port_closed(port_name: String) signal port_error(error_str: String) @@ -58,7 +67,7 @@ func poll_receive_yau07(sock: Socket) -> bool: ## Приёмник func poll_receive_fs(client: StreamPeerTCP): client.poll() - var peer = peerstream.get_stream_peer() + var peer = peerstream_fs_1.get_stream_peer() # Проверяем, существует ли соединение if not peer: emit_signal("port_error", ip_fs_1) @@ -71,12 +80,33 @@ func poll_receive_fs(client: StreamPeerTCP): if peer.get_available_bytes() > 0: var rx_data: PackedByteArray rx_data.append_array(peer.get_data(peer.get_available_bytes())[1]) - emit_signal("data_received", rx_data) + emit_signal("data_from_fs_1", rx_data) emit_signal("port_opened", ip_fs_1) if state_fs == Constants.STATE.SEND: state_fs = Constants.STATE.DONE +func poll_receive_fs_2(client: StreamPeerTCP): + client.poll() + var peer = peerstream_fs_2.get_stream_peer() + # Проверяем, существует ли соединение + if not peer: + emit_signal("port_fs_2_error", ip_fs_2) + return + # Проверяем состояние подключения + if client.get_status() != StreamPeerTCP.STATUS_CONNECTED: + emit_signal("port_closed_fs_2", ip_fs_2) + return + + if peer.get_available_bytes() > 0: + var rx_data: PackedByteArray + rx_data.append_array(peer.get_data(peer.get_available_bytes())[1]) + emit_signal("data_from_fs_2", rx_data) + emit_signal("port_opened_fs_2", ip_fs_2) + if state_fs_2 == Constants.STATE.SEND: + state_fs_2 = Constants.STATE.DONE + + func _ready() -> void: # Привязка для принятия широковещательного канала soc_brodcast = Socket.new() @@ -102,6 +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) poll_receive_yau07(soc_brodcast) poll_receive_yau07(soc_unicast) @@ -164,9 +196,10 @@ func on_command_change_device(meta_device): ip_address_yau = meta_device[0] ip_port_yau = meta_device[1] ip_fs_1 = meta_device[3] - #ip_fs_2 = meta_device[4] + ip_fs_2 = meta_device[4] #ip_fs_3 = meta_device[5] connect_fs() + connect_fs_2() func state_machine_fs(): @@ -185,18 +218,18 @@ func connect_fs(): disconnect_fs(client_fs_1) client_fs_1 = StreamPeerTCP.new() - peerstream = PacketPeerStream.new() + peerstream_fs_1 = PacketPeerStream.new() var rc = client_fs_1.connect_to_host(ip_fs_1, Constants.PORT_FS) if rc!= Error.OK: emit_signal("port_error", ip_fs_1) else: - peerstream.set_stream_peer(client_fs_1) + peerstream_fs_1.set_stream_peer(client_fs_1) # Отправить команду для ФС func send_data(data_to_sand: PackedByteArray): if client_fs_1.get_status() == 2: - var peer = peerstream.get_stream_peer() + var peer = peerstream_fs_1.get_stream_peer() if peer: peer.put_data(data_to_sand) emit_signal("data_send") @@ -208,3 +241,43 @@ func disconnect_fs(client_for_leave): state_fs = Constants.STATE.IDLE command_stack = [] + + +func state_machine_fs_2(): + if client_fs_2: + ## State fs machine + if (state_fs_2 == Constants.STATE.IDLE) or (state_fs_2 == Constants.STATE.DONE): + if command_stack_fs_2: + var pack: Array = command_stack_fs_2.pop_front() + send_data_fs_2(pack) + state_fs_2 = Constants.STATE.SEND + + +# Подключится к модулю ФС +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) + if rc!= Error.OK: + emit_signal("port_error", ip_fs_2) + else: + peerstream_fs_2.set_stream_peer(client_fs_2) + + +# Отправить команду для ФС +func send_data_fs_2(data_to_sand: PackedByteArray): + if client_fs_2.get_status() == 2: + var peer = peerstream_fs_2.get_stream_peer() + if peer: + peer.put_data(data_to_sand) + emit_signal("data_send_2") + + +# Разорвать соединение с ФС +func disconnect_fs_2(client_for_leave): + client_for_leave.disconnect_from_host() + state_fs_2 = Constants.STATE.IDLE + command_stack = [] diff --git a/table/node.tscn b/table/node.tscn index 7472d01..a417ee8 100644 --- a/table/node.tscn +++ b/table/node.tscn @@ -31,7 +31,6 @@ theme_override_font_sizes/font_size = 17 theme_override_styles/read_only = SubResource("StyleBoxFlat_q1ixs") theme_override_styles/normal = SubResource("StyleBoxFlat_q1ixs") alignment = 1 -editable = false caret_blink = true caret_blink_interval = 0.5 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