diff --git a/.gitignore b/.gitignore index f0b60c9e..75dd3518 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ mono_crash.*.json # Godot 4+ specific ignores .godot/ + +addons/ diff --git a/main.tscn b/main.tscn index aac142d9..3ad27386 100644 --- a/main.tscn +++ b/main.tscn @@ -1,20 +1,20 @@ [gd_scene load_steps=3 format=3 uid="uid://cu3e03by7d61j"] -[ext_resource type="PackedScene" uid="uid://3slb0i3pvowc" path="res://scenes/tab_switch.tscn" id="1_5w5c6"] -[ext_resource type="PackedScene" uid="uid://w6ta0ck1bedl" path="res://scenes/wnd_stc.tscn" id="2_ed2vr"] +[ext_resource type="PackedScene" uid="uid://3slb0i3pvowc" path="res://scenes/tab_switch.tscn" id="1_uwy4p"] +[ext_resource type="PackedScene" uid="uid://w6ta0ck1bedl" path="res://scenes/wnd_stc.tscn" id="2_jab5i"] [node name="main" type="Control"] layout_mode = 3 anchors_preset = 0 -offset_top = -55.0 offset_right = 1600.0 -offset_bottom = 1145.0 +offset_bottom = 1200.0 -[node name="tab_switch" parent="." instance=ExtResource("1_5w5c6")] +[node name="tab_switch" parent="." instance=ExtResource("1_uwy4p")] layout_mode = 0 -offset_left = 3.0 -offset_top = 55.0 -offset_right = 1603.0 -offset_bottom = 1257.0 +offset_top = 0.0 +offset_bottom = 1200.0 +all_tabs_in_front = true +metadata/_edit_lock_ = true -[node name="wnd_stc" parent="." instance=ExtResource("2_ed2vr")] +[node name="wnd_stc" parent="." instance=ExtResource("2_jab5i")] +visible = false diff --git a/project.godot b/project.godot index 5c995f94..41a4f912 100644 --- a/project.godot +++ b/project.godot @@ -19,6 +19,16 @@ boot_splash/fullsize=false boot_splash/use_filter=false config/icon="res://data/icon.png" +[autoload] + +Tools="*res://scenes/tools.gd" +REPSettings="*res://scenes/repsettings.gd" +REPNetwork="*res://scenes/repnetwork.gd" +yau07="*res://scenes/yau07.gd" +Log="*res://addons/godot-logger/scripts/logger.gd" +Table="*res://table/table.gd" +Bip="*res://scenes/bip.tscn" + [debug] file_logging/enable_file_logging=true @@ -29,6 +39,7 @@ window/size/viewport_width=1600 window/size/viewport_height=1200 window/size/mode=3 window/subwindows/embed_subwindows=false +window/stretch/mode="viewport" window/vsync/vsync_mode=false [editor] @@ -37,14 +48,15 @@ version_control/autoload_on_startup=true [editor_plugins] -enabled=PackedStringArray() +enabled=PackedStringArray("res://addons/godot-logger/plugin.cfg") [gui] common/text_edit_undo_stack_max_size=10 -theme/custom_font="res://data/main-font.tres" +theme/custom_font="res://data/secondary-font.tres" theme/default_font_antialiasing=0 theme/default_font_hinting=2 +theme/default_font_subpixel_positioning=0 theme/lcd_subpixel_layout=0 common/drop_mouse_on_gui_input_disabled=true @@ -65,7 +77,6 @@ common/enable_object_picking=false [rendering] -renderer/rendering_method="gl_compatibility" gl_compatibility/item_buffer_size=8192 shader_compiler/shader_cache/strip_debug=true textures/default_filters/anisotropic_filtering_level=0 diff --git a/scenes/Sector.tscn b/scenes/Sector.tscn index 6b1913f5..6e7d6b97 100644 --- a/scenes/Sector.tscn +++ b/scenes/Sector.tscn @@ -1,17 +1,17 @@ [gd_scene load_steps=4 format=3 uid="uid://c73ahpv8uiuc7"] -[ext_resource type="Shader" path="res://shaders/sector.gdshader" id="1_7cn72"] +[ext_resource type="Shader" path="res://shaders/sector.gdshader" id="1_aikdh"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_xo5or"] resource_local_to_scene = true -shader = ExtResource("1_7cn72") +shader = ExtResource("1_aikdh") shader_parameter/color = Color(1, 1, 1, 0.168627) shader_parameter/clip_color = Color(1, 0.5, 0.5, 1) shader_parameter/width = 45.0 -shader_parameter/band = 0.04 -shader_parameter/radius = 0.06 +shader_parameter/band = 0.02 +shader_parameter/radius = 0.08 shader_parameter/dir = 0.0 -shader_parameter/inner_clip = 0.02 +shader_parameter/inner_clip = 0.045 [sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_2lkm8"] diff --git a/scenes/bip.tscn b/scenes/bip.tscn index 8e61a0b6..ec38fa03 100644 --- a/scenes/bip.tscn +++ b/scenes/bip.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=5 format=3 uid="uid://cfk41dnfbr0wx"] -[ext_resource type="Shader" path="res://shaders/bip.gdshader" id="1_xb37i"] +[ext_resource type="Shader" path="res://shaders/bip.gdshader" id="1_k6vue"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_2dulj"] -shader = ExtResource("1_xb37i") -shader_parameter/color = Color(1, 1, 1, 1) +shader = ExtResource("1_k6vue") +shader_parameter/color = Color(0.666667, 0.690196, 0.807843, 1) [sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_tgf76"] diff --git a/scenes/button-flat.tscn b/scenes/button-flat.tscn deleted file mode 100644 index a0eb6d2f..00000000 --- a/scenes/button-flat.tscn +++ /dev/null @@ -1,49 +0,0 @@ -[gd_scene load_steps=9 format=3 uid="uid://da7w3vkhadfwe"] - -[ext_resource type="Script" path="res://scenes/nine-patch-button.gd" id="1_wo7pi"] -[ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="2_r8bpq"] - -[sub_resource type="StyleBoxEmpty" id="1"] - -[sub_resource type="StyleBoxEmpty" id="6"] - -[sub_resource type="StyleBoxEmpty" id="2"] - -[sub_resource type="StyleBoxEmpty" id="3"] - -[sub_resource type="StyleBoxEmpty" id="5"] - -[sub_resource type="StyleBoxEmpty" id="4"] - -[node name="container" type="PanelContainer"] -offset_right = 30.0 -offset_bottom = 30.0 -theme_override_styles/panel = SubResource("1") -script = ExtResource("1_wo7pi") -toggle_mode = true - -[node name="state" type="NinePatchRect" parent="."] -show_behind_parent = true -layout_mode = 2 -texture = ExtResource("2_r8bpq") -patch_margin_left = 10 -patch_margin_top = 10 -patch_margin_right = 10 -patch_margin_bottom = 10 -axis_stretch_horizontal = 1 -axis_stretch_vertical = 1 - -[node name="button" type="Button" parent="."] -layout_mode = 2 -theme_override_styles/normal = SubResource("6") -theme_override_styles/hover = SubResource("2") -theme_override_styles/pressed = SubResource("3") -theme_override_styles/disabled = SubResource("5") -theme_override_styles/focus = SubResource("4") -toggle_mode = true -clip_text = true - -[node name="label" type="Label" parent="."] -layout_mode = 2 - -[connection signal="toggled" from="button" to="." method="_on_button_toggled"] diff --git a/scenes/canvas.gd b/scenes/canvas.gd index 37bd620c..6ad2118e 100644 --- a/scenes/canvas.gd +++ b/scenes/canvas.gd @@ -6,12 +6,13 @@ func set_strob_color(val: Color): $строб.material.set('shader_parameter/col func set_strob_width(val: float): $строб.material.set('shader_parameter/width', val) func set_strob_band(val: float): $строб.material.set('shader_parameter/band', val / 125.0) func set_strob_radius(val: float): $строб.material.set('shader_parameter/radius', sv(val)) +func set_strob_center(val: Vector2): $строб.position = val -func get_center() -> Vector2: return $строб.position +func get_strob_center() -> Vector2: return $строб.position func get_strob_visible() -> bool: return $строб.visible func get_strob_width() -> float: return $строб.material.get('shader_parameter/width') func get_strob_band() -> float: return $строб.material.get('shader_parameter/band') * 125.0 func get_strob_radius(val: float): return $строб.material.set('shader_parameter/radius', sv(val)) -func get_radius_max(): return $"строб".scale.x / 2.0 +func get_radius_max(): return $строб.scale.x / 2.0 -func sv(val: float) -> float: return val / ($"строб".scale.x / 2.0) * 0.125 +func sv(val: float) -> float: return val / ($строб.scale.x / 2.0) * 0.125 diff --git a/scenes/canvas.tscn b/scenes/canvas.tscn index f1aca90c..ab82700c 100644 --- a/scenes/canvas.tscn +++ b/scenes/canvas.tscn @@ -1,17 +1,16 @@ -[gd_scene load_steps=8 format=3 uid="uid://b5kjdyxuwsot5"] +[gd_scene load_steps=7 format=3 uid="uid://b5kjdyxuwsot5"] -[ext_resource type="Material" uid="uid://s6xe8igevnv2" path="res://shaders/shader_edu.tres" id="1_uio4c"] -[ext_resource type="Script" path="res://scenes/canvas.gd" id="2_6bpru"] -[ext_resource type="Texture2D" uid="uid://b8ern67qnb5ky" path="res://data/кораблик-22800.png" id="3_bw5j0"] -[ext_resource type="PackedScene" uid="uid://c73ahpv8uiuc7" path="res://scenes/Sector.tscn" id="4_ev5xv"] -[ext_resource type="Shader" path="res://shaders/sector.gdshader" id="5_210ft"] +[ext_resource type="Material" uid="uid://s6xe8igevnv2" path="res://shaders/shader_edu.tres" id="1_uxbga"] +[ext_resource type="Script" path="res://scenes/canvas.gd" id="2_vkwmy"] +[ext_resource type="PackedScene" uid="uid://c73ahpv8uiuc7" path="res://scenes/Sector.tscn" id="3_uhdvc"] +[ext_resource type="Shader" path="res://shaders/sector.gdshader" id="4_gb4a1"] [sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_2bft1"] size = Vector2(1600, 1200) -[sub_resource type="ShaderMaterial" id="ShaderMaterial_c08th"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_hwrhs"] resource_local_to_scene = true -shader = ExtResource("5_210ft") +shader = ExtResource("4_gb4a1") shader_parameter/color = Color(1, 1, 1, 0.168627) shader_parameter/clip_color = Color(1, 0.5, 0.5, 1) shader_parameter/width = 45.0 @@ -21,15 +20,12 @@ shader_parameter/dir = 0.08 shader_parameter/inner_clip = 0.045 [node name="canvas" type="Sprite2D"] -material = ExtResource("1_uio4c") +material = ExtResource("1_uxbga") texture = SubResource("PlaceholderTexture2D_2bft1") centered = false -script = ExtResource("2_6bpru") +script = ExtResource("2_vkwmy") -[node name="строб" parent="." instance=ExtResource("4_ev5xv")] -material = SubResource("ShaderMaterial_c08th") +[node name="строб" parent="." instance=ExtResource("3_uhdvc")] +material = SubResource("ShaderMaterial_hwrhs") +position = Vector2(560, 560) scale = Vector2(1100, 1100) - -[node name="кораблик" type="Sprite2D" parent="строб"] -scale = Vector2(0.000181818, 0.000181818) -texture = ExtResource("3_bw5j0") diff --git a/scenes/frame.tscn b/scenes/frame.tscn index 73d5cb7f..0c12613f 100644 --- a/scenes/frame.tscn +++ b/scenes/frame.tscn @@ -1,17 +1,17 @@ [gd_scene load_steps=3 format=3 uid="uid://bq7haw1ypiv48"] -[ext_resource type="Texture2D" uid="uid://cs6i1xwx0pmdk" path="res://data/рамка-панели.png" id="1_s1rm1"] -[ext_resource type="Script" path="res://scenes/рамка.gd" id="2_pjc2i"] +[ext_resource type="Texture2D" uid="uid://cs6i1xwx0pmdk" path="res://data/рамка-панели.png" id="1_o7lya"] +[ext_resource type="Script" path="res://scenes/рамка.gd" id="2_7mns1"] [node name="ramka" type="NinePatchRect"] offset_right = 150.0 offset_bottom = 100.0 -texture = ExtResource("1_s1rm1") +texture = ExtResource("1_o7lya") patch_margin_left = 15 patch_margin_top = 30 patch_margin_right = 15 patch_margin_bottom = 10 -script = ExtResource("2_pjc2i") +script = ExtResource("2_7mns1") [node name="header" type="Label" parent="."] clip_contents = true diff --git a/scenes/node.tscn b/scenes/node.tscn deleted file mode 100644 index 2b1843fd..00000000 --- a/scenes/node.tscn +++ /dev/null @@ -1,4 +0,0 @@ -[gd_scene format=3 uid="uid://fp6utm5jmlj2"] - -[node name="Label" type="Label"] -clip_text = true diff --git a/scenes/repsettings.gd b/scenes/repsettings.gd new file mode 100644 index 00000000..fe1d208a --- /dev/null +++ b/scenes/repsettings.gd @@ -0,0 +1,18 @@ +extends Node + +@export var addr: Dictionary = { \ + 'уареп-пульт': ['udp', '10.1.1.160', 50160, 'IP-адрес ЯУ-07 прибора УФ'], + 'уареп-эмс': ['udp', '10.1.1.27', 50027, 'IP-адрес ЯУ-07 прибора УФ'], + 'уареп-яу07-2в': ['yau07', '10.1.1.34', 50034, 'IP-адрес ЯУ-07 прибора ПРД-В'], + 'уареп-яу07-2н': ['yau07', '10.1.1.33', 50033, 'IP-адрес ЯУ-07 прибора ПРД-Н'], + 'уареп-яу07-2к': ['yau07', '10.1.1.35', 50035, 'IP-адрес ЯУ-07 прибора ПРД-К'], + 'уареп-яу07-4в': ['yau07', '10.1.1.66', 50066, 'IP-адрес ЯУ-07 прибора ПРД-В'], + 'уареп-яу07-4н': ['yau07', '10.1.1.65', 50065, 'IP-адрес ЯУ-07 прибора ПРД-Н'], + 'уареп-яу07-4к': ['yau07', '10.1.1.67', 50067, 'IP-адрес ЯУ-07 прибора ПРД-К'], + 'уареп-яу07-1в': ['yau07', '10.1.1.18', 50018, 'IP-адрес ЯУ-07 прибора ПРД-В'], + 'уареп-яу07-1н': ['yau07', '10.1.1.17', 50017, 'IP-адрес ЯУ-07 прибора ПРД-Н'], + 'уареп-яу07-1к': ['yau07', '10.1.1.19', 50019, 'IP-адрес ЯУ-07 прибора ПРД-К'], + 'уареп-яу07-3в': ['yau07', '10.1.1.50', 50050, 'IP-адрес ЯУ-07 прибора ПРД-В'], + 'уареп-яу07-3н': ['yau07', '10.1.1.49', 50049, 'IP-адрес ЯУ-07 прибора ПРД-Н'], + 'уареп-яу07-3к': ['yau07', '10.1.1.51', 50051, 'IP-адрес ЯУ-07 прибора ПРД-Н'], + 'уареп-щ3': ['uart', '/dev/stty0', 115200, 1, 1, false, 10, 'Прибор Щ3 (скорость, стартовых, стоповых, чётность, таймаут)'] } diff --git a/scenes/selector.tscn b/scenes/selector.tscn deleted file mode 100644 index dfbfcca3..00000000 --- a/scenes/selector.tscn +++ /dev/null @@ -1,10 +0,0 @@ -[gd_scene format=3 uid="uid://dhdiy3lgtt8v3"] - -[node name="NinePatchRect" type="NinePatchRect"] -draw_center = false -patch_margin_left = 8 -patch_margin_top = 8 -patch_margin_right = 8 -patch_margin_bottom = 8 -axis_stretch_horizontal = 1 -axis_stretch_vertical = 1 diff --git a/scenes/tab_switch.tscn b/scenes/tab_switch.tscn index b0156305..02dad409 100644 --- a/scenes/tab_switch.tscn +++ b/scenes/tab_switch.tscn @@ -1,15 +1,21 @@ -[gd_scene load_steps=3 format=3 uid="uid://3slb0i3pvowc"] +[gd_scene load_steps=4 format=3 uid="uid://3slb0i3pvowc"] -[ext_resource type="PackedScene" uid="uid://b276iygic5itk" path="res://scenes/работа.tscn" id="1_jj8aj"] -[ext_resource type="PackedScene" uid="uid://lwmw4egynmd1" path="res://scenes/контроль.tscn" id="2_2hl1n"] +[ext_resource type="PackedScene" uid="uid://b276iygic5itk" path="res://scenes/работа.tscn" id="1_uow82"] +[ext_resource type="PackedScene" uid="uid://lwmw4egynmd1" path="res://scenes/контроль.tscn" id="2_83m7a"] +[ext_resource type="PackedScene" uid="uid://trt0q8th3bn2" path="res://scenes/журнал.tscn" id="3_hgnup"] [node name="tab_switch" type="TabContainer"] +offset_top = -25.0 offset_right = 1600.0 -offset_bottom = 1200.0 +offset_bottom = 1175.0 -[node name="работа" parent="." instance=ExtResource("1_jj8aj")] +[node name="работа" parent="." instance=ExtResource("1_uow82")] layout_mode = 2 -[node name="контроль" parent="." instance=ExtResource("2_2hl1n")] +[node name="контроль" parent="." instance=ExtResource("2_83m7a")] +visible = false +layout_mode = 2 + +[node name="журнал" parent="." instance=ExtResource("3_hgnup")] visible = false layout_mode = 2 diff --git a/scenes/table.gd b/scenes/table.gd deleted file mode 100644 index 2e26523d..00000000 --- a/scenes/table.gd +++ /dev/null @@ -1,509 +0,0 @@ -extends GridContainer - -@export var _selector_color: Color = Color(1.0, 1.0, 1.0, 1.0) -@export_file ('*.tscn') var node_type_file: String = 'res://scenes/node.tscn' -@export_file ('*.tscn') var selector_type_file: String = 'res://scenes/selector.tscn' - -const MAX_INDEX = 99 # Максимальное значение индекса для колонки и строки. Связано с форматом индекса ключа -const INDEX_FORMAT = '%02d_%02d' # Формат индекса -const NODE_PREFIX = 'NODE_' # Префикс ключа ячейки таблицы -const HEAD_PREFIX = 'HEAD_' # Префикс ключа заголовка таблицы -const DATA_PREFIX = 'DATA_' # Префикс ключа данных ячейки таблицы -const CONN_PREFIX = 'CONN_' # Префикс ключа обработчиков событий ячейки таблицы -const SLCT_PREFIX = 'SLCT_' # Префикс ключа индикатора выбранного ряда таблицы - -const NODE_KEY_FORMAT = NODE_PREFIX + INDEX_FORMAT -const HEAD_KEY_FORMAT = HEAD_PREFIX + INDEX_FORMAT -const DATA_KEY_FORMAT = DATA_PREFIX + INDEX_FORMAT -const CONNECTED_KEY_FORMAT = CONN_PREFIX + INDEX_FORMAT -const ROW_SELECTOR_KEY_FORMAT = SLCT_PREFIX + INDEX_FORMAT - -const SLCT_KEY_UP = KEY_UP # Клавиша уменьшения индекса выбранного ряда -const SLCT_KEY_DOWN = KEY_DOWN # Клавиша увеличения индекса выбранного ряда - -var nodes: = {} # Все ячейки таблицы и дополнительные элементы -var selector_color_proc: Callable # Ссылка на процедуру генератора цвета индикатора выбранного ряда -var selector_size_proc: Callable # Ссылка на процедуру генератора размера индикатора выбранного ряда -var ScnSelector: PackedScene # Прототип индикатора выбранного ряда -var ScnNode: PackedScene # Прототип ячейки таблицы -var in_focus: = false # Фокус пользовательского ввода -var header: GridContainer # Заголовок таблицы - -signal row_pressed(i_row) # Вызывается при нажатии кнопкой мыши на строку -signal selected_changed(i_row) # Вызывается при изменении выбранного ряда. i_row - текущий выбранный ряд - - -func selector_up(): - var i_rows: = [] - get_selected_rows(i_rows) - for i in i_rows: - set_row_selected(i, false) - var rows_count: = get_rows_count() - if not (i_rows.size() and (rows_count > 1)): - return - var i_row = i_rows[0] - i_row -= 1 - if i_row < 0: - i_row = rows_count - 1 - set_row_selected(i_row, true) - emit_signal('selected_changed', i_row) - - -func selector_down(): - var i_rows: = [] - get_selected_rows(i_rows) - for i in i_rows: - set_row_selected(i, false) - var rows_count: = get_rows_count() - if not (i_rows.size() and (rows_count > 1)): - return - var i_row = i_rows[0] - i_row += 1 - i_row %= rows_count - set_row_selected(i_row, true) - emit_signal('selected_changed', i_row) - - -func set_columns_alignments(alignments): - assert(columns == alignments.size()) - var rows_count: = get_rows_count() - for i_row in rows_count: - for i_col in alignments.size(): - set_node_alligment(i_col, i_row, alignments[i_col]) - - -func _ready(): - ScnSelector = load(selector_type_file) - ScnNode = load(node_type_file) - assert(ScnSelector) - assert(ScnNode) - - -func align_to_left_bottom(header, gap: = Vector2(0, 0)): - """ Выравнивает по нижнему левому углу. Используется для выравнивания по заголовку """ - position.x = header.position.x + gap.x - position.y = header.position.y + header.rect_size.y + gap.y - - -func _assert_meta(i_col: int, i_row: int, pname: String, node): - assert(node.has_meta(pname), 'ошибка: нет мета-свойства \"%s\" у ячейки (%s): колонка:%d ряд:%d' % [pname, typeof(node), i_col, i_row]) - - -func set_node_meta(i_col: int, i_row: int, pname: String, val) -> void: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - var node = nodes[key] - node.set_meta(pname, val) - - -func get_node_meta(i_col: int, i_row: int, pname: String): - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - var node = nodes[key] - _assert_meta(i_col, i_row, pname, node) - return node.get_meta(pname) - - -func set_node_property(i_col: int, i_row: int, pname: String, val) -> void: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - var node = nodes[key] - node.set(pname, val) - - -func get_node_property(i_col: int, i_row: int, pname: String): - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - var node = nodes[key] - return node.get(pname) - - -func get_node_key(format: String, i_col: int, i_row: int) -> String: - var key: String = format % [i_row, i_col] - assert(nodes.has(key), 'ошибка: нет такой ячейки: колонка:%d ряд:%d' % [i_col, i_row]) - return key - - -func get_key_indexes(key: String) -> Array: - var tokens: = key.split('_') - assert(tokens.size() == 3, 'ошибка: неверный ключ: \"%s\"' % key) - return [int(tokens[2]), int(tokens[1])] - - -func set_columns_min_size(sizes: Array) -> void: - var rows_count: = get_rows_count() - for i_row in rows_count: - set_nodes_min_size(i_row, sizes) - set_nodes_min_size(0, sizes, HEAD_KEY_FORMAT) - - -func set_columns_aligment(alignments: Array) -> void: - var rows_count: = get_rows_count() - for i_row in rows_count: - for i_col in alignments.size(): - set_node_alligment(i_col, i_row, alignments[i_col]) - - -func _input(event) -> void: - if event is InputEventKey: - if in_focus and event.pressed: - if event.scancode == SLCT_KEY_UP: - selector_up() - elif event.scancode == SLCT_KEY_DOWN: - selector_down() - elif event is InputEventMouseButton: - if not event.pressed: - return - if (event.position.x < position.x) \ - or (event.position.x > (position.x + size.x)) \ - or (event.position.y < position.y) \ - or (event.position.y > (position.y + size.y)): - in_focus = false - emit_signal('focus_exited') - return - var rows_count: = get_rows_count() - in_focus = true - emit_signal('focus_entered') - for i_row in rows_count: - var rect = [0, 0, 0, 0] - get_node_rect(0, i_row, rect) - var y = rect[1] + position.y - if event.position.y < y: - continue - if event.position.y > (y + rect[3]): - continue - emit_signal('row_pressed', i_row) - break - - -func _init() -> void: - selector_color_proc = Callable(self, 'default_selector_color_proc') - assert(selector_color_proc.is_valid()) - selector_size_proc = Callable(self, 'default_selector_size_proc') - assert(selector_size_proc.is_valid()) - - -func default_selector_color_proc(i_row: int): - return _selector_color - - -func set_selector_color_proc(instance: Object, function: String) -> void: - selector_color_proc = Callable(instance, function) - assert(selector_color_proc.is_valid()) - - -func set_selector_size_proc(instance: Object, function: String) -> void: - selector_size_proc = Callable(instance, function) - assert(selector_size_proc.is_valid()) - - -func default_selector_size_proc(i_row: int, rect: Array) -> void: - get_node_rect(0, i_row, rect) - rect[0] = rect[0] + position.x - 1 - rect[1] = rect[1] + position.y - 4 - rect[2] = size.x + 2 - rect[3] = rect[3] + 8 - - -func clear_rows_selected(): - var rows_count: = get_rows_count() - for i_row in rows_count: - set_row_selected(i_row, false) - - -func set_row_selected(i_row: int, selected: bool = true) -> void: - var key: = ROW_SELECTOR_KEY_FORMAT % [i_row, 0] - var parent = get_parent() - if nodes.has(key) and (not selected): - var selector = nodes[key] - parent.remove_child(selector) - selector.queue_free() - nodes.erase(key) - elif (not nodes.has(key)) and selected: - var selector = ScnSelector.instantiate() - var rect: = [0, 0, 0, 0] - selector_size_proc.call(i_row, rect) - selector.rect_position.x = rect[0] - selector.rect_position.y = rect[1] - selector.rect_size.x = rect[2] - selector.rect_size.y = rect[3] - selector.modulate = selector_color_proc.call(i_row) - nodes[key] = selector - parent.add_child(selector) - - -func is_row_selected(i_row: int) -> bool: - var key: = get_node_key(ROW_SELECTOR_KEY_FORMAT, 0, i_row) - return nodes.has(key) - - -func get_selected_rows(rows: Array) -> void: - for key in nodes.keys(): - if SLCT_PREFIX in key: - var indexes = get_key_indexes(key) - rows.append(indexes[1]) - - -func get_rows_count() -> int: - var rows_count: int = 0 - for key in nodes: - rows_count += int(NODE_PREFIX in key) - return rows_count / columns - - -func get_node2(i_col: int, i_row: int) -> Node: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - return nodes[key] - - -func set_node_user_data(i_col: int, i_row: int, user_data: Object) -> void: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - nodes[key] = user_data - - -func add_row(row_types: Array) -> void: - assert(row_types.size() < MAX_INDEX, 'ошибка: слишком много колонок, больше %d' % (MAX_INDEX + 1)) - if columns == 1: - set_columns(row_types.size()) - else: - assert(columns == row_types.size(), 'ошибка: %s количество колонок установлено ранее - %d, но требуется %d' % [self, columns, row_types.size()]) - var rows_count: int = get_rows_count() - assert(rows_count < MAX_INDEX, 'ошибка: слишком много рядов, больше %d' % (MAX_INDEX + 1)) - for i_col in columns: - var node = row_types[i_col].instantiate() - var key: String = NODE_KEY_FORMAT % [rows_count, i_col] - node.name = key - add_child(node) - nodes[key] = node - - -func set_header(header_types: Array): - assert(header_types.size() < MAX_INDEX, 'ошибка: слишком много колонок, больше %d' % (MAX_INDEX + 1)) - if columns == 1: - set_columns(header_types.size()) - else: - assert(columns == header_types.size()) - var do_adj: = false - if not header: - header = GridContainer.new() - header.position = position - header.columns = header_types.size() - header.size.x = size.x - var parent = get_parent() - parent.add_child(header) - do_adj = true - else: - var nodes = header.get_children() - for node in nodes: - nodes.erase(node.name) - header.remove_child(node) - node.queue_free() - for i_col in columns: - var node = header_types[i_col].instantiate() - var key: String = HEAD_KEY_FORMAT % [0, i_col] - node.name = key - nodes[key] = node - header.add_child(node) - if do_adj: - var rect = [0, 0, 0, 0] - get_node_rect(0, 0, rect, HEAD_KEY_FORMAT) - position.y += rect[3] - - -func set_header_text(headers: Array): - assert(columns == headers.size()) - set_row_text(0, headers, 0, HEAD_KEY_FORMAT) - - -func get_node_user_data(i_col: int, i_row: int) -> Object: - var key: = get_node_key(DATA_KEY_FORMAT, i_col, i_row) - return nodes[key] - - -func remove_row(i_row: int): - var sel_key: String = ROW_SELECTOR_KEY_FORMAT % [i_row, 0] - if nodes.has(sel_key): - var selector = nodes[sel_key] - get_parent().remove_child(selector) - selector.queue_free() - nodes.erase(sel_key) - for i_col in columns: - var node_key: String = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - var conn_key: String = CONNECTED_KEY_FORMAT % [i_row, i_col] - var data_key: String = DATA_KEY_FORMAT % [i_row, i_col] - var node = nodes[node_key] - nodes.erase(node_key) - remove_child(node) - node.queue_free() - - if nodes.has(data_key): - nodes.erase(data_key) - if nodes.has(conn_key): - var conn = nodes[conn_key] - var callback = conn[0] - var dest_node = conn[1] - node.disconnect('pressed', dest_node, callback) - nodes.erase(conn_key) - - -func rehash(swaps: Array): - """ Переназначает ключи в соответствии с размерами таблицы. - После вызова swaps содержит массив пар [<прежний ключ>, <текущий ключ>] """ - assert(not swaps.size(), 'ошибка: swaps не пустой') - var nodes_copy: = {} - var i_col: = 0 - var i_row: = 0 - for key0 in nodes: - if NODE_PREFIX in key0: - var node_key1: String = NODE_KEY_FORMAT % [i_row, i_col] - nodes_copy[node_key1] = nodes[key0] - swaps.append([key0, node_key1]) - - var indxs = get_key_indexes(key0) - - var slct_key0: String = ROW_SELECTOR_KEY_FORMAT % [indxs[1], indxs[0]] - if nodes.has(slct_key0): - var slct_key1: String = ROW_SELECTOR_KEY_FORMAT % [i_row, i_col] - nodes_copy[slct_key1] = nodes[slct_key0] - swaps.append([slct_key0, slct_key1]) - - var conn_key0: String = CONNECTED_KEY_FORMAT % [indxs[1], indxs[0]] - if nodes.has(conn_key0): - var conn_key1: String = CONNECTED_KEY_FORMAT % [i_row, i_col] - nodes_copy[conn_key1] = nodes[conn_key0] - swaps.append([conn_key0, conn_key1]) - - var data_key0: String = DATA_KEY_FORMAT % [indxs[1], indxs[0]] - if nodes.has(data_key0): - var data_key1: String = DATA_KEY_FORMAT % [i_row, i_col] - nodes_copy[data_key1] = nodes[data_key0] - swaps.append([data_key0, data_key1]) - - i_col += 1 - if i_col == columns: - i_col = 0 - i_row += 1 - nodes.clear() - nodes.merge(nodes_copy) - - -func clear_rows() -> void: - """ Удаляет все строки таблицы """ - var rows_count: int = get_rows_count() - for i_row in rows_count: - remove_row(i_row) - - -func set_callbacks(dest_node: Node, event_name: String, callback: String, clmns: Array, user_data: Array) -> void: - """ Настраивает обратные вызовы для колонок. - :dest_node: Получатель события - :event_name: Имя события - :callback: Имя функции получателя события - :clmns: Индексы колонок - :user_data: Аргументы функции получателя события """ - var rows_count = get_rows_count() - for i_row in rows_count: - for i_col in clmns: - assert(i_col >= 0 and i_col < columns, 'ошибка: нет колонки %d' % i_col) - var node_key: String = NODE_KEY_FORMAT % [i_row, i_col] - var conn_key: String = CONNECTED_KEY_FORMAT % [i_row, i_col] - var node = nodes[node_key] - if nodes.has(conn_key): - var conn = nodes[conn_key] - var prev_callback = conn[0] - var prev_dest_node = conn[1] - node.disconnect(event_name, prev_dest_node, prev_callback) - assert (OK == node.connect(event_name, dest_node, callback, [node] + user_data)) - nodes[conn_key] = [callback, dest_node] - - -func set_rows_text(rows: Array) -> void: - for i_row in rows.size(): - for i_col in columns: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - var node = nodes[key] - node.text = rows[i_row][i_col] - - -func set_nodes_min_size(i_row: int, sizes: Array, key_format: String = NODE_KEY_FORMAT) -> void: - for i_col in columns: - var key: = get_node_key(key_format, i_col, i_row) - var node = nodes[key] - node.size.x = sizes[i_col] - - -func set_node_text(i_col: int, i_row: int, val: String) -> void: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - nodes[key].text = val - - -func set_rows_state(rows: Array) -> void: - for i_row in rows.size(): - for i_col in columns: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - nodes[name].pressed = rows[i_row][i_col] - - -func set_node_state(i_col: int, i_row: int, val: bool) -> void: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - nodes[key].pressed = val - - -func set_node_frame(i_col: int, i_row: int, name: String, val: int) -> void: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - var node = nodes[key] - var sprite = node.get_node(name) - sprite.frame = val - - -func set_node_editable(i_col: int, i_row: int, val: bool) -> void: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - nodes[key].editable = val - - -func set_node_alligment(i_col: int, i_row: int, val: int) -> void: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - nodes[key].align = val - - -func set_row_alligments(i_row: int, aligns: Array) -> void: - for i_col in columns: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - nodes[key].align = aligns[i_col] - - -func get_row_text(i_row: int) -> Array: - var row: = [] - for i_col in columns: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - row.append(nodes[key].text) - return row - - -func set_row_text(i_row: int, row: Array, i_begin: int = 0, key_format: String = NODE_KEY_FORMAT) -> void: - for i_col in row.size(): - var key: = get_node_key(key_format, i_col, i_row) - nodes[key].text = row[i_col] - - -func get_rows_text() -> Array: - var rows_count: = get_rows_count() - var rows: = [] - for i_row in rows_count: - var row = get_row_text(i_row) - rows.append(row) - return rows - - -func get_row(i_row: int) -> Array: - var row: = [] - for i_col in columns: - var key: = get_node_key(NODE_KEY_FORMAT, i_col, i_row) - row.append(nodes[key]) - return row - - -func get_node_rect(i_col: int, i_row: int, rect: Array, key_format: String = NODE_KEY_FORMAT) -> void: - assert(rect.size() >= 4, 'ошибка: мало элементов для возврата результата') - var key: = get_node_key(key_format, i_col, i_row) - var cell = nodes[key] - rect[0] = cell.position.x - rect[1] = cell.position.y - rect[2] = cell.size.x - rect[3] = cell.size.y diff --git a/scenes/wnd_stc.tscn b/scenes/wnd_stc.tscn index 35995a5b..f32cc3de 100644 --- a/scenes/wnd_stc.tscn +++ b/scenes/wnd_stc.tscn @@ -1,11 +1,12 @@ [gd_scene load_steps=2 format=3 uid="uid://w6ta0ck1bedl"] -[ext_resource type="PackedScene" uid="uid://cbfp6bylx8g4i" path="res://tab_container_stc.tscn" id="1_76mnm"] +[ext_resource type="PackedScene" uid="uid://cbfp6bylx8g4i" path="res://tab_container_stc.tscn" id="1_ty26o"] [node name="wnd_stc" type="Window"] +sdf_oversize = 0 initial_position = 3 size = Vector2i(1600, 1200) mode = 3 current_screen = 1 -[node name="TabContainer" parent="." instance=ExtResource("1_76mnm")] +[node name="TabContainer" parent="." instance=ExtResource("1_ty26o")] diff --git a/scenes/контроль.tscn b/scenes/контроль.tscn index d0b62c10..629fa1aa 100644 --- a/scenes/контроль.tscn +++ b/scenes/контроль.tscn @@ -1,11 +1,11 @@ [gd_scene load_steps=7 format=3 uid="uid://lwmw4egynmd1"] -[ext_resource type="Script" path="res://scenes/контроль.gd" id="1_pdhey"] -[ext_resource type="Texture2D" uid="uid://bar8k5qef7kch" path="res://data/УФ.png" id="2_c8mnm"] -[ext_resource type="Texture2D" uid="uid://dkqlvd750pplc" path="res://data/СПТ.png" id="3_uldf5"] -[ext_resource type="Texture2D" uid="uid://b4isaggma6q3" path="res://data/Грани22.png" id="4_pojm0"] -[ext_resource type="Texture2D" uid="uid://d2jxmtd6n5jd1" path="res://data/Щ3.png" id="5_5hce7"] -[ext_resource type="Texture2D" uid="uid://bos68thpqqvn" path="res://data/ПРД.png" id="6_0mr8a"] +[ext_resource type="Script" path="res://scenes/контроль.gd" id="1_i5eo5"] +[ext_resource type="Texture2D" uid="uid://bar8k5qef7kch" path="res://data/УФ.png" id="2_drana"] +[ext_resource type="Texture2D" uid="uid://dkqlvd750pplc" path="res://data/СПТ.png" id="3_v54hc"] +[ext_resource type="Texture2D" uid="uid://b4isaggma6q3" path="res://data/Грани22.png" id="4_kwlmx"] +[ext_resource type="Texture2D" uid="uid://d2jxmtd6n5jd1" path="res://data/Щ3.png" id="5_8abdt"] +[ext_resource type="Texture2D" uid="uid://bos68thpqqvn" path="res://data/ПРД.png" id="6_sgnkf"] [node name="Контроль" type="Panel"] anchors_preset = 15 @@ -13,7 +13,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -script = ExtResource("1_pdhey") +script = ExtResource("1_i5eo5") metadata/_edit_lock_ = true [node name="pribor_uf" type="TextureButton" parent="."] @@ -24,7 +24,7 @@ offset_right = 1191.0 offset_bottom = 657.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("2_c8mnm") +texture_normal = ExtResource("2_drana") stretch_mode = 4 [node name="pribor_rtr" type="TextureButton" parent="."] @@ -35,7 +35,7 @@ offset_right = 1198.0 offset_bottom = 361.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("3_uldf5") +texture_normal = ExtResource("3_v54hc") stretch_mode = 4 [node name="pribor_afsp_l" type="TextureButton" parent="."] @@ -47,7 +47,7 @@ offset_bottom = 860.0 scale = Vector2(0.2, 0.2) size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("4_pojm0") +texture_normal = ExtResource("4_kwlmx") stretch_mode = 4 [node name="pribor_afsp_r" type="TextureButton" parent="."] @@ -59,7 +59,7 @@ offset_bottom = 865.0 scale = Vector2(0.2, 0.2) size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("4_pojm0") +texture_normal = ExtResource("4_kwlmx") stretch_mode = 4 [node name="pribor_sch3" type="TextureButton" parent="."] @@ -70,7 +70,7 @@ offset_right = 1208.0 offset_bottom = 951.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("5_5hce7") +texture_normal = ExtResource("5_8abdt") stretch_mode = 4 [node name="pribor_spt_l" type="TextureButton" parent="."] @@ -81,7 +81,7 @@ offset_right = 1053.0 offset_bottom = 951.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("3_uldf5") +texture_normal = ExtResource("3_v54hc") stretch_mode = 4 [node name="pribor_spt_r" type="TextureButton" parent="."] @@ -92,7 +92,7 @@ offset_right = 1353.0 offset_bottom = 951.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("3_uldf5") +texture_normal = ExtResource("3_v54hc") stretch_mode = 4 [node name="pribor_prd_v_2" type="TextureButton" parent="."] @@ -103,7 +103,7 @@ offset_right = 872.0 offset_bottom = 377.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 [node name="pribor_prd_n_2" type="TextureButton" parent="."] @@ -114,7 +114,7 @@ offset_right = 827.0 offset_bottom = 553.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 [node name="pribor_prd_k_2" type="TextureButton" parent="."] @@ -125,7 +125,7 @@ offset_right = 952.0 offset_bottom = 555.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 [node name="pribor_prd_v_3" type="TextureButton" parent="."] @@ -136,7 +136,7 @@ offset_right = 1494.0 offset_bottom = 896.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 flip_h = true @@ -148,7 +148,7 @@ offset_right = 1417.0 offset_bottom = 721.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 flip_h = true @@ -160,7 +160,7 @@ offset_right = 1537.0 offset_bottom = 721.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 flip_h = true @@ -172,7 +172,7 @@ offset_right = 1522.0 offset_bottom = 391.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 flip_h = true @@ -184,7 +184,7 @@ offset_right = 1412.0 offset_bottom = 553.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 flip_h = true @@ -196,7 +196,7 @@ offset_right = 1537.0 offset_bottom = 562.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 flip_h = true @@ -208,7 +208,7 @@ offset_right = 882.0 offset_bottom = 896.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 [node name="pribor_prd_n_4" type="TextureButton" parent="."] @@ -219,7 +219,7 @@ offset_right = 827.0 offset_bottom = 723.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 [node name="pribor_prd_k_4" type="TextureButton" parent="."] @@ -230,7 +230,7 @@ offset_right = 962.0 offset_bottom = 723.0 size_flags_horizontal = 15 size_flags_vertical = 15 -texture_normal = ExtResource("6_0mr8a") +texture_normal = ExtResource("6_sgnkf") stretch_mode = 4 [node name="pribor_sch" type="Panel" parent="."] diff --git a/scenes/работа.gd b/scenes/работа.gd index fc3091cb..844ab949 100644 --- a/scenes/работа.gd +++ b/scenes/работа.gd @@ -11,8 +11,10 @@ extends Panel @export var window_0_id: int @export var window_1_id: int +signal add_imit_threat (signal_name: String) +signal del_imit_threat (signal_name: String) -enum DRAG_FSM { IDLE, DRAG, DISABLE } +enum DRAG_FSM { IDLE, DRAG, OFF } """ Состояние перетаскивания """ var drag_pos_begin: Vector2 @@ -54,10 +56,10 @@ signal full_screen func _ready(): $btn_strobe.button_connect('pressed', Callable(self, 'on_button_strobe_pressed')) - $'рамка-режим/btn_off'.set_pressed(true) - strob_center = $canvas.get_center() + $btn_off.set_pressed(true) + strob_center = $canvas.get_strob_center() on_button_strobe_pressed() - drag_fsm = DRAG_FSM.DISABLE + drag_fsm = DRAG_FSM.OFF var nodes: = get_tree().get_nodes_in_group('группа-режим-помехи') for btn in nodes: btn.button_connect('pressed', Callable(self, 'on_button_pressed').bind(btn, nodes)) @@ -69,7 +71,7 @@ func on_button_strobe_pressed(): drag_fsm = DRAG_FSM.IDLE else: $canvas.set_strob_visible(false) - drag_fsm = DRAG_FSM.DISABLE + drag_fsm = DRAG_FSM.OFF func on_button_pressed(btn_this, btn_others): @@ -78,26 +80,12 @@ func on_button_pressed(btn_this, btn_others): btn_other.set_pressed(btn_this == btn_other) -func hypot(x: float, y: float) -> float: - return sqrt(x * x + y * y) - - func clip_value(val, val_min, val_max): if val < val_min: val = val_min if val > val_max: val = val_max return val -func map_dec_to_rad(pos0: Vector2, pos: Vector2) -> Vector2: - """ Преобразует декартовые координаты в полярные """ - var x1: float = pos.x - pos0.x - var y1: float = pos.y - pos0.y - var ang: float = (atan2(y1, x1) * 180.0) / PI - ang += 360.0 * float(ang < 0.0) - var radius: float = hypot(x1, y1) - return Vector2(ang, radius) - - func get_strob_width(pos: Vector2, prev: float) -> float: var strob_dir_width: float = prev + (drag_pos_begin.y - pos.y) * drag_scale_width strob_dir_width = clip_value(strob_dir_width, strob_min_width, strob_max_width) @@ -111,7 +99,7 @@ func get_strob_band(pos: Vector2, prev: float) -> float: func set_strob(pos: Vector2): - var radp: Vector2 = map_dec_to_rad(strob_center, pos) + var radp: Vector2 = Tools.map_dec_to_rad(strob_center, pos) if radp.y < $canvas.get_radius_max(): $canvas.set_strob_dir(radp.x) $canvas.set_strob_radius(radp.y) @@ -170,3 +158,7 @@ func toggle_full_screen(id: int): func _on_full_screen(): toggle_full_screen(window_1_id) toggle_full_screen(window_0_id) + + +func _on_btn_down(signal_name: String) -> void: + emit_signal(signal_name) diff --git a/scenes/работа.tscn b/scenes/работа.tscn index d833d7b7..3b353e50 100644 --- a/scenes/работа.tscn +++ b/scenes/работа.tscn @@ -1,14 +1,14 @@ [gd_scene load_steps=6 format=3 uid="uid://b276iygic5itk"] -[ext_resource type="Script" path="res://scenes/работа.gd" id="1_lgact"] -[ext_resource type="PackedScene" uid="uid://b5kjdyxuwsot5" path="res://scenes/canvas.tscn" id="2_pmw7s"] -[ext_resource type="PackedScene" uid="uid://bq7haw1ypiv48" path="res://scenes/frame.tscn" id="3_plabh"] -[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat.tscn" id="4_bq6mv"] +[ext_resource type="Script" path="res://scenes/работа.gd" id="1_qjoce"] +[ext_resource type="PackedScene" uid="uid://b5kjdyxuwsot5" path="res://scenes/canvas.tscn" id="2_bl0yt"] +[ext_resource type="PackedScene" uid="uid://bq7haw1ypiv48" path="res://scenes/frame.tscn" id="3_l1omj"] +[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button_flat.tscn" id="4_5es2r"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5ugj8"] [node name="Работа" type="Panel"] -script = ExtResource("1_lgact") +script = ExtResource("1_qjoce") col_red = Color(1, 0.568627, 0.431373, 0.239216) col_grey = Color(0.34902, 0.643137, 0.772549, 0.168627) strob_min_width = 5.0 @@ -19,177 +19,41 @@ drag_scale_width = 0.5 drag_scale_band = 0.05 window_1_id = 1 metadata/_edit_vertical_guides_ = [] +metadata/_edit_lock_ = true -[node name="canvas" parent="." instance=ExtResource("2_pmw7s")] +[node name="canvas" parent="." instance=ExtResource("2_bl0yt")] +metadata/_edit_lock_ = true -[node name="рамка-режим" parent="." instance=ExtResource("3_plabh")] +[node name="рамка-список-целей" parent="." instance=ExtResource("3_l1omj")] layout_mode = 0 -offset_left = 1180.0 -offset_top = 892.0 -offset_right = 1589.0 -offset_bottom = 1162.0 -text = "Режим помехи" +offset_left = 1121.0 +offset_top = 6.0 +offset_right = 1594.0 +offset_bottom = 642.0 +text = "Список целей" -[node name="btn_off" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] +[node name="рамка-параметры-цели" parent="рамка-список-целей" instance=ExtResource("3_l1omj")] layout_mode = 0 -offset_left = 10.0 -offset_top = 30.0 -offset_right = 100.0 -offset_bottom = 80.0 -text = "Откл" - -[node name="btn_p4" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 0 -offset_left = 110.0 -offset_top = 210.0 -offset_right = 200.0 -offset_bottom = 260.0 -text = "13" - -[node name="btn_p5" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 1 -anchors_preset = -1 -offset_left = 10.0 -offset_top = 210.0 -offset_right = 100.0 -offset_bottom = 260.0 -grow_horizontal = 2 -grow_vertical = 2 -text = "12" - -[node name="btn_p6" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 0 -offset_left = 210.0 -offset_top = 150.0 -offset_right = 300.0 -offset_bottom = 200.0 -text = "10" - -[node name="btn_p7" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 0 -offset_left = 310.0 -offset_top = 150.0 -offset_right = 400.0 -offset_bottom = 200.0 -text = "11" - -[node name="btn_p8" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 0 -offset_left = 110.0 -offset_top = 150.0 -offset_right = 200.0 -offset_bottom = 200.0 -text = "9" - -[node name="btn_p9" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 0 -offset_left = 10.0 -offset_top = 150.0 -offset_right = 100.0 -offset_bottom = 200.0 -text = "8" - -[node name="btn_p10" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 1 -anchors_preset = -1 -offset_left = 310.0 -offset_top = 90.0 -offset_right = 399.0 -offset_bottom = 140.0 -grow_horizontal = 2 -grow_vertical = 2 -text = "7" - -[node name="btn_p11" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 0 -offset_left = 310.0 -offset_top = 30.0 -offset_right = 399.0 -offset_bottom = 80.0 -text = "3" - -[node name="btn_p12" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 1 -anchors_preset = -1 -offset_left = 10.0 -offset_top = 90.0 -offset_right = 100.0 -offset_bottom = 140.0 -grow_horizontal = 2 -grow_vertical = 2 -text = "4" - -[node name="btn_p13" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 1 -anchors_preset = -1 -offset_left = 110.0 -offset_top = 90.0 -offset_right = 200.0 -offset_bottom = 140.0 -grow_horizontal = 2 -grow_vertical = 2 -text = "5" - -[node name="btn_p14" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 1 -anchors_preset = -1 -offset_left = 210.0 -offset_top = 90.0 -offset_right = 300.0 -offset_bottom = 140.0 -grow_horizontal = 2 -grow_vertical = 2 -text = "6" - -[node name="btn_p15" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 1 -anchors_preset = -1 -offset_left = 210.0 -offset_top = 30.0 -offset_right = 300.0 -offset_bottom = 80.0 -grow_horizontal = 2 -grow_vertical = 2 -text = "2" - -[node name="btn_p16" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 0 -offset_left = 110.0 -offset_top = 30.0 -offset_right = 200.0 -offset_bottom = 80.0 -text = "1" - -[node name="btn_auto_rfi" parent="рамка-режим" groups=["группа-режим-помехи"] instance=ExtResource("4_bq6mv")] -layout_mode = 0 -offset_left = 210.0 -offset_top = 210.0 -offset_right = 400.0 -offset_bottom = 260.0 -text = "Автоматически" - -[node name="рамка-цели" parent="." instance=ExtResource("3_plabh")] -layout_mode = 0 -offset_left = 1180.0 -offset_top = 547.0 -offset_right = 1589.0 -offset_bottom = 887.0 +offset_left = 5.0 +offset_top = 313.0 +offset_right = 467.0 +offset_bottom = 632.0 text = "Параметры цели" -[node name="tbl_celi" type="GridContainer" parent="рамка-цели"] +[node name="tbl_celi" type="GridContainer" parent="рамка-список-целей/рамка-параметры-цели"] layout_mode = 1 anchors_preset = -1 anchor_left = 0.012 anchor_top = 0.065 anchor_right = 0.99 anchor_bottom = 0.985 -offset_left = 0.092 -offset_top = 4.9 -offset_right = 0.0899658 -offset_bottom = 0.0999756 +offset_left = 0.212 +offset_top = 5.265 +offset_right = -0.0100098 +offset_bottom = -0.214996 columns = 2 -[node name="hdr_col0" type="Label" parent="рамка-цели/tbl_celi"] +[node name="hdr_col0" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -198,7 +62,7 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_5ugj8") text = "Параметр" horizontal_alignment = 1 -[node name="hdr_col1" type="Label" parent="рамка-цели/tbl_celi"] +[node name="hdr_col1" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -207,44 +71,14 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_5ugj8") text = "Значение" horizontal_alignment = 1 -[node name="node_00_00" type="Label" parent="рамка-цели/tbl_celi"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "Курсовой угол" - -[node name="node_00_01" type="Label" parent="рамка-цели/tbl_celi"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "90" -horizontal_alignment = 1 - -[node name="node_01_00" type="Label" parent="рамка-цели/tbl_celi"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "Частота, МГЦ" - -[node name="node_01_01" type="Label" parent="рамка-цели/tbl_celi"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "2600" -horizontal_alignment = 1 - -[node name="node_02_00" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_02_00" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Тип модуляции" -[node name="node_02_01" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_02_01" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -252,14 +86,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "qam256" horizontal_alignment = 1 -[node name="node_03_00" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_03_00" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Ширина диапазона, МГц" -[node name="node_03_01" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_03_01" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -267,14 +101,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "2.5" horizontal_alignment = 1 -[node name="node_04_00" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_04_00" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Мощность, дБ" -[node name="node_04_01" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_04_01" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -282,14 +116,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "43" horizontal_alignment = 1 -[node name="node_05_00" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_05_00" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Время обновления" -[node name="node_05_01" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_05_01" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -297,14 +131,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "20:23:04" horizontal_alignment = 1 -[node name="node_06_00" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_06_00" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Режим перестройки" -[node name="node_06_01" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_06_01" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -312,14 +146,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "ЛЧМ" horizontal_alignment = 1 -[node name="node_07_00" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_07_00" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Скорость данных, бит/с" -[node name="node_07_01" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_07_01" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -327,14 +161,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "1.8М" horizontal_alignment = 1 -[node name="node_08_00" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_08_00" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Протокол" -[node name="node_08_01" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_08_01" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -342,14 +176,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "solo7" horizontal_alignment = 1 -[node name="node_09_00" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_09_00" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Высота, м" -[node name="node_09_01" type="Label" parent="рамка-цели/tbl_celi"] +[node name="node_09_01" type="Label" parent="рамка-список-целей/рамка-параметры-цели/tbl_celi"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -357,138 +191,46 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "128" horizontal_alignment = 1 -[node name="node_10_00" type="Label" parent="рамка-цели/tbl_celi"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "Номер" - -[node name="node_10_01" type="Label" parent="рамка-цели/tbl_celi"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "2" -horizontal_alignment = 1 - -[node name="рамка-общие" parent="." instance=ExtResource("3_plabh")] +[node name="btn_add_thr" type="Button" parent="рамка-список-целей"] layout_mode = 0 -offset_left = 1180.0 -offset_top = 276.0 -offset_right = 1589.0 -offset_bottom = 431.0 -text = "Общее" +offset_left = 6.0 +offset_top = 4.0 +offset_right = 24.0 +offset_bottom = 31.0 +scale = Vector2(1, 0.6) +tooltip_text = "Добавить имитационную цель" +text = "+" -[node name="tbl_obschie" type="GridContainer" parent="рамка-общие"] -layout_mode = 1 -anchors_preset = -1 -anchor_left = 0.012 -anchor_top = 0.153 -anchor_right = 0.99 -anchor_bottom = 0.985 -offset_left = 0.092 -offset_top = 3.285 -offset_right = 0.0899963 -offset_bottom = 0.324997 -columns = 2 - -[node name="node_00_00" type="Label" parent="рамка-общие/tbl_obschie"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "Курс" - -[node name="node_00_01" type="Label" parent="рамка-общие/tbl_obschie"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "222 -" -horizontal_alignment = 1 - -[node name="node_01_00" type="Label" parent="рамка-общие/tbl_obschie"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "Скорость, узлы" - -[node name="node_01_01" type="Label" parent="рамка-общие/tbl_obschie"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "10" -horizontal_alignment = 1 - -[node name="node_02_00" type="Label" parent="рамка-общие/tbl_obschie"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "Время" - -[node name="node_02_01" type="Label" parent="рамка-общие/tbl_obschie"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "20:24:06" -horizontal_alignment = 1 - -[node name="node_03_00" type="Label" parent="рамка-общие/tbl_obschie"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "Направление ветра" - -[node name="node_03_01" type="Label" parent="рамка-общие/tbl_obschie"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "310" -horizontal_alignment = 1 - -[node name="node_04_00" type="Label" parent="рамка-общие/tbl_obschie"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "Скорость ветра, м/с" - -[node name="node_04_01" type="Label" parent="рамка-общие/tbl_obschie"] -custom_minimum_size = Vector2(100, 0) -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) -text = "3" -horizontal_alignment = 1 - -[node name="рамка-сеансы" parent="." instance=ExtResource("3_plabh")] +[node name="btn_del_thr" type="Button" parent="рамка-список-целей"] layout_mode = 0 -offset_left = 1180.0 -offset_top = 436.0 -offset_right = 1589.0 -offset_bottom = 543.0 +offset_left = 28.0 +offset_top = 4.0 +offset_right = 46.0 +offset_bottom = 31.0 +scale = Vector2(1, 0.6) +tooltip_text = "Удалить цель" +text = "-" + +[node name="рамка-сеансы-помех" parent="." instance=ExtResource("3_l1omj")] +layout_mode = 0 +offset_left = 1121.0 +offset_top = 648.0 +offset_right = 1594.0 +offset_bottom = 1168.0 text = "Сеансы помех" -[node name="tbl_seansy" type="GridContainer" parent="рамка-сеансы"] +[node name="tbl_seansy" type="GridContainer" parent="рамка-сеансы-помех"] layout_mode = 1 anchors_preset = -1 anchor_top = 0.115 anchor_bottom = 0.115 offset_left = 5.0 -offset_top = 15.695 -offset_right = 405.0 -offset_bottom = 90.695 +offset_top = -34.8 +offset_right = 453.0 +offset_bottom = 185.2 columns = 3 -[node name="hdr_col0" type="Label" parent="рамка-сеансы/tbl_seansy"] +[node name="hdr_col0" type="Label" parent="рамка-сеансы-помех/tbl_seansy"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -497,7 +239,7 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_5ugj8") text = "Индекс сеанса" horizontal_alignment = 1 -[node name="hdr_col1" type="Label" parent="рамка-сеансы/tbl_seansy"] +[node name="hdr_col1" type="Label" parent="рамка-сеансы-помех/tbl_seansy"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -506,7 +248,7 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_5ugj8") text = "Номер цели" horizontal_alignment = 1 -[node name="hdr_col2" type="Label" parent="рамка-сеансы/tbl_seansy"] +[node name="hdr_col2" type="Label" parent="рамка-сеансы-помех/tbl_seansy"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -515,7 +257,7 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_5ugj8") text = "Режим помехи" horizontal_alignment = 1 -[node name="node_00_00" type="Label" parent="рамка-сеансы/tbl_seansy"] +[node name="node_00_00" type="Label" parent="рамка-сеансы-помех/tbl_seansy"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -523,7 +265,7 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "1" horizontal_alignment = 1 -[node name="node_00_01" type="Label" parent="рамка-сеансы/tbl_seansy"] +[node name="node_00_01" type="Label" parent="рамка-сеансы-помех/tbl_seansy"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -531,7 +273,7 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "3" horizontal_alignment = 1 -[node name="node_00_02" type="Label" parent="рамка-сеансы/tbl_seansy"] +[node name="node_00_02" type="Label" parent="рамка-сеансы-помех/tbl_seansy"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -539,7 +281,7 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "СРН-И1" horizontal_alignment = 1 -[node name="node_01_00" type="Label" parent="рамка-сеансы/tbl_seansy"] +[node name="node_01_00" type="Label" parent="рамка-сеансы-помех/tbl_seansy"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -547,7 +289,7 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "2" horizontal_alignment = 1 -[node name="node_01_01" type="Label" parent="рамка-сеансы/tbl_seansy"] +[node name="node_01_01" type="Label" parent="рамка-сеансы-помех/tbl_seansy"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -555,7 +297,7 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "1" horizontal_alignment = 1 -[node name="node_01_02" type="Label" parent="рамка-сеансы/tbl_seansy"] +[node name="node_01_02" type="Label" parent="рамка-сеансы-помех/tbl_seansy"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -563,28 +305,28 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "ПД-М4С" horizontal_alignment = 1 -[node name="рамка-помеха" parent="." instance=ExtResource("3_plabh")] +[node name="рамка-помеха" parent="рамка-сеансы-помех" instance=ExtResource("3_l1omj")] layout_mode = 0 -offset_left = 1180.0 -offset_top = 6.0 -offset_right = 1589.0 -offset_bottom = 271.0 +offset_left = 5.0 +offset_top = 250.0 +offset_right = 467.0 +offset_bottom = 514.0 text = "Параметры помехи" -[node name="tbl_pomeha" type="GridContainer" parent="рамка-помеха"] +[node name="tbl_pomeha" type="GridContainer" parent="рамка-сеансы-помех/рамка-помеха"] layout_mode = 1 anchors_preset = -1 anchor_left = 0.012 anchor_top = 0.065 anchor_right = 0.99 anchor_bottom = 0.985 -offset_left = 0.092 -offset_top = 9.775 -offset_right = 0.0899658 -offset_bottom = -0.0250244 +offset_left = 0.212 +offset_top = 7.775 +offset_right = -0.0100098 +offset_bottom = -0.0249939 columns = 2 -[node name="hdr_col0" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="hdr_col0" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -593,7 +335,7 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_5ugj8") text = "Параметр" horizontal_alignment = 1 -[node name="hdr_col1" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="hdr_col1" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -602,14 +344,14 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_5ugj8") text = "Значение" horizontal_alignment = 1 -[node name="node_00_00" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_00_00" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Индекс сеанса" -[node name="node_00_01" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_00_01" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -617,14 +359,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "1" horizontal_alignment = 1 -[node name="node_01_00" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_01_00" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Курсовой угол" -[node name="node_01_01" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_01_01" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -632,14 +374,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "43" horizontal_alignment = 1 -[node name="node_02_00" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_02_00" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Частота, МГЦ" -[node name="node_02_01" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_02_01" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -647,14 +389,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "2600" horizontal_alignment = 1 -[node name="node_03_00" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_03_00" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Диапазон, МГЦ" -[node name="node_03_01" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_03_01" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -662,14 +404,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "80" horizontal_alignment = 1 -[node name="node_04_00" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_04_00" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Режим" -[node name="node_04_01" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_04_01" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -677,14 +419,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "СРН-М2" horizontal_alignment = 1 -[node name="node_05_00" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_05_00" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Мощность" -[node name="node_05_01" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_05_01" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -692,14 +434,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "2.5" horizontal_alignment = 1 -[node name="node_06_00" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_06_00" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Угол места" -[node name="node_06_01" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_06_01" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -707,14 +449,14 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "5" horizontal_alignment = 1 -[node name="node_07_00" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_07_00" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "Режим перестройки" -[node name="node_07_01" type="Label" parent="рамка-помеха/tbl_pomeha"] +[node name="node_07_01" type="Label" parent="рамка-сеансы-помех/рамка-помеха/tbl_pomeha"] custom_minimum_size = Vector2(100, 0) layout_mode = 2 size_flags_horizontal = 3 @@ -722,31 +464,181 @@ theme_override_colors/font_color = Color(0.729412, 0.729412, 0.729412, 1) text = "ЛЧМ" horizontal_alignment = 1 -[node name="btn_auto_threat" parent="." instance=ExtResource("4_bq6mv")] +[node name="btn_auto_threat" parent="." instance=ExtResource("4_5es2r")] layout_mode = 0 -offset_left = 980.0 -offset_top = 1101.0 -offset_right = 1170.0 -offset_bottom = 1151.0 +offset_left = 912.0 +offset_top = 67.0 +offset_right = 1102.0 +offset_bottom = 117.0 text = "Автоматически" -[node name="btn_strobe" parent="." instance=ExtResource("4_bq6mv")] +[node name="btn_strobe" parent="." instance=ExtResource("4_5es2r")] layout_mode = 0 -offset_left = 980.0 -offset_top = 30.0 -offset_right = 1170.0 -offset_bottom = 80.0 +offset_left = 912.0 +offset_top = 6.0 +offset_right = 1102.0 +offset_bottom = 56.0 text = "Строб" -[node name="надпись-выбор-цели" type="Label" parent="."] -layout_mode = 2 -offset_left = 983.0 -offset_top = 1076.0 -offset_right = 1172.0 -offset_bottom = 1098.0 -text = "Выбор цели" -horizontal_alignment = 1 +[node name="btn_p5" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 1 +anchors_preset = -1 +offset_left = 980.0 +offset_top = 1118.0 +offset_right = 1045.0 +offset_bottom = 1168.0 +grow_horizontal = 2 +grow_vertical = 2 +text = "ОЗП-1" +metadata/rfi_name = "ozp1" + +[node name="btn_p4" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 1 +anchors_preset = -1 +offset_left = 1052.0 +offset_top = 1118.0 +offset_right = 1117.0 +offset_bottom = 1168.0 +grow_horizontal = 2 +grow_vertical = 2 +tooltip_text = "Выбор цели или сектора" +text = "<-" +metadata/rfi_name = "" + +[node name="btn_p6" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 0 +offset_left = 840.0 +offset_top = 1118.0 +offset_right = 905.0 +offset_bottom = 1168.0 +text = "СВ-М2" +metadata/rfi_name = "svm2" + +[node name="btn_p7" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 0 +offset_left = 910.0 +offset_top = 1118.0 +offset_right = 975.0 +offset_bottom = 1168.0 +text = "K1" +metadata/rfi_name = "k1" + +[node name="btn_p8" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 0 +offset_left = 770.0 +offset_top = 1118.0 +offset_right = 835.0 +offset_bottom = 1168.0 +text = "СВ-И1" +metadata/rfi_name = "svi1" + +[node name="btn_p9" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 0 +offset_left = 700.0 +offset_top = 1118.0 +offset_right = 765.0 +offset_bottom = 1168.0 +text = "ПД-ЧМ" +metadata/rfi_name = "pdchm" + +[node name="btn_p10" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 1 +anchors_preset = -1 +offset_left = 630.0 +offset_top = 1118.0 +offset_right = 695.0 +offset_bottom = 1168.0 +grow_horizontal = 2 +grow_vertical = 2 +text = "ПД-М4С" +metadata/rfi_name = "pdm4s" + +[node name="btn_p11" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 0 +offset_left = 350.0 +offset_top = 1118.0 +offset_right = 415.0 +offset_bottom = 1168.0 +text = "ЛЧМ-1" +metadata/rfi_name = "lchm1" + +[node name="btn_p12" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 1 +anchors_preset = -1 +offset_left = 420.0 +offset_top = 1118.0 +offset_right = 485.0 +offset_bottom = 1168.0 +grow_horizontal = 2 +grow_vertical = 2 +text = "МЧМ-1" +metadata/rfi_name = "mchm1" + +[node name="btn_p13" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 1 +anchors_preset = -1 +offset_left = 490.0 +offset_top = 1118.0 +offset_right = 555.0 +offset_bottom = 1168.0 +grow_horizontal = 2 +grow_vertical = 2 +text = "ПД-М2" +metadata/rfi_name = "pdm2" + +[node name="btn_p14" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 1 +anchors_preset = -1 +offset_left = 560.0 +offset_top = 1118.0 +offset_right = 625.0 +offset_bottom = 1168.0 +grow_horizontal = 2 +grow_vertical = 2 +text = "ПД-М4" +metadata/rfi_name = "pdm4" + +[node name="btn_p15" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 1 +anchors_preset = -1 +offset_left = 280.0 +offset_top = 1118.0 +offset_right = 345.0 +offset_bottom = 1168.0 +grow_horizontal = 2 +grow_vertical = 2 +text = "СРН-М2" +metadata/rfi_name = "srnm2" + +[node name="btn_p16" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 0 +offset_left = 210.0 +offset_top = 1118.0 +offset_right = 275.0 +offset_bottom = 1168.0 +text = "СРН-И1" +metadata/rfi_name = "srni1" + +[node name="btn_off" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 0 +offset_left = 140.0 +offset_top = 1118.0 +offset_right = 205.0 +offset_bottom = 1168.0 +text = "Откл." +metadata/rfi_name = "" + +[node name="btn_auto_rfi" parent="." groups=["группа-режим-помехи"] instance=ExtResource("4_5es2r")] +layout_mode = 0 +offset_left = 10.0 +offset_top = 1118.0 +offset_right = 135.0 +offset_bottom = 1168.0 +text = "Автоматически" +metadata/rfi_name = "" [connection signal="drag_begin" from="." to="." method="_on_drag_begin"] [connection signal="drag_continue" from="." to="." method="_on_drag_continue"] [connection signal="full_screen" from="." to="." method="_on_full_screen" flags=3] +[connection signal="button_down" from="рамка-список-целей/btn_add_thr" to="." method="_on_btn_down" binds= ["add_imit_threat"]] +[connection signal="button_down" from="рамка-список-целей/btn_del_thr" to="." method="_on_btn_down" binds= ["del_imit_threat"]] diff --git a/shaders/bip.gdshader b/shaders/bip.gdshader index 11ce34b0..0e7ce0d8 100644 --- a/shaders/bip.gdshader +++ b/shaders/bip.gdshader @@ -3,7 +3,7 @@ shader_type canvas_item; /* Закрашенная окружность */ uniform vec4 color: source_color = vec4(1, 1, 1, 1); -const float ds = 0.01; /* Относительное расстояние на котором выполняется сглаживание краёв */ +const float ds = 0.005; /* Относительное расстояние на котором выполняется сглаживание краёв */ const vec2 center = vec2(0.125, 0.125); /* Центр должен быть в (0.5, 0.5), но это не так */ const float radius = 0.125 - ds * 2.0; /* Радиус должен быть 0.5, но это не так */ diff --git a/shaders/shader_edu.tres b/shaders/shader_edu.tres index a2f42f25..62508d8c 100644 --- a/shaders/shader_edu.tres +++ b/shaders/shader_edu.tres @@ -123,7 +123,7 @@ void fragment() [resource] shader = SubResource("1") -shader_parameter/pc0 = Vector2(610, 600) +shader_parameter/pc0 = Vector2(560, 560) shader_parameter/rotation = 0.0 shader_parameter/color0 = Color(0.380392, 0.470588, 0.509804, 0.537255) shader_parameter/color1 = Color(0.3315, 0.45645, 0.51, 0.537255) diff --git a/tab_container_stc.tscn b/tab_container_stc.tscn index 86e30ffd..2199b9e4 100644 --- a/tab_container_stc.tscn +++ b/tab_container_stc.tscn @@ -1,96 +1,10 @@ -[gd_scene load_steps=10 format=3 uid="uid://cbfp6bylx8g4i"] +[gd_scene load_steps=2 format=3 uid="uid://cbfp6bylx8g4i"] -[ext_resource type="Script" path="res://tab_container_stc.gd" id="1_xhvjk"] -[ext_resource type="Texture2D" uid="uid://tfju4shlxd7g" path="res://data/1.png" id="2_b360a"] -[ext_resource type="Texture2D" uid="uid://bhvo4qe45sof6" path="res://data/2.png" id="3_5v0ar"] -[ext_resource type="Texture2D" uid="uid://eixrw0k33lan" path="res://data/3.png" id="4_4ffa7"] -[ext_resource type="Texture2D" uid="uid://c52qoo3dp877e" path="res://data/4.png" id="5_81lhn"] -[ext_resource type="Texture2D" uid="uid://kx8tn03k5ips" path="res://data/5.png" id="6_8drcw"] -[ext_resource type="Texture2D" uid="uid://b6jjplsdvxmh2" path="res://data/7.png" id="7_b5lkb"] -[ext_resource type="Texture2D" uid="uid://cv2cj5ffmcked" path="res://data/6.png" id="8_ef4ag"] -[ext_resource type="VideoStream" path="res://data/dji-mini-2.mkv.ogv" id="9_3hyy5"] +[ext_resource type="Script" path="res://tab_container_stc.gd" id="1_rk3q4"] [node name="TabContainer" type="TabContainer"] -offset_left = 10.0 -offset_top = 5.0 offset_right = 1595.0 offset_bottom = 1200.0 -script = ExtResource("1_xhvjk") - -[node name="Panel1" type="Panel" parent="."] -layout_mode = 2 - -[node name="Sprite2D1" type="Sprite2D" parent="Panel1"] -position = Vector2(792.5, 589) -scale = Vector2(1.22951, 1.43142) -texture = ExtResource("2_b360a") - -[node name="Panel2" type="Panel" parent="."] -visible = false -layout_mode = 2 - -[node name="Sprite2D2" type="Sprite2D" parent="Panel2"] -position = Vector2(789.5, 586) -scale = Vector2(1.20724, 1.54768) -texture = ExtResource("3_5v0ar") - -[node name="Panel3" type="Panel" parent="."] -visible = false -layout_mode = 2 - -[node name="Sprite2D3" type="Sprite2D" parent="Panel3"] -position = Vector2(795.75, 582.25) -scale = Vector2(1.23536, 1.44257) -texture = ExtResource("4_4ffa7") - -[node name="Panel4" type="Panel" parent="."] -visible = false -layout_mode = 2 - -[node name="Sprite2D4" type="Sprite2D" parent="Panel4"] -position = Vector2(799.25, 582.75) -scale = Vector2(1.24902, 1.44271) -texture = ExtResource("5_81lhn") - -[node name="Panel5" type="Panel" parent="."] -visible = false -layout_mode = 2 - -[node name="Sprite2D5" type="Sprite2D" parent="Panel5"] -position = Vector2(797.5, 586.5) -scale = Vector2(1.34957, 1.69559) -texture = ExtResource("6_8drcw") - -[node name="Panel7" type="Panel" parent="."] -visible = false -layout_mode = 2 - -[node name="Sprite2D7" type="Sprite2D" parent="Panel7"] -position = Vector2(790, 586) -scale = Vector2(1.24219, 1.7432) -texture = ExtResource("7_b5lkb") - -[node name="Panel6" type="Panel" parent="."] -visible = false -layout_mode = 2 - -[node name="Sprite2D6" type="Sprite2D" parent="Panel6"] -position = Vector2(790, 577) -scale = Vector2(1.23437, 1.73112) -texture = ExtResource("8_ef4ag") - -[node name="Panel8" type="Panel" parent="."] -visible = false -layout_mode = 2 - -[node name="VideoStreamPlayer" type="VideoStreamPlayer" parent="Panel8"] -layout_mode = 0 -offset_left = 8.0 -offset_top = 9.0 -offset_right = 1570.0 -offset_bottom = 1155.0 -stream = ExtResource("9_3hyy5") -expand = true +script = ExtResource("1_rk3q4") [connection signal="tab_changed" from="." to="." method="_on_tab_changed"] -[connection signal="finished" from="Panel8/VideoStreamPlayer" to="." method="_on_video_stream_player_finished"]