Смена цвета в ЭМС ТГ

This commit is contained in:
lepshiy
2025-11-27 16:31:59 +03:00
parent 1937f0e45e
commit 5e00529f8b
58 changed files with 368 additions and 642 deletions

View File

@@ -36,4 +36,4 @@
- После клонирования запустить скрипт `git-hooks-config.sh`
- В среде **Windows** запуск скрипта `git-hooks-config.sh` производить из оболочки `git bash`
- Нужно обновить `settings.json`
- поиск циклических зависимостей (не реализованно)
- поиск циклических зависимостей

4
docs/build.sh Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
dot -Tpng "структура.dot" -o "структура.png"
pandoc -f markdown_strict --verbose "README.md" > "README.doc"

View File

@@ -0,0 +1,38 @@
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]
}

View File

@@ -28,7 +28,7 @@ interfer/center_offset=Vector2(200, 225)
interfer/default_color0=Color(0.38, 0.47, 0.51, 1)
interfer/default_color1=Color(0.39, 0.44, 0.5, 1)
interfer/select_color=Color(1, 1, 1, 1)
interfer/interfer_color=Color(0.9, 0.1, 0.25, 0.9)
interfer/interfer_color=Color(0.58, 0.47, 0.51, 1)
interfer/resend_timeout=1000.0
config/external_cu=false
config/unit_rr_request_period=20.0
@@ -36,7 +36,7 @@ config/kems_files_path="user://kems/"
config/emsg_files_path="user://emsg/"
config/settings_path="user://settings.json"
config/unit_bpo_request_period=20.0
interfer/emit_color=Color(0.9, 0.1, 0.25, 0.5)
interfer/emit_color=Color(0.58, 0.471, 0.51, 0.2)
interfer/closed_sectors=Color(0, 0, 0, 1)
[autoload]

View File

@@ -35,10 +35,8 @@ func get_radius_outter() -> float: return material.get('shader_parameter/radius
func get_radius_inner_0() -> float: return material.get('shader_parameter/radius_inner_0')
func get_radius_inner_1() -> float: return material.get('shader_parameter/radius_inner_1')
func get_band_colors(val: Array): return material.get('shader_parameter/ant_band_c')
func get_band_failures(val: Array): return material.get('shader_parameter/ant_band_m')
func set_band_colors(val: Array): material.set('shader_parameter/ant_band_c', val)
func set_band_failures(val: Array): material.set('shader_parameter/ant_band_m', val)
## Добавляет сектор запрета[br]
## [param id] - Индекс сектора запрета.[br]

View File

@@ -7,8 +7,8 @@ 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, 90, 170 ] ## Ширины колонок.
const TABLE_HEADERS_TEXT = ['Номер', 'Название', 'Пеленг', 'Состояние' ] ## Заголовки таблицы.
const TABLE_COLUMN_SIZE = [ 75, 100, 90, 170 ] ## Ширины колонок.
## Состояние выполнения сеанса помехи
const INTERFER_STATE = {
@@ -122,8 +122,7 @@ func on_interfer_new(ecm, table_index):
# Будем надеяться, что отложенные вызовы производятся в том же порядке
$table.call_deferred('clear_rows_selected')
$table.call_deferred('set_row_selected', i_row, true)
if not interfer.auto_enabled:
signaller.emit_signal('interfer_selected', ecm)
signaller.emit_signal('interfer_selected', ecm)
func on_interfer_off(ecm, table_index):

View File

@@ -35,5 +35,5 @@ script = ExtResource("2_empn3")
[node name="table" type="GridContainer" parent="scroll"]
layout_mode = 2
columns = 5
columns = 4
script = ExtResource("3_4bupu")

View File

@@ -5,16 +5,14 @@ class_name scroll_threats extends ScrollContainer
const CellLineEdit = preload('res://table/ячейка-2.tscn') ## Ячейка таблицы.
const TableHeader = preload('res://table/header.tscn') ## Ячейка заголовок таблицы.
const EmitLed = preload('res://scenes/frame-threats/emit-led.tscn') ## Ячейка заголовок таблицы.
const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader, TableHeader , TableHeader ] ## Описание ряда заголовка.
const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit, CellLineEdit, EmitLed ] ## Описание ряда.
const TABLE_COLUMN_PARAM = ['id', 'aoa', 'freq', 'proto', 'emit' ] ## Параметры цели отображаемые в таблице.
const TABLE_HEADERS_TEXT = ['', 'Пеленг', 'Частота, МГц', 'Протокол', 'Помеха' ] ## Заголовки таблицы.
const TABLE_COLUMN_SIZE = [ 65, 70, 110, 140, 65] ## Ширины колонок.
const TABLE_TEXT_ROWS = 4
const EMIT_STATE_COL = 4
const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader, TableHeader ] ## Описание ряда заголовка.
const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit, CellLineEdit ] ## Описание ряда.
const TABLE_COLUMN_PARAM = ['id', 'aoa', 'freq', 'proto' ] ## Параметры цели отображаемые в таблице.
const TABLE_HEADERS_TEXT = ['Номер', 'Пеленг', 'Частота, МГц', 'Протокол' ] ## Заголовки таблицы.
const TABLE_COLUMN_SIZE = [ 65, 145, 145, 90 ] ## Ширины колонок.
## Снимает выделение цели.
func on_rto_threat_unsel(_th_id): $table.clear_rows_selected()
@@ -65,17 +63,6 @@ func on_threat_update(th, table_index: Dictionary):
var row = map_th_to_row(th)
var i_row = table_index[th.id]
$table.set_row_text(i_row, row)
var emit_node = $table.get_node2(EMIT_STATE_COL, i_row)
var emit_txr = emit_node.get_node('texture-led')
if th.emit_state == 0:
emit_txr.visible = false
elif th.emit_state == 1:
emit_txr.visible = true
emit_txr.self_modulate = Color.ORANGE
elif th.emit_state == 2:
emit_txr.visible = true
emit_txr.self_modulate = Color.RED
## Обрабатывает сигнал [b]threat_lost[/b].
@@ -91,7 +78,7 @@ func on_threat_new(th, table_index):
$table.add_row(TABLE_ROW)
var row = map_th_to_row(th)
$table.set_row_text(i_row, row)
disable_edit($table, TABLE_TEXT_ROWS, i_row)
$table.set_row_editable(i_row, false)
$table.set_node_user_data(0, i_row, th)
table_index[th.id] = i_row
@@ -99,11 +86,10 @@ func on_threat_new(th, table_index):
## Преобразует цель в строку таблицы.
func map_th_to_row(th) -> Array:
var row: = Array()
row.resize(TABLE_TEXT_ROWS)
row.resize(TABLE_COLUMN_PARAM.size())
var i_col: int = 0
for param_name in TABLE_COLUMN_PARAM:
var val = th.get(param_name)
if val == null: continue
row[i_col] = '%0.1f' % val if val is float else '%s' % val
if not th.fflags[param_name]:
row[i_col] = ''
@@ -118,13 +104,3 @@ func on_rto_threat_sel(th_id, tbl):
if node.text.to_int() == th_id:
row_pressed(i)
break
## Отключает возможность редактирования LineEdit в таблице.[br]
## [param tbl] - таблица,[br]
## [param num_col] - номер колонки,[br]
## [param i_row] - номер столбца.[br]
func disable_edit(tbl, num_col: int, i_row: int):
for col in num_col:
var node: LineEdit = tbl.get_node2(col, i_row)
node.editable = false

View File

@@ -8,7 +8,7 @@
[ext_resource type="PackedScene" uid="uid://musb21x2u0xs" path="res://scenes/эмс2/эмс2.tscn" id="6_41d34"]
[ext_resource type="PackedScene" uid="uid://bnptm4rlp60dq" path="res://scenes/настройки/настройки.tscn" id="6_i8iv3"]
[ext_resource type="Script" uid="uid://b5ykwyk5vpi6" path="res://scenes/tabs-switch/lbl_ready.gd" id="8_tidwt"]
[ext_resource type="Script" path="res://scenes/tabs-switch/тренаж_режим.gd" id="9_41d34"]
[ext_resource type="Script" uid="uid://roajn6c6wvc1" path="res://scenes/tabs-switch/тренаж_режим.gd" id="9_41d34"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tidwt"]
@@ -47,10 +47,11 @@ theme_override_styles/tab_focus = SubResource("StyleBoxEmpty_41d34")
theme_override_styles/tab_disabled = SubResource("StyleBoxEmpty_cw2ss")
theme_override_styles/tabbar_background = SubResource("StyleBoxEmpty_nmdfd")
theme_override_styles/panel = SubResource("StyleBoxEmpty_vap7n")
current_tab = 0
current_tab = 3
script = ExtResource("1_fg0vd")
[node name="Работа" parent="tab_switch" instance=ExtResource("2_u7p16")]
visible = false
layout_mode = 2
metadata/_tab_index = 0
@@ -65,7 +66,6 @@ layout_mode = 2
metadata/_tab_index = 2
[node name="ЭМС" parent="tab_switch" instance=ExtResource("5_u71bh")]
visible = false
layout_mode = 2
metadata/_tab_index = 3
@@ -95,13 +95,15 @@ script = ExtResource("8_tidwt")
metadata/_edit_lock_ = true
[node name="remote_control" type="Label" parent="."]
visible = false
layout_mode = 2
offset_left = 1244.0
offset_right = 1401.0
offset_left = 1358.0
offset_right = 1501.0
offset_bottom = 27.0
tooltip_text = "Комплекс находится под внешним управлением"
mouse_filter = 0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 14
theme_override_styles/normal = SubResource("StyleBoxFlat_o1r22")
text = "Внешнее управление"
horizontal_alignment = 1

BIN
scenes/tilemap/23900.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://c0xt35lvgd5nx"
path="res://.godot/imported/nine-patch.png-b3022b5c868bc85e271b731e8fa2ec8a.ctex"
uid="uid://cj1f2uy6qfvki"
path="res://.godot/imported/23900.png-aba6c607cdfb6350afef981f7b82f108.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/nine-patch.png"
dest_files=["res://.godot/imported/nine-patch.png-b3022b5c868bc85e271b731e8fa2ec8a.ctex"]
source_file="res://scenes/tilemap/23900.png"
dest_files=["res://.godot/imported/23900.png-aba6c607cdfb6350afef981f7b82f108.ctex"]
[params]

BIN
scenes/tilemap/dot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cgqo5gucd2be0"
path="res://.godot/imported/dot.png-e35f44878005aaa12b3432f2608ddde5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://scenes/tilemap/dot.png"
dest_files=["res://.godot/imported/dot.png-e35f44878005aaa12b3432f2608ddde5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://ce5mtxqd1ndru"]
[ext_resource type="Texture2D" uid="uid://cgqo5gucd2be0" path="res://data/dot.png" id="2_rq0y0"]
[ext_resource type="Texture2D" uid="uid://cgqo5gucd2be0" path="res://scenes/tilemap/dot.png" id="2_rq0y0"]
[node name="rect" type="TextureRect"]
offset_left = -16.0

View File

@@ -1,7 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://c2523fcn14gn4"]
[ext_resource type="Texture2D" uid="uid://cj1f2uy6qfvki" path="res://data/23900.png" id="1_v0nwa"]
[ext_resource type="Texture2D" uid="uid://cj1f2uy6qfvki" path="res://scenes/tilemap/23900.png" id="1_v0nwa"]
[node name="23900" type="Sprite2D"]
rotation = 4.71239
scale = Vector2(0.496934, 0.496934)
texture = ExtResource("1_v0nwa")

BIN
scenes/tilemap/threat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://mobingoxskg1"
path="res://.godot/imported/threat.png-602b9c318dc5f1342d23490e047ca526.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://scenes/tilemap/threat.png"
dest_files=["res://.godot/imported/threat.png-602b9c318dc5f1342d23490e047ca526.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://cv342kc1jj5hb"]
[ext_resource type="Texture2D" uid="uid://mobingoxskg1" path="res://data/threat.png" id="1_pvxsy"]
[ext_resource type="Texture2D" uid="uid://mobingoxskg1" path="res://scenes/tilemap/threat.png" id="1_pvxsy"]
[node name="Threat" type="Sprite2D"]
scale = Vector2(0.0244268, 0.0244268)

View File

@@ -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 = 'Координаты:\nNS:%f\nEW:%f' % [lat, lon]
signaller.emit_signal('update_coordinates_map', coordinates_label)

View File

@@ -5,23 +5,7 @@ extends TextureButton
@export var state_colors: Array
func _on_toggled(toggled_on): $frame.visible = toggled_on
func _enter_tree() -> void:
$label.self_modulate = state_colors[state]
ProjectSettings.connect('settings_changed', _on_settings_changed)
func _exit_tree() -> void:
ProjectSettings.disconnect('settings_changed', _on_settings_changed)
func _on_settings_changed():
if not is_inside_tree(): return
var white_color = ProjectSettings.get_setting('Схема прибора. Белый цвет', Color.DIM_GRAY)
var black_color = ProjectSettings.get_setting('Схема прибора. Чёрный цвет', Color.CORAL)
$pic_functional.material.set('shader_parameter/white', white_color)
$pic_functional.material.set('shader_parameter/black', black_color)
func _enter_tree() -> void: $label.self_modulate = state_colors[state]
@export var state: int:
@@ -30,10 +14,3 @@ func _on_settings_changed():
state = v
if is_inside_tree():
$label.self_modulate = state_colors[v]
@export var show_functional: bool:
set(v):
show_functional = v
if is_inside_tree():
$pic_functional.visible = v

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=26 format=3 uid="uid://lwmw4egynmd1"]
[gd_scene load_steps=18 format=3 uid="uid://lwmw4egynmd1"]
[ext_resource type="Texture2D" uid="uid://bar8k5qef7kch" path="res://data/УФ.png" id="2_0nvm1"]
[ext_resource type="Script" uid="uid://q3gmpsqspjfp" path="res://scenes/контроль/внешний.gd" id="2_8r80x"]
@@ -12,16 +12,9 @@
[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="7_6j01w"]
[ext_resource type="Texture2D" uid="uid://u3tnejvpm8it" path="res://data/disconnect-a.png" id="8_gs2be"]
[ext_resource type="Texture2D" uid="uid://dnreyfh3cd1k2" path="res://data/состояние-исправности-1.png" id="8_isjua"]
[ext_resource type="Shader" uid="uid://83fx15q1xlid" path="res://shaders/two-color.gdshader" id="9_71ec4"]
[ext_resource type="Texture2D" uid="uid://b4isaggma6q3" path="res://data/Грани22.png" id="9_iqgf5"]
[ext_resource type="Texture2D" uid="uid://c6booa8753u5t" path="res://data/состояние-исправности-2.png" id="9_ll0vs"]
[ext_resource type="Texture2D" uid="uid://bktiige0i2lhl" path="res://data/У-РЭП-РПД-Н.png" id="9_qe1go"]
[ext_resource type="Texture2D" uid="uid://b2vf7en1jj8dv" path="res://data/У-РЭП-РПД-В.png" id="9_w6m6a"]
[ext_resource type="Texture2D" uid="uid://u7h3l0jjrsnp" path="res://data/У-УФ.png" id="11_gjf0t"]
[ext_resource type="Script" uid="uid://bncy1x53jp73d" path="res://scenes/контроль/connect_pribor.gd" id="11_u7tym"]
[ext_resource type="Texture2D" uid="uid://vdhmga62vjsj" path="res://data/АФСП-РТР.png" id="13_32yvq"]
[ext_resource type="Texture2D" uid="uid://dm350ta8noa0v" path="res://data/У-РЭП-РПД-К.png" id="16_32yvq"]
[ext_resource type="Texture2D" uid="uid://c3cyog3gy24ft" path="res://data/У-ЭП.png" id="16_gjf0t"]
[sub_resource type="GDScript" id="GDScript_iqgf5"]
script/source = "extends Panel
@@ -52,9 +45,6 @@ const PRIBORS_RES = \\
}
var cur_pribor_node = null
func on_line_changed(u, conn_node, _pribor_meta): conn_node.set_val(u.online)
func on_serv_changed(u, pribor_node, _pribor_meta): pribor_node.state = int(u.serviceability)
@@ -62,15 +52,12 @@ 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.disabled = true
$chk_show_functional.button_pressed = false
func reset_pribor_buttons():
var pribor_buttons: = get_tree().get_nodes_in_group('pribor_buttons')
for node in pribor_buttons:
node.button_pressed = false
node.show_functional = false
func _ready():
@@ -130,10 +117,6 @@ 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.button_pressed = false
cur_pribor_node = pribor_node
clean_pribor_items()
var pribor_obj = load(pribor_path)
if not pribor_obj:
@@ -144,7 +127,6 @@ 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.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')
@@ -161,26 +143,8 @@ func on_serviceability_changed(prd_module: Object, prd_pribor:Node)-> void:
func on_update_uf_serviceability(uf_serviceaability: bool, uf_pribor: Node)-> void:
uf_pribor.state = 1 if uf_serviceaability else 2
func _on_chk_show_functional_toggled(toggled_on: bool) -> void:
if cur_pribor_node:
cur_pribor_node.show_functional = toggled_on
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
if cur_pribor_node:
cur_pribor_node.show_functional = false
var pribor_buttons := get_tree().get_nodes_in_group('pribor_buttons')
for node in pribor_buttons:
node.button_pressed = false
clean_pribor_items()
cur_pribor_node = null
$chk_show_functional.button_pressed = false
$chk_show_functional.disabled = true
$lbl_header.text = \"\"
"
[sub_resource type="SpriteFrames" id="SpriteFrames_foasq"]
@@ -197,12 +161,6 @@ animations = [{
"speed": 5.0
}]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_71ec4"]
shader = ExtResource("9_71ec4")
shader_parameter/white = Vector3(0.14, 0.13, 0.13)
shader_parameter/black = Vector3(0.95, 0.55, 0.05)
shader_parameter/gamma = 2.0
[node name="Контроль" type="Panel"]
anchors_preset = 15
anchor_right = 1.0
@@ -211,8 +169,6 @@ grow_horizontal = 2
grow_vertical = 2
script = SubResource("GDScript_iqgf5")
metadata/_edit_lock_ = true
metadata/_edit_vertical_guides_ = [21.0, 1578.0]
metadata/_edit_horizontal_guides_ = [200.0, 51.0]
[node name="capsrpb" type="TextureRect" parent="." groups=["pribor_pics"]]
editor_description = "Кнопка для отображения внешних соединений."
@@ -433,27 +389,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_n_1"]
visible = false
light_mask = 3
position = Vector2(35, -10)
scale = Vector2(0.625, 0.625)
sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_n_1"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1029.0
offset_top = 9.0
offset_right = 576.0
offset_bottom = 830.0
scale = Vector2(0.97094, 0.97094)
texture = ExtResource("9_qe1go")
[node name="connect_pribor2" type="AnimatedSprite2D" parent="pribor_prd_n_1"]
light_mask = 3
position = Vector2(35, -10)
scale = Vector2(0.625, 0.625)
@@ -514,18 +449,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_uf"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1155.0
offset_top = -362.0
offset_right = -96.0001
offset_bottom = 311.0
scale = Vector2(0.789429, 0.789429)
texture = ExtResource("11_gjf0t")
[node name="pribor_rtr" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -570,6 +493,16 @@ patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
[node name="label2" type="Label" parent="pribor_rtr"]
layout_mode = 0
offset_left = 12.0
offset_top = -54.0
offset_right = 95.0
offset_bottom = -35.0
text = "РТР"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_rtr"]
light_mask = 3
position = Vector2(55, -15)
@@ -578,18 +511,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_rtr"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1036.0
offset_top = -394.0
offset_right = 927.0
offset_bottom = 595.0
scale = Vector2(0.792688, 0.792688)
texture = ExtResource("13_32yvq")
[node name="pribor_afsp_1" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -637,6 +558,17 @@ patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
[node name="label2" type="Label" parent="pribor_afsp_1"]
layout_mode = 0
offset_left = 165.0
offset_top = -245.0
offset_right = 262.0
offset_bottom = -225.0
scale = Vector2(5, 5)
text = "АФСП 1"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_afsp_1"]
light_mask = 3
position = Vector2(415, -40)
@@ -645,18 +577,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_afsp_1"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -5120.0
offset_top = -895.0
offset_right = -3157.0
offset_bottom = 93.9999
scale = Vector2(3.96323, 3.96323)
texture = ExtResource("13_32yvq")
[node name="pribor_afsp_2" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -705,6 +625,17 @@ patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
[node name="label2" type="Label" parent="pribor_afsp_2"]
layout_mode = 0
offset_left = 200.0
offset_top = -240.0
offset_right = 297.0
offset_bottom = -220.0
scale = Vector2(5, 5)
text = "АФСП 2"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_afsp_2"]
light_mask = 3
position = Vector2(425, -40)
@@ -713,18 +644,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_afsp_2"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -6070.0
offset_top = -900.0
offset_right = -4107.0
offset_bottom = 89.0001
scale = Vector2(3.96409, 4.54663)
texture = ExtResource("13_32yvq")
[node name="pribor_uyep" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -776,18 +695,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.872305
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_uyep"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1292.0
offset_top = -365.0
offset_right = 821.0
offset_bottom = 764.0
scale = Vector2(0.736875, 0.814493)
texture = ExtResource("16_gjf0t")
[node name="pribor_prd_v_2" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -840,18 +747,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_v_2"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1419.0
offset_top = -480.0
offset_right = 173.0
offset_bottom = 328.0
scale = Vector2(0.977411, 0.977411)
texture = ExtResource("9_w6m6a")
[node name="pribor_prd_n_2" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -899,7 +794,6 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_prd_n_2"]
visible = false
light_mask = 3
position = Vector2(40, -10)
scale = Vector2(0.625, 0.625)
@@ -907,26 +801,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_n_2"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1419.0
offset_top = -145.0
offset_right = 186.0
offset_bottom = 676.0
scale = Vector2(0.96888, 0.96888)
texture = ExtResource("9_qe1go")
[node name="connect_pribor2" type="AnimatedSprite2D" parent="pribor_prd_n_2"]
light_mask = 3
position = Vector2(35, -10)
scale = Vector2(0.625, 0.625)
sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pribor_prd_k_2" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -979,18 +853,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_k_2"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1418.0
offset_top = -314.0
offset_right = 345.0
offset_bottom = 649.0
scale = Vector2(0.881522, 0.881522)
texture = ExtResource("16_32yvq")
[node name="pribor_prd_v_3" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -1043,18 +905,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_v_3"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1026.0
offset_top = -601.0
offset_right = 566.0
offset_bottom = 207.0
scale = Vector2(0.975409, 0.975409)
texture = ExtResource("9_w6m6a")
[node name="pribor_prd_n_3" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -1107,18 +957,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_n_3"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1302.0
offset_top = -602.0
offset_right = 303.0
offset_bottom = 219.0
scale = Vector2(0.969291, 0.969291)
texture = ExtResource("9_qe1go")
[node name="pribor_prd_k_3" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -1171,18 +1009,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_k_3"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1167.0
offset_top = -602.0
offset_right = 596.0
offset_bottom = 361.0
scale = Vector2(0.882165, 0.896739)
texture = ExtResource("16_32yvq")
[node name="pribor_prd_v_1" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -1235,18 +1061,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_v_1"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1304.0
offset_top = 2.0
offset_right = 288.0
offset_bottom = 810.0
scale = Vector2(0.974661, 0.974661)
texture = ExtResource("9_w6m6a")
[node name="pribor_prd_k_1" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -1299,18 +1113,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_k_1"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -1163.0
offset_top = 10.0
offset_right = 600.0
offset_bottom = 973.0
scale = Vector2(0.883479, 0.883479)
texture = ExtResource("16_32yvq")
[node name="pribor_prd_v_4" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -1362,18 +1164,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_v_4"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -923.0
offset_top = -144.0
offset_right = 669.0
offset_bottom = 664.0
scale = Vector2(0.976707, 0.976707)
texture = ExtResource("9_w6m6a")
[node name="pribor_prd_n_4" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -1425,18 +1215,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_n_4"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -919.0
offset_top = -485.0
offset_right = 686.0
offset_bottom = 336.0
scale = Vector2(0.968111, 0.968111)
texture = ExtResource("9_qe1go")
[node name="pribor_prd_k_4" type="TextureButton" parent="." groups=["pribor_buttons"]]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
@@ -1488,18 +1266,6 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355
script = ExtResource("11_u7tym")
[node name="pic_functional" type="TextureRect" parent="pribor_prd_k_4"]
visible = false
z_index = 1
material = SubResource("ShaderMaterial_71ec4")
layout_mode = 0
offset_left = -924.0
offset_top = -315.0
offset_right = 839.0
offset_bottom = 648.0
scale = Vector2(0.879295, 0.879295)
texture = ExtResource("16_32yvq")
[node name="txr_legend0" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 219.0
@@ -1621,18 +1387,6 @@ points = PackedVector2Array(-8, 0, 608, 0)
width = 2.0
default_color = Color(1, 1, 1, 0.352941)
[node name="chk_show_functional" type="CheckButton" parent="."]
layout_mode = 0
offset_left = 1050.0
offset_top = 26.0
offset_right = 1429.0
offset_bottom = 60.0
theme_override_font_sizes/font_size = 22
disabled = true
text = "Показть функциональную схему Э2"
flat = true
[connection signal="gui_input" from="." to="." method="_on_gui_input"]
[connection signal="toggled" from="pribor_prd_n_1" to="pribor_prd_n_1" method="_on_toggled"]
[connection signal="toggled" from="pribor_uf" to="pribor_uf" method="_on_toggled"]
[connection signal="toggled" from="pribor_rtr" to="pribor_rtr" method="_on_toggled"]
@@ -1650,4 +1404,3 @@ flat = true
[connection signal="toggled" from="pribor_prd_v_4" to="pribor_prd_v_4" method="_on_toggled"]
[connection signal="toggled" from="pribor_prd_n_4" to="pribor_prd_n_4" method="_on_toggled"]
[connection signal="toggled" from="pribor_prd_k_4" to="pribor_prd_k_4" method="_on_toggled"]
[connection signal="toggled" from="chk_show_functional" to="." method="_on_chk_show_functional_toggled"]

View File

@@ -9,7 +9,6 @@ script/source = "class_name configure extends Panel
const TableHeader = preload('res://table/header.tscn')
const TableToggle = preload('res://table/settings-toggle.tscn')
const TableEdit = preload('res://table/ячейка-2.tscn')
const TableColor = preload('res://table/color-picker.tscn')
const ALIGNMENT = [HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER]
const HEADER_ROW = [TableHeader, TableHeader]
@@ -65,11 +64,9 @@ const SETTING_TABLE = [
['Адрес БПО правого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора БПО'],
['Период опроса состояния БПО, секунды', TableEdit, TableEdit, 'Время в секундах' ],
['Период опроса состояния АФСП, секунды', TableEdit, TableEdit, 'Время в секундах' ],
['уарэп-трасса', TableEdit, TableEdit, 'IP-адрес для связи с Трассой [<адрес этого узла>, <адрес удалённого узла>, <порт этого узла>, <порт удалённого узла>]'],
['уареп-трасса', TableEdit, TableEdit, 'IP-адрес для связи с Трассой [<адрес этого узла>, <адрес удалённого узла>, <порт этого узла>, <порт удалённого узла>]'],
['Включить работу по своим целям', TableEdit, TableToggle, 'Разрешает работу в секторе со своей целью'],
['Список своих протоколов', TableEdit, TableEdit, 'Список протоколов целей, по которым запрещено работать' ],
['Схема прибора. Белый цвет', TableEdit, TableColor, 'Настройка отображаемого цвета фона' ],
['Схема прибора. Чёрный цвет', TableEdit, TableColor, 'Настройка отображаемого цвета схемы' ], ]
['Список своих протоколов', TableEdit, TableEdit, 'Список протоколов целей, по которым запрещено работать' ], ]
const EXTERNAL_CU = 16 ## Внешнее целеуказание
const TRASSA = 17

View File

@@ -31,8 +31,7 @@ var strob_band_begin: float ## Ширина строба в моме
var strob_dir_begin: float ## Направление антенны в момент начала перетаскивания.
var strob_width_begin: float ## Ширина строба по углу в момент начала перетаскивания.
var view_mode: MapViewMode ## Режим отображения карты
var thrs_dict: Dictionary ## Ссылка на словарь целей
var gos_flag = true ## Флаг работать по своим целям
var thrs_dict: Dictionary ## Ссылка на словарь целей
var color_ecm: Color
var color_select: Color
var color_emit: Color
@@ -56,7 +55,6 @@ var fs_selected: Dictionary ## Словарь выбранных сектор
var fs_active: Dictionary ## Словарь секторов назначенных на подавление
var fs_emit: Dictionary ## Словарь секторов назначенных на подавление
var fs_closed: Dictionary ## Словарь для секторов запрета
var fs_failed: Array ## Индикация сломанных секторов (модули ФС). AntBandState.ANT_BAND_READY - исправен, AntBandState.ANT_BAND_FAILURE - сломан.
## Состояние перетаскивания.
enum DragFSM {
@@ -80,11 +78,6 @@ enum MapViewMode {
}
enum AntBandState {
ANT_BAND_READY = 1,
ANT_BAND_FAILED = 0
}
const VAL_TO_EVENT = {
false: 'manual_control', ## Выбор целей и установка помех вручную.
true: 'full_auto' } ## Выбор целей и установка помех автоматически.
@@ -98,14 +91,7 @@ func on_threat_selected(th, ecm_btns): on_rto_threat_sel(th.id, ecm_btns)
func on_enter_tree() -> void: call_deferred('on_button_strobe_pressed')
func clear_all_klaster(): $canvas.clear_all_seczap()
func on_user_panning(): $btn_center.button_pressed = false
func on_settings_changed():
gos_flag = ProjectSettings.get_setting('application/config/Включить работу по своим целям', true)
color_emit = ProjectSettings.get_setting('application/interfer/emit_color', Color(0.58, 0.47, 0.51, 1.0))
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))
@@ -123,7 +109,9 @@ func on_settings_changed():
## Обработчик сигнала изменения списка целей.
func on_threats_resized(ths: Dictionary):
count_threats(ths)
$count_all_pad/count_all.text = '%02d' % ths.size()
var c: int = ths.values().filter(func(th: threats.Threat): return th.proto != '').size()
$count_danger_pad/count_danger.text = '%02d' % c
thrs_dict = ths
@@ -156,18 +144,10 @@ func _exit_tree() -> void:
timer1.queue_free()
func init_fs_failed():
var sectors_count = $canvas.fs_default_colors.size()
fs_failed.resize(sectors_count)
for i in fs_failed.size():
fs_failed[i] = AntBandState.ANT_BAND_READY
## Производит инициализацию.
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
@@ -187,7 +167,6 @@ func _ready():
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'))
@@ -200,7 +179,6 @@ func _ready():
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'))
var unit_nav = network.get_unit_instance('навигация')
unit_nav.connect('data_received', on_navi_data_received)
on_btn_center_toggled(true)
@@ -208,13 +186,16 @@ func _ready():
func sector_klaster(sector_data):
if sector_data['draw']:
var rect: Rect2 = sector_data['rect']
var color: Color = sector_data['color']
var id: int = sector_data['index']
if sector_data["draw"]:
var rect: Rect2 = sector_data["rect"]
var color: Color = sector_data["color"]
var id: int = sector_data["index"]
$canvas.add_seczap(id, Vector4(rect.position.x, rect.position.y, rect.size.x, rect.size.y))
$canvas.set_seczap_color(id, color)
else:
pass
func clear_all_klaster(): $canvas.clear_all_seczap()
func on_navi_data_received(data: Dictionary):
var k = data.get('k', 0.0)
@@ -222,6 +203,10 @@ func on_navi_data_received(data: Dictionary):
course = k
func on_user_panning():
$btn_center.button_pressed = false
func on_chk_interfer_prinuditelno(_interfer_sectors):
$chk_auto.set_pressed_no_signal(false)
on_value_changed(false)
@@ -535,14 +520,6 @@ func update_fs_colors():
else:
fs_colors[key] = color_select
$canvas.set_band_colors(fs_colors)
$canvas.set_band_failures(fs_failed)
if fs_emit.size():
if $btn_activate.pressed:
$btn_activate.self_modulate = Color.RED
else:
$btn_activate.self_modulate = Color.WHITE
else:
$btn_activate.self_modulate = Color.WHITE
func unsel_fs_all(need_btns_off: bool):
@@ -591,9 +568,8 @@ func on_interfer_prinuditelno (prenuditelno_sectors, btns):
## Вызывается при получении информации о состоянии модулей ФС от КАПС РПБ.
func on_fs_update_state(fs_dict: Dictionary):
for key in fs_dict.keys():
fs_failed[key] = fs_dict[key].isg
func on_fs_update_state(_fs_dict: Dictionary):
pass
func on_btn_center_toggled(toggled_on: bool) -> void:
@@ -604,8 +580,6 @@ func on_btn_center_toggled(toggled_on: bool) -> void:
func on_btn_activate_toggled(toggled_on: bool) -> void:
$btn_activate.tooltip_text = 'Включает подавление (%s)' % ('включено' if toggled_on else 'отключено')
signaller.emit_signal('emit_changed', toggled_on)
if not toggled_on:
$btn_activate.self_modulate = Color.WHITE
func on_update_coordinates_label(coordinates_label) -> void:
@@ -622,7 +596,6 @@ func on_btn_close(btn):
fs_closed.merge(fs_selected)
signaller.emit_signal('update_fs_closed', fs_closed)
func on_btn_work(btn):
await get_tree().create_timer(0.2).timeout
btn.pressed = false
@@ -632,21 +605,6 @@ func on_btn_work(btn):
fs_closed[fs_index] = null
signaller.emit_signal('update_fs_closed', fs_closed)
func _on_btn_all_work_pressed() -> void:
fs_closed.clear()
signaller.emit_signal('update_fs_closed', fs_closed)
func on_th_aoa_update(ths):
count_threats(ths)
func count_threats(ths):
$count_all_pad/count_all.text = '%02d' % ths.size()
var c: int = 0
if gos_flag:
c = ths.values().filter(func(th: threats.Threat): return th.proto != '').size()
else:
c = ths.values().filter(func(th: threats.Threat): return ((th.proto != '') and th.proto not in interfer.gos_protocols)).size()
$count_danger_pad/count_danger.text = '%02d' % c

View File

@@ -306,18 +306,18 @@ vertical_alignment = 1
[node name="coordinates_map" type="Label" parent="."]
layout_mode = 0
offset_left = 660.0
offset_top = -24.0
offset_right = 772.0
offset_bottom = -5.0
offset_left = 999.0
offset_top = 128.0
offset_right = 1111.0
offset_bottom = 147.0
text = "Координаты:"
[node name="scale_map" type="Label" parent="."]
layout_mode = 0
offset_left = 1003.0
offset_top = -24.0
offset_right = 1113.0
offset_bottom = -3.0
offset_left = 999.0
offset_top = 202.0
offset_right = 1109.0
offset_bottom = 223.0
text = "Масштаб:"
[node name="zoom_plus" type="Button" parent="."]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=35 format=3 uid="uid://musb21x2u0xs"]
[gd_scene load_steps=34 format=3 uid="uid://musb21x2u0xs"]
[ext_resource type="Texture2D" uid="uid://hkcvl2waf63s" path="res://scenes/эмс2/вид сверху.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://scenes/эмс2/Окно частот0.png" id="2_2spgl"]
[ext_resource type="Texture2D" uid="uid://0w6q4vfst0ry" path="res://scenes/эмс2/OP-63.png" id="3_8gk36"]
[ext_resource type="Texture2D" uid="uid://coxhivvc6uibs" path="res://scenes/эмс2/Состояние РЭС 40.png" id="4_b3mus"]
[ext_resource type="Texture2D" uid="uid://073el51yholj" path="res://scenes/эмс2/454.png" id="4_nqi0i"]
@@ -23,6 +23,7 @@
[ext_resource type="Texture2D" uid="uid://b1kuhj03yigih" path="res://scenes/эмс2/Квадрат салатный 454.png" id="23_h11e0"]
[ext_resource type="Texture2D" uid="uid://d3v1r4r62na8" path="res://scenes/эмс2/Квадрат салатный ОР-63.png" id="24_2pcsf"]
[ext_resource type="Texture2D" uid="uid://ddm55bo28sxcs" path="res://scenes/эмс2/Квадрат салатный РЛС1.png" id="25_wmu4u"]
[ext_resource type="Texture2D" uid="uid://bymxiptkbufvs" path="res://scenes/эмс2/Скруглённый квадрат серый.png" id="26_b5v2s"]
[ext_resource type="Texture2D" uid="uid://dneqjcul4ipub" path="res://scenes/эмс2/Квадрат салатный РЛС2.png" id="26_w5eif"]
[ext_resource type="Texture2D" uid="uid://cyb60nh23ys6k" path="res://scenes/эмс2/Квадрат салатный ГО.png" id="27_2ft3r"]
[ext_resource type="Texture2D" uid="uid://cw8sd7v5f31ww" path="res://scenes/эмс2/Квадрат салатный с трубкой.png" id="28_rra4y"]
@@ -33,17 +34,10 @@
[ext_resource type="Texture2D" uid="uid://carr8bw5rwiwj" path="res://scenes/эмс2/Кнопка подтверждения01.png" id="32_p41nv"]
[ext_resource type="Texture2D" uid="uid://3siondd3feev" path="res://scenes/эмс2/Скруглённый прямоугольник белый.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")
[node name="Sprite2D" type="Sprite2D" parent="."]
modulate = Color(1, 0.596078, 0.4, 1)
modulate = Color(0.8, 0.533333, 0.27451, 1)
position = Vector2(792, 120)
rotation = 1.5708
scale = Vector2(0.325, 0.325)
@@ -56,7 +50,7 @@ offset_top = 240.0
offset_right = 1649.0
offset_bottom = 813.0
scale = Vector2(0.95, 0.95)
texture = SubResource("CompressedTexture2D_5u4bk")
texture = ExtResource("2_2spgl")
expand_mode = 1
[node name="Op-63" type="TextureRect" parent="."]
@@ -108,15 +102,6 @@ position = Vector2(275.641, 38.4615)
scale = Vector2(3.20513, 3.20513)
texture = ExtResource("6_m57px")
[node name="lbl_trassa" type="Label" parent="454"]
layout_mode = 0
offset_left = -42.0
offset_top = -135.0
offset_right = 221.0
offset_bottom = -36.0
theme_override_font_sizes/font_size = 100
text = "Трасса"
[node name="Го" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 488.0
@@ -262,7 +247,7 @@ texture = ExtResource("28_rra4y")
[node name="СкруглённыйКвадрат" type="Sprite2D" parent="."]
position = Vector2(1299, 873)
texture = SubResource("CompressedTexture2D_l3ueu")
texture = ExtResource("26_b5v2s")
[node name="СкруглённыйКвадратБелый" type="Sprite2D" parent="СкруглённыйКвадрат"]
position = Vector2(0, 49)
@@ -386,23 +371,23 @@ texture = ExtResource("15_2spgl")
[node name="СкруглённыйКвадратСерый2" type="Sprite2D" parent="СкруглённыйКвадрат"]
position = Vector2(49, 49)
texture = SubResource("CompressedTexture2D_l3ueu")
texture = ExtResource("26_b5v2s")
[node name="СкруглённыйКвадратСерый3" type="Sprite2D" parent="СкруглённыйКвадрат"]
position = Vector2(98, 98)
texture = SubResource("CompressedTexture2D_l3ueu")
texture = ExtResource("26_b5v2s")
[node name="СкруглённыйКвадратСерый4" type="Sprite2D" parent="СкруглённыйКвадрат"]
position = Vector2(147, 147)
texture = SubResource("CompressedTexture2D_l3ueu")
texture = ExtResource("26_b5v2s")
[node name="СкруглённыйКвадратСерый5" type="Sprite2D" parent="СкруглённыйКвадрат"]
position = Vector2(245, 245)
texture = SubResource("CompressedTexture2D_l3ueu")
texture = ExtResource("26_b5v2s")
[node name="СкруглённыйКвадратСерый6" type="Sprite2D" parent="СкруглённыйКвадрат"]
position = Vector2(196, 196)
texture = SubResource("CompressedTexture2D_l3ueu")
texture = ExtResource("26_b5v2s")
[node name="Label" type="Label" parent="."]
layout_mode = 0

View File

@@ -1,38 +1,39 @@
extends Panel
#
#
func _ready() -> void:
var unit_trassa = network.get_unit_instance('уарэп-трасса')
unit_trassa.connect('line_changed', Callable(self, 'on_trassa_line_changed'))
signaller.connect('sector_klaster', Callable(self, 'on_sector_klaster').bind(unit_trassa))
func on_trassa_line_changed(unit_trassa):
if unit_trassa.online:
$'454/СостояниеРэс3'.self_modulate = Color.WEB_GREEN
$'СкруглённыйПрямоугольникБелый/Label3'.text = 'Трасса'
$'СкруглённыйПрямоугольникБелый/Label4'.text = 'Трасса'
$'СкруглённыйПрямоугольникБелый/Label5'.text = 'Активный'
$'СкруглённыйПрямоугольникБелый/Label6'.text = str(unit_trassa.daa)
$'СкруглённыйПрямоугольникБелый/Label7'.text = str(unit_trassa.dap)
$'СкруглённыйПрямоугольникБелый/Label8'.text = '1'
$'СкруглённыйПрямоугольникБелый/Label9'.text = str(unit_trassa.lfb)
$'СкруглённыйПрямоугольникБелый/Label10'.text = str(unit_trassa.lfb)
else:
$'454/СостояниеРэс3'.self_modulate = Color.WHITE
$'СкруглённыйПрямоугольникБелый/Label3'.text = '-'
$'СкруглённыйПрямоугольникБелый/Label4'.text = '-'
$'СкруглённыйПрямоугольникБелый/Label5'.text = '-'
$'СкруглённыйПрямоугольникБелый/Label6'.text = '-'
$'СкруглённыйПрямоугольникБелый/Label7'.text = '-'
$'СкруглённыйПрямоугольникБелый/Label8'.text = '-'
$'СкруглённыйПрямоугольникБелый/Label9'.text = '-'
$'СкруглённыйПрямоугольникБелый/Label10'.text = '-'
func on_sector_klaster(data, unit_trassa):
$'СкруглённыйПрямоугольникБелый/Label6'.text = str(unit_trassa.dap)
$'СкруглённыйПрямоугольникБелый/Label7'.text = str(unit_trassa.daa)
$'СкруглённыйПрямоугольникБелый/Label8'.text = '1'
$'СкруглённыйПрямоугольникБелый/Label9'.text = str(unit_trassa.lfb)
$'СкруглённыйПрямоугольникБелый/Label10'.text = str(unit_trassa.hfb)
pass
#var unit_trassa = network.get_unit_instance('уарэп-трасса')
#unit_trassa.connect('line_changed', Callable(self, 'on_trassa_line_changed'))
#signaller.connect('sector_klaster', Callable(self, 'on_sector_klaster').bind(unit_trassa))
#
#
#func on_trassa_line_changed(unit_trassa):
#if unit_trassa.online:
#$'454/СостояниеРэс3'.self_modulate = Color.WEB_GREEN
#$'СкруглённыйПрямоугольникБелый/Label3'.text = 'Трасса'
#$'СкруглённыйПрямоугольникБелый/Label4'.text = 'Трасса'
#$'СкруглённыйПрямоугольникБелый/Label5'.text = 'Активный'
#$'СкруглённыйПрямоугольникБелый/Label6'.text = str(unit_trassa.daa)
#$'СкруглённыйПрямоугольникБелый/Label7'.text = str(unit_trassa.dap)
#$'СкруглённыйПрямоугольникБелый/Label8'.text = '1'
#$'СкруглённыйПрямоугольникБелый/Label9'.text = str(unit_trassa.lfb)
#$'СкруглённыйПрямоугольникБелый/Label10'.text = str(unit_trassa.lfb)
#else:
#$'454/СостояниеРэс3'.self_modulate = Color.WHITE
#$'СкруглённыйПрямоугольникБелый/Label3'.text = '-'
#$'СкруглённыйПрямоугольникБелый/Label4'.text = '-'
#$'СкруглённыйПрямоугольникБелый/Label5'.text = '-'
#$'СкруглённыйПрямоугольникБелый/Label6'.text = '-'
#$'СкруглённыйПрямоугольникБелый/Label7'.text = '-'
#$'СкруглённыйПрямоугольникБелый/Label8'.text = '-'
#$'СкруглённыйПрямоугольникБелый/Label9'.text = '-'
#$'СкруглённыйПрямоугольникБелый/Label10'.text = '-'
#
#
#func on_sector_klaster(data, unit_trassa):
#$'СкруглённыйПрямоугольникБелый/Label6'.text = str(unit_trassa.dap)
#$'СкруглённыйПрямоугольникБелый/Label7'.text = str(unit_trassa.daa)
#$'СкруглённыйПрямоугольникБелый/Label8'.text = '1'
#$'СкруглённыйПрямоугольникБелый/Label9'.text = str(unit_trassa.lfb)
#$'СкруглённыйПрямоугольникБелый/Label10'.text = str(unit_trassa.hfb)

View File

@@ -93,7 +93,6 @@ const ID_INTERFERS_LEN = 63 ## Размер пула номеров целе
const INTERFER_OFF = 'off'
const INTERFER_IQFILE = 'IQ-файл'
const POW_DEFAULT: float = 50.0
const PERIOD_DEFAULT = 7.5
var msg6_num: int = 0 ## Счётчик сообщений "тип 6"
var msg8_num: int = 0 ## Счётчик сообщений "тип 8"
var id_array: Array ## Массив id воздействий.
@@ -126,7 +125,6 @@ class Interfer:
var modulation: bool ## Модуляция для включения усилителей
var um: float ## Угол места для помехи.
var nmfs: int = 0 ## Номер модуля ФС в нумерации СТЦ
var priority: int = 0 ## Приоритет помехи
func _to_string() -> String:
return 'номер: %d название: %s частота: %0.1f МГц пеленг: %0.1f гр.' % [ispp, ITERFER_MODE[krp][0], params['freq'], kni]
@@ -216,7 +214,7 @@ func _ready() -> void:
threats.connect('threats_resized', Callable(self, 'on_threats_resized'))
threats.connect('threat_update', Callable(self, 'on_threats_update').bind(ecms, unit_caps))
ProjectSettings.connect('settings_changed', on_settings_changed)
var unit_nav: = network.get_unit_instance('навигация')
var unit_nav = network.get_unit_instance('навигация')
unit_nav.connect('data_received', on_nav_data_received.bind(unit_caps))
@@ -259,34 +257,22 @@ func on_timer_check_state(unit_instance, ecms, resend_timeout) -> void:
func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> void:
gos_nmfs.clear()
for thr in threats.values():
var fs_arr: Array = []
var th_aoa = fposmod(thr.aoa - course, 360)
prd.find_fs_index(th_aoa, thr.freq, fs_arr)
if fs_arr.size():
for item in fs_arr:
var nmfs = prd.FS_PRD[item][1]
thr.nmfs = nmfs
if (thr.proto in gos_protocols) and thr.fflags.proto and (not gos_flag):
gos_nmfs.append(nmfs)
thr.emit_state = 0
for ecm in ecms.values():
if thr.nmfs == ecm.nmfs:
set_th_emit(thr, ecm)
var ecm_active = true
if not gos_flag:
if ecm.nmfs in gos_nmfs:
interfer_off(ecm, unit_instance)
ecm_active = false
if ecm_active and (prd.fs_caps_id[ecm.nmfs] in fs_closed):
interfer_off(ecm, unit_instance)
if not gos_flag: # Составляется список запретных секторов работы
if (thr.proto in gos_protocols) and thr.fflags.proto:
var fs_arr: Array = []
prd.find_fs_index(thr.aoa, thr.freq, fs_arr)
if fs_arr.size():
for item in fs_arr:
var nmfs = prd.FS_PRD[item][1]
gos_nmfs.append(nmfs)
var th_id = thr.id
for ecm_i in thrs.keys():
if thrs[ecm_i] == th_id:
var ecm = ecms[ecm_i]
ecm.params['freq'] = thr.freq
ecm.kni = fposmod(thr.aoa - course, 360)
ecm.kni = thr.aoa - course
if ecm.kni < 0:
ecm.kni += 360
call_ecm_proc(ecm)
if ecm.nmfs in gos_nmfs:
interfer_off(ecm, unit_instance)
@@ -297,11 +283,23 @@ func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> v
signaller.emit_signal('fs_update_color', ecms)
prd.update_fs_state(ecms, trenazh_mode)
for ecm in ecms.values():
var ecm_active = true
if not gos_flag:
if ecm.nmfs in gos_nmfs:
interfer_off(ecm, unit_instance)
ecm_active = false
if ecm_active and (prd.fs_caps_id[ecm.nmfs] in fs_closed):
interfer_off(ecm, unit_instance)
if not auto_enabled:
return
if auto_enabled:
for thr in threats.values():
var fs_arr: Array = []
var th_aoa = fposmod(thr.aoa - course, 360)
prd.find_fs_index(th_aoa, thr.freq, fs_arr)
prd.find_fs_index(thr.aoa, thr.freq, fs_arr)
if fs_arr.size():
var need_continue = false
for item in fs_arr:
@@ -368,29 +366,22 @@ func map_mpchf_to_seczaps(unit_instance: unit.Unit, _seczaps: Dictionary):
## Вызыватся, когда пользователь выбрал помеху и выбраны цели.
func on_interfer_create(interfer_name, sel_threats, fs_arr, power, u, ecms) -> void:
for item in sel_threats:
if auto_enabled:
var need_continue = false
for ecm in ecms.values():
if ecm.nmfs == item.nmfs:
if item.priority > ecm.priority:
interfer_off(ecm, u)
elif item.priority < ecm.priority:
need_continue = true
break
if need_continue: continue
var param: Dictionary = {}
var kni: float = item.aoa - course
if kni < 0:
kni += 360.0
var id = item.id
param['freq'] = item.freq
param['width'] = item.width * 1.5
param['width'] = item.width
if (item.rkrp != '') and item.fflags.rkrp and auto_enabled:
var krp = get_krp(item)
if krp != '':
interfer_name = krp
set_rparams(item, param)
check_width(param)
if (param['width'] < settings.WIDTH_MIN):
param['width'] = settings.WIDTH_MIN
elif (param['width'] > settings.WIDTH_MAX):
param['width'] = settings.WIDTH_MAX
interfer_create(u, interfer_name, ecms, param, kni, id, thrs, SOURCE_INTERFER[0], power)
for item in fs_arr:
@@ -399,7 +390,10 @@ func on_interfer_create(interfer_name, sel_threats, fs_arr, power, u, ecms) -> v
var id = item[3]
param['freq'] = item[1]
param['width'] = item[2]
check_width(param)
if (param['width'] < settings.WIDTH_MIN):
param['width'] = settings.WIDTH_MIN
elif (param['width'] > settings.WIDTH_MAX):
param['width'] = settings.WIDTH_MAX
interfer_create(u, interfer_name, ecms, param, kni, id, fs, SOURCE_INTERFER[1], power)
@@ -439,7 +433,7 @@ func interfer_create(u, interfer_name, ecms, param, kni, id, dict, source_interf
var sz = ecms.size()
var ispp: int = 0
param['dur'] = 1.0 # Необходимо добавить параметры управления
param['period'] = param.get('period', PERIOD_DEFAULT)
param['period'] = 1.0 # Необходимо добавить параметры управления
var key = dict.find_key(id)
if source_interfer != SOURCE_INTERFER[2]:
if key != null:
@@ -460,16 +454,13 @@ func interfer_create(u, interfer_name, ecms, param, kni, id, dict, source_interf
ecm = Interfer.new()
ecm.ispp = ispp
ecms[ispp] = ecm
ecm.modulation = emit_enable
ecm.kni = kni
ecm.krp = interfer_name
ecm.params = param
ecm.powp = power
ecm.source_interfer = source_interfer
ecm.modulation = emit_enable
ecm.um = param.get('um', 15.0) # Значение по умолчанию
if source_interfer == SOURCE_INTERFER[0]:
if thrs_dict.has(dict[ispp]):
ecm.priority = thrs_dict[dict[ispp]].priority
call_ecm_proc(ecm)
var set_nmfs_ok = set_nmfs(ecm)
if set_nmfs_ok != Error.OK:
@@ -486,7 +477,7 @@ func interfer_create(u, interfer_name, ecms, param, kni, id, dict, source_interf
func send_ecm(ecm, unit0) -> void:
if ecm.krp != INTERFER_OFF:
if not ecm.modulation:
if not emit_enable:
ecm.svk = 0
call_deferred('emit_signal', 'interfer_update', ecm)
return
@@ -521,10 +512,8 @@ func push_id(id: int) -> void:
id_array.sort()
func on_emit_changed(state, ecms) -> void:
func on_emit_changed(state, _ecms) -> void:
emit_enable = state
for ecm in ecms.values():
ecm.modulation = state
func call_all_diap(ecm, ecm_params: Dictionary):
@@ -572,11 +561,8 @@ func on_threats_update(threat, ecms, unit_caps):
for ecm_i in thrs.keys():
if thrs[ecm_i] == th_id:
ecm = ecms[ecm_i]
ecm.priority = threat.priority
ecm.params['freq'] = threat.freq
var width = threat.width * 1.5
ecm.params['width'] = width
check_width(ecm.params)
ecm.params['width'] = threat.width
if (threat.rkrp != '') and threat.fflags.rkrp and auto_enabled:
var krp = get_krp(threat)
if krp != '':
@@ -590,8 +576,58 @@ func on_threats_update(threat, ecms, unit_caps):
if ecm.kni < 0:
ecm.kni += 360
set_nmfs(ecm)
if ecm != null:
send_ecm(ecm, unit_caps)
if threat.tmod != 'fm':
if ecm != null:
send_ecm(ecm, unit_caps)
return
var th_fm_dict: Dictionary
var fs_index_arr: Array
prd.find_fs_index(threat.aoa, threat.freq, fs_index_arr)
if fs_index_arr.size() == 0:
if ecm != null:
send_ecm(ecm, unit_caps)
return
var fs_index = fs_index_arr[0]
var nmfs = prd.FS_PRD[fs_index][1]
if ecm == null:
for ecm_i in ecms.values():
if nmfs != ecm_i.nmfs: continue
if ecm_i.svk != 1: continue
ecm = ecm_i
if ecm == null: return
for th_index in thrs_dict:
if thrs_dict[th_index].tmod != 'fm': continue
fs_index_arr = []
prd.find_fs_index(thrs_dict[th_index].aoa, thrs_dict[th_index].freq, fs_index_arr)
if fs_index_arr.size() == 0: continue
if fs_index_arr[0] != fs_index: continue
th_fm_dict[th_index] = thrs_dict[th_index]
if len(th_fm_dict) > 1:
pass
send_ecm(ecm, unit_caps)
func get_freq_range(freq_range_dict: Dictionary, th_dict: Dictionary):
for key_i in th_dict:
var min_range: int = 6000
var key_min = null
for key_j in th_dict:
if key_i == key_j: continue
var width = (th_dict[key_i].width / 2) + (th_dict[key_j].width / 2)
var freq_range = abs(th_dict[key_i].freq - th_dict[key_j].freq) + width
if freq_range < min_range:
key_min = key_j
min_range = freq_range
var max_width = 0
for key in PDCHM_PARAMS['files'].keys():
if max_width < key: max_width = key
if min_range > max_width:
th_dict.erase(key_i)
continue
else:
if key_min == null: continue
freq_range_dict[key_i] = [th_dict[key_i], th_dict[key_min], min_range]
func find_threat(freq: int, aoa: float):
@@ -613,11 +649,12 @@ func set_rparams(threat: threats.Threat, params: Dictionary):
params['freq'] = threat.rparams['freq']
else:
params['freq'] = threat.freq
if threat.rparams.has('period'):
params['period'] = threat.rparams['period']
if threat.rparams.has('width'):
params['width'] = threat.rparams['width'] * 1.5
params['width'] = threat.rparams['width']
else:
params['width'] = threat.width * 1.5
check_width(params)
params['width'] = threat.width
if threat.rparams.has('filename'):
params['filename'] = threat.rparams['filename']
@@ -640,7 +677,6 @@ func get_krp(threat: threats.Threat):
func on_interfer_off(ecm: Interfer, ecms):
var sz = ecms.size()
signaller.emit_signal('on_prog_ecm_off', ecm)
ecms.erase(ecm.ispp)
thrs.erase(ecm.ispp)
interfer.cu.erase(ecm.ispp)
@@ -676,20 +712,3 @@ func call_ecm_proc(ecm):
func on_update_fs_closed(fs_dict):
fs_closed = fs_dict
func set_th_emit(th: threats.Threat, ecm: Interfer):
var freq_min = ecm.params['freq'] - ecm.params.get('width', settings.WIDTH_MAX)/2
var freq_max = ecm.params['freq'] + ecm.params.get('width', settings.WIDTH_MAX)/2
if (th.freq >= freq_min) and (th.freq <= freq_max):
if ecm.svk == 1:
th.emit_state = 2
elif th.emit_state == 2:
return
else:
th.emit_state = 1
func check_width(param: Dictionary):
if (param['width'] < settings.WIDTH_MIN): param['width'] = settings.WIDTH_MIN
elif (param['width'] > settings.WIDTH_MAX): param['width'] = settings.WIDTH_MAX

View File

@@ -10,7 +10,7 @@ var UnitProfiles: Dictionary[StringName, Array] = { \
'уарэп-яу07-частный': ['yau07rx', ['10.1.1.2', 50002, false, true], 'IP-адрес для приёма частных сообщений от ЯУ-07'],
'уарэп-яу07-общий': ['yau07rx', ['*', 50000, true, true], 'IP-адрес для приёма широковещательных сообщений от ЯУ-07'],
'уарэп-капсрпб': ['capsrpb', ['127.0.0.1', '127.0.0.1', 42023, 42022, false, true], 'IP-адрес для обмена сообщениями со службой \"МП550\" (СТЦ)'],
'уарэп-трасса': ['trassa', ['192.168.11.34', '192.168.11.105', 50200, 10004, false, true], 'IP-адрес для обмена сообщениями с \"Трассой\"'],
'уарэп-трасса': ['trassa', ['127.0.0.1', '127.0.0.1', 50200, 10004, false, true], 'IP-адрес для обмена сообщениями с \"Трассой\"'],
'уарэп-эмс': ['yau07tx', ['10.1.1.52', 50052, false, false], 'IP-адрес прибора УФ'],
'уарэп-яу07-2в': ['yau07tx', ['10.1.1.22', 50022, false, false], 'IP-адрес прибора ПРД-В2'],
'уарэп-яу07-2н': ['yau07tx', ['10.1.1.21', 50021, false, false], 'IP-адрес прибора ПРД-Н2'],
@@ -51,7 +51,7 @@ var UnitProfiles: Dictionary[StringName, Array] = { \
const FREQ_MAX: = 6000.0
const FREQ_MIN: = 400.0
const WIDTH_MAX: = 120.0
const WIDTH_MIN: = 5.0
const WIDTH_MIN: = 0.0
const DUR_MAX: = 1000000.0
const PERIOD_MAX: = 1000000.0
const UM_MIN: = -5.0

View File

@@ -30,8 +30,6 @@ signal режим_журнал()
## Вызывается при переходе в режим [b]ЭМС[/b].
signal режим_эмс()
## Вызывается при переходе в режим [b]ЭМС ТГ[/b].
signal режим_эмс2()
## Вызывается при переходе в режим [b]Настройка[/b].
signal режимастройки()
@@ -214,8 +212,3 @@ signal sector_klaster (new_sector_data)
signal clear_klaster ()
## Вызывается при программном отключении помехи.[br]
## [param ecm] - выключаемая помеха ([b]true[/b]
signal on_prog_ecm_off(ecm: interfer.Interfer)

View File

@@ -29,9 +29,9 @@ const MOD_TYPES: Array = [
const CU_STATE: Dictionary = {
0: 2, # Подготовка к выполнению
1: 1, # Выполняется
2: 3, # Ошибка в команде
2: 9, # Ошибка в команде
3: 7, # Занят выполнением другого ЦУ
4: 2, # Неисправность
4: 9, # Неисправность
}
class TCP5P28 extends unit.Unit:
@@ -135,7 +135,7 @@ class TCP5P28 extends unit.Unit:
continue
var cu = ecms[id]
cu_data.encode_u16(0, cu.ispp)
var state: int = CU_STATE[cu.svk] if CU_STATE.has(cu.svk) else 8
var state: int = CU_STATE[cu.svk] if CU_STATE.has(cu.svk) else 9
cu_data.encode_u8(2, state) # Состояние выполнения команды
cu_data.encode_u8(3, 0xFF) # Эффективность работы помехи
data.append_array(cu_data)

View File

@@ -28,9 +28,6 @@ class Threat:
var width: float ## Ширина занимаемого диапазона частот, МГц.
var selected: bool ## Флаг, что цель выбрана.
var auto_selected: bool = false ## Флаг автомата для целей
var emit_state: int = 0 ## 0 - подавление не назначено, 1 - назначено, 2 - выполняется
var nmfs: int ## Индекс модуля ФС, в зону действия которого попала цель
var priority: int ## Приоритет опасности цели
func _init(): clear_fflags()
func _to_string() -> String: return 'номер: %d пеленг: %0.1f частота: %0.1f МГц' % [id, aoa, freq]
@@ -143,10 +140,6 @@ func on_data_capsrpb_received(unit: capsrpb.CapsRpb, threats: Dictionary):
th.clear_fflags()
th.set_from_dic(dic_th)
th.tick_rx = unit.tick
if th.fflags.proto and th.proto != '':
th.priority = 1
else:
th.priority = 0
call_deferred('emit_signal', 'threat_update', th)
else:
var th: = Threat.new()

View File

@@ -35,10 +35,6 @@ class Trassa extends unit.Unit:
[2000, 6000, 500, 100],
[3500, 6000, 524, 50],
[390, 6000, 374, 50*7]]
var lfb = 0
var hfb = 0
var dap = 0
var daa = 0
# Инициализация
func _init(nm: StringName, buttons: Array = []) -> void:
@@ -109,10 +105,10 @@ class Trassa extends unit.Unit:
if txe == true or rxe == true:
sector_data["draw"] = true
if data.has("lfb") and data.has("hfb") and data.has("dap") and data.has("daa"):
lfb = int(data["lfb"])
hfb = int(data["hfb"])
dap = int(data["dap"])
daa = int(data["daa"])
var lfb = int(data["lfb"])
var hfb = int(data["hfb"])
var dap = int(data["dap"])
var daa = int(data["daa"])
for i in range(set_klaster.size()):
var mapping = set_klaster[i]
if lfb == mapping[0] and hfb == mapping[1]:

View File

@@ -4,7 +4,6 @@
"Адрес БПО левого борта": "http://172.22.246.13:8081/selftest?presetType=bpo&400000000",
"Адрес БПО правого борта": "http://172.22.246.11:8082/selftest?presetType=bpo&400000000",
"Виртуальная клавиатура": false,
"Включить работу по своим целям": true,
"Внешнее указание Трасса": false,
"Внешнее управление": false,
"Кнопка «JTIDS»": false,
@@ -27,31 +26,29 @@
"Период опроса состояния АФСП, секунды": "30",
"Период опроса состояния БПО, секунды": "30",
"Скрыть вкладку ЭМС 2": true,
"Список своих протоколов": "j11",
"Схема прибора. Белый цвет": [1.0, 1.0, 1.0],
"Схема прибора. Чёрный цвет": [0.0, 0.0, 0.0],
"Текущая версия ПО УАРЭП": "master b2633d8 Thu Sep 11 16:26:39 2025 +0300",
"Шаблон адреса сервера карт": "http://169.254.27.71:8001/osm_tiles/{z}/{x}/{y}.png",
"Шаблон адреса сервера карт": "http://10.1.1.2:8001/osm_tiles/{z}/{x}/{y}.png",
"навигация": [
"*",
60000,
true,
true
],
"уареп-трасса": "127.0.0.1,127.0.0.1,50200,10004",
"уарэп-5п28": [
"127.0.0.1",
50777
],
"уарэп-капсрпб": [
"127.0.0.1",
"127.0.0.1",
"192.168.11.102",
"192.168.11.105",
42023,
42022,
false,
true
],
"уарэп-спт25-1": [
"/home/sasha/dev/tty0",
"/home/user/tty0",
0,
19200,
"N",
@@ -59,23 +56,15 @@
1
],
"уарэп-спт25-2": [
"/home/sasha/dev/tty4",
"/home/user/tty1",
0,
19200,
"N",
8,
1
],
"уарэп-трасса": [
"127.0.0.1",
"127.0.0.1",
50200,
10004,
false,
true
],
"уарэп-щ3": [
"/home/sasha/dev/tty2",
"/home/user/tty3",
7,
19200,
"N",

View File

@@ -7,9 +7,6 @@ code = "shader_type canvas_item;
#define RADIUS_INNER_0 200.0 /* Радиус внутренний для режима приоритет РТО */
#define RADIUS_INNER_1 480.0 /* Радиус внутренний для режима приоритет РЛС */
#define ANTENAS_COUNT 28 /* Количество антенн */
#define ANT_BAND_READY 1U /* Антенна (модуль ФС) готова или исправна */
#define ANT_BAND_FAILED 0U /* Антенна (модуль ФС) не исправно */
uniform vec2 pc0 = vec2(560, 560); /* Центр сетки антенн */
uniform float rotation: hint_range(0.0, 360.0) = 0.0; /* */
@@ -17,13 +14,9 @@ uniform vec4 color0: source_color = vec4(0.38, 0.47, 0.51, 0.4);
uniform vec4 color1: source_color = vec4(0.39, 0.44, 0.50, 0.4);
uniform float radius_inner_0 = RADIUS_INNER_0;
uniform float radius_inner_1 = RADIUS_INNER_1;
uniform float radius_outter = 550.0; /* Радиус внешний. Должно быть равно ant_band_r1_6 */
uniform float radius_outter = 550.0; /* Радиус внешний. Должно быть равно ant_band_r1_6 */
uniform float alpha: hint_range(0.0, 1.0) = 0.5;
uniform int mode = 0; /* Режим отображения. Приоритет РТО - 0, приоритет РЛС - 1 */
uniform float ffr: hint_range(0.0, 1.0) = 0.2; /* Индикация неисправности модулей ФС. Заметность штриховки. */
uniform float sfr: hint_range(0.0, 10.0) = 0.0; /* Индикация неисправности модулей ФС. Скорость движения штрховки */
uniform float afr: hint_range(0.0, 180.0) = 0.0; /* Индикация неисправности модулей ФС. Наклон штрховки */
uniform float pfr: hint_range(1.0, 20.0) = 10.0; /* Индикация неисправности модулей ФС. Частота штриховки */
uniform int mode = 0; /* Режим отображения. Приоритет РТО - 0, приоритет РЛС - 1 */
const int ant_band_count_0 = 2;
const int ant_band_count_1 = 2;
@@ -49,8 +42,7 @@ const float ant_band_r1_4[] = {450.0, 530.0};
const float ant_band_r1_5[] = {500.0, 540.0};
const float ant_band_r1_6[] = {550.0, 550.0};
uniform vec4 ant_band_c[ANTENAS_COUNT];
uniform uint ant_band_m[ANTENAS_COUNT];
uniform vec4 ant_band_c[28];
const float d4 = 90.0;
const float ds = 1.0;
@@ -87,12 +79,6 @@ void antenas(inout vec4 c, vec2 uv, vec2 p0, int cnt, float r0, float r1, inout
col.rgb = ant_band_c[j].rgb;
index++;
col.a = alpha + (random_timed(uv) - 0.5f) * ant_band_c[j].a;
if (ant_band_m[j] == ANT_BAND_FAILED)
{
vec2 uvr = uv;
rotate_vec2(uvr, radians(afr), pc0);
col.a *= (1.0 - ffr) + tanh(10.0 * sin(TIME * sfr + 2.0 * PI * uvr.x / pfr)) * ffr;
}
float v = float(i & 1);
vec4 color = v * col + (1.0f - v) * col;
sector(c, uv, p0, float(i) * da, da, r0, r1, color);
@@ -134,9 +120,4 @@ shader_parameter/radius_inner_1 = 480.0
shader_parameter/radius_outter = 550.0
shader_parameter/alpha = 0.5
shader_parameter/mode = 0
shader_parameter/ffr = 0.2
shader_parameter/sfr = 0.0
shader_parameter/afr = 0.0
shader_parameter/pfr = 10.0
shader_parameter/ant_band_c = PackedVector4Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
shader_parameter/ant_band_m = PackedInt32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)

View File

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

View File

@@ -326,9 +326,7 @@ func _set_row_selected(i_row: int, selected: bool = true) -> void:
var selector = nodes[selector_key]
nodes.erase(selector_key)
if is_instance_valid(selector):
var prnt = selector.get_parent_control()
if prnt:
prnt.remove_child(selector)
node.remove_child(selector)
selector.queue_free()
else:
push_warning('обращение к удалённому элементу \"%s\"' % selector_key)