Merge remote-tracking branch 'origin/dev_maxim' into temp_dev

# Conflicts:
#	PRD_MP550.tscn
#	scripts/PRD.gd
#	scripts/constants.gd
#	scripts/control_panel.gd
This commit is contained in:
danil_tim
2025-02-07 11:09:29 +03:00
20 changed files with 558 additions and 384 deletions

View File

@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -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,12 +143,15 @@ 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")
[node name="Background" type="ColorRect" parent="."]
offset_right = 1941.0
offset_bottom = 988.0
offset_right = 3025.0
offset_bottom = 1060.0
theme = SubResource("Theme_k5ur4")
color = Color(0.356863, 0.278431, 0.356863, 1)
metadata/_edit_lock_ = true
@@ -272,7 +267,7 @@ text = "Прочитать ISA"
offset_left = 216.0
offset_top = 39.0
offset_right = 2420.0
offset_bottom = 940.0
offset_bottom = 917.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)
@@ -284,11 +279,10 @@ 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 = 1
current_tab = 0
tab_focus_mode = 0
[node name="PRD" type="Panel" parent="TabContainer"]
visible = false
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxTexture_7u7p7")
metadata/_tab_index = 0
@@ -296,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
@@ -401,8 +329,9 @@ script = ExtResource("2_vmbyo")
metadata/_edit_lock_ = true
[node name="PSK" type="Sprite2D" parent="TabContainer/PRD/body_grid/litera_2_4_6"]
modulate = Color(1, 1, 0.941176, 0.588235)
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)
@@ -429,102 +358,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
@@ -532,8 +387,9 @@ script = ExtResource("2_vmbyo")
metadata/_edit_lock_ = true
[node name="PSK2" type="Sprite2D" parent="TabContainer/PRD/body_grid/litera_3_5_7"]
modulate = Color(1, 1, 0.941176, 0.588235)
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)
@@ -558,10 +414,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
@@ -572,18 +424,19 @@ 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")
metadata/_tab_index = 1
metadata/_edit_lock_ = true
[node name="label_control_PRD" type="Label" parent="TabContainer/ControlPanel"]
[node name="lbl_control" type="Label" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 4.0
offset_top = -44.0
offset_top = 21.0
offset_right = 624.0
offset_bottom = -13.0
offset_bottom = 52.0
theme_override_font_sizes/font_size = 22
text = "Контроль исправности прибора ПРД-Н"
horizontal_alignment = 1
@@ -592,16 +445,16 @@ vertical_alignment = 1
[node name="soc_y5" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 199.0
offset_top = 8.0
offset_top = 103.0
offset_right = 516.0
offset_bottom = 198.0
offset_bottom = 293.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
[node name="IP5_25" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")]
[node name="ref_A24" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")]
offset_left = 9.0
offset_top = 34.0
offset_right = 59.0
@@ -617,11 +470,11 @@ offset_top = 34.0
offset_right = 109.0
offset_bottom = 184.0
textures = Array[Texture]([])
fname = "ЯУ-07Б"
fname = "ЯУ-07"
rname = "A30"
metadata/_edit_lock_ = true
[node name="ems_g" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")]
[node name="ref_A26" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")]
offset_left = 109.0
offset_top = 34.0
offset_right = 159.0
@@ -631,7 +484,7 @@ fname = "ЭМС-Г"
rname = "A26"
metadata/_edit_lock_ = true
[node name="ug" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")]
[node name="ref_A27" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")]
offset_left = 159.0
offset_top = 34.0
offset_right = 209.0
@@ -641,7 +494,7 @@ fname = "УГ"
rname = "A27"
metadata/_edit_lock_ = true
[node name="ukp_1" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")]
[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
@@ -652,7 +505,7 @@ fname = "УКП-1"
rname = "A28"
metadata/_edit_lock_ = true
[node name="ukp_2" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")]
[node name="ref_A29" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")]
offset_left = 259.0
offset_top = 34.0
offset_right = 309.0
@@ -781,6 +634,11 @@ offset_left = -63.0
offset_top = 36.0
offset_right = -13.0
offset_bottom = 210.0
[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]([])
self_size = Vector2i(50, 174)
fname = "МАА2000"
@@ -791,6 +649,11 @@ offset_left = 199.0
offset_top = 37.0
offset_right = 249.0
offset_bottom = 211.0
[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]([])
self_size = Vector2i(50, 174)
fname = "МАА2000"
@@ -821,6 +684,12 @@ offset_left = 16.0
offset_top = 37.0
offset_right = 66.0
offset_bottom = 211.0
[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
offset_bottom = 208.0
textures = Array[Texture]([])
self_size = Vector2i(50, 174)
fname = "ИП12-50"
@@ -854,8 +723,15 @@ offset_left = 73.0
offset_top = 36.0
offset_right = 123.0
offset_bottom = 210.0
[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
offset_bottom = 208.0
textures = Array[Texture]([])
self_size = Vector2i(50, 174)
metadata/_edit_lock_ = true
fname = "ИП9-50"
rname = "А22"
@@ -871,10 +747,10 @@ rname = "A25"
[node name="Signal_EMS_G" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 592.0
offset_top = 193.0
offset_right = 1111.0
offset_bottom = 420.0
offset_left = 536.0
offset_top = 550.0
offset_right = 1055.0
offset_bottom = 777.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
@@ -1000,12 +876,11 @@ metadata/_edit_lock_ = true
[node name="table1" type="GridContainer" parent="TabContainer/EMS_G"]
layout_mode = 2
offset_left = 27.0
offset_top = 148.0
offset_right = 27.0
offset_bottom = 148.0
offset_left = 35.0
offset_top = 60.0
offset_right = 35.0
offset_bottom = 60.0
script = ExtResource("2_vmbyo")
metadata/_edit_lock_ = true
[node name="load_boadr" type="ColorRect" parent="TabContainer/EMS_G"]
layout_mode = 0
@@ -1177,6 +1052,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"]
@@ -1184,23 +1067,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"]

View File

@@ -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;

View File

@@ -6,3 +6,4 @@
shader = ExtResource("1_mtift")
shader_parameter/color_signal = null
shader_parameter/turn = 0.785
shader_parameter/inner_radius = 0.32

1
ems_1 Normal file
View File

@@ -0,0 +1 @@
{}

64
export_presets.cfg Normal file
View File

@@ -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}'"

1
others-Н1 Normal file
View File

@@ -0,0 +1 @@
[]

View File

@@ -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"

View File

@@ -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;

View File

@@ -129,31 +129,6 @@ class FGOS:
i += 1
emit_signal('data_received', self)
#var GRP = data.decode_u8(0x0)
#var CMD = data.decode_u8(0x1)
#match CMD:
#Constants.CMD.READ_CARRIER:
#if GRP == Constants.GROUP.BASE:
#$manage_panel/get_freq/freq_ind.text = str(data.decode_u64(0xC)) + ' Гц'
#Constants.CMD.READ_ATT:
#if GRP == Constants.GROUP.RF:
#$manage_panel/get_att/att_ind.text = '-' + str(data.decode_float(0x18)) + ' dB'
#Constants.CMD.READ_GEN_STATUS:
#if GRP == Constants.GROUP.GENERATOR:
#if data.decode_u32(0xC) == 0:
#$manage_panel/get_gen_status/status_ind.text = 'Включен'
#$manage_panel/get_gen_status/status_ind.modulate = Color.GREEN
#else:
#$manage_panel/get_gen_status/status_ind.text = 'Выключен'
#$manage_panel/get_gen_status/status_ind.modulate = Color.RED
#Constants.CMD.BASE_GET_CURRENT_TEMP:
#if GRP == Constants.GROUP.BASE:
#$temp_1.text = '%.2f' % data.decode_float(0xC) + ' °C'
#$temp_2.text = str(data.decode_float(0x10)) + ' °C'
#$temp_3.text = str(data.decode_float(0x14)) + ' °C'
#$read.text = str(data.hex_encode())
func start_session():
counter = 0

View File

@@ -2,16 +2,32 @@ extends Node2D
signal read_ems_g_start()
signal read_ems_g_finish()
var unit_fs_1 = Fs.FGOS.new()
var flag_mode = Constants.ADDRESSES[0][3]
var broadcast_packet: PackedByteArray
var node_select1: Node
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())
@@ -21,11 +37,67 @@ 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 = 'в МГц'
node_select_fs_1.get_node2(1, 2).editable = true
node_select_fs_1.set_node_text(0, 3, 'Аттенюатор')
node_select_fs_1.get_node2(1, 3).placeholder_text = 'в dB'
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).placeholder_text = '38.7'
#node_select_fs_2.get_node2(1, 3).d = 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())
@@ -39,20 +111,45 @@ 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'))
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'))
func draw_control_panel_prd(pribor) -> void:
@@ -177,8 +274,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')
## Рисует таблицу
@@ -200,28 +348,28 @@ func _on_data_received(data_from_yau_07):
var _DKM: int = data_from_yau_07.decode_u16(Constants.DataIndices.DKM) # ДКМ от УГ
#node_select1.set_node_text(2, 0, '%d' % dry_contact)
#node_select1.set_node_text(3, 0, '%d' % DKM)
## УКП
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)
@@ -245,18 +393,93 @@ 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:
$TabContainer.current_tab = tab_index
var side_panel = $Background/side_panel
for button in side_panel.get_children():
if button is Button:
button.button_pressed = (button.name == button_name)
@@ -267,6 +490,9 @@ func on_btn_select(intem_from_sector: int) -> void:
var get_select_device = node_select_device.get_node2(1, 0)
var meta = get_select_device.get_item_metadata(intem_from_sector)
Network.on_command_change_device(meta)
flag_mode = meta[2]
draw_control_panel_prd(flag_mode)
_on_start_fs_1()
Constants.CURRENT_MODE = meta[2]
draw_control_panel_prd(Constants.CURRENT_MODE)
@@ -281,51 +507,57 @@ func fill_item(node: Node, i_column: int, i_row: int, arr: Dictionary, select: i
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))
@@ -334,26 +566,33 @@ func _on_btn_ray_1(item_from_ray_1: int) -> void:
## Регулировка положением луча 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])
@@ -364,3 +603,24 @@ 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_1.start_session()
unit_fs_1.base_get_current_temp()
func _on_get_status_1(toggled_btn):
var inverted_state = not toggled_btn
unit_fs_1.set_gen_state(inverted_state)
unit_fs_1.get_gen_state()
func _on_set_ferq():
var freq = int($set_space/write_to_set_freq.get_text()) * 1_000_000
unit_fs_1.set_carrier(freq)
func _on_set_att():
var att = float($set_space/write_to_set_att.get_text())
unit_fs_1.set_att_batch(att)

View File

@@ -12,32 +12,45 @@ const TableNode = preload("res://table/node.tscn")
const TableList = preload("res://table/node_list.tscn")
const Switch = preload("res://table/switch.tscn")
const SocketStatus = preload("res://table/socket_status.tscn")
const Header = preload("res://table/header.tscn")
const SELECT_DEVICE: Array = [[TableNode, TableList]]
const ROWS_REGS_DATA: Array = [
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode],
[Header, Header],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode]]
const ROWS_UKP2_DATA: Array = [
const ROWS_YAU_07B_1: Array = [
[Header, Header],
[TableNode, Switch],
[TableNode, TableList],
[TableNode, TableList],
[TableNode, TableList],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode],
[TableNode, TableNode]]
[TableNode, SocketStatus]]
const ROWS_YAU_07B_2: Array = [
[Header, Header],
[TableNode, Switch],
[TableNode, TableList],
[TableNode, TableList],
[TableNode, TableList],
[TableNode, Switch],
[TableNode, SocketStatus]]
const ROWS_FS: Array = [
[Header, Header, Header],
[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,7 +99,7 @@ const OUT_EMS_G: Array = [
const OUT_x128: Array = [
'Р',
'К',
'0',
'Откл.',
'1',]
const RAY_DICT: Array = [
' Контроль',
@@ -96,24 +109,23 @@ const RAY_DICT: Array = [
' 25°',
' 35°',
' 45°',
' Контроль',
]
const ATT_DICT: Array = [
' 0 db',
' 0.5 db',
' 2 db',
' 2.5 db',
' 8 db',
' 8.5 db',
' 10 db',
' 10.5 db',
' 0 dB',
' 0.5 dB',
' 2 dB',
' 2.5 dB',
' 8 dB',
' 8.5 dB',
' 10 dB',
' 10.5 dB',
]
const SIGNS_PRD: Array = [
## ПРК-К
[
' Запрет СИ6',
' Запрет СИ7',
' Запрет СИ1',
'ЛИТЕРА 6! ПРД-К',
'ЛИТЕРА 7! ПРД-К',
'СЗИ6 от УФ',
'СЗИ7 от УФ',
@@ -129,9 +141,7 @@ const SIGNS_PRD: Array = [
'МАА №2',
'ИП9-50 №1',
'ИП9-50 №2',
'ИП12-50 №1',
'ИП9-50 №3',
'ИП12-50 №2',
'ИП5-25',
],
## ПРК-В
@@ -139,7 +149,6 @@ const SIGNS_PRD: Array = [
' Запрет СИ4',
' Запрет СИ5',
'',
'ЛИТЕРА 4! ПРД-В',
'ЛИТЕРА 5! ПРД-В',
'СЗИ4 от УФ',
'СЗИ5 от УФ',
@@ -155,21 +164,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 в УФ',
@@ -181,10 +184,10 @@ const SIGNS_PRD: Array = [
'МАА №2',
'ИП9-50 №1',
'ИП9-50 №2',
'ИП12-50 №1',
'-',
'-',
'ИП5-25',
'--',
],
]

View File

@@ -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[[Номер входа, Номер выхода]]

View File

@@ -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()

View File

@@ -18,19 +18,21 @@ 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
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_from_fs_1(data:PackedByteArray)
signal port_opened(port_name: String)
signal port_closed(port_name: String)
signal port_error(error_str: String)
## Класс для отправки данных в сокет
class Socket extends PacketPeerUDP:
func send_to(addr: String, port: int, data: PackedByteArray):
@@ -58,7 +60,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,7 +73,7 @@ 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
@@ -185,18 +187,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")
@@ -207,4 +209,3 @@ func disconnect_fs(client_for_leave):
client_for_leave.disconnect_from_host()
state_fs = Constants.STATE.IDLE
command_stack = []

View File

@@ -1,12 +1,17 @@
[gd_scene load_steps=2 format=3 uid="uid://ch14g46swx74h"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2thpi"]
bg_color = Color(0.8, 0.403922, 0.27451, 1)
bg_color = Color(0.455894, 0.0685824, 0.187642, 0.945098)
corner_radius_top_left = 5
corner_radius_top_right = 2
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[node name="heder" type="Label"]
custom_minimum_size = Vector2(0, 30)
offset_right = 128.0
offset_bottom = 23.0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_colors/font_color = Color(1, 1, 0.941176, 1)
theme_override_font_sizes/font_size = 15
theme_override_styles/normal = SubResource("StyleBoxFlat_2thpi")
horizontal_alignment = 1

View File

@@ -2,12 +2,10 @@
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q1ixs"]
bg_color = Color(0, 0, 0, 0.490196)
border_width_bottom = 2
border_color = Color(0.223529, 0.168627, 0.223529, 1)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[node name="Label" type="LineEdit"]
texture_filter = 2
@@ -24,18 +22,15 @@ grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
focus_mode = 0
mouse_default_cursor_shape = 0
theme_override_colors/font_uneditable_color = Color(1, 1, 1, 1)
theme_override_colors/font_uneditable_color = Color(1, 1, 0.941176, 1)
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
[node name="ColorRect" type="ColorRect" parent="."]
[node name="Color_Ems_g" type="ColorRect" parent="."]
layout_mode = 0
offset_right = 1933.0
offset_bottom = 1088.0

View File

@@ -6,3 +6,4 @@ offset_bottom = 25.0
focus_mode = 0
mouse_default_cursor_shape = 2
alignment = 1
expand_icon = true

View File

@@ -6,12 +6,10 @@
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q1ixs"]
bg_color = Color(0, 0, 0, 0.490196)
border_width_bottom = 2
border_color = Color(0.223529, 0.168627, 0.223529, 1)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[sub_resource type="SpriteFrames" id="SpriteFrames_a7q1i"]
animations = [{
@@ -34,18 +32,17 @@ animations = [{
}]
[node name="PanelContainer" type="PanelContainer"]
custom_minimum_size = Vector2(50, 35)
offset_left = -3.0
offset_right = 319.0
offset_bottom = 66.0
offset_right = 119.0
offset_bottom = 35.0
theme_override_styles/panel = SubResource("StyleBoxFlat_q1ixs")
metadata/_edit_lock_ = true
[node name="ColorRect" type="ColorRect" parent="."]
[node name="Color_ems_g" type="ColorRect" parent="."]
layout_mode = 2
color = Color(0, 0, 0, 0.195)
color = Color(1, 1, 1, 0)
[node name="SZI_x" type="AnimatedSprite2D" parent="."]
position = Vector2(40, 11)
position = Vector2(59, 18)
scale = Vector2(1.2, 1.2)
sprite_frames = SubResource("SpriteFrames_a7q1i")
metadata/_edit_lock_ = true

View File

@@ -3,6 +3,10 @@
[ext_resource type="Script" path="res://scripts/switch.gd" id="1_h0k6p"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_r5cym"]
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_b6sp7"]