diff --git a/PRD57EF.tmp b/PRD57EF.tmp new file mode 100644 index 0000000..1bcb40f --- /dev/null +++ b/PRD57EF.tmp @@ -0,0 +1,1003 @@ +[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"] +[ext_resource type="Script" path="res://table/table.gd" id="2_vmbyo"] +[ext_resource type="Material" uid="uid://s6xe8igevnv2" path="res://Shaders/shader_edu.tres" id="3_3syd3"] +[ext_resource type="Texture2D" uid="uid://cfktmk2rowmul" path="res://table/off.png" id="3_qvuyu"] +[ext_resource type="Shader" path="res://Shaders/ray.gdshader" id="4_uy5o2"] +[ext_resource type="Texture2D" uid="uid://co8dxcd8eckjs" path="res://Web.png" id="5_i3nvb"] +[ext_resource type="Shader" path="res://ray_2.gdshader" id="8_12mng"] +[ext_resource type="Texture2D" uid="uid://cgtg4gbqnuxrc" path="res://nine-patch-round.png" id="9_0r2qk"] +[ext_resource type="Script" path="res://scripts/control_panel.gd" id="9_akagi"] +[ext_resource type="Script" path="res://scripts/ems_g.gd" id="9_g1wia"] +[ext_resource type="Shader" path="res://load.gdshader" id="10_lf1xh"] +[ext_resource type="PackedScene" uid="uid://bdb0bhfu7366l" path="res://kasseta-fs-kd.tscn" id="10_tdh2s"] +[ext_resource type="PackedScene" uid="uid://bnlkbbn7b4a3k" path="res://table/элемент-эмс.tscn" id="11_d60jk"] +[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://table/элемент-в.tscn" id="11_fg7ul"] +[ext_resource type="Script" path="res://scripts/modul_fs.gd" id="15_b4pr1"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_eib3t"] +bg_color = Color(0.223529, 0.168627, 0.223529, 1) +border_width_bottom = 6 +border_color = Color(0.228592, 0.173062, 0.22863, 1) +border_blend = true + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o0too"] +bg_color = Color(0.223529, 0.168627, 0.223529, 1) +border_width_bottom = 6 +border_color = Color(0.339047, 0.26316, 0.339004, 1) +border_blend = true + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gooip"] +bg_color = Color(0.143, 0.103, 0.143, 0.799) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lqhgx"] +bg_color = Color(0, 0, 0, 0.490196) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_148rs"] +bg_color = Color(0.141176, 0.101961, 0.141176, 0.8) +border_width_bottom = 4 +border_color = Color(0.223529, 0.168627, 0.223529, 1) +border_blend = true +corner_radius_top_left = 2 +corner_radius_top_right = 2 +corner_radius_bottom_right = 2 +corner_radius_bottom_left = 2 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ldbvf"] +bg_color = Color(0.141176, 0.101961, 0.141176, 0.8) + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_h8aei"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_d322q"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_8j02b"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_ls6vm"] + +[sub_resource type="Theme" id="Theme_k5ur4"] +Button/styles/focus = SubResource("StyleBoxFlat_eib3t") +Button/styles/hover = SubResource("StyleBoxFlat_o0too") +Button/styles/normal = SubResource("StyleBoxFlat_o0too") +Button/styles/pressed = SubResource("StyleBoxFlat_eib3t") +CheckButton/icons/checked = ExtResource("2_dv7xx") +CheckButton/icons/unchecked = ExtResource("3_qvuyu") +OptionButton/font_sizes/font_size = 17 +OptionButton/styles/focus = SubResource("StyleBoxFlat_gooip") +OptionButton/styles/hover = SubResource("StyleBoxFlat_lqhgx") +OptionButton/styles/normal = SubResource("StyleBoxFlat_148rs") +OptionButton/styles/pressed = SubResource("StyleBoxFlat_ldbvf") +TabContainer/styles/panel = SubResource("StyleBoxTexture_h8aei") +TabContainer/styles/tab_focus = SubResource("StyleBoxTexture_d322q") +TabContainer/styles/tab_selected = SubResource("StyleBoxTexture_8j02b") +TabContainer/styles/tabbar_background = SubResource("StyleBoxTexture_ls6vm") + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pxarn"] +bg_color = Color(0.356863, 0.278431, 0.356863, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p247y"] +bg_color = Color(0.356863, 0.278431, 0.356863, 1) + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_rh6pm"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_x11tp"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mn8w2"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_21lc8"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_k08q3"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_dklg6"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_17le6"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_7u7p7"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_1as41"] + +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_723du"] +size = Vector2(1600, 1200) + +[sub_resource type="GDScript" id="GDScript_0sobq"] +script/source = "extends Sprite2D + +" + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_o7txs"] + +[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.785 +shader_parameter/inner_radius = 0.32 + +[sub_resource type="Gradient" id="Gradient_ki0n7"] + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_0pk2o"] +gradient = SubResource("Gradient_ki0n7") +fill_from = Vector2(0.474359, 0.5) +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.785 +shader_parameter/inner_radius = 0.32 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_tn8m6"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_ooo4i"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_slcfo"] +shader = ExtResource("10_lf1xh") +shader_parameter/frequency = 5.0 +shader_parameter/amplitude = 600.0 +shader_parameter/speed = 5.0 +shader_parameter/direction = -1.0 +shader_parameter/color1 = Color(0, 0, 0, 1) +shader_parameter/color2 = Color(0.235, 0.18, 0.235, 1) +shader_parameter/color3 = Color(0.235, 0.18, 0.235, 0.5) +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 = 3025.0 +offset_bottom = 1060.0 +theme = SubResource("Theme_k5ur4") +color = Color(0.356863, 0.278431, 0.356863, 1) +metadata/_edit_lock_ = true + +[node name="side_panel" type="ColorRect" parent="Background"] +layout_mode = 0 +offset_right = 216.0 +offset_bottom = 988.0 +color = Color(0.586231, 0.481877, 0.585869, 1) + +[node name="select_prd" type="Button" parent="Background/side_panel"] +layout_mode = 0 +offset_top = 120.0 +offset_right = 216.0 +offset_bottom = 156.0 +focus_mode = 0 +mouse_default_cursor_shape = 2 +theme_override_font_sizes/font_size = 14 +theme_override_styles/pressed = SubResource("StyleBoxFlat_pxarn") +toggle_mode = true +button_pressed = true +text = "ПРД" + +[node name="select_control" type="Button" parent="Background/side_panel"] +layout_mode = 0 +offset_top = 160.0 +offset_right = 216.0 +offset_bottom = 196.0 +focus_mode = 0 +mouse_default_cursor_shape = 2 +theme_override_font_sizes/font_size = 14 +theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y") +toggle_mode = true +text = "КОНТРОЛЬ" + +[node name="select_ems_g" type="Button" parent="Background/side_panel"] +layout_mode = 0 +offset_top = 200.0 +offset_right = 216.0 +offset_bottom = 236.0 +focus_mode = 0 +mouse_default_cursor_shape = 2 +theme_override_font_sizes/font_size = 14 +theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y") +toggle_mode = true +text = "ЭМС Г" + +[node name="select_fs" type="Button" parent="Background/side_panel"] +layout_mode = 0 +offset_top = 241.0 +offset_right = 216.0 +offset_bottom = 277.0 +focus_mode = 0 +mouse_default_cursor_shape = 2 +theme_override_font_sizes/font_size = 14 +theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y") +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 +focus_mode = 0 +mouse_default_cursor_shape = 2 +theme_override_font_sizes/font_size = 14 +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 +focus_mode = 0 +mouse_default_cursor_shape = 2 +theme_override_font_sizes/font_size = 14 +theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y") +text = "Загрузить" + +[node name="Litera_3_5_7" type="ColorRect" parent="Background"] +visible = false +layout_mode = 0 +offset_top = 48.0 +offset_right = 1941.0 +offset_bottom = 352.0 +color = Color(0.669446, 0.567301, 0.66881, 1) + +[node name="Litera_1" type="ColorRect" parent="Background"] +visible = false +layout_mode = 0 +offset_top = 359.0 +offset_right = 2182.0 +offset_bottom = 638.0 +color = Color(0.669446, 0.567301, 0.66881, 1) + +[node name="ISA" type="Label" parent="."] +offset_left = 225.0 +offset_top = 11.0 +offset_right = 409.0 +offset_bottom = 48.0 +autowrap_mode = 3 +metadata/_edit_lock_ = true + +[node name="read_isa" type="Button" parent="."] +offset_left = 85.0 +offset_top = 7.0 +offset_right = 210.0 +offset_bottom = 38.0 +text = "Прочитать ISA" +metadata/_edit_lock_ = true + +[node name="TabContainer" type="TabContainer" parent="."] +offset_left = 216.0 +offset_top = 39.0 +offset_right = 2420.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) +theme_override_styles/tab_focus = SubResource("StyleBoxTexture_rh6pm") +theme_override_styles/tab_disabled = SubResource("StyleBoxTexture_x11tp") +theme_override_styles/tabbar_background = SubResource("StyleBoxTexture_mn8w2") +theme_override_styles/panel = SubResource("StyleBoxTexture_21lc8") +theme_override_styles/tab_selected = SubResource("StyleBoxTexture_k08q3") +theme_override_styles/tab_hovered = SubResource("StyleBoxTexture_dklg6") +theme_override_styles/tab_unselected = SubResource("StyleBoxTexture_17le6") +tab_alignment = 2 +current_tab = 0 +tab_focus_mode = 0 +metadata/_edit_lock_ = true + +[node name="PRD" type="Panel" parent="TabContainer"] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxTexture_7u7p7") +metadata/_tab_index = 0 +metadata/_edit_lock_ = true + +[node name="body_grid" type="GridContainer" parent="TabContainer/PRD"] +layout_mode = 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 = 5 + +[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="space" 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="yau07b_control" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_2_4_6"] +layout_mode = 2 +script = ExtResource("2_vmbyo") +metadata/_edit_lock_ = true + +[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 +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.733333) +material = ExtResource("3_3syd3") +position = Vector2(955, 5) +scale = Vector2(0.23, 0.217) +texture = SubResource("PlaceholderTexture2D_723du") +offset = Vector2(800, 600) +script = SubResource("GDScript_0sobq") +metadata/_edit_lock_ = true + +[node name="PSK grad" type="TextureRect" parent="TabContainer/PRD/body_grid/litera_2_4_6/PSK"] +modulate = Color(1, 1, 0.941176, 0.784314) +material = SubResource("ShaderMaterial_o7txs") +offset_left = 554.954 +offset_top = -30.0 +offset_right = 1290.95 +offset_bottom = 1134.0 +texture = ExtResource("5_i3nvb") +expand_mode = 1 +metadata/_edit_lock_ = true + +[node name="ray_1" type="Sprite2D" parent="TabContainer/PRD/body_grid/litera_2_4_6/PSK"] +material = SubResource("ShaderMaterial_dgiai") +position = Vector2(549.221, 543.623) +scale = Vector2(21.8765, 21.6782) +texture = SubResource("GradientTexture2D_0pk2o") +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 = 5 + +[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="space" 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="yau07b_control" type="GridContainer" parent="TabContainer/PRD/body_grid/litera_3_5_7"] +layout_mode = 2 +script = ExtResource("2_vmbyo") +metadata/_edit_lock_ = true + +[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 +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.733333) +material = ExtResource("3_3syd3") +position = Vector2(955, -6) +scale = Vector2(0.23, 0.217) +texture = SubResource("PlaceholderTexture2D_723du") +offset = Vector2(800, 600) +script = SubResource("GDScript_0sobq") +metadata/_edit_lock_ = true + +[node name="PSK grad" type="TextureRect" parent="TabContainer/PRD/body_grid/litera_3_5_7/PSK2"] +modulate = Color(1, 1, 0.941176, 0.784314) +show_behind_parent = true +material = SubResource("ShaderMaterial_o7txs") +offset_left = 554.954 +offset_top = -30.0 +offset_right = 1290.95 +offset_bottom = 1134.0 +texture = ExtResource("5_i3nvb") +expand_mode = 1 +metadata/_edit_lock_ = true + +[node name="ray_2" type="Sprite2D" parent="TabContainer/PRD/body_grid/litera_3_5_7/PSK2"] +material = SubResource("ShaderMaterial_2pxu2") +position = Vector2(549.221, 539.353) +scale = Vector2(21.8765, 21.6782) +texture = SubResource("GradientTexture2D_0pk2o") +metadata/_edit_lock_ = true + +[node name="select_dev" type="GridContainer" parent="TabContainer/PRD"] +layout_mode = 2 +offset_left = 16.0 +offset_top = 11.0 +offset_right = 16.0 +offset_bottom = 11.0 +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="lbl_control" type="Label" parent="TabContainer/ControlPanel"] +layout_mode = 0 +offset_left = 4.0 +offset_top = 21.0 +offset_right = 624.0 +offset_bottom = 52.0 +theme_override_font_sizes/font_size = 22 +text = "Контроль исправности прибора ПРД-Н" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="soc_y5" type="NinePatchRect" parent="TabContainer/ControlPanel"] +layout_mode = 0 +offset_left = 199.0 +offset_top = 103.0 +offset_right = 516.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="ref_A24" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +offset_left = 9.0 +offset_top = 34.0 +offset_right = 59.0 +offset_bottom = 184.0 +textures = Array[Texture]([]) +fname = "ИП-25" +rname = "A24" +metadata/_edit_lock_ = true + +[node name="ref_A30" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +offset_left = 59.0 +offset_top = 34.0 +offset_right = 109.0 +offset_bottom = 184.0 +textures = Array[Texture]([]) +fname = "ЯУ-07" +rname = "A30" +metadata/_edit_lock_ = true + +[node name="ref_A26" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +offset_left = 109.0 +offset_top = 34.0 +offset_right = 159.0 +offset_bottom = 184.0 +textures = Array[Texture]([]) +fname = "ЭМС-Г" +rname = "A26" +metadata/_edit_lock_ = true + +[node name="ref_A27" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +offset_left = 159.0 +offset_top = 34.0 +offset_right = 209.0 +offset_bottom = 184.0 +textures = Array[Texture]([]) +fname = "УГ" +rname = "A27" +metadata/_edit_lock_ = true + +[node name="ref_A28" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +offset_left = 209.0 +offset_top = 34.0 +offset_right = 259.0 +offset_bottom = 183.0 +textures = Array[Texture]([]) +self_size = Vector2i(50, 149) +fname = "УКП-1" +rname = "A28" +metadata/_edit_lock_ = true + +[node name="ref_A29" parent="TabContainer/ControlPanel/soc_y5" instance=ExtResource("11_fg7ul")] +offset_left = 259.0 +offset_top = 34.0 +offset_right = 309.0 +offset_bottom = 184.0 +textures = Array[Texture]([]) +fname = "УКП-2" +rname = "A29" +metadata/_edit_lock_ = true + +[node name="lbl_fname" type="Label" parent="TabContainer/ControlPanel/soc_y5"] +self_modulate = Color(1, 1, 1, 0.62) +layout_mode = 0 +offset_left = 7.0 +offset_top = 8.0 +offset_right = 309.0 +offset_bottom = 33.0 +text = "Кассета У5" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="soc_fs-nkvd" parent="TabContainer/ControlPanel" instance=ExtResource("10_tdh2s")] +layout_mode = 0 +offset_left = 198.0 +offset_top = 311.0 +offset_right = 516.0 +offset_bottom = 538.0 +script = null + +[node name="lbl_fname" type="Label" parent="TabContainer/ControlPanel/soc_fs-nkvd"] +self_modulate = Color(1, 1, 1, 0.62) +layout_mode = 0 +offset_left = 7.0 +offset_top = 8.0 +offset_right = 299.0 +offset_bottom = 33.0 +text = "Кассета ФС-НД" +horizontal_alignment = 1 +vertical_alignment = 1 +metadata/_edit_lock_ = true + +[node name="ref_A3" parent="TabContainer/ControlPanel/soc_fs-nkvd" instance=ExtResource("11_fg7ul")] +offset_left = 109.0 +offset_top = 68.0 +offset_right = 159.0 +offset_bottom = 218.0 +textures = Array[Texture]([]) +fname = "ФС-2" +rname = "A3" +metadata/_edit_lock_ = true + +[node name="ref_A1" parent="TabContainer/ControlPanel/soc_fs-nkvd" instance=ExtResource("11_fg7ul")] +offset_left = 159.0 +offset_top = 68.0 +offset_right = 209.0 +offset_bottom = 218.0 +textures = Array[Texture]([]) +fname = "Модуль" +rname = "A1" +metadata/_edit_lock_ = true + +[node name="ref_A2" parent="TabContainer/ControlPanel/soc_fs-nkvd" instance=ExtResource("11_fg7ul")] +offset_left = 209.0 +offset_top = 68.0 +offset_right = 259.0 +offset_bottom = 217.0 +textures = Array[Texture]([]) +self_size = Vector2i(50, 149) +fname = "Модуль" +rname = "A2" +metadata/_edit_lock_ = true + +[node name="ref_A4" parent="TabContainer/ControlPanel/soc_fs-nkvd" instance=ExtResource("11_fg7ul")] +offset_left = 259.0 +offset_top = 68.0 +offset_right = 309.0 +offset_bottom = 218.0 +textures = Array[Texture]([]) +fname = "ФС-3" +rname = "A4" +metadata/_edit_lock_ = true + +[node name="soc_P1" type="NinePatchRect" parent="TabContainer/ControlPanel"] +layout_mode = 0 +offset_left = 96.0 +offset_top = 560.0 +offset_right = 516.0 +offset_bottom = 776.0 +texture = ExtResource("9_0r2qk") +patch_margin_left = 16 +patch_margin_top = 16 +patch_margin_right = 16 +patch_margin_bottom = 16 + +[node name="lbl_fname" type="Label" parent="TabContainer/ControlPanel/soc_P1"] +self_modulate = Color(1, 1, 1, 0.62) +layout_mode = 0 +offset_left = 7.0 +offset_top = 8.0 +offset_right = 409.0 +offset_bottom = 33.0 +text = "Кассета П-1" +horizontal_alignment = 1 +vertical_alignment = 1 +metadata/_edit_lock_ = true + +[node name="ref_A23" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +offset_left = 40.0 +offset_top = -206.0 +offset_right = 90.0 +offset_bottom = -32.0 +textures = Array[Texture]([]) +self_size = Vector2i(50, 174) + +[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) + +[node name="ref_A25" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +offset_left = 109.0 +offset_top = 34.0 +offset_right = 159.0 +offset_bottom = 208.0 +textures = Array[Texture]([]) +self_size = Vector2i(50, 174) +metadata/_edit_lock_ = true + +[node name="ref_A26" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +offset_left = 159.0 +offset_top = 34.0 +offset_right = 209.0 +offset_bottom = 208.0 +textures = Array[Texture]([]) +self_size = Vector2i(50, 174) +metadata/_edit_lock_ = true + +[node name="ref_A27" parent="TabContainer/ControlPanel/soc_P1" instance=ExtResource("11_fg7ul")] +offset_left = 209.0 +offset_top = 34.0 +offset_right = 259.0 +offset_bottom = 208.0 +textures = Array[Texture]([]) +self_size = Vector2i(50, 174) +metadata/_edit_lock_ = true + +[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) +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 +offset_bottom = 208.0 +textures = Array[Texture]([]) +self_size = Vector2i(50, 174) +metadata/_edit_lock_ = true + +[node name="Signal_EMS_G" type="NinePatchRect" parent="TabContainer/ControlPanel"] +layout_mode = 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 +patch_margin_right = 16 +patch_margin_bottom = 16 + +[node name="lbl_fname" type="Label" parent="TabContainer/ControlPanel/Signal_EMS_G"] +self_modulate = Color(1, 1, 1, 0.62) +layout_mode = 0 +offset_left = 7.0 +offset_top = 8.0 +offset_right = 508.0 +offset_bottom = 33.0 +text = "ЭМС-Г" +horizontal_alignment = 1 +vertical_alignment = 1 +metadata/_edit_lock_ = true + +[node name="ref_A22" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] +offset_left = 9.0 +offset_top = 38.0 +offset_right = 59.0 +offset_bottom = 216.0 +self_size = Vector2i(50, 178) +rname = "A22" +metadata/_edit_lock_ = true + +[node name="ref_A23" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] +offset_left = 59.0 +offset_top = 38.0 +offset_right = 109.0 +offset_bottom = 216.0 +self_size = Vector2i(50, 178) +rname = "A23" +metadata/_edit_lock_ = true + +[node name="ref_A26" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] +offset_left = 109.0 +offset_top = 38.0 +offset_right = 159.0 +offset_bottom = 216.0 +self_size = Vector2i(50, 178) +rname = "A26" +metadata/_edit_lock_ = true + +[node name="ref_A27" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] +offset_left = 159.0 +offset_top = 38.0 +offset_right = 209.0 +offset_bottom = 216.0 +self_size = Vector2i(50, 178) +rname = "A27" +metadata/_edit_lock_ = true + +[node name="ref_A28" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] +offset_left = 209.0 +offset_top = 38.0 +offset_right = 259.0 +offset_bottom = 216.0 +self_size = Vector2i(50, 178) +rname = "A28" +metadata/_edit_lock_ = true + +[node name="ref_A29" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] +offset_left = 259.0 +offset_top = 38.0 +offset_right = 309.0 +offset_bottom = 216.0 +self_size = Vector2i(50, 178) +rname = "A29" +metadata/_edit_lock_ = true + +[node name="ref_A31" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] +offset_left = 309.0 +offset_top = 38.0 +offset_right = 359.0 +offset_bottom = 216.0 +self_size = Vector2i(50, 178) +rname = "УМ2" +metadata/_edit_lock_ = true + +[node name="ref_A32" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] +offset_left = 359.0 +offset_top = 38.0 +offset_right = 409.0 +offset_bottom = 216.0 +self_size = Vector2i(50, 178) +rname = "УМ3" +metadata/_edit_lock_ = true + +[node name="ref_A33" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] +offset_left = 409.0 +offset_top = 38.0 +offset_right = 459.0 +offset_bottom = 216.0 +self_size = Vector2i(50, 178) +rname = "A33" +metadata/_edit_lock_ = true + +[node name="ref_A34" parent="TabContainer/ControlPanel/Signal_EMS_G" instance=ExtResource("11_d60jk")] +offset_left = 459.0 +offset_top = 38.0 +offset_right = 509.0 +offset_bottom = 216.0 +self_size = Vector2i(50, 178) +rname = "A33" +metadata/_edit_lock_ = true + +[node name="EMS_G" type="Panel" parent="TabContainer"] +visible = false +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxTexture_ooo4i") +script = ExtResource("9_g1wia") +metadata/_tab_index = 2 +metadata/_edit_lock_ = true + +[node name="table1" type="GridContainer" parent="TabContainer/EMS_G"] +layout_mode = 2 +offset_left = 35.0 +offset_top = 60.0 +offset_right = 35.0 +offset_bottom = 60.0 +script = ExtResource("2_vmbyo") + +[node name="load_boadr" type="ColorRect" parent="TabContainer/EMS_G"] +layout_mode = 0 +offset_left = 35.0 +offset_top = 58.0 +offset_right = 1604.0 +offset_bottom = 782.0 +color = Color(0, 0, 0, 0.596078) +metadata/_edit_lock_ = true + +[node name="load" type="Sprite2D" parent="TabContainer/EMS_G/load_boadr"] +material = SubResource("ShaderMaterial_slcfo") +position = Vector2(785.001, 361.5) +scale = Vector2(24.5313, 11.2656) +texture = SubResource("GradientTexture2D_0pk2o") +metadata/_edit_lock_ = true + +[node name="Load_text" type="Label" parent="TabContainer/EMS_G/load_boadr"] +layout_mode = 0 +offset_left = 693.0 +offset_top = 341.0 +offset_right = 849.0 +offset_bottom = 380.0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_colors/font_shadow_color = Color(0.427493, 0.427493, 0.427493, 1) +theme_override_font_sizes/font_size = 28 +text = "Загрузка ..." + +[node name="Modul_fs" type="Panel" parent="TabContainer"] +visible = false +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxTexture_ooo4i") +script = ExtResource("15_b4pr1") +metadata/_tab_index = 3 +metadata/_edit_lock_ = true + +[node name="set_space" type="GridContainer" parent="TabContainer/Modul_fs"] +layout_mode = 0 +offset_left = 211.0 +offset_top = 378.0 +offset_right = 854.0 +offset_bottom = 418.0 +columns = 2 + +[node name="set_ferq" type="Button" parent="TabContainer/Modul_fs/set_space"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +text = " Set н/ч" + +[node name="write_to_set_freq" type="LineEdit" parent="TabContainer/Modul_fs/set_space"] +custom_minimum_size = Vector2(300, 0) +layout_mode = 2 +text = "500" +placeholder_text = "Частота" + +[node name="measurement" type="Label" parent="TabContainer/Modul_fs/set_space/write_to_set_freq"] +layout_mode = 0 +offset_left = 313.0 +offset_top = 2.0 +offset_right = 365.0 +offset_bottom = 30.0 +text = "МГц" + +[node name="set_att2" type="Button" parent="TabContainer/Modul_fs/set_space"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +text = " Set att" + +[node name="write_to_set_att" type="LineEdit" parent="TabContainer/Modul_fs/set_space"] +custom_minimum_size = Vector2(300, 0) +layout_mode = 2 +text = "38.75" +placeholder_text = "-38.75 to 0" + +[node name="measurement" type="Label" parent="TabContainer/Modul_fs/set_space/write_to_set_att"] +layout_mode = 0 +offset_left = 313.0 +offset_top = 2.0 +offset_right = 351.0 +offset_bottom = 30.0 +text = "dB" + +[node name="manage_panel" type="GridContainer" parent="TabContainer/Modul_fs"] +layout_mode = 0 +offset_left = 200.0 +offset_top = 186.0 +offset_right = 805.0 +offset_bottom = 308.0 +columns = 5 +metadata/_edit_lock_ = true + +[node name="con" type="Button" parent="TabContainer/Modul_fs/manage_panel"] +layout_mode = 2 +text = " Подключение " + +[node name="ip_connect" type="Label" parent="TabContainer/Modul_fs/manage_panel/con"] +layout_mode = 0 +offset_top = 32.0 +offset_right = 118.0 +offset_bottom = 55.0 + +[node name="get_freq" type="Button" parent="TabContainer/Modul_fs/manage_panel"] +layout_mode = 2 +text = " Получить н/ч " + +[node name="freq_ind" type="Label" parent="TabContainer/Modul_fs/manage_panel/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/Modul_fs/manage_panel"] +layout_mode = 2 +text = " Получить att " + +[node name="att_ind" type="Label" parent="TabContainer/Modul_fs/manage_panel/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/Modul_fs/manage_panel"] +layout_mode = 2 +toggle_mode = true +text = "Переключатель генератора " + +[node name="status_ind" type="Label" parent="TabContainer/Modul_fs/manage_panel/get_gen_status"] +layout_mode = 0 +offset_top = 33.0 +offset_right = 84.0 +offset_bottom = 56.0 + +[node name="read" type="LineEdit" parent="TabContainer/Modul_fs"] +layout_mode = 0 +offset_left = 216.0 +offset_top = 818.0 +offset_right = 971.0 +offset_bottom = 849.0 +metadata/_edit_lock_ = true + +[node name="fs_connect" type="Label" parent="TabContainer/Modul_fs"] +layout_mode = 0 +offset_left = 206.0 +offset_top = 88.0 +offset_right = 377.0 +offset_bottom = 111.0 +text = "Связь с модулем ФС" + +[node name="temp_1" type="Label" parent="TabContainer/Modul_fs"] +layout_mode = 0 +offset_left = 1015.0 +offset_top = 119.0 +offset_right = 1102.0 +offset_bottom = 152.0 +text = "Темп" + +[node name="temp_2" type="Label" parent="TabContainer/Modul_fs"] +layout_mode = 0 +offset_left = 1016.0 +offset_top = 156.0 +offset_right = 1103.0 +offset_bottom = 189.0 +text = "Темп" + +[node name="temp_3" type="Label" parent="TabContainer/Modul_fs"] +layout_mode = 0 +offset_left = 1015.0 +offset_top = 193.0 +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"] +[connection signal="pressed" from="Background/side_panel/select_fs" to="." method="_on_mfs_select"] +[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/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"] +[connection signal="pressed" from="TabContainer/Modul_fs/manage_panel/get_freq" to="TabContainer/Modul_fs" method="_on_send_pressed"] +[connection signal="pressed" from="TabContainer/Modul_fs/manage_panel/get_att" to="TabContainer/Modul_fs" method="_on_get_att"] +[connection signal="toggled" from="TabContainer/Modul_fs/manage_panel/get_gen_status" to="TabContainer/Modul_fs" method="_on_get_status"] diff --git a/scripts/FS.gd b/scripts/FS.gd index c16846f..c5a583e 100644 --- a/scripts/FS.gd +++ b/scripts/FS.gd @@ -66,6 +66,7 @@ class FGOS: 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D] + const INDEX_SIZE: int = 0xC const GROUP_OFFSET: int = 0x0 const CMD_OFFSET: int = 0x1 @@ -76,7 +77,6 @@ class FGOS: signal line_changed(unit: FGOS) ## Вызывается когда меняется состояние связи с ячейкой - var counter: int = 0 var online: bool = false ## Состояние связи с ячейкой var status: = PackedByteArray() ## Поле "состояние прибора" #var fgos_data = {} ## Результат выполнения команды "читать порт" @@ -92,7 +92,7 @@ class FGOS: return final_crc - func _form_packet(group: int, cmd: int, index_size: int, data = null): + func _form_packet(group: int, cmd: int, index_size: int, counter: int, data = null): var packet = PackedByteArray() packet.resize(index_size) packet.encode_u8(GROUP_OFFSET, group) @@ -108,79 +108,80 @@ class FGOS: var crc = crc32(packet) packet.resize(packet.size() + 4) packet.encode_u32(packet.size() - 4, crc) - #Network.command_stack.append(packet) - Network.command_stack_2.append(packet) - - - func _parse(rx_data: PackedByteArray): - - if not online: - online = true - emit_signal('line_changed', self) - - - var status_len = rx_data.decode_u16(6) # Длина массива байтового "состояние прибора" - - var i: = 0 - var len_rx_data: = rx_data.size() - status.resize(status_len) - while i < status_len: - var byte_i = i + 8 - if byte_i < len_rx_data: - status[i] = rx_data[byte_i] # Массив байтовый "состояние прибора" - i += 1 - emit_signal('data_received', self) + Network.command_stack.append(packet) + + + func send_fs_data(data_to_sand: PackedByteArray, client_fs: StreamPeer, peerstream_fs: PacketPeer): + if client_fs.get_status() == 2: + var peer = peerstream_fs.get_stream_peer() + if peer: + peer.put_data(data_to_sand) + else: + print_debug('client_fs.get_status != 2 !!!') + + + #func _parse(rx_data: PackedByteArray): + #if not online: + #online = true + #emit_signal('line_changed', self) + # + #var status_len = rx_data.decode_u16(6) # Длина массива байтового "состояние прибора" +# + #var i: = 0 + #var len_rx_data: = rx_data.size() + #status.resize(status_len) + #while i < status_len: + #var byte_i = i + 8 + #if byte_i < len_rx_data: + #status[i] = rx_data[byte_i] # Массив байтовый "состояние прибора" + #i += 1 + #emit_signal('data_received', self) - func start_session(): - counter = 0 - var packet = _form_packet(GROUP.BASE, CmdCode.START_SESSION, 0xC) + func start_session(counter: int): + var packet = _form_packet(GROUP.BASE, CmdCode.START_SESSION, INDEX_SIZE, counter) _send_packet(packet) - get_gen_state() - get_att_batch() - get_carrier() - func set_gen_state(button_state: bool): + func set_gen_state(button_state: bool, counter: int): var index_size = 0x1C - var packet = _form_packet(GROUP.GENERATOR, CmdCode.SET_GEN_STATUS, index_size) + var packet = _form_packet(GROUP.GENERATOR, CmdCode.SET_GEN_STATUS, index_size, counter) packet.encode_u16(0x8, 0x0010) packet.encode_u32(0xC, button_state) ## MODE GEN STATUS _send_packet(packet) - get_gen_state() - func set_carrier(installation_frequency: int): + func set_carrier(installation_frequency: int, counter: int): var index_size = 0x1C - var packet = _form_packet(GROUP.BASE, CmdCode.SET_CARRIER, index_size) + var packet = _form_packet(GROUP.BASE, CmdCode.SET_CARRIER, index_size, counter) packet.encode_u16(0x8, 0x10) packet.encode_u64(0xC, installation_frequency) ## uint64_t freq low dword/high dword _send_packet(packet) - func set_att_batch(attenuation: float): + func set_att_batch(attenuation: float, counter: int): var index_size = 0x1C - var packet = _form_packet(GROUP.RF, CmdCode.SET_ATT, index_size) + var packet = _form_packet(GROUP.RF, CmdCode.SET_ATT, index_size, counter) packet.encode_u16(0x8, 0x10) packet.encode_float(0x18, attenuation) _send_packet(packet) - func get_carrier(): - var packet = _form_packet(GROUP.BASE, CmdCode.READ_CARRIER, INDEX_SIZE) + func get_carrier(counter: int): + var packet = _form_packet(GROUP.BASE, CmdCode.READ_CARRIER, INDEX_SIZE, counter) _send_packet(packet) - func get_att_batch(): - var packet = _form_packet(GROUP.RF, CmdCode.READ_ATT, INDEX_SIZE) + func get_att_batch(counter: int): + var packet = _form_packet(GROUP.RF, CmdCode.READ_ATT, INDEX_SIZE, counter) _send_packet(packet) - func get_gen_state(): - var packet = _form_packet(GROUP.GENERATOR, CmdCode.READ_GEN_STATUS, INDEX_SIZE) + func get_gen_state(counter: int): + var packet = _form_packet(GROUP.GENERATOR, CmdCode.READ_GEN_STATUS, INDEX_SIZE, counter) _send_packet(packet) - func base_get_current_temp(): - var packet = _form_packet(GROUP.BASE, CmdCode.BASE_GET_CURRENT_TEMP, INDEX_SIZE) + func base_get_current_temp(counter: int): + var packet = _form_packet(GROUP.BASE, CmdCode.BASE_GET_CURRENT_TEMP, INDEX_SIZE, counter) _send_packet(packet) diff --git a/scripts/PRD.gd b/scripts/PRD.gd index c27debc..a84bea2 100644 --- a/scripts/PRD.gd +++ b/scripts/PRD.gd @@ -420,8 +420,8 @@ 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) - #_on_start_fs_1() - _on_start_fs_2() + _on_start_fs_1() + #_on_start_fs_2() func _on_zapret1(toggled_on: bool) -> void: diff --git a/scripts/modul_fs.gd b/scripts/modul_fs.gd index 61677ed..19dc73c 100644 --- a/scripts/modul_fs.gd +++ b/scripts/modul_fs.gd @@ -58,29 +58,29 @@ func _on_data_send(): func _on_send_pressed() -> void: - unit_fs.get_carrier() + unit_fs.get_carrier(counter) func _on_get_att() -> void: - unit_fs.get_att_batch() + unit_fs.get_att_batch(counter) func _on_start(): - unit_fs.start_session() - unit_fs.base_get_current_temp() + unit_fs.start_session(counter) + unit_fs.base_get_current_temp(counter) func _on_get_status(toggled_btn): var inverted_state = not toggled_btn - unit_fs.set_gen_state(inverted_state) - unit_fs.get_gen_state() + unit_fs.set_gen_state(inverted_state, counter) + unit_fs.get_gen_state(counter) func _on_set_ferq(): var freq = int($set_space/write_to_set_freq.get_text()) * 1_000_000 - unit_fs.set_carrier(freq) + unit_fs.set_carrier(freq, counter) func _on_set_att(): var att = float($set_space/write_to_set_att.get_text()) - unit_fs.set_att_batch(att) + unit_fs.set_att_batch(att, counter) diff --git a/scripts/network.gd b/scripts/network.gd index 69f7985..67f403f 100644 --- a/scripts/network.gd +++ b/scripts/network.gd @@ -2,8 +2,8 @@ extends Node # ЯУ-07 Блок var unit = Yau07.YaU07.new('ЯУ-07Б') -#var unit_fs_1 = Fs.FGOS.new() -var unit_fs_2 = Fs.FGOS.new() +var unit_fs_1 = Fs.FGOS.new() +#var unit_fs_2 = Fs.FGOS.new() var soc_unicast: Socket var soc_brodcast: Socket var ip_address_yau: String = Constants.ADDRESSES[0][1] @@ -21,6 +21,7 @@ var ip_fs_1: String = Constants.ADDRESSES[0][4] var peerstream_fs_1: PacketPeer var state_fs = Constants.STATE.IDLE var command_stack: Array +var counter_fs_1: int = 0 ## 2 ФС var client_fs_2: StreamPeer @@ -28,6 +29,7 @@ var ip_fs_2: String = Constants.ADDRESSES[0][5] var peerstream_fs_2: PacketPeer var state_fs_2 = Constants.STATE.IDLE var command_stack_2: Array +var counter_fs_2: int = 0 # Яу-07б signal yau_status_line(_status) ## Вызывается когда меняется состояние связи с ячейкой @@ -82,11 +84,16 @@ func poll_receive_fs(client: StreamPeerTCP, peerstream: PacketPeer, ip_fs: Strin 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_1", rx_data) - #emit_signal("data_from_fs_2", rx_data) - emit_signal("port_fs_opened_1", ip_fs) - if state_fs == Constants.STATE.SEND: - state_fs = Constants.STATE.DONE + if client == client_fs_1: + emit_signal("data_from_fs_1", rx_data) + emit_signal("port_fs_opened_1", ip_fs) + if state_fs == Constants.STATE.SEND: + state_fs = Constants.STATE.DONE + elif client == client_fs_2: + emit_signal("data_from_fs_2", rx_data) + emit_signal("port_fs_opened_2", ip_fs) + if state_fs_2 == Constants.STATE.SEND: + state_fs_2 = Constants.STATE.DONE func _ready() -> void: @@ -103,7 +110,7 @@ func _ready() -> void: unit.connect('line_changed', Callable(self, 'on_line_changed')) unit.connect('command_fail', Callable(self, 'on_command_fail')) - #connect_fs_1() + connect_fs_1() connect_fs_2() read_port_isa([0x106, 0x108]) @@ -115,16 +122,16 @@ func _process(delta: float) -> void: if client_fs_1: poll_receive_fs(client_fs_1, peerstream_fs_1, ip_fs_1) + state_machine_fs() if client_fs_2: - poll_receive_fs_2(client_fs_2, peerstream_fs_2, ip_fs_2) + poll_receive_fs(client_fs_2, peerstream_fs_2, ip_fs_2) + state_machine_fs_2() poll_receive_yau07(soc_brodcast) poll_receive_yau07(soc_unicast) state_machine_yau07() - #state_machine_fs() - state_machine_fs_2() - + match unit.process(delta): Error.OK: soc_unicast.send_to(ip_address_yau, ip_port_yau, unit.tx_data.slice(0, unit.tx_len)) Error.FAILED: print_debug('Ошибка отправки данных') @@ -182,18 +189,24 @@ func on_command_change_device(meta_device): ip_fs_1 = meta_device[3] ip_fs_2 = meta_device[4] #ip_fs_3 = meta_device[5] - #connect_fs_1() - connect_fs_2() + connect_fs_1() + #connect_fs_2() func state_machine_fs(): + ## State fs machine if client_fs_1: - ## State fs machine if (state_fs == Constants.STATE.IDLE) or (state_fs == Constants.STATE.DONE): if command_stack: var pack: Array = command_stack.pop_front() - send_fs_data_1(pack) + unit_fs_1.send_fs_data(pack, client_fs_1, peerstream_fs_1) state_fs = Constants.STATE.SEND + if client_fs_2: + if (state_fs_2 == Constants.STATE.IDLE) or (state_fs_2 == Constants.STATE.DONE): + if command_stack_2: + var pack: Array = command_stack_2.pop_front() + unit_fs_1.send_fs_data(pack, client_fs_2, peerstream_fs_2) + state_fs_2 = Constants.STATE.SEND # Подключится к модулю ФС @@ -210,43 +223,52 @@ func connect_fs_1(): peerstream_fs_1.set_stream_peer(client_fs_1) -# Отправить команду для ФС -func send_fs_data_1(data_to_sand: PackedByteArray): - if client_fs_1.get_status() == 2: - var peer = peerstream_fs_1.get_stream_peer() - if peer: - peer.put_data(data_to_sand) - emit_signal("data_send") - - # Разорвать соединение с ФС func disconnect_fs(client_for_leave): client_for_leave.disconnect_from_host() state_fs = Constants.STATE.IDLE command_stack = [] -# -#func start_work_fs(): - #unit_fs_1.start_session() - #unit_fs_1.base_get_current_temp() -# -# -#func get_fs_gen_status(state_gen): - #unit_fs_1.set_gen_state(state_gen) - #unit_fs_1.get_gen_state() - #unit_fs_1.base_get_current_temp() -# -# -#func set_fs_ferq_carrier(freq: int): - #unit_fs_1.set_carrier(freq) - #unit_fs_1.base_get_current_temp() - #unit_fs_1.get_carrier() -# -# -#func set_fs_attenuation(attenuation: float): - #unit_fs_1.set_att_batch(attenuation) - #unit_fs_1.get_att_batch() - #unit_fs_1.base_get_current_temp() + +func start_work_fs(): + counter_fs_1 = 0 + unit_fs_1.start_session(counter_fs_1) + counter_fs_1 += 1 + unit_fs_1.get_gen_state(counter_fs_1) + counter_fs_1 += 1 + unit_fs_1.get_att_batch(counter_fs_1) + counter_fs_1 += 1 + unit_fs_1.get_carrier(counter_fs_1) + counter_fs_1 += 1 + unit_fs_1.base_get_current_temp(counter_fs_1) + counter_fs_1 += 1 + + +func get_fs_gen_status(state_gen): + unit_fs_1.set_gen_state(state_gen, counter_fs_1) + counter_fs_1 += 1 + unit_fs_1.get_gen_state(counter_fs_1) + counter_fs_1 += 1 + unit_fs_1.base_get_current_temp(counter_fs_1) + counter_fs_1 += 1 + + +func set_fs_ferq_carrier(freq: int): + unit_fs_1.set_carrier(freq, counter_fs_1) + counter_fs_1 += 1 + unit_fs_1.base_get_current_temp(counter_fs_1) + counter_fs_1 += 1 + unit_fs_1.get_carrier(counter_fs_1) + counter_fs_1 += 1 + + +func set_fs_attenuation(attenuation: float): + unit_fs_1.set_att_batch(attenuation, counter_fs_1) + counter_fs_1 += 1 + unit_fs_1.get_att_batch(counter_fs_1) + counter_fs_1 += 1 + unit_fs_1.base_get_current_temp(counter_fs_1) + counter_fs_1 += 1 ## 2 ФС коннект @@ -289,45 +311,25 @@ func state_machine_fs_2(): state_fs_2 = Constants.STATE.SEND -func poll_receive_fs_2(client: StreamPeerTCP, peerstream: PacketPeer, ip_fs: String): - client.poll() - var peer = peerstream.get_stream_peer() - # Проверяем, существует ли соединение - if not peer: - emit_signal("port_error", ip_fs) - return - # Проверяем состояние подключения - if client.get_status() != StreamPeerTCP.STATUS_CONNECTED: - emit_signal("port_closed", ip_fs) - 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_fs_opened_2", ip_fs) - if state_fs_2 == Constants.STATE.SEND: - state_fs_2 = Constants.STATE.DONE - - -func start_work_fs_2(): - unit_fs_2.start_session() - unit_fs_2.base_get_current_temp() - - -func get_fs_gen_status_2(state_gen): - unit_fs_2.set_gen_state(state_gen) - unit_fs_2.get_gen_state() - unit_fs_2.base_get_current_temp() - - -func set_fs_ferq_carrier_2(freq: int): - unit_fs_2.set_carrier(freq) - unit_fs_2.base_get_current_temp() - unit_fs_2.get_carrier() - - -func set_fs_attenuation_2(attenuation: float): - unit_fs_2.set_att_batch(attenuation) - unit_fs_2.get_att_batch() - unit_fs_2.base_get_current_temp() +# +#func start_work_fs_2(): + #unit_fs_2.start_session() + #unit_fs_2.base_get_current_temp() +# +# +#func get_fs_gen_status_2(state_gen): + #unit_fs_2.set_gen_state(state_gen) + #unit_fs_2.get_gen_state() + #unit_fs_2.base_get_current_temp() +# +# +#func set_fs_ferq_carrier_2(freq: int): + #unit_fs_2.set_carrier(freq) + #unit_fs_2.base_get_current_temp() + #unit_fs_2.get_carrier() +# +# +#func set_fs_attenuation_2(attenuation: float): + #unit_fs_2.set_att_batch(attenuation) + #unit_fs_2.get_att_batch() + #unit_fs_2.base_get_current_temp()