diff --git a/README.md b/README.md index 3fc369dd..03896213 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ - [Проброс последовательных портов через Ethernet](http://gitea.srez.local:3000/sasha80/uart-forwarder) - [Сборка Godot из исходников](http://gitea.srez.local:3000/sasha80/godot-build) - [Сервер карт](http://gitea.srez.local:3000/sasha80/map-tiles) +- [Генераторы PCM файлов для модулей ФС](http://gitea.srez.local:3000/danil_tim/Signals_to_the_MP-550) # Ссылки на имитаторы @@ -35,4 +36,4 @@ - После клонирования запустить скрипт `git-hooks-config.sh` - В среде **Windows** запуск скрипта `git-hooks-config.sh` производить из оболочки `git bash` -- Нужно обновить `settings.json` +- При необходимости обновить `settings.json` diff --git a/table/nine-patch.png b/data/nine-patch.png similarity index 100% rename from table/nine-patch.png rename to data/nine-patch.png diff --git a/table/nine-patch.png.import b/data/nine-patch.png.import similarity index 68% rename from table/nine-patch.png.import rename to data/nine-patch.png.import index 2d8c80aa..3e0ab369 100644 --- a/table/nine-patch.png.import +++ b/data/nine-patch.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bw3yv3smvaxqn" -path="res://.godot/imported/nine-patch.png-798f7950fb3126b4e1ed0c39d9e4beba.ctex" +uid="uid://vqajxsh5xamt" +path="res://.godot/imported/nine-patch.png-b3022b5c868bc85e271b731e8fa2ec8a.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://table/nine-patch.png" -dest_files=["res://.godot/imported/nine-patch.png-798f7950fb3126b4e1ed0c39d9e4beba.ctex"] +source_file="res://data/nine-patch.png" +dest_files=["res://.godot/imported/nine-patch.png-b3022b5c868bc85e271b731e8fa2ec8a.ctex"] [params] diff --git a/data/Излучение.png b/data/Излучение.png index 6290bbf3..8758f6f3 100644 Binary files a/data/Излучение.png and b/data/Излучение.png differ diff --git a/data/Квадрат марс 454.png b/data/Квадрат марс 454.png index 31b21a33..670d2dec 100644 Binary files a/data/Квадрат марс 454.png and b/data/Квадрат марс 454.png differ diff --git a/data/Квадрат марс ГО.png b/data/Квадрат марс ГО.png index cce427a7..2bf79149 100644 Binary files a/data/Квадрат марс ГО.png and b/data/Квадрат марс ГО.png differ diff --git a/data/Квадрат марс ОР-63.png b/data/Квадрат марс ОР-63.png index 4d13f1d9..821dad95 100644 Binary files a/data/Квадрат марс ОР-63.png and b/data/Квадрат марс ОР-63.png differ diff --git a/data/Квадрат марс РЛС1.png b/data/Квадрат марс РЛС1.png index 6e835b46..4be19b5f 100644 Binary files a/data/Квадрат марс РЛС1.png and b/data/Квадрат марс РЛС1.png differ diff --git a/data/Квадрат марс РЛС2.png b/data/Квадрат марс РЛС2.png index 8a538ce3..7f6c0be0 100644 Binary files a/data/Квадрат марс РЛС2.png and b/data/Квадрат марс РЛС2.png differ diff --git a/data/Квадрат марс с трубкой.png b/data/Квадрат марс с трубкой.png index 1025c0ef..06466be2 100644 Binary files a/data/Квадрат марс с трубкой.png and b/data/Квадрат марс с трубкой.png differ diff --git a/data/Квадрат салатный 454.png b/data/Квадрат салатный 454.png index 6ad8a291..fda1e654 100644 Binary files a/data/Квадрат салатный 454.png and b/data/Квадрат салатный 454.png differ diff --git a/data/Квадрат салатный ГО.png b/data/Квадрат салатный ГО.png index 5589812a..46f2795d 100644 Binary files a/data/Квадрат салатный ГО.png and b/data/Квадрат салатный ГО.png differ diff --git a/data/Квадрат салатный ОР-63.png b/data/Квадрат салатный ОР-63.png index 6f2e7a58..1e9e6c98 100644 Binary files a/data/Квадрат салатный ОР-63.png and b/data/Квадрат салатный ОР-63.png differ diff --git a/data/Квадрат салатный РЛС1.png b/data/Квадрат салатный РЛС1.png index e4c8f0cf..f57560f3 100644 Binary files a/data/Квадрат салатный РЛС1.png and b/data/Квадрат салатный РЛС1.png differ diff --git a/data/Квадрат салатный РЛС2.png b/data/Квадрат салатный РЛС2.png index c7f33d66..119b3c8d 100644 Binary files a/data/Квадрат салатный РЛС2.png and b/data/Квадрат салатный РЛС2.png differ diff --git a/data/Квадрат салатный с трубкой.png b/data/Квадрат салатный с трубкой.png index c32ec861..4509564f 100644 Binary files a/data/Квадрат салатный с трубкой.png and b/data/Квадрат салатный с трубкой.png differ diff --git a/data/Кнопка подтверждения01.png b/data/Кнопка подтверждения01.png index f2d71a93..8449777f 100644 Binary files a/data/Кнопка подтверждения01.png and b/data/Кнопка подтверждения01.png differ diff --git a/data/Окно частот0.png b/data/Окно частот0.png index 37c9874a..18d7d280 100644 Binary files a/data/Окно частот0.png and b/data/Окно частот0.png differ diff --git a/data/Приём.png b/data/Приём.png index bc17234b..776df102 100644 Binary files a/data/Приём.png and b/data/Приём.png differ diff --git a/data/Скруглённый квадрат белый.png b/data/Скруглённый квадрат белый.png index c470bd35..d0959be3 100644 Binary files a/data/Скруглённый квадрат белый.png and b/data/Скруглённый квадрат белый.png differ diff --git a/data/Скруглённый квадрат серый.png b/data/Скруглённый квадрат серый.png index d4779b41..35d08ee1 100644 Binary files a/data/Скруглённый квадрат серый.png and b/data/Скруглённый квадрат серый.png differ diff --git a/data/Скруглённый прямоуг салатный.png b/data/Скруглённый прямоуг салатный.png index 38f308c3..f2ba3418 100644 Binary files a/data/Скруглённый прямоуг салатный.png and b/data/Скруглённый прямоуг салатный.png differ diff --git a/data/Скруглённый прямоугольник белый.png b/data/Скруглённый прямоугольник белый.png index c17d762d..f734b978 100644 Binary files a/data/Скруглённый прямоугольник белый.png and b/data/Скруглённый прямоугольник белый.png differ diff --git a/data/Скруглённый прямоугольник серый.png b/data/Скруглённый прямоугольник серый.png index 6b6dfbe6..c1684d86 100644 Binary files a/data/Скруглённый прямоугольник серый.png and b/data/Скруглённый прямоугольник серый.png differ diff --git a/data/Угловой квадрат2.png b/data/Угловой квадрат2.png index 4208f4c5..ca73f105 100644 Binary files a/data/Угловой квадрат2.png and b/data/Угловой квадрат2.png differ diff --git a/docs/build.sh b/docs/build.sh deleted file mode 100644 index 0f259e13..00000000 --- a/docs/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -dot -Tpng "структура.dot" -o "структура.png" -pandoc -f markdown_strict --verbose "README.md" > "README.doc" diff --git a/docs/струкура-по.dot b/docs/струкура-по.dot deleted file mode 100644 index 5b3b6680..00000000 --- a/docs/струкура-по.dot +++ /dev/null @@ -1,38 +0,0 @@ -digraph "Прибор УФ" -{ - graph [nodesep=0.5, overlap = false]; - node [shape=box, overlap = false]; - eth0 [label="eth0", shape=cds]; - eth1 [label="eth1", shape=cds]; - eth2 [label="eth2", shape=cds]; - tty0 [label="tty0", shape=cds]; - tty1 [label="tty1", shape=cds]; - tty2 [label="tty2", shape=cds]; - proto_capsrpb [label="Протокол КАПС-РПБ"]; - proto_5p28 [label="Протокол 5П-28"]; - uarep_uart [label="UART ModBus"]; - uarep_ctl [label="ПО УАРЭП"]; - caps_rpb [label="СПО \"КАПС РПБ\""]; - p16 [label="П16", shape=plaintext, style=filled]; - spt25left [label="СПТ25 левый борт", shape=plaintext, style=filled]; - spt25right [label="СПТ25 правый борт", shape=plaintext, style=filled]; - - eth0 -> proto_5p28; - eth1 -> proto_5p28; - eth0 -> proto_capsrpb; - eth1 -> proto_capsrpb; - eth0 -> uarep_uart; - eth1 -> uarep_uart; - eth2 -> caps_rpb; - proto_5p28 -> uarep_ctl; - uarep_uart -> uarep_ctl; - uarep_uart -> tty0; - uarep_uart -> tty1; - uarep_uart -> tty2; - uarep_ctl -> caps_rpb; - proto_capsrpb -> caps_rpb; - p16 -> eth0 [style=invis] - p16 -> eth1 [style=invis] - spt25left -> tty0 [style=invis] - spt25right -> tty1 [style=invis] -} diff --git a/scenes/frame-ecm-list/scroll-ecm-list.gd b/scenes/frame-ecm-list/scroll-ecm-list.gd index 8c6c2074..8ad0a9fd 100644 --- a/scenes/frame-ecm-list/scroll-ecm-list.gd +++ b/scenes/frame-ecm-list/scroll-ecm-list.gd @@ -8,7 +8,7 @@ const TableHeader = preload('res://table/header.tscn') ## Ячейка за const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader , TableHeader ] ## Описание ряда заголовка. const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit , CellLineEdit ] ## Описание ряда. const TABLE_HEADERS_TEXT = ['№', 'Название', 'Пеленг', 'Состояние' ] ## Заголовки таблицы. -const TABLE_COLUMN_SIZE = [ 65, 100, 95, 185 ] ## Ширины колонок. +const TABLE_COLUMN_SIZE = [ 65, 100, 90, 170 ] ## Ширины колонок. ## Состояние выполнения сеанса помехи const INTERFER_STATE = { diff --git a/scenes/tilemap/tilemap.gd b/scenes/tilemap/tilemap.gd index f013c667..39b0e0d3 100644 --- a/scenes/tilemap/tilemap.gd +++ b/scenes/tilemap/tilemap.gd @@ -373,7 +373,7 @@ func _process(delta) -> void: remove_child(req) req.queue_free() _req_count -= 1 - push_error('запрос \"%s\" не отправлен' % tile.url) #TODO: For Debug + push_error('запрос \"%s\" не отправлен' % tile.url) #TODO: For Deugs if _queue.is_empty(): emit_signal('load_completed') @@ -727,7 +727,7 @@ func blend_mask(val: bool) -> void: func update_coordinates_label(lon: float, lat: float) -> void: - coordinates_label = 'Координаты: NS: %f, EW: %f' % [lat, lon] + coordinates_label = 'Координаты: NS:%f, EW:%f' % [lat, lon] signaller.emit_signal('update_coordinates_map', coordinates_label) diff --git a/scenes/контроль/control_prd.gd b/scenes/контроль/control_prd.gd index 6e9a9d74..6c4475fd 100644 --- a/scenes/контроль/control_prd.gd +++ b/scenes/контроль/control_prd.gd @@ -1,7 +1,7 @@ extends Button var base_style: StyleBoxFlat -var tween +var tween: Tween var pulsing: bool = false var original_text: String var flag_control_is_over: bool = false @@ -14,7 +14,7 @@ func _ready(): func _setup_styles() -> void: - if get("theme_override_styles/disabled") == null: + if get('theme_override_styles/disabled') == null: base_style = StyleBoxFlat.new() base_style.border_color = Color(1.0, 0.5, 0.0) base_style.border_width_top = 4 @@ -22,26 +22,26 @@ func _setup_styles() -> void: base_style.border_width_left = 4 base_style.border_width_right = 4 base_style.bg_color = Color(0.2, 0.2, 0.2) - set("theme_override_styles/disabled", base_style) + set('theme_override_styles/disabled', base_style) else: - base_style = get("theme_override_styles/disabled") - set("theme_override_colors/font_disabled_color", Color(1.0, 1.0, 1.0)) + base_style = get('theme_override_styles/disabled') + set('theme_override_colors/font_disabled_color', Color(1.0, 1.0, 1.0)) func _setup_signals() -> void: - connect("pressed", Callable(self, "_on_pressed")) - + connect('pressed', Callable(self, '_on_pressed')) + if not signaller: return - var signals_to_connect := ["режим_работа", "режим_журнал", "режим_эмс", "режим_настройки", "режим_контроль"] + var signals_to_connect := ['режим_работа', 'режим_журнал', 'режим_эмс', 'режим_настройки", "режим_контроль'] for signal_name in signals_to_connect: if signaller.has_signal(signal_name): - signaller.connect(signal_name, Callable(self, "_on_status_change")) + signaller.connect(signal_name, Callable(self, '_on_status_change')) func _on_pressed(): disabled = true - text = "Идет выполнение контроля" + text = 'Идет выполнение контроля' flag_control_is_over = false _start_pulse() @@ -50,16 +50,13 @@ func _start_pulse(): if pulsing: return pulsing = true - tween = create_tween() + if not tween: + tween = create_tween() tween.set_loops() var color1 = Color(1.0, 0.5, 0.0) # оранжевый var color2 = Color(0.4, 0.4, 0.4) # серый - tween.tween_property(base_style, "border_color", color2, 0.5)\ - .set_trans(Tween.TRANS_SINE)\ - .set_ease(Tween.EASE_IN_OUT) - tween.tween_property(base_style, "border_color", color1, 0.5)\ - .set_trans(Tween.TRANS_SINE)\ - .set_ease(Tween.EASE_IN_OUT) + tween.tween_property(base_style, 'border_color', color2, 0.5).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT) + tween.tween_property(base_style, 'border_color', color1, 0.5).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT) func _stop_pulse(): @@ -80,16 +77,17 @@ func _on_status_change(): func _on_stop_control(): var time_dict = Time.get_datetime_dict_from_system() - text = 'Контроль выполнен %02d:%02d/%02d.%02d' % [ - time_dict.hour, - time_dict.minute, - time_dict.day, - time_dict.month] + text = 'Контроль завершён %02d:%02d/%02d.%02d' % [ + time_dict.hour, + time_dict.minute, + time_dict.day, + time_dict.month ] disabled = false - tooltip_text = 'Нажать для повторного контроля ' + tooltip_text = 'Нажать для запуска контроля ' flag_control_is_over = true func _exit_tree() -> void: if tween: tween.kill() + tween = null diff --git a/scenes/контроль/контроль.tscn b/scenes/контроль/контроль.tscn index 7a5c209c..6be0fd78 100644 --- a/scenes/контроль/контроль.tscn +++ b/scenes/контроль/контроль.tscn @@ -68,7 +68,7 @@ func on_serv_changed(u, pribor_node, _pribor_meta): pribor_node.state = int(u.se func on_mode_changed(): clean_pribor_items() reset_pribor_buttons() - $chk_show_functional.visible = false + $chk_show_functional.disabled = true $chk_show_functional.button_pressed = false @@ -146,6 +146,7 @@ func clean_pribor_items(): func on_pribor_press(pribor_path, header_text, pribor_node): if cur_pribor_node: cur_pribor_node.show_functional = false + $chk_show_functional.disabled = false $chk_show_functional.button_pressed = false cur_pribor_node = pribor_node clean_pribor_items() @@ -158,7 +159,7 @@ func on_pribor_press(pribor_path, header_text, pribor_node): push_error('экземпляр не создан: \\\"%s\\\" (%s)' % [pribor_path, header_text]) return $lbl_header.text = header_text - $chk_show_functional.visible = true + $chk_show_functional.disabled = false var meta_list = pribor_node.get_meta_list() if meta_list.find('unit_name') > -1: var unit_name = pribor_node.get_meta('unit_name') @@ -223,8 +224,7 @@ func _on_gui_input(event: InputEvent) -> void: clean_pribor_items() cur_pribor_node = null $chk_show_functional.button_pressed = false - $chk_show_functional.visible = false - $lbl_header.text = \"\" + $chk_show_functional.disabled = true func on_control_button_pressed(state: bool) -> void: @@ -566,6 +566,7 @@ metadata/unit_name = ["уарэп-эмс"] metadata/online_proc = "on_line_changed" [node name="label" type="Label" parent="pribor_uf"] +self_modulate = Color(0, 1, 0, 1) layout_mode = 0 offset_left = 15.0 offset_top = -44.0 @@ -1930,12 +1931,11 @@ horizontal_alignment = 1 vertical_alignment = 1 [node name="chk_show_functional" type="CheckButton" parent="."] -visible = false layout_mode = 0 -offset_left = 1028.0 -offset_top = 26.0 -offset_right = 1407.0 -offset_bottom = 60.0 +offset_left = 1029.0 +offset_top = 15.0 +offset_right = 1408.0 +offset_bottom = 49.0 theme_override_font_sizes/font_size = 22 text = "Показать функциональную схему Э2" flat = true diff --git a/scenes/настройки/нас1E59.tmp b/scenes/настройки/нас1E59.tmp deleted file mode 100644 index 4dd57e8a..00000000 --- a/scenes/настройки/нас1E59.tmp +++ /dev/null @@ -1,102 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://bnptm4rlp60dq"] - -[ext_resource type="Script" path="res://scenes/настройки/настройки.gd" id="1_2l3rd"] -[ext_resource type="Script" path="res://table/table.gd" id="2_ts42i"] - -[sub_resource type="GDScript" id="GDScript_anjmx"] -script/source = "extends LineEdit - -func _ready() -> void: text = ProjectSettings.get('application/config/map_server_addr') - - -func _on_text_changed(new_text: String) -> void: - ProjectSettings.set('application/config/map_server_addr', new_text) - ProjectSettings.save_custom('override.cfg') -" - -[node name="Настройки" type="Panel"] -script = ExtResource("1_2l3rd") - -[node name="table" type="GridContainer" parent="."] -layout_mode = 2 -offset_left = 32.0 -offset_top = 96.0 -offset_right = 241.0 -offset_bottom = 535.0 -columns = 2 -script = ExtResource("2_ts42i") - -[node name="Label1" type="Label" parent="."] -layout_mode = 0 -offset_left = 16.0 -offset_top = 60.0 -offset_right = 434.0 -offset_bottom = 82.0 -text = "Управление элементами в режиме с ограниченным доступом" - -[node name="Label2" type="Label" parent="."] -layout_mode = 0 -offset_left = 16.0 -offset_top = 20.0 -offset_right = 476.0 -offset_bottom = 50.0 -text = "Текущий режим доступа: полный" -vertical_alignment = 1 - -[node name="edt_mapaddr" type="LineEdit" parent="."] -layout_mode = 0 -offset_left = 660.0 -offset_top = 80.0 -offset_right = 1032.0 -offset_bottom = 110.0 -script = SubResource("GDScript_anjmx") - -[node name="Label" type="Label" parent="edt_mapaddr"] -layout_mode = 0 -offset_left = -180.0 -offset_right = -20.0 -offset_bottom = 30.0 -text = "Адрес сервера карт:" -vertical_alignment = 1 - -[node name="GridContainer2" type="GridContainer" parent="."] -layout_mode = 0 -offset_left = 478.0 -offset_top = 154.0 -offset_right = 784.0 -offset_bottom = 260.0 -columns = 2 - -[node name="external_cu_lbl" type="Label" parent="GridContainer2"] -layout_mode = 2 -text = "Внешнее целеуказание." -vertical_alignment = 1 - -[node name="external_cu_btn" type="CheckButton" parent="GridContainer2"] -layout_mode = 2 - -[node name="Label19" type="Label" parent="GridContainer2"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Кнопка «Подавление». -Отключить отображение этой кнопки, -что бы тип помех применялся сразу." - -[node name="CheckButton18" type="CheckButton" parent="GridContainer2"] -layout_mode = 2 -size_flags_horizontal = 6 -size_flags_vertical = 6 -button_pressed = true - -[node name="lbl_commit" type="Label" parent="."] -layout_mode = 0 -offset_left = 480.0 -offset_top = 20.0 -offset_right = 1040.0 -offset_bottom = 50.0 -text = "Текущая версия ПО УАРЭП:" -vertical_alignment = 1 - -[connection signal="text_changed" from="edt_mapaddr" to="edt_mapaddr" method="_on_text_changed"] -[connection signal="pressed" from="GridContainer2/external_cu_btn" to="." method="_on_external_cu_btn_pressed"] diff --git a/scenes/работа/работа.gd b/scenes/работа/работа.gd index 54ab937e..df17dfd1 100644 --- a/scenes/работа/работа.gd +++ b/scenes/работа/работа.gd @@ -39,6 +39,7 @@ var color_emit: Color var color_emit_sel: Color var color_closed: Color var color_closed_emit: Color +var signal_conections: Array var course = 0.0 ## Курс корабля @@ -90,8 +91,35 @@ const VAL_TO_EVENT = { true: 'full_auto' } ## Выбор целей и установка помех автоматически. +var SIGNALS_CONNECTIONS = [ + [interfer, 'interfer_update', 'on_interfer_new'], + [signaller, 'bip_pressed', 'on_bip_pressed'], + [signaller, 'clear_klaster', 'clear_all_klaster'], + [signaller, 'fs_selected', 'on_fs_selected'], + [signaller, 'fs_update_color', 'set_fs_color'], + [signaller, 'fs_update_state', 'on_fs_update_state'], + [signaller, 'interfer_new', 'on_interfer_new'], + [signaller, 'interfer_off_all', 'on_interfer_off_all'], + [signaller, 'interfer_prinuditelno', 'on_chk_interfer_prinuditelno'], + [signaller, 'interfer_prinuditelno', 'on_interfer_prinuditelno'], + [signaller, 'interfer_selected', 'on_interfer_selected'], + [signaller, 'map_user_panning', 'on_user_panning'], + [signaller, 'on_prog_ecm_off', 'on_interfer_new'], + [signaller, 'rto_threat_sel', 'on_rto_threat_sel'], + [signaller, 'rto_threat_unsel', 'on_rto_threat_unsel'], + [signaller, 'sector_klaster', 'sector_klaster'], + [signaller, 'th_aoa_update', 'on_th_aoa_update'], + [signaller, 'threat_selected', 'on_threat_selected'], + [signaller, 'update_coordinates_map', 'on_update_coordinates_label'], + [signaller, 'update_scale_map', 'on_update_scale_label'], + [threats, 'threat_lost', 'on_threat_lost'], + [threats, 'threat_new', 'on_threat_new'], + [threats, 'threat_update', 'on_threat_update'], + [threats, 'threats_resized', 'on_threats_resized'] ] + + ## Обработчик выбора цели. -func on_threat_selected(th, ecm_btns): on_rto_threat_sel(th.id, ecm_btns) +func on_threat_selected(th): on_rto_threat_sel(th.id) ## Встроенный обратный вызов. @@ -110,6 +138,8 @@ func on_settings_changed(): color_ecm = ProjectSettings.get_setting('application/interfer/interfer_color', Color(0.58, 0.47, 0.51, 1.0)) color_select = ProjectSettings.get_setting('application/interfer/select_color', Color(1.0, 1.0, 1.0, 1.0)) color_closed = ProjectSettings.get_setting('application/interfer/closed_sectors', Color(0.0, 0.0, 0.0, 1.0)) + min_zoom = ProjectSettings.get_setting('application/config/map_minimum_zoom', 5) + max_zoom = ProjectSettings.get_setting('application/config/map_maximum_zoom', 19) color_emit_sel = color_select color_closed_emit = color_closed @@ -168,43 +198,42 @@ func _ready(): ProjectSettings.connect('settings_changed', on_settings_changed) on_settings_changed() init_fs_failed() - min_zoom = ProjectSettings.get_setting('application/config/map_minimum_zoom', 5) - max_zoom = ProjectSettings.get_setting('application/config/map_maximum_zoom', 19) drag_fsm = DragFSM.OFF var btns_select: Array = get_tree().get_nodes_in_group('группа-режим-выбора') btns_select.any(func(btn): btn.button_connect('pressed', Callable(self, 'on_button_select').bind(btn, btns_select))) var nodes: Array = get_tree().get_nodes_in_group('группа-режим-помехи') nodes.any(func(btn): btn.button_connect('pressed', Callable(self, 'on_button_pressed').bind(btn, nodes))) - $btn_close.button_connect('pressed', Callable(self, 'on_btn_close').bind($btn_close)) - $btn_work.button_connect('pressed', Callable(self, 'on_btn_work').bind($btn_work)) - threats.connect('threat_new', Callable(self, 'on_threat_new')) - threats.connect('threat_lost', Callable(self, 'on_threat_lost')) - threats.connect('threats_resized', Callable(self, 'on_threats_resized')) - threats.connect('threat_update', Callable(self, 'on_threat_update')) - signaller.connect('rto_threat_sel', Callable(self, 'on_rto_threat_sel').bind(nodes)) - signaller.connect('bip_pressed', Callable(self, 'on_bip_pressed').bind(nodes)) - signaller.connect('rto_threat_unsel', Callable(self, 'on_rto_threat_unsel').bind(nodes)) - signaller.connect('threat_selected', Callable(self, 'on_threat_selected').bind(nodes)) - signaller.connect('interfer_selected', Callable(self, 'on_interfer_selected').bind(nodes)) - signaller.connect('interfer_new', Callable(self, 'on_interfer_new')) - signaller.connect('on_prog_ecm_off', Callable(self, 'on_interfer_new')) - signaller.connect('interfer_off_all', Callable(self, 'on_interfer_off_all')) - signaller.connect('interfer_prinuditelno', Callable(self, 'on_interfer_prinuditelno').bind(nodes)) - signaller.connect('fs_selected', Callable(self, 'on_fs_selected')) - signaller.connect('fs_update_color', Callable(self, 'set_fs_color')) - interfer.connect('interfer_update', Callable(self, 'on_interfer_new')) - signaller.connect('interfer_prinuditelno', Callable(self, 'on_chk_interfer_prinuditelno')) - signaller.connect('fs_update_state', Callable(self, 'on_fs_update_state')) - signaller.connect('map_user_panning', Callable(self, 'on_user_panning')) - signaller.connect('update_coordinates_map', Callable(self, 'on_update_coordinates_label')) - signaller.connect('update_scale_map', Callable(self, 'on_update_scale_label')) - signaller.connect('sector_klaster', Callable(self, 'sector_klaster')) - signaller.connect('clear_klaster', Callable(self, 'clear_all_klaster')) - signaller.connect('th_aoa_update', Callable(self, 'on_th_aoa_update')) + $btn_close.button_connect('pressed', on_btn_close) + $btn_work.button_connect('pressed', on_btn_work) var unit_nav = network.get_unit_instance('навигация') unit_nav.connect('data_received', on_navi_data_received) on_btn_center_toggled(true) on_btn_activate_toggled(true) + signaller.connect('режим_работа', connect_all) + signaller.connect('режим_контроль', disconnect_all) + signaller.connect('режим_журнал', disconnect_all) + signaller.connect('режим_эмс', disconnect_all) + signaller.connect('режим_эмс2', disconnect_all) + signaller.connect('режим_настройки', disconnect_all) + connect_all() + + +func connect_all() -> void: + signal_conections.clear() + for item in SIGNALS_CONNECTIONS: + var proc = Callable(self, item[2]) + var rc = item[0].connect(item[1], proc) + if rc == Error.OK: + signal_conections.append([item[0], item[1], proc]) + else: + var ers = error_string(rc) + push_error('%s: %s %s %s' % [ers, item[0], item[1], item[2]]) + + +func disconnect_all() -> void: + for item in signal_conections: + item[0].disconnect(item[1], item[2]) + signal_conections.clear() func sector_klaster(sector_data): @@ -320,13 +349,13 @@ func on_threat_lost(th) -> void: ## обработчик нажатия на цель на экране. -func on_bip_pressed(th_id, _ecm_btns): +func on_bip_pressed(th_id): if btn_select == BtnSel.THREAT: signaller.emit_signal('rto_threat_sel', th_id) ## Обработчик выбора РТО цели. -func on_rto_threat_sel(th_id, ecm_btns): +func on_rto_threat_sel(th_id): var bips: Array = get_children().filter(func(item): return item.name.is_valid_int()) for item in bips: if th_id == item.name.to_int(): @@ -336,6 +365,7 @@ func on_rto_threat_sel(th_id, ecm_btns): item.set_sel_visible(false) var th = thrs_dict[th_id] var krp = interfer.get_krp(th) + var ecm_btns: Array = get_tree().get_nodes_in_group('группа-режим-помехи') for btn in ecm_btns: set_btns_disabled(false, btn) var btn_meta = btn.get_meta('rfi_name') @@ -346,13 +376,14 @@ func on_rto_threat_sel(th_id, ecm_btns): ## Обработчик снятия выбора РТО цели. -func on_rto_threat_unsel(th_id, ecm_btns): +func on_rto_threat_unsel(th_id): var bips: Array = get_children().filter(func(item): return item.name.is_valid_int()) for item in bips: if th_id == item.name.to_int(): item.set_sel_visible(false) break set_ecm_btns_state(true) + var ecm_btns: Array = get_tree().get_nodes_in_group('группа-режим-помехи') for btn in ecm_btns: btn.set_rec_visible(false) @@ -386,12 +417,13 @@ func on_button_pressed(btn_this, btn_others) -> void: ## Управляет состоянием кнопок в радиогруппе при выборе помехи. -func on_interfer_selected(ecm, btns) -> void: +func on_interfer_selected(ecm) -> void: var ecm_name: String if ecm != null: ecm_name = ecm.krp else: ecm_name = interfer.INTERFER_OFF + var btns: Array = get_tree().get_nodes_in_group('группа-режим-помехи') for btn in btns: set_btns_disabled(false, btn) btn.get_meta('rfi_name') @@ -578,13 +610,14 @@ func set_btns_disabled(value: bool, btn): btn.set_disabled(value) -func on_interfer_prinuditelno(prenuditelno_sectors, btns): +func on_interfer_prinuditelno(prenuditelno_sectors): for key in prenuditelno_sectors: var sectors = [] for sector in prenuditelno_sectors[key]: sectors.append(prd.get_fs_param(sector)) signaller.emit_signal('interfer_init', key, sectors, interfer.POW_DEFAULT) update_fs_colors() + var btns: Array = get_tree().get_nodes_in_group('группа-режим-помехи') for btn in btns: btn.set_pressed(false) set_btns_disabled(true, btn) @@ -616,16 +649,16 @@ func on_update_scale_label(scale_label) -> void: $scale_map.text = str(scale_label) -func on_btn_close(btn): +func on_btn_close(): await get_tree().create_timer(0.2).timeout - btn.pressed = false + $btn_close.pressed = false fs_closed.merge(fs_selected) signaller.emit_signal('update_fs_closed', fs_closed) -func on_btn_work(btn): +func on_btn_work(): await get_tree().create_timer(0.2).timeout - btn.pressed = false + $btn_work.pressed = false fs_closed.clear() for fs_index in prd.FS_PRD.keys(): if fs_index in fs_selected: continue diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index 9931c649..c1eb2df2 100644 --- a/scenes/работа/работа.tscn +++ b/scenes/работа/работа.tscn @@ -306,36 +306,36 @@ vertical_alignment = 1 [node name="coordinates_map" type="Label" parent="."] layout_mode = 0 -offset_left = 654.0 -offset_top = -23.0 -offset_right = 766.0 -offset_bottom = -4.0 +offset_left = 660.0 +offset_top = -24.0 +offset_right = 772.0 +offset_bottom = -5.0 text = "Координаты:" [node name="scale_map" type="Label" parent="."] layout_mode = 0 -offset_left = 1009.0 -offset_top = -23.0 -offset_right = 1119.0 -offset_bottom = -2.0 +offset_left = 1003.0 +offset_top = -24.0 +offset_right = 1113.0 +offset_bottom = -3.0 text = "Масштаб:" [node name="zoom_plus" type="Button" parent="."] layout_mode = 0 -offset_left = 952.0 -offset_top = 43.0 -offset_right = 984.0 -offset_bottom = 75.0 +offset_left = 1056.0 +offset_top = 230.0 +offset_right = 1088.0 +offset_bottom = 262.0 theme_override_fonts/font = SubResource("SystemFont_5ffal") theme_override_font_sizes/font_size = 20 text = "+" [node name="zoom_minus" type="Button" parent="."] layout_mode = 0 -offset_left = 952.0 -offset_top = 84.0 -offset_right = 984.0 -offset_bottom = 116.0 +offset_left = 1056.0 +offset_top = 270.0 +offset_right = 1088.0 +offset_bottom = 302.0 theme_override_font_sizes/font_size = 20 text = "−" diff --git a/scenes/эмс2/эмс2.tscn b/scenes/эмс2/эмс2.tscn index 4e6e530d..90bde52a 100644 --- a/scenes/эмс2/эмс2.tscn +++ b/scenes/эмс2/эмс2.tscn @@ -2,7 +2,6 @@ [ext_resource type="Texture2D" uid="uid://hkcvl2waf63s" path="res://data/вид сверху.png" id="1_b7vcf"] [ext_resource type="Script" uid="uid://bvlqgv7aapebl" path="res://scenes/эмс2/эмс_тг.gd" id="1_l3ueu"] -[ext_resource type="Texture2D" uid="uid://b1dw06ahtftq2" path="res://data/Окно частот0.png" id="3_2spgl"] [ext_resource type="Texture2D" uid="uid://0w6q4vfst0ry" path="res://data/OP-63.png" id="3_8gk36"] [ext_resource type="Texture2D" uid="uid://coxhivvc6uibs" path="res://data/Состояние РЭС 40.png" id="4_b3mus"] [ext_resource type="Texture2D" uid="uid://073el51yholj" path="res://data/454.png" id="4_nqi0i"] @@ -34,7 +33,11 @@ [ext_resource type="Texture2D" uid="uid://carr8bw5rwiwj" path="res://data/Кнопка подтверждения01.png" id="32_p41nv"] [ext_resource type="Texture2D" uid="uid://3siondd3feev" path="res://data/Скруглённый прямоугольник белый.png" id="33_5ifkb"] +[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_5u4bk"] +load_path = "res://.godot/imported/Окно частот0.png-6b01791c971bddb01337caf9077bf060.ctex" + [sub_resource type="CompressedTexture2D" id="CompressedTexture2D_l3ueu"] +load_path = "res://.godot/imported/Скруглённый квадрат серый.png-4655829309cca3b1dec2c9ae01376d54.ctex" [node name="Panel" type="Panel"] script = ExtResource("1_l3ueu") @@ -53,7 +56,7 @@ offset_top = 240.0 offset_right = 1649.0 offset_bottom = 813.0 scale = Vector2(0.95, 0.95) -texture = ExtResource("3_2spgl") +texture = SubResource("CompressedTexture2D_5u4bk") expand_mode = 1 [node name="Op-63" type="TextureRect" parent="."] @@ -66,13 +69,13 @@ scale = Vector2(0.312207, 0.312207) texture = ExtResource("3_8gk36") [node name="СостояниеРэс44" type="Sprite2D" parent="Op-63"] -position = Vector2(285.067, 253.037) -scale = Vector2(2.1, 2.1) +position = Vector2(277.772, 259.444) +scale = Vector2(1.77945, 1.77945) texture = ExtResource("4_b3mus") [node name="СостояниеРэс24" type="Sprite2D" parent="Op-63"] -position = Vector2(285.067, 150.541) -scale = Vector2(2.1, 2.1) +position = Vector2(277.772, 192.18) +scale = Vector2(1.77945, 1.77945) texture = ExtResource("5_yqn2y") [node name="СостояниеРэс2" type="Sprite2D" parent="Op-63"] @@ -91,18 +94,18 @@ scale = Vector2(0.312, 0.312) texture = ExtResource("4_nqi0i") [node name="СостояниеРэс45" type="Sprite2D" parent="454"] -position = Vector2(287.571, 253.205) -scale = Vector2(2.1, 2.1) +position = Vector2(277.956, 259.615) +scale = Vector2(1.78063, 1.78063) texture = ExtResource("4_b3mus") [node name="СостояниеРэс25" type="Sprite2D" parent="454"] -position = Vector2(287.571, 153.847) -scale = Vector2(2.1, 2.1) +position = Vector2(277.956, 192.308) +scale = Vector2(1.78063, 1.78063) texture = ExtResource("5_yqn2y") [node name="СостояниеРэс3" type="Sprite2D" parent="454"] -position = Vector2(285.256, 41.6667) -scale = Vector2(4, 4) +position = Vector2(275.641, 38.4615) +scale = Vector2(3.20513, 3.20513) texture = ExtResource("6_m57px") [node name="lbl_trassa" type="Label" parent="454"] @@ -117,25 +120,25 @@ text = "Трасса" [node name="Го" type="TextureRect" parent="."] layout_mode = 0 offset_left = 488.0 -offset_top = 84.0 +offset_top = 85.0 offset_right = 701.0 -offset_bottom = 376.0 +offset_bottom = 377.0 scale = Vector2(0.312, 0.312) texture = ExtResource("5_e7tlv") [node name="СостояниеРэс40" type="Sprite2D" parent="Го"] -position = Vector2(287.66, 253.205) -scale = Vector2(2.1, 2.1) +position = Vector2(278.045, 253.205) +scale = Vector2(1.78063, 1.78063) texture = ExtResource("4_b3mus") [node name="СостояниеРэс20" type="Sprite2D" parent="Го"] -position = Vector2(287.66, 150.641) -scale = Vector2(2.1, 2.1) +position = Vector2(278.045, 185.897) +scale = Vector2(1.78063, 1.78063) texture = ExtResource("5_yqn2y") [node name="СостояниеЭмсСлабыйСигнал" type="Sprite2D" parent="Го"] -position = Vector2(284.455, 38.4619) -scale = Vector2(4, 3.796) +position = Vector2(278.045, 118.59) +scale = Vector2(3.37683, 3.20513) texture = ExtResource("9_5u4bk") [node name="Рлс1" type="TextureRect" parent="."] @@ -148,18 +151,18 @@ scale = Vector2(0.312, 0.312) texture = ExtResource("6_y58bl") [node name="СостояниеРэс41" type="Sprite2D" parent="Рлс1"] -position = Vector2(287.661, 253.205) -scale = Vector2(2.1, 2.1) +position = Vector2(278.045, 259.615) +scale = Vector2(1.78063, 1.78063) texture = ExtResource("4_b3mus") [node name="СостояниеРэс21" type="Sprite2D" parent="Рлс1"] -position = Vector2(287.661, 153.846) -scale = Vector2(2.1, 2.1) +position = Vector2(278.045, 192.308) +scale = Vector2(1.78063, 1.78063) texture = ExtResource("5_yqn2y") [node name="СостояниеЭмсСлабыйСигнал2" type="Sprite2D" parent="Рлс1"] -position = Vector2(287.66, 38.4615) -scale = Vector2(4, 3.796) +position = Vector2(278.045, 125) +scale = Vector2(3.37683, 3.20513) texture = ExtResource("9_5u4bk") [node name="Рлс2" type="TextureRect" parent="."] @@ -172,37 +175,37 @@ scale = Vector2(0.312, 0.312) texture = ExtResource("7_mxw8g") [node name="СостояниеРэс42" type="Sprite2D" parent="Рлс2"] -position = Vector2(287.661, 253.205) -scale = Vector2(2.1, 2.1) +position = Vector2(278.045, 259.615) +scale = Vector2(1.78063, 1.78063) texture = ExtResource("4_b3mus") [node name="СостояниеРэс22" type="Sprite2D" parent="Рлс2"] -position = Vector2(287.661, 153.846) -scale = Vector2(2.1, 2.1) +position = Vector2(278.045, 192.308) +scale = Vector2(1.78063, 1.78063) texture = ExtResource("5_yqn2y") [node name="СостояниеЭмсСлабыйСигнал3" type="Sprite2D" parent="Рлс2"] -position = Vector2(287.66, 38.4615) -scale = Vector2(4, 3.796) +position = Vector2(278.045, 125) +scale = Vector2(3.37683, 3.20513) texture = ExtResource("9_5u4bk") [node name="Ннвс" type="TextureRect" parent="."] layout_mode = 0 offset_left = 1240.0 -offset_top = 84.0 +offset_top = 88.0 offset_right = 1453.0 -offset_bottom = 376.0 +offset_bottom = 380.0 scale = Vector2(0.312, 0.312) texture = ExtResource("8_q16jd") [node name="СостояниеРэс43" type="Sprite2D" parent="Ннвс"] -position = Vector2(287.571, 253.205) -scale = Vector2(2.1, 2.1) +position = Vector2(277.956, 253.205) +scale = Vector2(1.78063, 1.78063) texture = ExtResource("4_b3mus") [node name="СостояниеРэс23" type="Sprite2D" parent="Ннвс"] -position = Vector2(287.571, 153.846) -scale = Vector2(2.1, 2.1) +position = Vector2(277.956, 185.897) +scale = Vector2(1.78063, 1.78063) texture = ExtResource("5_yqn2y") [node name="УгловойКвадрат2" type="Sprite2D" parent="."] @@ -403,9 +406,9 @@ texture = SubResource("CompressedTexture2D_l3ueu") [node name="Label" type="Label" parent="."] layout_mode = 0 -offset_left = 799.0 +offset_left = 800.0 offset_top = 246.0 -offset_right = 872.0 +offset_right = 873.0 offset_bottom = 265.0 theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_font_sizes/font_size = 16 @@ -413,7 +416,7 @@ text = "Излучение" [node name="Label2" type="Label" parent="."] layout_mode = 0 -offset_left = 814.0 +offset_left = 813.0 offset_top = 503.0 offset_right = 861.0 offset_bottom = 522.0 @@ -481,52 +484,52 @@ theme_override_colors/font_color = Color(0, 0, 0, 1) text = "Изделие" [node name="Label" type="Label" parent="СкруглённыйПрямоугСалатный"] -offset_left = -33.7501 +offset_left = -33.0 offset_top = -10.2857 -offset_right = 34.2499 -offset_bottom = 8.7143 +offset_right = 35.0 +offset_bottom = 8.71429 theme_override_colors/font_color = Color(0, 0, 0, 1) text = "Комплекс" [node name="Label3" type="Label" parent="СкруглённыйПрямоугСалатный"] -offset_left = 132.75 -offset_top = -11.1428 -offset_right = 179.75 -offset_bottom = 11.8572 +offset_left = 133.0 +offset_top = -10.0 +offset_right = 180.0 +offset_bottom = 9.0 theme_override_colors/font_color = Color(0, 0, 0, 1) text = "Режим" [node name="Label4" type="Label" parent="СкруглённыйПрямоугСалатный"] -offset_left = 210.751 +offset_left = 209.25 offset_top = -10.2857 -offset_right = 259.751 +offset_right = 258.25 offset_bottom = 8.7143 theme_override_colors/font_color = Color(0, 0, 0, 1) text = "Азимут" [node name="Label5" type="Label" parent="СкруглённыйПрямоугСалатный"] -offset_left = 620.252 -offset_top = -23.1428 -offset_right = 699.252 -offset_bottom = 25.8572 +offset_left = 627.0 +offset_top = -20.5713 +offset_right = 693.0 +offset_bottom = 20.4287 theme_override_colors/font_color = Color(0, 0, 0, 1) text = "Запрет передачи" horizontal_alignment = 1 [node name="Label6" type="Label" parent="СкруглённыйПрямоугСалатный"] -offset_left = 518.251 -offset_top = -12.0 -offset_right = 576.251 -offset_bottom = 11.0 +offset_left = 516.75 +offset_top = -10.2857 +offset_right = 574.75 +offset_bottom = 8.7143 theme_override_colors/font_color = Color(0, 0, 0, 1) text = "Верхняя" [node name="Label7" type="Label" parent="СкруглённыйПрямоугСалатный"] -offset_left = 440.0 -offset_top = -11.0 -offset_right = 494.0 -offset_bottom = 12.0 +offset_left = 441.0 +offset_top = -10.2857 +offset_right = 495.0 +offset_bottom = 8.7143 theme_override_colors/font_color = Color(0, 0, 0, 1) text = "Нижняя" @@ -539,14 +542,12 @@ theme_override_colors/font_color = Color(0, 0, 0, 1) text = "Кластер" [node name="Label9" type="Label" parent="СкруглённыйПрямоугСалатный"] -offset_left = 276.001 -offset_top = -20.5714 -offset_right = 350.001 -offset_bottom = 20.4286 +offset_left = 275.25 +offset_top = -10.2857 +offset_right = 349.25 +offset_bottom = 8.7143 theme_override_colors/font_color = Color(0, 0, 0, 1) -text = "Угол -места" -horizontal_alignment = 1 +text = "Угол места" [node name="Label10" type="Label" parent="СкруглённыйПрямоугСалатный"] offset_left = 747.0 diff --git a/scripts/network.gd b/scripts/network.gd index a8d709d1..e0827ea8 100644 --- a/scripts/network.gd +++ b/scripts/network.gd @@ -405,7 +405,7 @@ func _process(_delta: float) -> void: var sock: = send_sockets[unit_name] var dst_port: = dst_ports[unit_name] var dst_addr: = dst_addrs[unit_name] - while (Error.OK == unit_udptx.process(tick)): + while Error.OK == unit_udptx.process(tick): var tx_data: = unit_udptx.tx_data.slice(0, unit_udptx.tx_len) sock.send_to([dst_addr, dst_port], tx_data) for unit_name: StringName in units_udprx: diff --git a/table/selector.tscn b/table/selector.tscn index 47a6c745..dfd76979 100644 --- a/table/selector.tscn +++ b/table/selector.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://pd3fcx55duj2"] -[ext_resource type="Texture2D" uid="uid://bw3yv3smvaxqn" path="res://table/nine-patch.png" id="1_ik10p"] +[ext_resource type="Texture2D" uid="uid://vqajxsh5xamt" path="res://data/nine-patch.png" id="1_ik10p"] [node name="NinePatchRect" type="NinePatchRect"] offset_right = 17.0 diff --git a/table/table.gd b/table/table.gd index f17dbfe2..5a3cf9f5 100644 --- a/table/table.gd +++ b/table/table.gd @@ -281,7 +281,7 @@ func check_event_pos(event_pos: Vector2, obj: Control): ## -func setselector_color_proc(instance: Object, function: String) -> void: +func set_selector_color_proc(instance: Object, function: String) -> void: selector_color_proc = Callable(instance, function) _assert(selector_color_proc.is_valid()) @@ -391,13 +391,17 @@ func add_row(row_types: Array) -> void: add_child(node) if allow_set_size: node.custom_minimum_size.x = columns_min_size[i_col] - node.size.x = columns_min_size[i_col] + node.set_deferred('size', Vector2(columns_min_size[i_col], node.size.y)) nodes[node_key] = node var conn = Callable(self, '_on_focus_entered').bind(node) node.connect('focus_entered', conn) set_node_meta(i_col, i_row, 'callable_focus_entered', conn) +func _set_size_x_defered(node: Control, val: Vector2): + node.size = val + + ## func _on_focus_entered(node): var indexes = get_key_indexes(node.name)