Merge remote-tracking branch 'origin/master' into master-prd
# Conflicts: # scenes/pribor-prd-k/pribor-prd-k.gd
This commit is contained in:
Binary file not shown.
@@ -1,35 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://c6p8thias0vuy"
|
||||
path="res://.godot/imported/DejaVuSans.ttf-b4085dde282b5d503d6a56e258b526b7.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/DejaVuSans.ttf"
|
||||
dest_files=["res://.godot/imported/DejaVuSans.ttf-b4085dde282b5d503d6a56e258b526b7.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=1
|
||||
generate_mipmaps=false
|
||||
disable_embedded_bitmaps=true
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=true
|
||||
force_autohinter=false
|
||||
hinting=1
|
||||
subpixel_positioning=1
|
||||
keep_rounding_remainders=true
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
||||
Binary file not shown.
@@ -1,35 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://c7hvei2ks7jp6"
|
||||
path="res://.godot/imported/DejaVuSansCondensed.ttf-7a8251b7291db131ffa4eaba367ef066.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/DejaVuSansCondensed.ttf"
|
||||
dest_files=["res://.godot/imported/DejaVuSansCondensed.ttf-7a8251b7291db131ffa4eaba367ef066.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=1
|
||||
generate_mipmaps=false
|
||||
disable_embedded_bitmaps=true
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=true
|
||||
force_autohinter=false
|
||||
hinting=1
|
||||
subpixel_positioning=1
|
||||
keep_rounding_remainders=true
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
||||
BIN
data/bip.png
BIN
data/bip.png
Binary file not shown.
|
Before Width: | Height: | Size: 610 B |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cp4bv6lh8w83k"
|
||||
path="res://.godot/imported/bip.png-6f0fd2c953cace8aaed57abe6fd7518e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/bip.png"
|
||||
dest_files=["res://.godot/imported/bip.png-6f0fd2c953cace8aaed57abe6fd7518e.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
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cjsr544qccftu"
|
||||
path="res://.godot/imported/disconnect.png-c8d8039f8761972a5ad748aee64d2372.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/disconnect.png"
|
||||
dest_files=["res://.godot/imported/disconnect.png-c8d8039f8761972a5ad748aee64d2372.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
|
||||
@@ -1,30 +0,0 @@
|
||||
[gd_resource type="FontFile" load_steps=2 format=3 uid="uid://clrxfflc1wrhj"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://c7hvei2ks7jp6" path="res://data/DejaVuSansCondensed.ttf" id="1"]
|
||||
|
||||
[resource]
|
||||
fallbacks = Array[Font]([ExtResource("1")])
|
||||
cache/0/16/0/ascent = 0.0
|
||||
cache/0/16/0/descent = 0.0
|
||||
cache/0/16/0/underline_position = 0.0
|
||||
cache/0/16/0/underline_thickness = 0.0
|
||||
cache/0/16/0/scale = 1.0
|
||||
cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0)
|
||||
cache/0/16/0/kerning_overrides/14/0 = Vector2(0, 0)
|
||||
cache/0/16/0/kerning_overrides/50/0 = Vector2(0, 0)
|
||||
cache/0/14/0/ascent = 0.0
|
||||
cache/0/14/0/descent = 0.0
|
||||
cache/0/14/0/underline_position = 0.0
|
||||
cache/0/14/0/underline_thickness = 0.0
|
||||
cache/0/14/0/scale = 1.0
|
||||
cache/0/14/0/kerning_overrides/16/0 = Vector2(0, 0)
|
||||
cache/0/14/0/kerning_overrides/14/0 = Vector2(0, 0)
|
||||
cache/0/14/0/kerning_overrides/50/0 = Vector2(0, 0)
|
||||
cache/0/50/0/ascent = 0.0
|
||||
cache/0/50/0/descent = 0.0
|
||||
cache/0/50/0/underline_position = 0.0
|
||||
cache/0/50/0/underline_thickness = 0.0
|
||||
cache/0/50/0/scale = 1.0
|
||||
cache/0/50/0/kerning_overrides/16/0 = Vector2(0, 0)
|
||||
cache/0/50/0/kerning_overrides/14/0 = Vector2(0, 0)
|
||||
cache/0/50/0/kerning_overrides/50/0 = Vector2(0, 0)
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ccgavrtpkd56i"
|
||||
path="res://.godot/imported/прицел-сопровождение.png-c9d19addfccd8f78fb08a176ca62316e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/прицел-сопровождение.png"
|
||||
dest_files=["res://.godot/imported/прицел-сопровождение.png-c9d19addfccd8f78fb08a176ca62316e.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
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bq6biyc0nxjv4"
|
||||
path="res://.godot/imported/прицел-табличка.png-45ba36412555fb1cbc42d6445071f6cd.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/прицел-табличка.png"
|
||||
dest_files=["res://.godot/imported/прицел-табличка.png-45ba36412555fb1cbc42d6445071f6cd.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
|
||||
@@ -22,7 +22,10 @@ script = ExtResource("1_151rh")
|
||||
metadata/DeviceName = &"Устройство РР левого борта"
|
||||
|
||||
[node name="request" type="HTTPRequest" parent="."]
|
||||
use_threads = true
|
||||
script = ExtResource("2_4vyhj")
|
||||
addr_left = "http://192.168.56.2:8001/selftest"
|
||||
addr_right = "http://192.168.56.2:8002/selftest"
|
||||
|
||||
[node name="timer" type="Timer" parent="request"]
|
||||
autostart = true
|
||||
|
||||
@@ -22,6 +22,7 @@ script = ExtResource("1_tfses")
|
||||
metadata/DeviceName = &"Устройство РР правого борта"
|
||||
|
||||
[node name="request" type="HTTPRequest" parent="."]
|
||||
use_threads = true
|
||||
script = ExtResource("2_miwrd")
|
||||
|
||||
[node name="timer" type="Timer" parent="request"]
|
||||
|
||||
@@ -3,7 +3,7 @@ class_name pribor_afsp extends 'res://scenes/контроль/прибор.gd'
|
||||
@export var prefix_path: String = 'DeviceDescripton[DeviceName]'
|
||||
|
||||
static var json_conv: JSON = JSON.new()
|
||||
static var node_maper = load('res://scenes/pribor-afsp/node_maper.gd')
|
||||
static var node_maper = load('res://scenes/pribor-afsp/node-maper.gd')
|
||||
|
||||
func _on_request_completed(result, _response_code, headers, body: PackedByteArray):
|
||||
if result != 0:
|
||||
@@ -56,8 +56,8 @@ func _on_request_completed(result, _response_code, headers, body: PackedByteArra
|
||||
node_maper.map_error_codes_to_item(json_conv.data, child, 'state', 0)
|
||||
|
||||
|
||||
## Вызывается при клике мыши на элементе контроля.
|
||||
## [param block_a] - Кликнутый элемент контроля.
|
||||
## Вызывается при клике мыши на элементе.
|
||||
## [param block_a] - Кликнутый элемент.
|
||||
func _on_item_pressed(block_a: Control):
|
||||
var metas = block_a.get_meta_list()
|
||||
for n in metas:
|
||||
|
||||
@@ -3,7 +3,7 @@ class_name pribor_rtr extends 'res://scenes/контроль/прибор.gd'
|
||||
@export var prefix_path: String = 'DeviceDescripton[DeviceName]'
|
||||
|
||||
static var json_conv: JSON = JSON.new()
|
||||
static var node_maper = load('res://scenes/pribor-afsp/node_maper.gd')
|
||||
static var node_maper = load('res://scenes/pribor-afsp/node-maper.gd')
|
||||
|
||||
|
||||
const bort_to_node_name = {
|
||||
@@ -1,20 +1,20 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://5uv1idl3lqea"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d0jwv5opi3mrk" path="res://scenes/pribor-afsp/pribor-rtr.gd" id="1_soedq"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_pspup"]
|
||||
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="3_gh777"]
|
||||
[ext_resource type="Script" uid="uid://bux47vkw71w1t" path="res://scenes/pribor-afsp/request.gd" id="4_pspup"]
|
||||
[ext_resource type="Script" uid="uid://d0jwv5opi3mrk" path="res://scenes/pribor-afsp/pribor-bpo.gd" id="1_bhc4e"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_jp6m0"]
|
||||
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="3_jcpjs"]
|
||||
[ext_resource type="Script" uid="uid://bux47vkw71w1t" path="res://scenes/pribor-afsp/request.gd" id="4_crej3"]
|
||||
|
||||
[node name="pribor_rtr" type="Control"]
|
||||
[node name="pribor_bpo" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_left = 115.0
|
||||
offset_top = 150.0
|
||||
offset_right = 115.0
|
||||
offset_bottom = 150.0
|
||||
script = ExtResource("1_soedq")
|
||||
script = ExtResource("1_bhc4e")
|
||||
|
||||
[node name="mod_pit_g1" parent="." instance=ExtResource("2_pspup")]
|
||||
[node name="mod_pit_g1" parent="." instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
offset_left = 40.0
|
||||
offset_top = 535.0
|
||||
@@ -25,14 +25,14 @@ size_flags_vertical = 7
|
||||
fname = "Модуль электропитания"
|
||||
rname = "G1"
|
||||
|
||||
[node name="blok_bpo_a1" parent="." instance=ExtResource("2_pspup")]
|
||||
[node name="blok_bpo_a1" parent="." instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 0
|
||||
offset_left = 40.0
|
||||
offset_top = 135.0
|
||||
offset_right = 560.0
|
||||
offset_bottom = 330.0
|
||||
show_state = false
|
||||
fname = "Блок БПО"
|
||||
fname = "Блок БПО левого борта"
|
||||
rname = "А1"
|
||||
|
||||
[node name="grid_bpo_a1" type="GridContainer" parent="."]
|
||||
@@ -43,63 +43,63 @@ offset_right = 498.0
|
||||
offset_bottom = 320.0
|
||||
columns = 4
|
||||
|
||||
[node name="kanal1" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal1" parent="grid_bpo_a1" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 1"
|
||||
metadata/state = "SelfTest[0].SystemList[0].DevList[0]['TestPassed']"
|
||||
|
||||
[node name="kanal2" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal2" parent="grid_bpo_a1" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 2"
|
||||
metadata/state = "SelfTest[0].SystemList[0].DevList[1]['TestPassed']"
|
||||
|
||||
[node name="kanal3" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal3" parent="grid_bpo_a1" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 3"
|
||||
metadata/state = "SelfTest[0].SystemList[0].DevList[2]['TestPassed']"
|
||||
|
||||
[node name="kanal4" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal4" parent="grid_bpo_a1" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 4"
|
||||
metadata/state = "SelfTest[0].SystemList[0].DevList[3]['TestPassed']"
|
||||
|
||||
[node name="kanal5" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal5" parent="grid_bpo_a1" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 5"
|
||||
metadata/state = "SelfTest[0].SystemList[0].DevList[4]['TestPassed']"
|
||||
|
||||
[node name="kanal6" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal6" parent="grid_bpo_a1" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 6"
|
||||
metadata/state = "SelfTest[0].SystemList[0].DevList[5]['TestPassed']"
|
||||
|
||||
[node name="kanal7" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal7" parent="grid_bpo_a1" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 7"
|
||||
metadata/state = "SelfTest[0].SystemList[0].DevList[6]['TestPassed']"
|
||||
|
||||
[node name="kanal8" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal8" parent="grid_bpo_a1" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 8"
|
||||
metadata/state = "SelfTest[0].SystemList[0].DevList[7]['TestPassed']"
|
||||
|
||||
[node name="yas_bpo_a1" parent="." instance=ExtResource("3_gh777")]
|
||||
[node name="yas_bpo_a1" parent="." instance=ExtResource("3_jcpjs")]
|
||||
offset_left = 500.0
|
||||
offset_top = 175.0
|
||||
offset_right = 550.0
|
||||
@@ -108,14 +108,14 @@ show_rname = false
|
||||
self_size = Vector2i(50, 145)
|
||||
fname = "Яч. связи"
|
||||
|
||||
[node name="blok_bpo_a2" parent="." instance=ExtResource("2_pspup")]
|
||||
[node name="blok_bpo_a2" parent="." instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 0
|
||||
offset_left = 40.0
|
||||
offset_top = 335.0
|
||||
offset_right = 560.0
|
||||
offset_bottom = 530.0
|
||||
show_state = false
|
||||
fname = "Блок БПО"
|
||||
fname = "Блок БПО правого борта"
|
||||
rname = "А2"
|
||||
|
||||
[node name="grid_bpo_a2" type="GridContainer" parent="."]
|
||||
@@ -126,55 +126,55 @@ offset_right = 498.0
|
||||
offset_bottom = 520.0
|
||||
columns = 4
|
||||
|
||||
[node name="kanal1" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal1" parent="grid_bpo_a2" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 1"
|
||||
|
||||
[node name="kanal2" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal2" parent="grid_bpo_a2" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 2"
|
||||
|
||||
[node name="kanal3" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal3" parent="grid_bpo_a2" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 3"
|
||||
|
||||
[node name="kanal4" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal4" parent="grid_bpo_a2" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 4"
|
||||
|
||||
[node name="kanal5" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal5" parent="grid_bpo_a2" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 5"
|
||||
|
||||
[node name="kanal6" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal6" parent="grid_bpo_a2" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 6"
|
||||
|
||||
[node name="kanal7" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal7" parent="grid_bpo_a2" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 7"
|
||||
|
||||
[node name="kanal8" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
|
||||
[node name="kanal8" parent="grid_bpo_a2" instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Канал 8"
|
||||
|
||||
[node name="yas_bpo_a2" parent="." instance=ExtResource("3_gh777")]
|
||||
[node name="yas_bpo_a2" parent="." instance=ExtResource("3_jcpjs")]
|
||||
offset_left = 500.0
|
||||
offset_top = 375.0
|
||||
offset_right = 550.0
|
||||
@@ -184,7 +184,10 @@ self_size = Vector2i(50, 145)
|
||||
fname = "Яч. связи"
|
||||
|
||||
[node name="request" type="HTTPRequest" parent="."]
|
||||
script = ExtResource("4_pspup")
|
||||
use_threads = true
|
||||
script = ExtResource("4_crej3")
|
||||
addr_left = "http://192.168.56.2:8001/selftest"
|
||||
addr_right = "http://192.168.56.2:8002/selftest"
|
||||
|
||||
[node name="timer" type="Timer" parent="request"]
|
||||
autostart = true
|
||||
@@ -19,9 +19,11 @@ const RESULT_STRINGS = {
|
||||
RESULT_TIMEOUT: 'Время истекло' }
|
||||
|
||||
|
||||
@export var addr_left: String
|
||||
@export var addr_right: String
|
||||
|
||||
|
||||
var i_bort: int = 0
|
||||
var addr_left: String
|
||||
var addr_right: String
|
||||
|
||||
|
||||
func get_result_string(result: Result):
|
||||
|
||||
@@ -50,8 +50,8 @@ func _ready() -> void:
|
||||
|
||||
func initialize_connections() -> void:
|
||||
signaller.conn(signaller.fs_update_state, Callable(self, 'on_fs_update_state'))
|
||||
var unit_key = settings.get_unit_key(get_meta('unit_name')[0])
|
||||
var unit_prd = network.units[unit_key]
|
||||
var unit_name = get_meta('unit_name')[0]
|
||||
var unit_prd = network.get_unit_instance(unit_name)
|
||||
currecnt_unit = unit_prd.name
|
||||
unit_prd.connect('data_received', Callable(self, 'on_data_received'))
|
||||
unit_prd.connect('line_changed', Callable(self, 'on_line_changed'))
|
||||
@@ -80,10 +80,9 @@ func _enter_tree() -> void:
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
var unit_key = settings.get_unit_key(get_meta('unit_name')[0])
|
||||
var unit_prd = network.units[unit_key]
|
||||
var unit_name = get_meta('unit_name')[0]
|
||||
var unit_prd = network.get_unit_instance(unit_name)
|
||||
var prd_module = prd.prd_dict[unit_prd.name]
|
||||
|
||||
prd_module.cmd_array.append([unit_prd.CmdCode.WRITE_ISA, [Constants.ADDR_UG_LITERA_1, ug_work_1, Constants.ADDR_UG_LITERA_2, ug_work_2]])
|
||||
|
||||
|
||||
@@ -322,9 +321,8 @@ func on_fs_update_state(packet_type_7: Dictionary) -> void:
|
||||
|
||||
|
||||
func on_ug_setting() -> void:
|
||||
var unit_key = settings.get_unit_key(get_meta('unit_name')[0])
|
||||
var unit_prd = network.units[unit_key]
|
||||
|
||||
var unit_name = get_meta('unit_name')[0]
|
||||
var unit_prd = network.get_unit_instance(unit_name)
|
||||
if unit_prd.isa_ports.has(Constants.ADDR_UG_LITERA_1):
|
||||
ug_work_1 = unit_prd.isa_ports[Constants.ADDR_UG_LITERA_1]
|
||||
if unit_prd.isa_ports.has(Constants.ADDR_UG_LITERA_2):
|
||||
|
||||
@@ -50,8 +50,8 @@ func _ready() -> void:
|
||||
|
||||
func initialize_connections() -> void:
|
||||
signaller.conn(signaller.fs_update_state, Callable(self, 'on_fs_update_state'))
|
||||
var unit_key = settings.get_unit_key(get_meta('unit_name')[0])
|
||||
var unit_prd = network.units[unit_key]
|
||||
var unit_name = get_meta('unit_name')[0]
|
||||
var unit_prd = network.get_unit_instance(unit_name)
|
||||
currecnt_unit = unit_prd.name
|
||||
unit_prd.connect('data_received', Callable(self, 'on_data_received'))
|
||||
unit_prd.connect('line_changed', Callable(self, 'on_line_changed'))
|
||||
@@ -74,10 +74,9 @@ func _enter_tree() -> void:
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
var unit_key = settings.get_unit_key(get_meta('unit_name')[0])
|
||||
var unit_prd = network.units[unit_key]
|
||||
var unit_name = get_meta('unit_name')[0]
|
||||
var unit_prd = network.get_unit_instance(unit_name)
|
||||
var prd_module = prd.prd_dict[unit_prd.name]
|
||||
|
||||
prd_module.cmd_array.append([unit_prd.CmdCode.WRITE_ISA, [Constants.ADDR_UG_LITERA_1, ug_work_1, Constants.ADDR_UG_LITERA_2, ug_work_2]])
|
||||
|
||||
|
||||
@@ -329,8 +328,8 @@ func on_fs_update_state(packet_type_7: Dictionary) -> void:
|
||||
|
||||
|
||||
func on_ug_setting() -> void:
|
||||
var unit_key = settings.get_unit_key(get_meta('unit_name')[0])
|
||||
var unit_prd = network.units[unit_key]
|
||||
var unit_name = get_meta('unit_name')[0]
|
||||
var unit_prd = network.units[unit_name]
|
||||
|
||||
if unit_prd.isa_ports.has(Constants.ADDR_UG_LITERA_1):
|
||||
ug_work_1 = unit_prd.isa_ports[Constants.ADDR_UG_LITERA_1]
|
||||
|
||||
@@ -13,9 +13,7 @@ var REVFF = '(rev ff)'
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var unit_key = settings.get_unit_key('уарэп-эмс')
|
||||
var unit_uf = network.units[unit_key]
|
||||
|
||||
var unit_uf = network.get_unit_instance('уарэп-эмс')
|
||||
self.add_child(timer)
|
||||
timer.connect('timeout', Callable(self, 'on_timer').bind(unit_uf))
|
||||
timer.start(1)
|
||||
|
||||
@@ -69,8 +69,7 @@ func on_toggled_switch(val: bool, meta: Array, unit_sch3):
|
||||
func _enter_tree() -> void:
|
||||
super._enter_tree()
|
||||
if Engine.is_editor_hint(): return
|
||||
var unit_key = settings.get_unit_key(unit_name)
|
||||
var unit_sch3 = network.units[unit_key]
|
||||
var unit_sch3 = network.get_unit_instance(unit_name)
|
||||
unit_sch3.base_holding_address = base_holding_address
|
||||
unit_sch3.regs_holding_count = regs_holding_count
|
||||
unit_sch3.base_input_address = base_input_address
|
||||
@@ -83,8 +82,7 @@ func _enter_tree() -> void:
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var unit_key = settings.get_unit_key(unit_name)
|
||||
var unit_sch3 = network.units[unit_key]
|
||||
var unit_sch3 = network.get_unit_instance(unit_name)
|
||||
var items = get_tree().get_nodes_in_group('bits_items_switch')
|
||||
for item in items:
|
||||
var meta = item.get_meta('bits')
|
||||
@@ -94,8 +92,7 @@ func _ready() -> void:
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if Engine.is_editor_hint(): return
|
||||
var unit_key = settings.get_unit_key(unit_name)
|
||||
var unit_sch3 = network.units[unit_key]
|
||||
var unit_sch3 = network.get_unit_instance(unit_name)
|
||||
unit_sch3.disconnect('read_input', on_input.bind(unit_sch3))
|
||||
external_ctl = ProjectSettings.get_setting('application/config/Внешнее управление', false)
|
||||
unit_sch3.disconnect('error', on_error)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=15 format=3 uid="uid://3slb0i3pvowc"]
|
||||
[gd_scene load_steps=14 format=3 uid="uid://3slb0i3pvowc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvo6tcreqyuex" path="res://scenes/tabs-switch/tab-switch.gd" id="1_fg0vd"]
|
||||
[ext_resource type="PackedScene" uid="uid://b276iygic5itk" path="res://scenes/работа/работа.tscn" id="2_u7p16"]
|
||||
@@ -7,7 +7,6 @@
|
||||
[ext_resource type="PackedScene" uid="uid://dab6loryocc73" path="res://scenes/эмс/эмс.tscn" id="5_u71bh"]
|
||||
[ext_resource type="PackedScene" uid="uid://bnptm4rlp60dq" path="res://scenes/настройки/настройки.tscn" id="6_i8iv3"]
|
||||
[ext_resource type="PackedScene" uid="uid://musb21x2u0xs" path="res://scenes/эмс2/эмс2.tscn" id="6_rsg03"]
|
||||
[ext_resource type="FontFile" uid="uid://clrxfflc1wrhj" path="res://data/main-font.tres" id="7_i7l8n"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tidwt"]
|
||||
|
||||
@@ -75,7 +74,6 @@ offset_bottom = 27.0
|
||||
tooltip_text = "Готовность аппаратуры к работе"
|
||||
mouse_filter = 0
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_fonts/font = ExtResource("7_i7l8n")
|
||||
theme_override_font_sizes/font_size = 14
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_o1r22")
|
||||
text = "Исправно"
|
||||
@@ -91,7 +89,6 @@ offset_bottom = 27.0
|
||||
tooltip_text = "Комплекс находится под внешним управлением"
|
||||
mouse_filter = 0
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_fonts/font = ExtResource("7_i7l8n")
|
||||
theme_override_font_sizes/font_size = 14
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_o1r22")
|
||||
text = "Внешнее управление"
|
||||
|
||||
@@ -135,8 +135,7 @@ func _ready() -> void:
|
||||
_on_resize()
|
||||
signaller.connect('map_centered', on_map_centered)
|
||||
if not Engine.is_editor_hint():
|
||||
var key = settings.get_unit_key('навигация')
|
||||
var unit_nav = network.units[key]
|
||||
var unit_nav = network.get_unit_instance('навигация')
|
||||
unit_nav.connect('data_received', on_data_received)
|
||||
ProjectSettings.connect('settings_changed', _settings_changed)
|
||||
threats.connect('threat_new', Callable(self, '_on_threat_new'))
|
||||
|
||||
@@ -5,10 +5,10 @@ enum STATE_VAL {
|
||||
GOOD = 1,
|
||||
ERROR = 2 }
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
|
||||
func _ready() -> void:
|
||||
var unit_key = settings.get_unit_key(get_parent().get_meta('unit_name')[0])
|
||||
var unit_prd = network.units[unit_key]
|
||||
var unit_name = get_parent().get_meta('unit_name')[0]
|
||||
var unit_prd = network.get_unit_instance(unit_name)
|
||||
unit_prd.connect('data_received', Callable(self, 'on_data_received'))
|
||||
unit_prd.connect('line_changed', Callable(self, 'on_line_changed'))
|
||||
set_default_state()
|
||||
|
||||
@@ -44,16 +44,14 @@ func _ready():
|
||||
continue
|
||||
if pribor_meta.size():
|
||||
for i in pribor_meta.size():
|
||||
var unit_key = settings.get_unit_key(pribor_meta[i])
|
||||
var unit_pribor = network.units[unit_key]
|
||||
var unit_pribor = network.get_unit_instance(pribor_meta[i])
|
||||
unit_pribor.connect('line_changed', Callable(self, pribor_proc).bind(conn_node, pribor_meta))
|
||||
|
||||
|
||||
func online_change_arr(_u, conn_node, pribor_meta):
|
||||
var state_online = true
|
||||
for i in pribor_meta.size():
|
||||
var unit_key = settings.get_unit_key(pribor_meta[i])
|
||||
var unit_pribor = network.units[unit_key]
|
||||
var unit_pribor = network.get_unit_instance(pribor_meta[i])
|
||||
if not unit_pribor.online:
|
||||
state_online = false
|
||||
break
|
||||
|
||||
@@ -54,10 +54,9 @@ func _on_resized() -> void:
|
||||
|
||||
func _enter_tree() -> void:
|
||||
if Engine.is_editor_hint(): return
|
||||
var unit_key = settings.get_unit_key(unit_name)
|
||||
var unit = network.units[unit_key]
|
||||
unit.connect('data_received', Callable(self, 'on_data_received'))
|
||||
unit.connect('line_changed', Callable(self, 'on_line_changed'))
|
||||
var unit_any = network.get_unit_instance(unit_name)
|
||||
unit_any.connect('data_received', Callable(self, 'on_data_received'))
|
||||
unit_any.connect('line_changed', Callable(self, 'on_line_changed'))
|
||||
$margin/vbox.alignment = alignment
|
||||
$margin/vbox/grid/fname.text = fname
|
||||
$margin/vbox/grid/rname.text = rname
|
||||
@@ -66,7 +65,6 @@ func _enter_tree() -> void:
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if Engine.is_editor_hint(): return
|
||||
var unit_key = settings.get_unit_key(unit_name)
|
||||
var unit = network.units[unit_key]
|
||||
unit.disconnect('data_received', Callable(self, 'on_data_received'))
|
||||
unit.disconnect('line_changed', Callable(self, 'on_line_changed'))
|
||||
var unit_any = network.get_unit_instance(unit_name)
|
||||
unit_any.disconnect('data_received', Callable(self, 'on_data_received'))
|
||||
unit_any.disconnect('line_changed', Callable(self, 'on_line_changed'))
|
||||
|
||||
@@ -32,8 +32,7 @@ func _ready() -> void:
|
||||
|
||||
## Инициализация основных элементов экрана ЭМС.
|
||||
func init_boards():
|
||||
var unit_key = settings.get_unit_key('уарэп-эмс')
|
||||
var unit_ems = network.units[unit_key]
|
||||
var unit_ems = network.get_unit_instance('уарэп-эмс')
|
||||
|
||||
# Выставление позиций элементов ЭМС на экране
|
||||
$scrollin.set_position(Vector2(posx,posy))
|
||||
|
||||
@@ -106,10 +106,8 @@ func _ready() -> void:
|
||||
var ecms: Dictionary = {} ## Словарь помех.
|
||||
for i in ID_INTERFERS_LEN: # Заполняет массив ID целей
|
||||
id_array.append(i + 1)
|
||||
var unit_key = settings.get_unit_key('уарэп-капсрпб')
|
||||
var unit_caps = network.units[unit_key]
|
||||
var unit_5p28_key = settings.get_unit_key('уарэп-5п28')
|
||||
var unit_5p28 = network.units_tcp[unit_5p28_key]
|
||||
var unit_caps = network.get_unit_instance('уарэп-капсрпб')
|
||||
var unit_5p28 = network.get_unit_instance('уарэп-5п28')
|
||||
var timer_check_state: = Timer.new()
|
||||
add_child(timer_check_state)
|
||||
var resend_timeout = ProjectSettings.get_setting('application/interfer/resend_timeout', 1000.0)
|
||||
@@ -128,8 +126,7 @@ func _ready() -> void:
|
||||
signaller.connect('interfer_prinuditelno', Callable(self, 'on_interfer_prinuditelno'))
|
||||
signaller.connect('emit_changed', Callable(self, 'on_emit_changed').bind(ecms))
|
||||
threats.connect('threat_lost', Callable(self, 'on_threats_lost').bind(ecms, unit_caps))
|
||||
var key = settings.get_unit_key('навигация')
|
||||
var unit_nav = network.units[key]
|
||||
var unit_nav = network.get_unit_instance('навигация')
|
||||
unit_nav.connect('data_received', on_nav_data_received.bind(unit_caps))
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class Socket extends PacketPeerUDP:
|
||||
class SocketTCP extends TCPServer:
|
||||
const RX_TIMEOUT: int = 1000 ## Время сброса счётчика принятия части пакета.
|
||||
var peerstream: = PacketPeerStream.new()
|
||||
var unit_key: Array ## Ключ юнита.
|
||||
var unit_key: StringName ## Ключ юнита.
|
||||
var head_len: int = 8 ## Длина заголовка команды.
|
||||
var len_place: int = 4 ## Номер начального байта с длинной блока данных.
|
||||
var type_len: int = 4 ## Количество байт в размере длинны.
|
||||
@@ -62,20 +62,22 @@ class SocketTCP extends TCPServer:
|
||||
|
||||
var poll_sockets: Array[Socket]
|
||||
var tcp_sockets: Array
|
||||
var units: Dictionary
|
||||
var units_udp: Dictionary
|
||||
var units_udprx: Dictionary
|
||||
var units_tcp: Dictionary
|
||||
var units_serial: Dictionary
|
||||
var units_modbus: Dictionary
|
||||
var units: Dictionary[StringName, unit.Unit]
|
||||
var units_udp: Dictionary[StringName, unit.Unit]
|
||||
var units_udprx: Dictionary[StringName, unit.Unit]
|
||||
var units_tcp: Dictionary[StringName, unit.Unit]
|
||||
var units_serial: Dictionary[StringName, unit.Unit]
|
||||
var units_modbus: Dictionary[StringName, unit.Unit]
|
||||
var serials: Dictionary # Последовательные порты
|
||||
var mbcs: Dictionary # Клиенты modbus.
|
||||
var dst_ports: Dictionary
|
||||
var dst_ports: Dictionary[StringName, int]
|
||||
var dst_addrs: Dictionary[StringName, StringName]
|
||||
var unit_keys: Dictionary
|
||||
var sock_unicast: Socket
|
||||
var sock_capsrpb: Socket
|
||||
var logger_page: Node
|
||||
var send_sockets: Dictionary # Таблица <имяустройста>: <сокет> для отправки сообщений
|
||||
var addr_port_to_unit_name: Dictionary[StringName, StringName]
|
||||
|
||||
|
||||
func on_serial_data(data, unit): unit.parse(data, tick)
|
||||
@@ -94,16 +96,16 @@ func create_socket(nm) -> Socket:
|
||||
return sock
|
||||
|
||||
|
||||
func create_tcpsocket(nm) -> SocketTCP:
|
||||
var addr = settings.UnitProfiles[nm][1]
|
||||
var port = settings.UnitProfiles[nm][2][0]
|
||||
func create_tcpsocket(unit_name: StringName) -> SocketTCP:
|
||||
var addr = settings.UnitProfiles[unit_name][1]
|
||||
var port = settings.UnitProfiles[unit_name][2][0]
|
||||
var sock = SocketTCP.new()
|
||||
sock.unit_key = settings.get_unit_key(nm)
|
||||
sock.unit_key = unit_name
|
||||
var rc: = sock.listen(port, addr)
|
||||
if rc == Error.OK:
|
||||
log.message(log.INFO, '\"%s\" слушает на %s:%d' % [nm, addr, port])
|
||||
log.message(log.INFO, '\"%s\" слушает на %s:%d' % [unit_name, addr, port])
|
||||
else:
|
||||
log.message(log.ERROR, '\"%s\" %s:%d \"%s\"' % [nm, addr, port, error_string(rc)])
|
||||
log.message(log.ERROR, '\"%s\" %s:%d \"%s\"' % [unit_name, addr, port, error_string(rc)])
|
||||
return sock
|
||||
|
||||
|
||||
@@ -156,42 +158,40 @@ func _ready() -> void:
|
||||
|
||||
if proto in UDPRX_PROTO:
|
||||
var new_unit = UDPRX_PROTO[proto].new(unit_name)
|
||||
var unit_key = settings.get_unit_key(unit_name)
|
||||
units[unit_key] = new_unit
|
||||
units_udprx[unit_key] = new_unit
|
||||
dst_ports[unit_key] = st[2][0]
|
||||
units[unit_name] = new_unit
|
||||
units_udprx[unit_name] = new_unit
|
||||
dst_ports[unit_name] = st[2][0]
|
||||
|
||||
if proto in UDP_PROTO:
|
||||
var new_unit = UDP_PROTO[proto].new(unit_name)
|
||||
var unit_key = settings.get_unit_key(unit_name)
|
||||
units[unit_key] = new_unit
|
||||
units_udp[unit_key] = new_unit
|
||||
dst_ports[unit_key] = st[2][1] if len(st[2]) > 1 else st[2][0]
|
||||
units[unit_name] = new_unit
|
||||
units_udp[unit_name] = new_unit
|
||||
dst_ports[unit_name] = st[2][1] if len(st[2]) > 1 else st[2][0]
|
||||
dst_addrs[unit_name] = st[1]
|
||||
|
||||
if proto in TCP_PROTO:
|
||||
var unit_tcp = TCP_PROTO[proto].new(unit_name)
|
||||
var unit_key = settings.get_unit_key(unit_name)
|
||||
units_tcp[unit_key] = unit_tcp
|
||||
units[unit_key] = unit_tcp
|
||||
units[unit_name] = unit_tcp
|
||||
units_tcp[unit_name] = unit_tcp
|
||||
|
||||
if proto in MODBUS_PROTO:
|
||||
var unit_modbus = MODBUS_PROTO[proto].new(unit_name)
|
||||
var unit_key = settings.get_unit_key(unit_name)
|
||||
units_modbus[unit_key] = unit_modbus
|
||||
units[unit_key] = unit_modbus
|
||||
unit_modbus.port = settings.UnitProfiles[unit_name][1] # TODO: убрать это отсюда (обращение к глобальным данным из экземпляра)
|
||||
unit_modbus.params = settings.UnitProfiles[unit_name][2] # TODO: убрать это отсюда (обращение к глобальным данным из экземпляра)
|
||||
units[unit_name] = unit_modbus
|
||||
units_modbus[unit_name] = unit_modbus
|
||||
bind_modbuses.append([unit_modbus, unit_name])
|
||||
|
||||
if proto in SERIAL_PROTO:
|
||||
var unit_serial = SERIAL_PROTO[proto].new(unit_name)
|
||||
var unit_key = settings.get_unit_key(unit_name)
|
||||
var serial = create_serial(unit_name)
|
||||
units_serial[unit_key] = unit_serial
|
||||
units[unit_key] = unit_serial
|
||||
serials[unit_key] = serial
|
||||
units_serial[unit_name] = unit_serial
|
||||
units[unit_name] = unit_serial
|
||||
serials[unit_name] = serial
|
||||
|
||||
ProjectSettings.connect('settings_changed', Callable(self, '_on_settings_changed_serial').bind(bind_serials))
|
||||
|
||||
tcp_sockets.append([create_tcpsocket('уарэп-5п28'), units_tcp[settings.get_unit_key('уарэп-5п28')]])
|
||||
tcp_sockets.append([create_tcpsocket('уарэп-5п28'), units_tcp['уарэп-5п28']])
|
||||
for key in dst_ports:
|
||||
unit_keys[dst_ports[key]] = key
|
||||
if logger_page:
|
||||
@@ -200,6 +200,11 @@ func _ready() -> void:
|
||||
u.connect('line_changed', Callable(logger_page, 'on_line_changed').bind(key))
|
||||
u.connect('command_fail', Callable(logger_page, 'on_command_fail').bind(key))
|
||||
|
||||
for key in settings.UnitProfiles:
|
||||
var item = settings.UnitProfiles[key]
|
||||
var addr_port: = StringName('%s:%d' % [item[1], item[2][0]])
|
||||
addr_port_to_unit_name[addr_port] = StringName(key)
|
||||
|
||||
|
||||
func _on_settings_changed_modbus(bind_modbuses: Array):
|
||||
var external_ctl = ProjectSettings.get_setting('application/config/Внешнее управление', false)
|
||||
@@ -228,9 +233,10 @@ func poll_receive_udp(sock: Socket) -> bool:
|
||||
var data: = sock.get_packet()
|
||||
var addr: = sock.get_packet_ip()
|
||||
var port: = sock.get_packet_port()
|
||||
var addr_port: = [addr, port]
|
||||
if units.has(addr_port):
|
||||
units[addr_port].parse(data, tick)
|
||||
var addr_port: = StringName('%s:%d' % [addr, port])
|
||||
if addr_port_to_unit_name.has(addr_port):
|
||||
var unit_name: = addr_port_to_unit_name[addr_port]
|
||||
units[unit_name].parse(data, tick)
|
||||
continue
|
||||
if unit_keys.has(port):
|
||||
var key1 = unit_keys[port]
|
||||
@@ -238,7 +244,7 @@ func poll_receive_udp(sock: Socket) -> bool:
|
||||
units[key1].parse(data, tick)
|
||||
continue
|
||||
port = sock.get_local_port()
|
||||
var key = ['*', port]
|
||||
var key = StringName('%s:%d' % ['*', port])
|
||||
if units.has(key):
|
||||
var unit_udprx = units[key]
|
||||
unit_udprx.source_addr = [addr, port]
|
||||
@@ -301,9 +307,10 @@ func _process(_delta: float) -> void:
|
||||
var unit_udp = units_udp[key]
|
||||
if Error.OK == unit_udp.process(tick):
|
||||
var sock = send_sockets[unit_udp.name]
|
||||
var dst_port = dst_ports[key]
|
||||
var tx_data = unit_udp.tx_data.slice(0, unit_udp.tx_len)
|
||||
sock.send_to([key[0], dst_port], tx_data)
|
||||
var dst_port = dst_ports[key]
|
||||
var dst_addr = dst_addrs[key]
|
||||
sock.send_to([dst_addr, dst_port], tx_data)
|
||||
for key in units_udprx:
|
||||
var unit_udprx = units_udprx[key]
|
||||
unit_udprx.process(tick)
|
||||
@@ -322,3 +329,8 @@ func _process(_delta: float) -> void:
|
||||
sock.send_to(unit_tcp.tx_data)
|
||||
poll_receive_tcp(sock)
|
||||
poll_sockets.any(poll_receive_udp)
|
||||
|
||||
|
||||
func get_unit_instance(unit_name: StringName) -> unit.Unit:
|
||||
tools.allways(unit_name in units, 'нет такого устройства: \"%s\"' % unit_name)
|
||||
return units[unit_name]
|
||||
|
||||
@@ -159,9 +159,9 @@ class PRD:
|
||||
var ug_online: bool = false ## Состояние ячейки УГ
|
||||
var set_ug_state: bool = true ## Необходимо ли записать в УГ настройки
|
||||
|
||||
func _init(u_name ,u):
|
||||
func _init(u_name, u_yau07):
|
||||
prd_name = u_name
|
||||
unit_yau07 = u
|
||||
unit_yau07 = u_yau07
|
||||
init_ems_g()
|
||||
|
||||
func init_ems_g():
|
||||
@@ -261,8 +261,7 @@ class PRD:
|
||||
func _ready() -> void:
|
||||
check_dir()
|
||||
for prd_name in PRD_NAMES:
|
||||
var unit_key = settings.get_unit_key(prd_name)
|
||||
var unit_prd = network.units[unit_key]
|
||||
var unit_prd = network.get_unit_instance(prd_name)
|
||||
var new_prd = PRD.new(prd_name, unit_prd)
|
||||
prd_dict[prd_name] = new_prd
|
||||
for key in FS_PRD.keys():
|
||||
@@ -274,8 +273,7 @@ func _ready() -> void:
|
||||
|
||||
for key in FS_PRD.keys():
|
||||
fs_caps_id[FS_PRD[key][1]] = key
|
||||
var unit_caps_key = settings.get_unit_key('уарэп-капсрпб')
|
||||
var unit_caps = network.units[unit_caps_key]
|
||||
var unit_caps = network.get_unit_instance('уарэп-капсрпб')
|
||||
unit_caps.connect('data_received', Callable(self, 'on_data_capsrpb_received'))
|
||||
signaller.connect('режим_контроль', Callable(self, 'on_mode_changed').bind(PrdState.CONTROL))
|
||||
signaller.connect('режим_работа', Callable(self, 'on_mode_changed').bind(PrdState.WORK))
|
||||
|
||||
@@ -25,6 +25,9 @@ class Sch3 extends unit.Unit:
|
||||
var tick_fsm: int = 0
|
||||
var mbc: = ModbusClientRtu.new()
|
||||
var tick_fsm_delta: = reconnect_period
|
||||
var port: String
|
||||
var params: Array
|
||||
|
||||
|
||||
func try_disconnect():
|
||||
mbc.thread_stop()
|
||||
@@ -33,8 +36,6 @@ class Sch3 extends unit.Unit:
|
||||
mbc.close()
|
||||
|
||||
func try_connect() -> bool:
|
||||
var port = settings.UnitProfiles[name][1] # TODO: убрать это отсюда (обращение к глобальным данным из экземпляра)
|
||||
var params = settings.UnitProfiles[name][2] # TODO: убрать это отсюда (обращение к глобальным данным из экземпляра)
|
||||
var rc = mbc.open(port, params[0], params[1], params[2], params[3], params[4])
|
||||
if rc != Error.OK: # TODO: убрать это отсюда (неуместный вывод сообщения)
|
||||
if not reconnect_failed:
|
||||
@@ -102,8 +103,14 @@ class Sch3 extends unit.Unit:
|
||||
if external_ctl and (step_fsm not in [Sch3Fsm.DISCONNECT, Sch3Fsm.IDLE]):
|
||||
step_fsm = Sch3Fsm.DISCONNECT
|
||||
elif (not external_ctl) and (step_fsm in [Sch3Fsm.DISCONNECT, Sch3Fsm.IDLE]):
|
||||
var unit_sch3 = network.get_unit_instance('уарэп-щ3')
|
||||
var unit_prof = ProjectSettings.get_setting('application/config/%s' % unit_sch3.name)
|
||||
if unit_prof:
|
||||
unit_sch3.port = unit_prof[0]
|
||||
unit_sch3.params = unit_prof[1]
|
||||
step_fsm = Sch3Fsm.CONNECT
|
||||
|
||||
|
||||
func parse(return_code: Error, base_addr: int, data: Array, code: String):
|
||||
if return_code == Error.OK:
|
||||
rx_tick = Time.get_ticks_msec()
|
||||
|
||||
@@ -5,7 +5,7 @@ class_name uarep_settings extends Node
|
||||
|
||||
var settings_program: Dictionary
|
||||
|
||||
@export var UnitProfiles: = { \
|
||||
@export var UnitProfiles: Dictionary[StringName, Array] = { \
|
||||
# Название | Протокол | Адрес | Порт | Широковещательное | Привязывать к адресу | Комментарий
|
||||
'уарэп-яу07-частный': ['yau07rx', '10.1.1.2', [50002], false, true, 'IP-адрес на котором принимают частные сообщения от ЯУ-07'],
|
||||
'уарэп-яу07-общий': ['yau07rx', '*', [50000], true, true, 'IP-адрес на котором принимают широковещательные сообщения от ЯУ-07'],
|
||||
@@ -110,6 +110,5 @@ func get_settings_file_path():
|
||||
|
||||
|
||||
## Возвращает ключ устройства.
|
||||
func get_unit_key(unit_name: String) -> Array:
|
||||
var item = UnitProfiles[unit_name]
|
||||
return [item[1], item[2][0]]
|
||||
func get_unit_key(unit_name: String) -> StringName:
|
||||
return StringName(unit_name)
|
||||
|
||||
@@ -71,8 +71,7 @@ class TCP5P28 extends unit.Unit:
|
||||
|
||||
func init_state():
|
||||
for key in PR_STATE.keys():
|
||||
var unit_key = settings.get_unit_key(key)
|
||||
var unit_pribor = network.units[unit_key]
|
||||
var unit_pribor = network.get_unit_instance(key)
|
||||
unit_pribor.connect('line_changed', Callable(self, 'pribor_line_changed').bind(key))
|
||||
|
||||
func pribor_line_changed(u, key):
|
||||
|
||||
@@ -46,15 +46,13 @@ signal threats_resized(th: Dictionary)
|
||||
|
||||
func _ready() -> void:
|
||||
var threats = {} ## Список целей. Индекс - <номер цели>
|
||||
var unit_key = settings.get_unit_key('уарэп-капсрпб')
|
||||
var unit = network.units[unit_key]
|
||||
var unit_5p28_key = settings.get_unit_key('уарэп-5п28')
|
||||
var unit_5p28 = network.units_tcp[unit_5p28_key]
|
||||
var unit_caps = network.get_unit_instance('уарэп-капсрпб')
|
||||
var unit_5p28 = network.get_unit_instance('уарэп-5п28')
|
||||
var timer_check_lost: = Timer.new()
|
||||
var timer_aoa_update: = Timer.new()
|
||||
add_child(timer_check_lost)
|
||||
add_child(timer_aoa_update)
|
||||
unit.connect('data_received', Callable(self, 'on_data_capsrpb_received').bind(threats))
|
||||
unit_caps.connect('data_received', Callable(self, 'on_data_capsrpb_received').bind(threats))
|
||||
unit_5p28.connect('get_threats', Callable(self, 'on_get_threats').bind(unit_5p28, threats))
|
||||
timer_check_lost.connect('timeout', Callable(self, 'on_timer_check_lost').bind(settings.ThreatParams.time_lost, threats))
|
||||
timer_check_lost.start(settings.ThreatParams.time_lost / 1000.0)
|
||||
|
||||
Reference in New Issue
Block a user