Merge remote-tracking branch 'sasha/master'

# Conflicts:
#	scenes/работа.tscn
This commit is contained in:
MaD_CaT
2023-11-20 13:52:41 +03:00
14 changed files with 74 additions and 51 deletions

1
.gitignore vendored
View File

@@ -25,3 +25,4 @@ mono_crash.*.json
# Godot 4+ specific ignores
.godot/
/override.cfg

View File

@@ -226,7 +226,6 @@ func _open_file() -> void:
err = _file.get_error()
if err:
return print_debug(error_string(err))
var read = _file.get_as_text()
_file.seek_end(0)

View File

@@ -12,20 +12,20 @@ config_version=5
config/name="uarep-ctl"
run/main_scene="res://scenes/tab-switch.tscn"
config/features=PackedStringArray("4.1")
config/features=PackedStringArray("4.2")
run/low_processor_mode=true
run/delta_smoothing=false
boot_splash/show_image=false
boot_splash/fullsize=false
boot_splash/use_filter=false
config/icon="res://data/icon.png"
config/map_server_addr="https://a.tile.openstreetmap.org"
config/map_bcs=Vector3(0.5, 1.5, 0.3)
config/map_tile_size=256
config/map_image_hight=512
config/map_image_width=512
config/map_minimum_zoom=5
config/map_maximum_zoom=19
config/map_server_addr="https://b.tile.openstreetmap.org"
[autoload]
@@ -113,3 +113,10 @@ shader_compiler/shader_cache/strip_debug=true
textures/default_filters/anisotropic_filtering_level=0
anti_aliasing/screen_space_roughness_limiter/enabled=false
quality/driver/fallback_to_gles2=true
[shader_globals]
tools={
"type": "bool",
"value": true
}

View File

@@ -38,18 +38,18 @@ const INTERFER_NAMES = {
## Индексы колонок
const COLUMN_NUMBER = 0
const COLUMN_NAME = 1
const COLUMN_FREQ = 2
const COLUMN_NUMBER = 0
const COLUMN_NAME = 1
const COLUMN_FREQ = 2
const COLUMN_AOA = 3
const COLUMN_STATE = 4
const COLUMN_STATE = 4
# Called when the node enters the scene tree for the first time.
func _ready():
var table_index: = Dictionary()
signaller.connect('interfer_new', Callable(self, 'on_interfer_new').bind(table_index))
call_deferred('init_table')
func init_table():
$table.set_header(TABLE_HEADER)
@@ -87,7 +87,3 @@ func map_th_to_row(ecm) -> Array:
row[COLUMN_STATE] = '%s' % INTERFER_STATE[ecm.svk]
return row
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

View File

@@ -10,6 +10,7 @@
[node name="tab_switch" type="TabContainer"]
offset_right = 1600.0
offset_bottom = 1200.0
tooltip_text = "Переключает режимы работы программы"
script = ExtResource("1_fg0vd")
[node name="Работа" parent="." instance=ExtResource("2_u7p16")]

View File

@@ -84,7 +84,7 @@ func img_tile_to_map_image(image: Image, dst_pos: Vector2i, tile: mercator.Tile)
map_rects.append(Rect2i(dst_pos.x, dst_pos.y, tile.x, tile.y)) # сохранить корневую плитку
func _process(delta: float):
func _process(_delta: float):
if (map_tile_state == TASK_STATE.DONE) and map_tile_stack.size():
var tile: mercator.Tile = map_tile_stack[-1]
if request_tile(tile, map_server_addr) == OK:

View File

@@ -1,13 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://b37dpuas0emkc"]
[ext_resource type="Texture2D" uid="uid://bgekehgbqyddu" path="res://кнопка-3-1.png" id="1"]
[ext_resource type="Texture2D" uid="uid://caj3qxh8fo025" path="res://кнопка-3-0.png" id="2"]
[node name="TextureButton" type="TextureButton"]
modulate = Color(1.5, 1.5, 1.5, 1)
offset_right = 140.0
offset_bottom = 34.0
toggle_mode = true
action_mode = 0
texture_normal = ExtResource("2")
texture_pressed = ExtResource("1")

View File

@@ -7,3 +7,4 @@ func _ready() -> void:
$Label2.text = 'Текущий режим доступа: ограниченный'
for node in $GridContainer.get_children().filter(func(b): return b is Button):
node.disabled = true

View File

@@ -1,7 +1,18 @@
[gd_scene load_steps=2 format=3 uid="uid://bnptm4rlp60dq"]
[gd_scene load_steps=3 format=3 uid="uid://bnptm4rlp60dq"]
[ext_resource type="Script" path="res://scenes/настройки.gd" id="1_2l3rd"]
[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")
@@ -241,11 +252,11 @@ text = "Текущий режим доступа: полный"
[node name="edt_mapaddr" type="LineEdit" parent="."]
layout_mode = 0
offset_left = 536.0
offset_top = 60.0
offset_right = 908.0
offset_bottom = 87.0
text = "https://a.tile.openstreetmap.org"
offset_left = 477.0
offset_top = 85.0
offset_right = 849.0
offset_bottom = 112.0
script = SubResource("GDScript_anjmx")
[node name="Label" type="Label" parent="edt_mapaddr"]
layout_mode = 0
@@ -255,3 +266,5 @@ offset_bottom = -8.0
text = "Адрес сервера карт"
horizontal_alignment = 1
vertical_alignment = 1
[connection signal="text_changed" from="edt_mapaddr" to="edt_mapaddr" method="_on_text_changed"]

View File

@@ -52,29 +52,48 @@ func on_button_view_toggled(toggled: bool): $canvas.set_view_mode(int(toggled))
func on_threats_resized(threats: Dictionary): $count_all_pad/count_all.text = '%02d' % threats.size()
##
func _enter_tree() -> void:
var timer1 = Timer.new()
timer1.name = 'timer1'
add_child(timer1)
timer1.one_shot = true
timer1.connect('timeout', Callable(self, 'on_enter_tree'))
timer1.start(1.0)
func _exit_tree() -> void:
var timer1 = get_node('timer1')
remove_child(timer1)
timer1.queue_free()
## Производит инициализацию
func _ready():
min_zoom = ProjectSettings.get_setting('application/config/map_minimum_zoom', 5)
max_zoom = ProjectSettings.get_setting('application/config/map_maximum_zoom', 19)
$btn_zoom.set_meta('zoom', min_zoom - 1)
$tilemap.position = $canvas.get_strob_center()
$btn_strob.button_connect('pressed', Callable(self, 'on_button_strobe_pressed'))
$btn_view.button_connect('toggled', Callable(self, 'on_button_view_toggled'))
$grd_btns/btn_off.set_pressed(true)
on_button_strobe_pressed()
drag_fsm = DragFSM.OFF
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)))
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'))
call_deferred('_on_btn_scale_pressed')
signaller.connect('zoom_complete', Callable(self, '_on_zoom_complete'))
signaller.connect('rto_threat_sel', Callable(self, 'on_rto_threat_sel'))
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('zoom_complete', Callable(self, '_on_zoom_complete'))
signaller.connect('rto_threat_sel', Callable(self, 'on_rto_threat_sel'))
signaller.connect('threat_selected', Callable(self, 'on_threat_selected'))
func on_enter_tree() -> void:
call_deferred('_on_btn_scale_pressed')
call_deferred('on_button_strobe_pressed')
$tilemap.position = $canvas.get_strob_center()
## Производит отображение цели на диаграмму
func map_threat_to_bip(th: threats.Threat, bip: Control):
bip.position = tools.pos_calc(

View File

@@ -3,16 +3,16 @@
[ext_resource type="Script" path="res://scenes/работа.gd" id="1_niok4"]
[ext_resource type="PackedScene" uid="uid://nl1vklubr5kr" path="res://scenes/bip.tscn" id="2_br3s6"]
[ext_resource type="PackedScene" uid="uid://dem3fcec25awh" path="res://scenes/grd_side.tscn" id="3_s2j0e"]
[ext_resource type="PackedScene" uid="uid://b5kjdyxuwsot5" path="res://scenes/canvas.tscn" id="4_lryxs"]
[ext_resource type="PackedScene" uid="uid://cnkbk53mi7viu" path="res://scenes/grd_btns.tscn" id="5_2jnbs"]
[ext_resource type="PackedScene" uid="uid://dymo732qc2doa" path="res://scenes/count_all_pad.tscn" id="6_e3re7"]
[ext_resource type="PackedScene" uid="uid://bwti82byphl68" path="res://scenes/count_danger_pad.tscn" id="7_2arls"]
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat.tscn" id="8_k0iv2"]
[ext_resource type="PackedScene" uid="uid://0uqi1ghf7sma" path="res://scenes/btn_scale.tscn" id="9_oey3x"]
[ext_resource type="PackedScene" uid="uid://bbq6nklh36yij" path="res://scenes/tilemap.tscn" id="10_gtwyg"]
[ext_resource type="PackedScene" uid="uid://b5kjdyxuwsot5" path="res://scenes/canvas.tscn" id="11_b6su4"]
[ext_resource type="Shader" path="res://shaders/tilemap.gdshader" id="11_ekapd"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_mds64"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_4p7y1"]
resource_local_to_scene = true
shader = ExtResource("11_ekapd")
shader_parameter/radius = 0.39
@@ -45,10 +45,7 @@ offset_bottom = 1170.0
metadata/_edit_lock_ = true
[node name="tilemap" parent="." instance=ExtResource("10_gtwyg")]
material = SubResource("ShaderMaterial_mds64")
[node name="canvas" parent="." instance=ExtResource("4_lryxs")]
metadata/_edit_lock_ = true
material = SubResource("ShaderMaterial_4p7y1")
[node name="grd_btns" parent="." instance=ExtResource("5_2jnbs")]
layout_mode = 0
@@ -136,6 +133,8 @@ offset_right = 1104.0
offset_bottom = 1056.0
metadata/zoom = 4
[node name="canvas" parent="." instance=ExtResource("11_b6su4")]
[connection signal="drag_begin" from="." to="." method="_on_drag_begin"]
[connection signal="drag_continue" from="." to="." method="_on_drag_continue"]
[connection signal="pressed" from="btn_zoom" to="." method="_on_btn_scale_pressed"]

View File

@@ -34,7 +34,7 @@ class Interfer:
var powp: float = 0.0 ## Мощность излучения выраженная в процентах.
var kni: = 0.0 ## Курсовой угол направления излучения.
var params: = {} ## Параметры помехи.
var get: Array[String] ## Запрос массива параметров (список запрошенных параметров).
var get_params: Array[String] ## Запрос массива параметров (список запрошенных параметров).
var retss: int ## Значение счётчика сообщения в котором был произведён запрос массива параметров.
var tick_rx: int ## Тик время обновления цели, мс.

View File

@@ -5,7 +5,7 @@ code = "shader_type canvas_item;
#include \"tools.gdshaderinc\"
uniform vec2 pc0; /* Центр сетки антенн */
uniform vec2 pc0 = vec2(560, 560); /* Центр сетки антенн */
uniform float rotation: hint_range(0.0, 360.0) = 0.0; /* */
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);

View File

@@ -53,7 +53,7 @@ vec2 rotateUVmatrinx(vec2 uv, vec2 pivot, float rotation)
void vertex()
{
{
float dir = 0.0;
vec2 offset = vec2(0.125, 0.125);
dir -= speed * TIME;
@@ -75,6 +75,6 @@ void fragment()
get_line_points(px0, px1, py0, py1, 210.0);
COLOR.a += line(vec2(px0, py0), vec2(px1, py1), 5.0, UV);
COLOR *= smooth_px(length(UV-center), radius, DSS);
}