Compare commits
89 Commits
3f469935bc
...
a9bd975cb1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9bd975cb1 | ||
|
|
568f0d1357 | ||
|
|
0bf79c7f6b | ||
|
|
3aaff6faa1 | ||
|
|
8b28ca7714 | ||
|
|
e6ea873294 | ||
|
|
20eec6e8be | ||
|
|
0c8f02bc77 | ||
|
|
bfb9d3a4e8 | ||
|
|
5eb44fd20a | ||
|
|
5b1984a307 | ||
|
|
dd642ea057 | ||
|
|
63de1118b0 | ||
|
|
831b2e0ea8 | ||
|
|
423411cf94 | ||
|
|
8f2a6b031b | ||
|
|
2e5edc793e | ||
|
|
b273a01bf5 | ||
|
|
c6ed61b6ce | ||
|
|
7954048f11 | ||
|
|
6b8f767a89 | ||
|
|
8c330d08a6 | ||
|
|
a8b085a514 | ||
|
|
e688e27a63 | ||
|
|
3fb2601aca | ||
|
|
aebccdcf91 | ||
|
|
3d2d29c3f2 | ||
|
|
661e8ef96c | ||
|
|
fbd9969f93 | ||
|
|
2cdce8f1e6 | ||
|
|
3b747f211c | ||
|
|
c2e3127afa | ||
|
|
33e793faec | ||
|
|
43eb151471 | ||
|
|
38c2aa9f80 | ||
|
|
f39212232a | ||
|
|
dc362ad26f | ||
|
|
58e43884f0 | ||
|
|
208406971f | ||
|
|
9eb31c0d4a | ||
|
|
09b17c7ef7 | ||
|
|
033e9869f1 | ||
|
|
427581b1f9 | ||
|
|
cbc9fbc7a9 | ||
|
|
5e78e06626 | ||
|
|
56a0fd8af8 | ||
|
|
38b858b6fc | ||
|
|
5293313f0e | ||
|
|
04da0d0cfd | ||
|
|
89bc19ec98 | ||
|
|
9f32e293a0 | ||
|
|
217281ce51 | ||
|
|
de86d281ca | ||
|
|
9727eb04a9 | ||
|
|
e1cd37bcfd | ||
|
|
dcd806309c | ||
|
|
3915bd59d1 | ||
|
|
ae96a8aa97 | ||
|
|
9aeacea4d7 | ||
|
|
22fe43a062 | ||
|
|
cee75d02cf | ||
|
|
4f3f4ff7f8 | ||
|
|
3cbba93658 | ||
|
|
9d476859b1 | ||
|
|
69b455f811 | ||
|
|
9856e300e9 | ||
|
|
87e360e1a9 | ||
|
|
64cbf59ac6 | ||
|
|
77b822f3b8 | ||
|
|
eb0978599a | ||
|
|
51f3e961c1 | ||
|
|
2980aa9f15 | ||
|
|
5b5b5d31c6 | ||
|
|
1785d23e43 | ||
|
|
85c02f3f6c | ||
|
|
15be378743 | ||
|
|
94f0eccaa1 | ||
|
|
2d4fd57789 | ||
|
|
71176c4869 | ||
|
|
36e47bbd13 | ||
|
|
77e15627d0 | ||
|
|
effbbb9272 | ||
|
|
56343338c2 | ||
|
|
3bff1cd90f | ||
|
|
5657892887 | ||
|
|
606f5ea689 | ||
|
|
6c62419bdb | ||
|
|
5991a079c7 | ||
|
|
2a29e4bd54 |
@@ -36,4 +36,4 @@
|
||||
- После клонирования запустить скрипт `git-hooks-config.sh`
|
||||
- В среде **Windows** запуск скрипта `git-hooks-config.sh` производить из оболочки `git bash`
|
||||
- Нужно обновить `settings.json`
|
||||
- поиск циклических зависимостей
|
||||
- поиск циклических зависимостей (не реализованно)
|
||||
|
||||
222
config/setting_prd_control.json
Normal file
@@ -0,0 +1,222 @@
|
||||
{
|
||||
"device_constants": {
|
||||
"PRD_N": {
|
||||
"constants": {
|
||||
"POWER_UKP_1": 31,
|
||||
"POWER_UKP_2": 63,
|
||||
"DKM_BIT_2": 1,
|
||||
"DKM_BIT_3": 2,
|
||||
"BASE_ADDR_EMS_G": 288,
|
||||
"ADDR_UG_LITERA_1": 262,
|
||||
"ADDR_UG_LITERA_2": 264,
|
||||
"ADDR_UG_LITERA_3": 266,
|
||||
"TEMP_THRESHOLD": 70,
|
||||
"POWER_THRESHOLD": 40,
|
||||
"RAY_DOU_NUM": 3,
|
||||
"ATT_UM_2": 2,
|
||||
"ATT_UM_3": 3,
|
||||
"POWER_UM": 100,
|
||||
"TIMER_DELAY": 10.0,
|
||||
"STATE_MASHINE_TIMER": 0.3
|
||||
},
|
||||
"pribor_config": {
|
||||
"1н": {"angle": 0.0, "sectors": [4, 8]},
|
||||
"2н": {"angle": 90.0, "sectors": [7, 11]},
|
||||
"3н": {"angle": 180.0, "sectors": [6, 10]},
|
||||
"4н": {"angle": 270.0, "sectors": [5, 9]}
|
||||
},
|
||||
"fs_params": {
|
||||
"2": {"freq": 932.0, "width": 100.0},
|
||||
"3": {"freq": 1157.0, "width": 100.0}
|
||||
},
|
||||
"start_litera": 2,
|
||||
},
|
||||
"PRD_V": {
|
||||
"constants": {
|
||||
"POWER_UKP_1": 31,
|
||||
"POWER_UKP_2": 63,
|
||||
"DKM_BIT_4": 3,
|
||||
"DKM_BIT_5": 4,
|
||||
"BASE_ADDR_EMS_G": 288,
|
||||
"ADDR_UG_LITERA_1": 262,
|
||||
"ADDR_UG_LITERA_2": 264,
|
||||
"ADDR_UG_LITERA_3": 266,
|
||||
"TEMP_THRESHOLD": 70,
|
||||
"POWER_THRESHOLD": 40,
|
||||
"RAY_DOU_NUM": 3,
|
||||
"ATT_UM_4": 2,
|
||||
"ATT_UM_5": 3,
|
||||
"POWER_UM": 100,
|
||||
"TIMER_DELAY": 10.0,
|
||||
"STATE_MASHINE_TIMER": 0.3
|
||||
},
|
||||
"pribor_config": {
|
||||
"1в": {"angle": 0.0, "sectors": [12, 16]},
|
||||
"2в": {"angle": 90.0, "sectors": [15, 19]},
|
||||
"3в": {"angle": 180.0, "sectors": [14, 18]},
|
||||
"4в": {"angle": 270.0, "sectors": [13, 17]}
|
||||
},
|
||||
"fs_params": {
|
||||
"4": {"freq": 1227.0, "width": 100.0},
|
||||
"5": {"freq": 1575.0, "width": 110.0}
|
||||
},
|
||||
"start_litera": 4,
|
||||
},
|
||||
"PRD_K": {
|
||||
"constants": {
|
||||
"POWER_UKP_1": 31,
|
||||
"POWER_UKP_2": 63,
|
||||
"DKM_BIT_1": 0,
|
||||
"DKM_BIT_6": 5,
|
||||
"DKM_BIT_7": 6,
|
||||
"BASE_ADDR_EMS_G": 288,
|
||||
"ADDR_UG_LITERA_1": 262,
|
||||
"ADDR_UG_LITERA_2": 264,
|
||||
"ADDR_UG_LITERA_3": 266,
|
||||
"TEMP_THRESHOLD": 40,
|
||||
"POWER_THRESHOLD": 40,
|
||||
"RAY_DOU_NUM": 3,
|
||||
"ATT_UM_1": 0,
|
||||
"ATT_UM_6": 3,
|
||||
"ATT_UM_7": 2,
|
||||
"POWER_UM": 100,
|
||||
"TIMER_DELAY": 10.0,
|
||||
"STATE_MASHINE_TIMER": 0.3
|
||||
},
|
||||
"pribor_config": {
|
||||
"1к": {"angle": 0.0, "sectors": [0, 20, 24]},
|
||||
"2к": {"angle": 90.0, "sectors": [3, 23, 27]},
|
||||
"3к": {"angle": 180.0, "sectors": [2, 22, 26]},
|
||||
"4к": {"angle": 270.0, "sectors": [1, 21, 25]}
|
||||
},
|
||||
"fs_params": {
|
||||
"1": {"freq": 450.0, "width": 80.0},
|
||||
"6": {"freq": 2450.0, "width": 110.0},
|
||||
"7": {"freq": 4750.0, "width": 110.0}
|
||||
},
|
||||
"start_litera": 1,
|
||||
}
|
||||
},
|
||||
"base_configs": {
|
||||
"block_ip": {
|
||||
"maa2000_1": [0, false],
|
||||
"maa2000_2": [1, false],
|
||||
"ip9_50_1": [2, false],
|
||||
"ip9_50_2": [3, false],
|
||||
"ip12_50_1": [4, false],
|
||||
"ip5_25": [7, false]
|
||||
},
|
||||
"block_kasseta": {
|
||||
"yau07": false,
|
||||
"ems": false,
|
||||
"ug": false,
|
||||
"ukp1": false,
|
||||
"ukp2": false
|
||||
}
|
||||
},
|
||||
"device_configs": {
|
||||
"PRD_N": {
|
||||
"block_ip": "base",
|
||||
"block_kasseta": "base",
|
||||
"control_results": {
|
||||
"block_kasseta":false,
|
||||
"block_ip": false,
|
||||
"temperature": true,
|
||||
"dkm_2": false,
|
||||
"dkm_3": false,
|
||||
"dou_2": false,
|
||||
"dou_3": false,
|
||||
"fs_2": false,
|
||||
"fs_3": false,
|
||||
"is_over_control": false,
|
||||
}
|
||||
},
|
||||
"PRD_V": {
|
||||
"block_ip": "base",
|
||||
"block_kasseta": "base",
|
||||
"control_results": {
|
||||
"block_kasseta":false,
|
||||
"block_ip": false,
|
||||
"temperature": true,
|
||||
"dkm_4": false,
|
||||
"dkm_5": false,
|
||||
"dou_4": false,
|
||||
"dou_5": false,
|
||||
"fs_4": false,
|
||||
"fs_5": false,
|
||||
"is_over_control": false,
|
||||
}
|
||||
},
|
||||
"PRD_K": {
|
||||
"block_ip": {
|
||||
"maa2000_1": [0, false],
|
||||
"maa2000_2": [1, false],
|
||||
"ip9_50_1": [2, false],
|
||||
"ip9_50_2": [3, false],
|
||||
"ip12_50_1": [4, false],
|
||||
"ip9_50_3": [5, false],
|
||||
"ip12_50_2": [6, false],
|
||||
"ip5_25": [7, false]
|
||||
},
|
||||
"block_kasseta": "base",
|
||||
"control_results": {
|
||||
"block_kasseta":false,
|
||||
"block_ip": false,
|
||||
"temperature": true,
|
||||
"dkm_1": false,
|
||||
"dkm_6": false,
|
||||
"dkm_7": false,
|
||||
"dou_6": false,
|
||||
"dou_7": false,
|
||||
"fs_1": false,
|
||||
"fs_6": false,
|
||||
"fs_7": false,
|
||||
"is_over_control": false,
|
||||
}
|
||||
}
|
||||
},
|
||||
"ray_types": ["RAY_m5", "RAY_5", "RAY_15", "RAY_25", "RAY_35", "RAY_45"],
|
||||
"data_indices": {
|
||||
"STATUS_BOARD": 0,
|
||||
"IN_BLANK_PRD": 1,
|
||||
"IN_IMPULS_PRD": 7,
|
||||
"OUT_BLANK_PRD": 13,
|
||||
"OUT_IMPULS_PRD": 19,
|
||||
"DRY_CONTACT": 27,
|
||||
"DKM": 28,
|
||||
"POWER_UKP_1": 31,
|
||||
"TEMPERATURE_UKP_1": 47,
|
||||
"POWER_UKP_2": 63,
|
||||
"TEMPERATURE_UKP_2": 79
|
||||
},
|
||||
"fs_keys": {
|
||||
"1": "fs_1",
|
||||
"2": "fs_2",
|
||||
"3": "fs_3",
|
||||
"4": "fs_4",
|
||||
"5": "fs_5",
|
||||
"6": "fs_6",
|
||||
"7": "fs_7"
|
||||
},
|
||||
"temperature_constants": {
|
||||
"CONST_MIN_TEMP": -25,
|
||||
"MAXIMUM_CODE_ADC": 3796,
|
||||
"MINIMUM_CODE_AD": 2660,
|
||||
"TEMPERATURE_UKP_1": 47,
|
||||
"TEMPERATURE_UKP_2": 79
|
||||
},
|
||||
"ems_input_bits_config": {
|
||||
"PRD_N": {"bit1": 9, "bit2": 10},
|
||||
"PRD_V": {"bit1": 11, "bit2": 12},
|
||||
"PRD_K": {"bit1": 13, "bit2": 14, "bit_lit": 8}
|
||||
},
|
||||
"fs_rules":[
|
||||
{"key": "fs_1", "min": 0, "max": 4},
|
||||
{"key": "fs_2", "min": 4, "max": 8},
|
||||
{"key": "fs_3", "min": 8, "max": 12},
|
||||
{"key": "fs_4", "min": 12, "max": 16},
|
||||
{"key": "fs_5", "min": 16, "max": 20},
|
||||
{"key": "fs_6", "min": 20, "max": 24},
|
||||
{"key": "fs_7", "min": 24, "max": 27}
|
||||
]
|
||||
}
|
||||
BIN
data/АФСП-РТР.png
Normal file
|
After Width: | Height: | Size: 150 KiB |
34
data/АФСП-РТР.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://vdhmga62vjsj"
|
||||
path="res://.godot/imported/АФСП-РТР.png-0b840f65d8791cdd41736204e8128ac9.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/АФСП-РТР.png"
|
||||
dest_files=["res://.godot/imported/АФСП-РТР.png-0b840f65d8791cdd41736204e8128ac9.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
|
||||
BIN
data/Структура1.wmf.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
34
data/Структура1.wmf.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bj6gixv60xcrq"
|
||||
path="res://.godot/imported/Структура1.wmf.png-3f3bea77b2575bb24d8ebb8779214cf5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Структура1.wmf.png"
|
||||
dest_files=["res://.godot/imported/Структура1.wmf.png-3f3bea77b2575bb24d8ebb8779214cf5.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
|
||||
BIN
data/У-РЭП-РПД-В.png
Normal file
|
After Width: | Height: | Size: 254 KiB |
34
data/У-РЭП-РПД-В.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b2vf7en1jj8dv"
|
||||
path="res://.godot/imported/У-РЭП-РПД-В.png-16e53650006353b1f4857905926a9d2e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/У-РЭП-РПД-В.png"
|
||||
dest_files=["res://.godot/imported/У-РЭП-РПД-В.png-16e53650006353b1f4857905926a9d2e.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
|
||||
BIN
data/У-РЭП-РПД-К.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
34
data/У-РЭП-РПД-К.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dm350ta8noa0v"
|
||||
path="res://.godot/imported/У-РЭП-РПД-К.png-382bf7e19c5207a25529ff47820a3140.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/У-РЭП-РПД-К.png"
|
||||
dest_files=["res://.godot/imported/У-РЭП-РПД-К.png-382bf7e19c5207a25529ff47820a3140.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
|
||||
BIN
data/У-РЭП-РПД-Н.png
Normal file
|
After Width: | Height: | Size: 150 KiB |
34
data/У-РЭП-РПД-Н.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bktiige0i2lhl"
|
||||
path="res://.godot/imported/У-РЭП-РПД-Н.png-1812f48d3e2d228cc07e3a1f352eee1f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/У-РЭП-РПД-Н.png"
|
||||
dest_files=["res://.godot/imported/У-РЭП-РПД-Н.png-1812f48d3e2d228cc07e3a1f352eee1f.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
|
||||
BIN
data/У-УФ.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
34
data/У-УФ.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://u7h3l0jjrsnp"
|
||||
path="res://.godot/imported/У-УФ.png-e70ef42c717c17d1d5bd404916252ea3.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/У-УФ.png"
|
||||
dest_files=["res://.godot/imported/У-УФ.png-e70ef42c717c17d1d5bd404916252ea3.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
|
||||
BIN
data/У-ЭП.png
Normal file
|
After Width: | Height: | Size: 319 KiB |
34
data/У-ЭП.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c3cyog3gy24ft"
|
||||
path="res://.godot/imported/У-ЭП.png-5de01103a8e9a06ea0e900facdc90d4d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/У-ЭП.png"
|
||||
dest_files=["res://.godot/imported/У-ЭП.png-5de01103a8e9a06ea0e900facdc90d4d.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
|
||||
BIN
data/УА-РЭП.png
Normal file
|
After Width: | Height: | Size: 557 KiB |
34
data/УА-РЭП.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cllxcfa130vqu"
|
||||
path="res://.godot/imported/УА-РЭП.png-2578a93f5ba5f7909945125656980bd6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/УА-РЭП.png"
|
||||
dest_files=["res://.godot/imported/УА-РЭП.png-2578a93f5ba5f7909945125656980bd6.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
|
||||
@@ -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.92379, 0.0965192, 0.249261, 1)
|
||||
interfer/interfer_color=Color(0.9, 0.1, 0.25, 0.9)
|
||||
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.92549, 0.0980392, 0.25098, 0.509804)
|
||||
interfer/emit_color=Color(0.9, 0.1, 0.25, 0.5)
|
||||
interfer/closed_sectors=Color(0, 0, 0, 1)
|
||||
|
||||
[autoload]
|
||||
|
||||
@@ -35,8 +35,10 @@ 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]
|
||||
|
||||
@@ -65,7 +65,7 @@ layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 15.0
|
||||
text = "СПРС"
|
||||
text = "JTIDS"
|
||||
metadata/rfi_name = "sprs"
|
||||
|
||||
[node name="btn_kupd" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
||||
|
||||
@@ -122,7 +122,8 @@ func on_interfer_new(ecm, table_index):
|
||||
# Будем надеяться, что отложенные вызовы производятся в том же порядке
|
||||
$table.call_deferred('clear_rows_selected')
|
||||
$table.call_deferred('set_row_selected', i_row, true)
|
||||
signaller.emit_signal('interfer_selected', ecm)
|
||||
if not interfer.auto_enabled:
|
||||
signaller.emit_signal('interfer_selected', ecm)
|
||||
|
||||
|
||||
func on_interfer_off(ecm, table_index):
|
||||
|
||||
@@ -75,7 +75,7 @@ func on_threat_update(th, table_index: Dictionary):
|
||||
elif th.emit_state == 2:
|
||||
emit_txr.visible = true
|
||||
emit_txr.self_modulate = Color.RED
|
||||
|
||||
|
||||
|
||||
|
||||
## Обрабатывает сигнал [b]threat_lost[/b].
|
||||
|
||||
@@ -147,6 +147,6 @@ layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "ЕПРЛС"
|
||||
text = "ЕРЛС"
|
||||
disabled = true
|
||||
metadata/rfi_name = "eprls"
|
||||
|
||||
@@ -30,7 +30,9 @@ autostart = true
|
||||
|
||||
[node name="bort" parent="." instance=ExtResource("3_d7iti")]
|
||||
layout_mode = 0
|
||||
offset_left = 24.0
|
||||
offset_top = 27.7778
|
||||
offset_right = 604.0
|
||||
offset_bottom = 1216.78
|
||||
metadata/DeviceName = &"Устройство РР левого борта"
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
[node name="pribor_afsp" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_left = 81.0
|
||||
offset_left = 82.0
|
||||
offset_top = 108.0
|
||||
offset_right = 81.0
|
||||
offset_right = 82.0
|
||||
offset_bottom = 108.0
|
||||
scale = Vector2(1, 0.9)
|
||||
script = ExtResource("1_tfses")
|
||||
@@ -30,9 +30,9 @@ autostart = true
|
||||
|
||||
[node name="bort" parent="." instance=ExtResource("3_xpxb5")]
|
||||
layout_mode = 0
|
||||
offset_left = -11.0
|
||||
offset_left = 12.0
|
||||
offset_top = -59.0
|
||||
offset_right = 569.0
|
||||
offset_right = 592.0
|
||||
offset_bottom = 1130.0
|
||||
metadata/DeviceName = &"Устройство РР правого борта"
|
||||
|
||||
|
||||
@@ -99,4 +99,4 @@ func _on_request_completed(result, _response_code, headers, body: PackedByteArra
|
||||
func _on_item_pressed(block_a: Control):
|
||||
var metas = block_a.get_meta_list()
|
||||
for n in metas:
|
||||
var v = block_a.get_meta(n)
|
||||
var _v = block_a.get_meta(n)
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_left = 115.0
|
||||
offset_top = 150.0
|
||||
offset_top = 148.0
|
||||
offset_right = 115.0
|
||||
offset_bottom = 150.0
|
||||
offset_bottom = 148.0
|
||||
script = ExtResource("1_bhc4e")
|
||||
prefix_path = "DeviceDescription[DeviceName]"
|
||||
this_bpo1_name = "Устройство БПО левого борта"
|
||||
@@ -24,10 +24,10 @@ settings_path_to_wait_time = "Период опроса состояния БП
|
||||
|
||||
[node name="mod_pit_g1" parent="." instance=ExtResource("2_jp6m0")]
|
||||
layout_mode = 2
|
||||
offset_left = 40.0
|
||||
offset_top = 535.0
|
||||
offset_right = 560.0
|
||||
offset_bottom = 605.0
|
||||
offset_left = 9.0
|
||||
offset_top = 377.0
|
||||
offset_right = 529.0
|
||||
offset_bottom = 447.0
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 7
|
||||
fname = "Модуль электропитания"
|
||||
@@ -35,20 +35,20 @@ rname = "G1"
|
||||
|
||||
[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
|
||||
offset_left = 9.0
|
||||
offset_top = -23.0
|
||||
offset_right = 529.0
|
||||
offset_bottom = 172.0
|
||||
show_state = false
|
||||
fname = "Блок БПО левого борта"
|
||||
rname = "А1"
|
||||
|
||||
[node name="grid_bpo_a1" type="GridContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 50.0
|
||||
offset_top = 175.0
|
||||
offset_right = 498.0
|
||||
offset_bottom = 320.0
|
||||
offset_left = 19.0
|
||||
offset_top = 17.0
|
||||
offset_right = 467.0
|
||||
offset_bottom = 162.0
|
||||
columns = 4
|
||||
|
||||
[node name="kanal1" parent="grid_bpo_a1" groups=["потребитель-питания"] instance=ExtResource("2_jp6m0")]
|
||||
@@ -108,30 +108,30 @@ fname = "Канал 8"
|
||||
metadata/state = "SelfTest[0].SystemList[0].DevList[7]['TestPassed']"
|
||||
|
||||
[node name="yas_bpo_a1" parent="." groups=["потребитель-питания"] instance=ExtResource("3_jcpjs")]
|
||||
offset_left = 500.0
|
||||
offset_top = 175.0
|
||||
offset_right = 550.0
|
||||
offset_bottom = 320.0
|
||||
offset_left = 469.0
|
||||
offset_top = 17.0
|
||||
offset_right = 519.0
|
||||
offset_bottom = 162.0
|
||||
show_rname = false
|
||||
self_size = Vector2i(50, 145)
|
||||
fname = "Яч. связи"
|
||||
|
||||
[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
|
||||
offset_left = 9.0
|
||||
offset_top = 177.0
|
||||
offset_right = 529.0
|
||||
offset_bottom = 372.0
|
||||
show_state = false
|
||||
fname = "Блок БПО правого борта"
|
||||
rname = "А2"
|
||||
|
||||
[node name="grid_bpo_a2" type="GridContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 50.0
|
||||
offset_top = 375.0
|
||||
offset_right = 498.0
|
||||
offset_bottom = 520.0
|
||||
offset_left = 19.0
|
||||
offset_top = 217.0
|
||||
offset_right = 467.0
|
||||
offset_bottom = 362.0
|
||||
columns = 4
|
||||
|
||||
[node name="kanal1" parent="grid_bpo_a2" groups=["потребитель-питания", "управляется-по-шине-2"] instance=ExtResource("2_jp6m0")]
|
||||
@@ -191,10 +191,10 @@ fname = "Канал 8"
|
||||
metadata/state = "SelfTest[0].SystemList[0].DevList[7]['TestPassed']"
|
||||
|
||||
[node name="yas_bpo_a2" parent="." groups=["потребитель-питания"] instance=ExtResource("3_jcpjs")]
|
||||
offset_left = 500.0
|
||||
offset_top = 375.0
|
||||
offset_right = 550.0
|
||||
offset_bottom = 520.0
|
||||
offset_left = 469.0
|
||||
offset_top = 217.0
|
||||
offset_right = 519.0
|
||||
offset_bottom = 362.0
|
||||
show_rname = false
|
||||
self_size = Vector2i(50, 145)
|
||||
fname = "Яч. связи"
|
||||
|
||||
@@ -49,7 +49,7 @@ offset_top = 33.0
|
||||
offset_right = 155.0
|
||||
offset_bottom = 183.0
|
||||
fname = "Блок ФС-2"
|
||||
rname = "A2"
|
||||
rname = "A6"
|
||||
|
||||
[node name="ref_A6" parent="." groups=["default_reset", "fs_group"] instance=ExtResource("3_kqnvt")]
|
||||
offset_left = 155.0
|
||||
@@ -57,7 +57,7 @@ offset_top = 33.0
|
||||
offset_right = 205.0
|
||||
offset_bottom = 183.0
|
||||
fname = "Модуль ФС"
|
||||
rname = "A5"
|
||||
rname = "A3"
|
||||
metadata/fs = "fs_6"
|
||||
|
||||
[node name="ref_A5" parent="." groups=["default_reset", "fs_group"] instance=ExtResource("3_kqnvt")]
|
||||
@@ -66,7 +66,7 @@ offset_top = 33.0
|
||||
offset_right = 255.0
|
||||
offset_bottom = 183.0
|
||||
fname = "Модуль ФС"
|
||||
rname = "A3"
|
||||
rname = "A2"
|
||||
metadata/fs = "fs_7"
|
||||
|
||||
[node name="ref_A7" parent="." groups=["default_reset"] instance=ExtResource("3_kqnvt")]
|
||||
@@ -75,4 +75,4 @@ offset_top = 33.0
|
||||
offset_right = 305.0
|
||||
offset_bottom = 183.0
|
||||
fname = "Блок ФС-6"
|
||||
rname = "A6"
|
||||
rname = "A5"
|
||||
|
||||
@@ -1,252 +1,194 @@
|
||||
@tool
|
||||
extends 'res://scenes/контроль/прибор.gd'
|
||||
|
||||
const constants_k: Dictionary = {
|
||||
'POWER_UKP_1': 31,
|
||||
'POWER_UKP_2': 63,
|
||||
'DKM_BIT_1': 0,
|
||||
'DKM_BIT_6': 5,
|
||||
'DKM_BIT_7': 6,
|
||||
'BASE_ADDR_EMS_G': 0x120,
|
||||
'ADDR_UG_LITERA_1': 0x106,
|
||||
'ADDR_UG_LITERA_2': 0x108,
|
||||
'ADDR_UG_LITERA_3': 0x10A,
|
||||
'TEMP_THRESHOLD': 40,
|
||||
'POWER_THRESHOLD': 40,
|
||||
'RAY_DOU_NUM': 0x3,
|
||||
'ATT_UM_1': 0x0,
|
||||
'ATT_UM_6': 0x3,
|
||||
'ATT_UM_7': 0x2,
|
||||
'POWER_UM': 100,
|
||||
'TIMER_DELAY': 10.0,
|
||||
'STATE_MASHINE_TIMER': 0.3,
|
||||
}
|
||||
# Конфигурация параметров для каждого прибора
|
||||
const PRIBOR_CONFIG := {
|
||||
'1к': {'angle': 0.0, 'sectors': [0, 20, 24]},
|
||||
'2к': {'angle': 90.0, 'sectors': [3, 23, 27]},
|
||||
'3к': {'angle': 180.0, 'sectors': [2, 22, 26]},
|
||||
'4к': {'angle': 270.0, 'sectors': [1, 21, 25]},
|
||||
}
|
||||
# Конфигурация частот и ширин для каждого ФС
|
||||
const FS_PARAMS := {
|
||||
1: {'freq': 450.0, 'width': 80.0},
|
||||
6: {'freq': 2450.0, 'width': 110.0},
|
||||
7: {'freq': 4750.0, 'width': 110.0}
|
||||
}
|
||||
enum STATE_VAL { NONE = 0, GOOD = 1, ERROR = 2 }
|
||||
|
||||
var block_ip_config_k := {
|
||||
'maa2000_1': [0, false],
|
||||
'maa2000_2': [1, false],
|
||||
'ip9_50_1': [2, false],
|
||||
'ip9_50_2': [3, false],
|
||||
'ip12_50_1': [4, false],
|
||||
'ip9_50_3': [5, false],
|
||||
'ip12_50_2': [6, false],
|
||||
'ip5_25': [7, false],
|
||||
}
|
||||
var block_kasseta_y5_prd_config_k: = {
|
||||
'yau07': false,
|
||||
'ems': false,
|
||||
'ug': false,
|
||||
'ukp1': false,
|
||||
'ukp2': false,
|
||||
}
|
||||
# Основные переменные
|
||||
var start_litera: int = 1
|
||||
var ug_work_1: int = 3 ## Аттенюация усилителей мощности
|
||||
var ug_work_2: int = 2 ## Аттенюация усилителей мощности
|
||||
var ug_work_3: int = 0 ## Аттенюация усилителей мощности
|
||||
var mashine_timer: Timer = Timer.new()
|
||||
var prd_k_module: Object
|
||||
var unit_prd_k: Object
|
||||
var control_prd_k: Object
|
||||
# Результаты контроля
|
||||
var control_results_k: Dictionary = {
|
||||
'block_ip': false, # Проверка касет П1 и ИП МА2000
|
||||
'temperature': true,
|
||||
'dkm_1': false,
|
||||
'dkm_6': false,
|
||||
'dkm_7': false,
|
||||
'dou_6': false,
|
||||
'dou_7': false,
|
||||
'fs_1': 2,
|
||||
'fs_6': 2,
|
||||
'fs_7': 2,
|
||||
}
|
||||
|
||||
var test_control_k = preload('res://scripts/pribor-prd.gd')
|
||||
var ctrl_pos = 30
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
|
||||
initialize_connections()
|
||||
setup_timer()
|
||||
set_default_state()
|
||||
find_labels(self)
|
||||
|
||||
|
||||
func on_state_mashine() -> void:
|
||||
control_prd_k.state_control_machine()
|
||||
|
||||
|
||||
func initialize_connections() -> void:
|
||||
var unit_name = get_meta('unit_name')[0]
|
||||
prd_k_module = prd.prd_dict[unit_name]
|
||||
unit_prd_k = prd_k_module.unit_yau07
|
||||
|
||||
unit_prd_k.connect('line_changed', Callable(self, 'on_line_changed'))
|
||||
var power_amplifiers: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
var init_data: Dictionary = {
|
||||
'control_label': $control_result,
|
||||
'power_amplifiers': power_amplifiers,
|
||||
'unit_prd': unit_prd_k,
|
||||
'module_prd' : prd_k_module,
|
||||
'constants': constants_k,
|
||||
'prd_config': PRIBOR_CONFIG,
|
||||
'fs_params': FS_PARAMS,
|
||||
'block_ip_prd_config': block_ip_config_k,
|
||||
'block_kasseta_y5_prd_config': block_kasseta_y5_prd_config_k,
|
||||
'control_results': control_results_k,
|
||||
'current_litera': start_litera,
|
||||
}
|
||||
control_prd_k = test_control_k.TestPRD.new(init_data)
|
||||
add_child(control_prd_k)
|
||||
control_prd_k.connect('control_is_over', Callable(self, 'on_control_result'))
|
||||
var prd_k_module = prd.prd_dict[unit_name]
|
||||
unit_prd_k = prd_k_module.unit_control
|
||||
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
for temp in power_amplifier:
|
||||
temp.value1 = -70
|
||||
# Подписываемся на сигналы
|
||||
signaller.conn(signaller.start_contol_device, Callable(self, '_on_start_control'))
|
||||
unit_prd_k.connect('control_is_over', Callable(self, 'on_press_device'))
|
||||
unit_prd_k.connect('status_updated', Callable(self, '_on_status_updated'))
|
||||
# Устанавливаем начальный статус
|
||||
_update_status_text(unit_prd_k.get_current_status())
|
||||
on_press_device(unit_prd_k.self_name)
|
||||
|
||||
|
||||
func setup_timer() -> void:
|
||||
add_child(mashine_timer)
|
||||
mashine_timer.connect('timeout', Callable(self, 'on_state_mashine'))
|
||||
mashine_timer.wait_time = constants_k.STATE_MASHINE_TIMER
|
||||
mashine_timer.start()
|
||||
func _process(_delta: float) -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
set_frame($input_0, unit_prd_k.ems_g_sock_dic.ems_input_1)
|
||||
set_frame($input_1, unit_prd_k.ems_g_sock_dic.ems_input_2)
|
||||
set_frame($input_2, unit_prd_k.ems_g_sock_dic.ems_input_lit_1)
|
||||
set_frame($output_0, unit_prd_k.ems_g_sock_dic.ems_output_1)
|
||||
set_frame($output_1, unit_prd_k.ems_g_sock_dic.ems_output_2)
|
||||
set_frame($output_2, unit_prd_k.ems_g_sock_dic.ems_output_lit_1)
|
||||
|
||||
|
||||
func set_default_state() -> void:
|
||||
for group in get_tree().get_nodes_in_group('default_reset'):
|
||||
group.state = STATE_VAL.NONE
|
||||
func set_frame(node_frame: Node, val: int): node_frame.set_frame(val)
|
||||
|
||||
for group in get_tree().get_nodes_in_group('power_amplifier'):
|
||||
|
||||
func _on_start_control() -> void:
|
||||
set_default_state(get_tree().get_nodes_in_group('default_reset'))
|
||||
set_default_state(get_tree().get_nodes_in_group('power_amplifier'))
|
||||
find_labels(self)
|
||||
await get_tree().create_timer(1.0).timeout
|
||||
on_press_device(unit_prd_k.self_name)
|
||||
|
||||
|
||||
static func set_default_state(default_reset_array_node: Array) -> void:
|
||||
for group in default_reset_array_node:
|
||||
group.state = STATE_VAL.NONE
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
$control_result.text = 'Выполняется ...'
|
||||
$control_result.add_theme_color_override('font_color', Color.ALICE_BLUE)
|
||||
signaller.connect('режим_работа', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_журнал', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_эмс', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_настройки', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_контроль', Callable(self, 'on_mode_changed').bind(true))
|
||||
if unit_prd_k:
|
||||
_update_status_text(unit_prd_k.get_current_status())
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
prd_k_module.cmd_array.append([unit_prd_k.CmdCode.WRITE_ISA, [constants_k.ADDR_UG_LITERA_1, ug_work_1, constants_k.ADDR_UG_LITERA_2, ug_work_2, constants_k.ADDR_UG_LITERA_3, ug_work_3]])
|
||||
#prd_k_module.cmd_array.append([unit_prd_k.CmdCode.WRITE_ISA, [constants_k.ADDR_UG_LITERA_1, ug_work_1, constants_k.ADDR_UG_LITERA_2, ug_work_2, constants_k.ADDR_UG_LITERA_3, ug_work_3]])
|
||||
|
||||
|
||||
func on_line_changed(unit_pribor: Object) -> void:
|
||||
if not unit_pribor.online:
|
||||
set_default_state()
|
||||
static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dictionary)->void:
|
||||
for i_node_temperature in temperature_arr_node:
|
||||
var temperature_meta: String = i_node_temperature.get_meta('um')
|
||||
if not temperature_dic.has(temperature_meta): return
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta] if temperature_dic[temperature_meta] < 361 else -40
|
||||
|
||||
|
||||
func on_mode_changed(in_tree: bool) -> void:
|
||||
if not in_tree:
|
||||
mashine_timer.stop()
|
||||
prd_k_module.cmd_array.append([unit_prd_k.CmdCode.WRITE_ISA, [constants_k.ADDR_UG_LITERA_1, ug_work_1, constants_k.ADDR_UG_LITERA_2, ug_work_2, constants_k.ADDR_UG_LITERA_3, ug_work_3]])
|
||||
signaller.emit_signal('interfer_off_all')
|
||||
else:
|
||||
set_default_state()
|
||||
control_prd_k.state = control_prd_k.STATE_MASHINE.INIT
|
||||
mashine_timer.start()
|
||||
|
||||
|
||||
func power_fill(pow_dic: Dictionary, fs_result: Dictionary) -> void:
|
||||
#if not control_prd_k.block_kasseta_y5_config.yau07 or not control_prd_k.block_kasseta_y5_config.ukp1 or not control_prd_k.block_kasseta_y5_config.ukp2:
|
||||
#return
|
||||
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
for i_powapm in power_amplifier:
|
||||
var powamp_meta: String = i_powapm.get_meta('um')
|
||||
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void:
|
||||
for i_node_temperature in power_amplifier_arr_node:
|
||||
var powamp_meta: String = i_node_temperature.get_meta('um')
|
||||
var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE
|
||||
if pow_dic:
|
||||
if not pow_dic.has(powamp_meta):
|
||||
break
|
||||
if pow_dic[powamp_meta].size() < 6:
|
||||
status = STATE_VAL.ERROR
|
||||
if not pow_dic.has(powamp_meta): continue
|
||||
# Проверки fs_result
|
||||
if powamp_meta == 'um_8' and not fs_result.fs_1: continue
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_6: continue
|
||||
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_7: continue
|
||||
if powamp_meta == 'um_8':
|
||||
var power_value = pow_dic[powamp_meta][5]
|
||||
i_node_temperature.value0 = [power_value]
|
||||
# Проверка для um_8: если значение < 1 → STATE_VAL.NONE
|
||||
if power_value < 1:
|
||||
status = STATE_VAL.NONE
|
||||
else:
|
||||
if powamp_meta == 'um_7' and not fs_result.fs_1: return
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_6: return
|
||||
if powamp_meta in ['um_8', 'um_9', 'um_10', 'um_11', 'um_12', 'um_13'] and not fs_result.fs_7: return
|
||||
i_powapm.value0 = pow_dic[powamp_meta]
|
||||
for i_p in pow_dic[powamp_meta]:
|
||||
if i_p < constants_k.POWER_THRESHOLD:
|
||||
status = STATE_VAL.ERROR
|
||||
i_powapm.state = status
|
||||
status = STATE_VAL.ERROR if power_value < POWER_THRESHOLD else STATE_VAL.GOOD
|
||||
else:
|
||||
var power_array: Array = pow_dic[powamp_meta]
|
||||
i_node_temperature.value0 = power_array
|
||||
# Проверка: если ВСЕ значения в массиве < 1 → STATE_VAL.NONE
|
||||
var all_below_one: bool = true
|
||||
for i_p in power_array:
|
||||
if i_p >= 1:
|
||||
all_below_one = false
|
||||
break
|
||||
|
||||
if all_below_one:
|
||||
status = STATE_VAL.NONE
|
||||
else:
|
||||
var count_above_threshold = 0
|
||||
for i_p in power_array:
|
||||
if i_p >= POWER_THRESHOLD:
|
||||
count_above_threshold += 1
|
||||
status = STATE_VAL.GOOD if count_above_threshold >= 3 else STATE_VAL.ERROR
|
||||
i_node_temperature.state = status
|
||||
|
||||
|
||||
func on_control_result(result_dic: Dictionary, power_dic: Dictionary) -> void:
|
||||
mashine_timer.stop()
|
||||
block_kasseta_y5_prd_config_k = control_prd_k.block_kasseta_y5_config
|
||||
func on_press_device(_name_davice: String) -> void:
|
||||
var nodes_y5: Array = get_tree().get_nodes_in_group('y-5')
|
||||
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
|
||||
var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
|
||||
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
var default_reset_array_node: Array = get_tree().get_nodes_in_group('default_reset')
|
||||
var module_fs_1: Node = $kasseta_fs_kd/ref_A2
|
||||
var module_fs_6: Node = $kasseta_fs_kd/ref_A4
|
||||
var dou_6: Node = $dou6_A7
|
||||
var module_fs_7: Node = $kasseta_fs_kd/ref_A7
|
||||
var dou_7: Node = $dou7_A8
|
||||
var control_data: Dictionary = unit_prd_k.get_control_results()
|
||||
var for_control_result: Dictionary = {
|
||||
'nodes_y5': nodes_y5,
|
||||
'node_ip_power_arr': node_ip_power_arr,
|
||||
'fs_nodes': fs_nodes,
|
||||
'power_amplifier': power_amplifier,
|
||||
'default_reset_array_node': default_reset_array_node,
|
||||
'module_fs_1': module_fs_1,
|
||||
'module_fs_6': module_fs_6,
|
||||
'dou_6': dou_6,
|
||||
'module_fs_7': module_fs_7,
|
||||
'dou_7': dou_7,
|
||||
}
|
||||
for_control_result.merge(control_data, true)
|
||||
on_control_result(for_control_result)
|
||||
|
||||
|
||||
static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
temperature_fill(for_result_dic.power_amplifier, for_result_dic.temperature_um)
|
||||
var all_y5_good: bool = true
|
||||
var block_kasseta_y5_prd_config_k: Dictionary = for_result_dic.block_kasseta_y5_config
|
||||
var nodes_y5: Array = for_result_dic.nodes_y5
|
||||
for node_y5 in nodes_y5:
|
||||
var meta_y5 = node_y5.get_meta('y5')
|
||||
if block_kasseta_y5_prd_config_k.has(meta_y5):
|
||||
if block_kasseta_y5_prd_config_k['yau07'] == false:
|
||||
if not block_kasseta_y5_prd_config_k['yau07']:
|
||||
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
|
||||
break
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_k[meta_y5] else STATE_VAL.ERROR
|
||||
|
||||
block_ip_config_k = control_prd_k.block_ip_config
|
||||
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
|
||||
for power_supply in node_ip_power_arr:
|
||||
else:
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_k[meta_y5] else STATE_VAL.ERROR
|
||||
# Проверяем состояние после установки
|
||||
if node_y5.state == STATE_VAL.ERROR:
|
||||
all_y5_good = false
|
||||
var block_ip_config_k: Dictionary = for_result_dic.block_ip_config
|
||||
for power_supply in for_result_dic.node_ip_power_arr:
|
||||
var meta_ip = power_supply.get_meta('ip')
|
||||
if block_ip_config_k.has(meta_ip) and block_kasseta_y5_prd_config_k.ug:
|
||||
if block_ip_config_k.has(meta_ip) and block_kasseta_y5_prd_config_k.ug and block_kasseta_y5_prd_config_k.yau07:
|
||||
power_supply.state = STATE_VAL.GOOD if block_ip_config_k[meta_ip][1] else STATE_VAL.ERROR
|
||||
else:
|
||||
power_supply.state = STATE_VAL.NONE
|
||||
# Проверяем состояние после установки
|
||||
if power_supply.state == STATE_VAL.ERROR:
|
||||
all_y5_good = false
|
||||
|
||||
var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
|
||||
for f in fs_nodes:
|
||||
if not for_result_dic.control_is_over:
|
||||
set_default_state(for_result_dic.default_reset_array_node)
|
||||
set_default_state(for_result_dic.power_amplifier)
|
||||
return
|
||||
var result_dic: Dictionary = for_result_dic.result_dic
|
||||
for f in for_result_dic.fs_nodes:
|
||||
var fs_meta: String = f.get_meta('fs')
|
||||
if result_dic.has(fs_meta):
|
||||
var new_state = result_dic[fs_meta]
|
||||
f.state = new_state
|
||||
result_dic[fs_meta] = new_state
|
||||
f.state = result_dic[fs_meta]
|
||||
|
||||
if result_dic.fs_1 == 1:
|
||||
$kasseta_fs_kd/ref_A2.state = STATE_VAL.GOOD if result_dic.dkm_1 else STATE_VAL.ERROR
|
||||
else:
|
||||
result_dic.fs_1 = false
|
||||
if result_dic.fs_6 == 1:
|
||||
$kasseta_fs_kd/ref_A4.state = STATE_VAL.GOOD if result_dic.dkm_6 else STATE_VAL.ERROR
|
||||
$dou6_A7.state = STATE_VAL.GOOD if result_dic.dou_6 else STATE_VAL.ERROR
|
||||
else:
|
||||
result_dic.fs_6 = false
|
||||
if result_dic.fs_7 == 1:
|
||||
$kasseta_fs_kd/ref_A7.state = STATE_VAL.GOOD if result_dic.dkm_7 else STATE_VAL.ERROR
|
||||
$dou7_A8.state = STATE_VAL.GOOD if result_dic.dou_7 else STATE_VAL.ERROR
|
||||
else:
|
||||
result_dic.fs_7 = false
|
||||
if not all_y5_good: return
|
||||
if result_dic.fs_1 == 1 and block_kasseta_y5_prd_config_k['yau07']:
|
||||
for_result_dic.module_fs_1.state = STATE_VAL.GOOD if result_dic.dkm_1 else STATE_VAL.ERROR
|
||||
|
||||
power_fill(power_dic, result_dic)
|
||||
if result_dic.fs_6 == 1 and block_kasseta_y5_prd_config_k['yau07']:
|
||||
for_result_dic.module_fs_6.state = STATE_VAL.GOOD if result_dic.dkm_6 else STATE_VAL.ERROR
|
||||
for_result_dic.dou_6.state = STATE_VAL.GOOD if result_dic.dou_6 else STATE_VAL.ERROR
|
||||
|
||||
var result = true
|
||||
for device in result_dic.values():
|
||||
if not device:
|
||||
result = false
|
||||
if result_dic.fs_7 == 1 and block_kasseta_y5_prd_config_k['yau07']:
|
||||
for_result_dic.module_fs_7.state = STATE_VAL.GOOD if result_dic.dkm_7 else STATE_VAL.ERROR
|
||||
for_result_dic.dou_7.state = STATE_VAL.GOOD if result_dic.dou_7 else STATE_VAL.ERROR
|
||||
|
||||
var name_prd = control_prd_k.self_name
|
||||
if result:
|
||||
$control_result.text = 'Прибор ПРД-%s исправен' % name_prd
|
||||
$control_result.add_theme_color_override('font_color', Color.GREEN)
|
||||
else:
|
||||
$control_result.text = 'Прибор ПРД-%s неисправен' % name_prd
|
||||
$control_result.add_theme_color_override('font_color', Color.RED)
|
||||
if block_kasseta_y5_prd_config_k['yau07']:
|
||||
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD)
|
||||
|
||||
|
||||
func find_labels(node1: Node):
|
||||
@@ -263,3 +205,22 @@ func find_labels(node1: Node):
|
||||
node1.set_meta("tooltip_set", true)
|
||||
for child in node1.get_children():
|
||||
find_labels(child)
|
||||
|
||||
|
||||
func _on_status_updated(status_text: String) -> void:
|
||||
_update_status_text(status_text)
|
||||
|
||||
|
||||
func _update_status_text(text: String) -> void:
|
||||
$control_result.text = text
|
||||
# Можно добавить смену цвета в зависимости от статуса
|
||||
if "Ошибка" in text or "неисправен" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.RED)
|
||||
log.message(Logger.INFO, 'Прибор ПРД-%s неисправен' % [unit_prd_k.self_name])
|
||||
elif "Ограничена" in text or "Предупреждение" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.YELLOW)
|
||||
elif "исправен" in text or "завершён" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.GREEN)
|
||||
log.message(Logger.INFO, 'Прибор ПРД-%s исправен' % [unit_prd_k.self_name])
|
||||
else:
|
||||
$control_result.add_theme_color_override('font_color', Color.WHITE)
|
||||
|
||||
@@ -1,14 +1,39 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://m5s87q7m66lj"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://m5s87q7m66lj"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="1_8dmgr"]
|
||||
[ext_resource type="Script" uid="uid://cwvikiygf8b1m" path="res://scenes/pribor-prd-k/pribor-prd-k.gd" id="1_tpdyp"]
|
||||
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="2_14h25"]
|
||||
[ext_resource type="PackedScene" uid="uid://cm5jd4gjrrpba" path="res://scenes/контроль/кассета-у-5-к.tscn" id="2_tb85r"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcyxqni7gxvtq" path="res://scenes/контроль/блок-в.tscn" id="5_c7lv8"]
|
||||
[ext_resource type="PackedScene" uid="uid://ffi1njkjceb5" path="res://scenes/контроль/блок-к.tscn" id="6_wd1vi"]
|
||||
[ext_resource type="PackedScene" uid="uid://bmagw8nd0ulhj" path="res://scenes/pribor-prd-k/kasseta-fs-kd.tscn" id="7_ia27q"]
|
||||
[ext_resource type="Script" uid="uid://crpedygm3gohi" path="res://scenes/контроль/кассета.gd" id="7_xpa2n"]
|
||||
[ext_resource type="PackedScene" uid="uid://dq31j24gv5vi4" path="res://scenes/контроль/кассета-п-2.tscn" id="8_6fdp7"]
|
||||
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="8_la5yt"]
|
||||
[ext_resource type="Texture2D" uid="uid://belwchvdktrw0" path="res://data/эмс-бланк.png" id="10_c7lv8"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwddxs24es81u" path="res://data/эмс-бланк-пост.png" id="11_wd1vi"]
|
||||
[ext_resource type="Texture2D" uid="uid://pfoscstbm025" path="res://data/эмс-бланк-перем.png" id="12_bjebg"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvl3sq036gn75" path="res://data/эмс-бланк-замыкание.png" id="13_kc77u"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_di0aa"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("10_c7lv8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("11_wd1vi")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("12_bjebg")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("13_kc77u")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="pribor_prd_k" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -21,55 +46,55 @@ script = ExtResource("1_tpdyp")
|
||||
|
||||
[node name="kasseta_u5" parent="." instance=ExtResource("2_tb85r")]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 242.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 432.0
|
||||
offset_left = 214.0
|
||||
offset_top = 96.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 286.0
|
||||
|
||||
[node name="maa2000_A22" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("1_8dmgr")]
|
||||
[node name="maa2000_A22" parent="." groups=["power_supply"] instance=ExtResource("1_8dmgr")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 907.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 949.0
|
||||
offset_left = 524.0
|
||||
offset_top = 761.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 803.0
|
||||
fname = "MAA2000"
|
||||
rname = "A28"
|
||||
metadata/ip = "maa2000_1"
|
||||
|
||||
[node name="dou6_A7" parent="." groups=["default_reset"] instance=ExtResource("1_8dmgr")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 862.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 907.0
|
||||
offset_left = 47.0
|
||||
offset_top = 716.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 761.0
|
||||
fname = "ДОУ-6"
|
||||
rname = "A7"
|
||||
|
||||
[node name="maa2000_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("1_8dmgr")]
|
||||
[node name="maa2000_A23" parent="." groups=["power_supply"] instance=ExtResource("1_8dmgr")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 907.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 949.0
|
||||
offset_left = 47.0
|
||||
offset_top = 761.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 803.0
|
||||
fname = "MAA2000"
|
||||
rname = "A27"
|
||||
metadata/ip = "maa2000_2"
|
||||
|
||||
[node name="dou7_A8" parent="." groups=["default_reset"] instance=ExtResource("1_8dmgr")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 812.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 860.0
|
||||
offset_left = 47.0
|
||||
offset_top = 666.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 714.0
|
||||
fname = "ДОУ-7"
|
||||
rname = "A8"
|
||||
|
||||
[node name="ref_ZZ3" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 812.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 949.0
|
||||
offset_left = 214.0
|
||||
offset_top = 666.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 803.0
|
||||
texture = ExtResource("2_14h25")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
@@ -90,175 +115,175 @@ vertical_alignment = 1
|
||||
|
||||
[node name="um1535_A10" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 242.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 337.0
|
||||
offset_left = 524.0
|
||||
offset_top = 96.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 191.0
|
||||
value0 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
|
||||
fname = "УМ1535Б"
|
||||
rname = "A10"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_1"
|
||||
|
||||
[node name="um1535_A11" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 337.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 432.0
|
||||
offset_left = 524.0
|
||||
offset_top = 191.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 286.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A11"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_2"
|
||||
|
||||
[node name="um1535_A12" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 432.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 527.0
|
||||
offset_left = 524.0
|
||||
offset_top = 286.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 381.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A12"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_3"
|
||||
|
||||
[node name="um1535_A13" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 527.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 622.0
|
||||
offset_left = 524.0
|
||||
offset_top = 381.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 476.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A13"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_4"
|
||||
|
||||
[node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 622.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 717.0
|
||||
offset_left = 524.0
|
||||
offset_top = 476.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 571.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A14"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_5"
|
||||
|
||||
[node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 717.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 812.0
|
||||
offset_left = 524.0
|
||||
offset_top = 571.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 666.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A15"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_6"
|
||||
|
||||
[node name="utm80_A9" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
[node name="блок-к" parent="." groups=["power_amplifier"] instance=ExtResource("6_wd1vi")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 812.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 907.0
|
||||
offset_left = 524.0
|
||||
offset_top = 666.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 761.0
|
||||
fname = "УТМ80"
|
||||
rname = "A9"
|
||||
value0_info = "Мощность, Вт"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_7"
|
||||
|
||||
[node name="rm1620m_A16" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 242.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 337.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A16"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_8"
|
||||
|
||||
[node name="rm1620m_A17" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
[node name="rm1620m_A16" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 337.0
|
||||
offset_right = 173.0
|
||||
offset_bottom = 432.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A17"
|
||||
value0_info = "Мощность, Вт"
|
||||
offset_left = 47.0
|
||||
offset_top = 96.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 191.0
|
||||
fname = "РМ16-20М"
|
||||
rname = "A16"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_9"
|
||||
|
||||
[node name="rm1620m_A18" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
[node name="rm1620m_A17" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 432.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 527.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A18"
|
||||
value0_info = "Мощность, Вт"
|
||||
offset_left = 47.0
|
||||
offset_top = 191.0
|
||||
offset_right = 212.0
|
||||
offset_bottom = 286.0
|
||||
fname = "РМ16-20М"
|
||||
rname = "A17"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_10"
|
||||
|
||||
[node name="rm1620m_A19" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
[node name="rm1620m_A18" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 527.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 622.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A19"
|
||||
value0_info = "Мощность, Вт"
|
||||
offset_left = 47.0
|
||||
offset_top = 286.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 381.0
|
||||
fname = "РМ16-20М"
|
||||
rname = "A18"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_11"
|
||||
|
||||
[node name="rm1620m_A20" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
[node name="rm1620m_A19" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 622.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 717.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A20"
|
||||
value0_info = "Мощность, Вт"
|
||||
offset_left = 47.0
|
||||
offset_top = 381.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 476.0
|
||||
fname = "РМ16-20М"
|
||||
rname = "A19"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_12"
|
||||
|
||||
[node name="rm1620m_A21" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
[node name="rm1620m_A20" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 717.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 812.0
|
||||
fname = "УМ1535Б"
|
||||
rname = "A21"
|
||||
value0_info = "Мощность, Вт"
|
||||
offset_left = 47.0
|
||||
offset_top = 476.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 571.0
|
||||
fname = "РМ16-20М"
|
||||
rname = "A20"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_13"
|
||||
|
||||
[node name="rm1620m_A21" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
|
||||
layout_mode = 0
|
||||
offset_left = 47.0
|
||||
offset_top = 571.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 666.0
|
||||
fname = "РМ16-20М"
|
||||
rname = "A21"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_14"
|
||||
|
||||
[node name="kasseta_fs_kd" parent="." instance=ExtResource("7_ia27q")]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 432.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 622.0
|
||||
offset_left = 214.0
|
||||
offset_top = 286.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 476.0
|
||||
fname = "Кассета ФС-КД"
|
||||
|
||||
[node name="kasseta_p_1" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 622.0
|
||||
offset_right = 340.0
|
||||
offset_bottom = 812.0
|
||||
offset_left = 214.0
|
||||
offset_top = 476.0
|
||||
offset_right = 379.0
|
||||
offset_bottom = 666.0
|
||||
texture = ExtResource("2_14h25")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
@@ -267,7 +292,7 @@ patch_margin_bottom = 16
|
||||
script = ExtResource("7_xpa2n")
|
||||
fname = "Кассета П-1"
|
||||
|
||||
[node name="ref_A26" parent="kasseta_p_1" groups=["default_reset", "power_supply"] instance=ExtResource("8_la5yt")]
|
||||
[node name="ref_A26" parent="kasseta_p_1" groups=["power_supply"] instance=ExtResource("8_la5yt")]
|
||||
offset_left = 9.0
|
||||
offset_top = 33.0
|
||||
offset_right = 59.0
|
||||
@@ -276,7 +301,7 @@ fname = "ИП9-50"
|
||||
rname = "A23"
|
||||
metadata/ip = "ip9_50_1"
|
||||
|
||||
[node name="ref_A23" parent="kasseta_p_1" groups=["default_reset", "power_supply"] instance=ExtResource("8_la5yt")]
|
||||
[node name="ref_A23" parent="kasseta_p_1" groups=["power_supply"] instance=ExtResource("8_la5yt")]
|
||||
offset_left = 59.0
|
||||
offset_top = 33.0
|
||||
offset_right = 109.0
|
||||
@@ -285,7 +310,7 @@ fname = "ИП9-50"
|
||||
rname = "A24"
|
||||
metadata/ip = "ip9_50_2"
|
||||
|
||||
[node name="ref_A24" parent="kasseta_p_1" groups=["default_reset", "power_supply"] instance=ExtResource("8_la5yt")]
|
||||
[node name="ref_A24" parent="kasseta_p_1" groups=["power_supply"] instance=ExtResource("8_la5yt")]
|
||||
offset_left = 109.0
|
||||
offset_top = 33.0
|
||||
offset_right = 159.0
|
||||
@@ -297,9 +322,9 @@ metadata/ip = "ip12_50_1"
|
||||
[node name="lbl_fname" type="Label" parent="kasseta_p_1"]
|
||||
self_modulate = Color(1, 1, 1, 0.62)
|
||||
layout_mode = 0
|
||||
offset_left = 7.0
|
||||
offset_left = 2.0
|
||||
offset_top = 8.0
|
||||
offset_right = 159.0
|
||||
offset_right = 162.0
|
||||
offset_bottom = 33.0
|
||||
text = "Кассета П-1"
|
||||
horizontal_alignment = 1
|
||||
@@ -307,18 +332,50 @@ vertical_alignment = 1
|
||||
|
||||
[node name="kasseta_p_2" parent="." instance=ExtResource("8_6fdp7")]
|
||||
layout_mode = 0
|
||||
offset_left = 365.0
|
||||
offset_top = 622.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 812.0
|
||||
offset_left = 404.0
|
||||
offset_top = 476.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 666.0
|
||||
fname = "Кассета П-2"
|
||||
|
||||
[node name="input_0" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(392, 472)
|
||||
sprite_frames = SubResource("SpriteFrames_di0aa")
|
||||
|
||||
[node name="input_1" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(444, 472)
|
||||
sprite_frames = SubResource("SpriteFrames_di0aa")
|
||||
|
||||
[node name="input_2" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(294, 473)
|
||||
sprite_frames = SubResource("SpriteFrames_di0aa")
|
||||
|
||||
[node name="output_0" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(394, 318)
|
||||
sprite_frames = SubResource("SpriteFrames_di0aa")
|
||||
|
||||
[node name="output_1" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(444, 318)
|
||||
sprite_frames = SubResource("SpriteFrames_di0aa")
|
||||
|
||||
[node name="output_2" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(294, 318)
|
||||
sprite_frames = SubResource("SpriteFrames_di0aa")
|
||||
|
||||
[node name="control_result" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 9.0
|
||||
offset_top = 960.0
|
||||
offset_right = 649.0
|
||||
offset_bottom = 1003.0
|
||||
text = "Прибор ПРД- неисправен"
|
||||
offset_left = 49.0
|
||||
offset_top = 993.0
|
||||
offset_right = 689.0
|
||||
offset_bottom = 1036.0
|
||||
theme_override_font_sizes/font_size = 22
|
||||
horizontal_alignment = 1
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="line" type="Line2D" parent="."]
|
||||
position = Vector2(59, 920)
|
||||
scale = Vector2(1.03548, 1)
|
||||
points = PackedVector2Array(-8, 0, 61.8069, 0, 608, 0)
|
||||
width = 2.0
|
||||
default_color = Color(1, 1, 1, 0.352941)
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
@@ -1,235 +1,181 @@
|
||||
@tool
|
||||
extends 'res://scenes/контроль/прибор.gd'
|
||||
|
||||
const constants_n = {
|
||||
'POWER_UKP_1': 31,
|
||||
'POWER_UKP_2': 63,
|
||||
'DKM_BIT_2': 1,
|
||||
'DKM_BIT_3': 2,
|
||||
'BASE_ADDR_EMS_G': 0x120,
|
||||
'ADDR_UG_LITERA_1': 0x106,
|
||||
'ADDR_UG_LITERA_2': 0x108,
|
||||
'ADDR_UG_LITERA_3': 0x10A,
|
||||
'TEMP_THRESHOLD': 70,
|
||||
'POWER_THRESHOLD': 40,
|
||||
'RAY_DOU_NUM': 0x3,
|
||||
'ATT_UM_2': 0x2,
|
||||
'ATT_UM_3': 0x3,
|
||||
'POWER_UM': 100,
|
||||
'TIMER_DELAY': 10.0,
|
||||
'STATE_MASHINE_TIMER': 0.3,
|
||||
}
|
||||
# Конфигурация параметров для каждого прибора
|
||||
const PRIBOR_CONFIG_N := {
|
||||
'1н': {'angle': 0.0, 'sectors': [4, 8]},
|
||||
'2н': {'angle': 90.0, 'sectors': [7, 11]},
|
||||
'3н': {'angle': 180.0, 'sectors': [6, 10]},
|
||||
'4н': {'angle': 270.0, 'sectors': [5, 9]},
|
||||
}
|
||||
# Конфигурация частот и ширин для каждого ФС
|
||||
const FS_PARAMS_N := {
|
||||
2: {'freq': 932.0, 'width': 100.0},
|
||||
3: {'freq': 1157.0, 'width': 100.0}
|
||||
}
|
||||
enum STATE_VAL { NONE = 0, GOOD = 1, ERROR = 2 }
|
||||
var block_ip_config_n:= {
|
||||
'maa2000_1': [0, false],
|
||||
'maa2000_2': [1, false],
|
||||
'ip9_50_1': [2, false],
|
||||
'ip9_50_2': [3, false],
|
||||
'ip12_50_1': [4, false],
|
||||
'ip5_25': [7, false],
|
||||
}
|
||||
var block_kasseta_y5_prd_config_n: = {
|
||||
'yau07': false,
|
||||
'ems': false,
|
||||
'ug': false,
|
||||
'ukp1': false,
|
||||
'ukp2': false,
|
||||
}
|
||||
|
||||
# Основные переменные
|
||||
var start_litera: int = 2
|
||||
var ug_work_1: int = 2 ## Аттенюация усилителей мощности
|
||||
var ug_work_2: int = 3 ## Аттенюация усилителей мощности
|
||||
# Флаги и таймеры
|
||||
var mashine_timer: Timer = Timer.new()
|
||||
var prd_n_module: Object
|
||||
var unit_prd_n: Object
|
||||
var control_prd_n: Object
|
||||
# Результаты контроля
|
||||
var control_results_n: Dictionary = {
|
||||
'block_ip': false, # Проверка касет П1 и ИП МА2000
|
||||
'temperature': true, # Проверка температур УМ
|
||||
'dkm_2': false,
|
||||
'dkm_3': false,
|
||||
'dou_2': false,
|
||||
'dou_3': false,
|
||||
'fs_2': 2,
|
||||
'fs_3': 2,
|
||||
}
|
||||
var test_control_n = preload('res://scripts/pribor-prd.gd')
|
||||
var ctrl_pos = 0
|
||||
################################
|
||||
func on_state_mashine() -> void:
|
||||
control_prd_n.state_control_machine()
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
|
||||
initialize_connections()
|
||||
setup_timer()
|
||||
set_default_state()
|
||||
find_labels(self)
|
||||
|
||||
|
||||
func initialize_connections() -> void:
|
||||
var unit_name = get_meta('unit_name')[0]
|
||||
prd_n_module = prd.prd_dict[unit_name]
|
||||
unit_prd_n = prd_n_module.unit_yau07
|
||||
|
||||
unit_prd_n.connect('line_changed', Callable(self, 'on_line_changed'))
|
||||
var power_amplifiers: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
var init_data: Dictionary = {
|
||||
'control_label': $control_result,
|
||||
'power_amplifiers': power_amplifiers,
|
||||
'unit_prd': unit_prd_n,
|
||||
'module_prd' : prd_n_module,
|
||||
'constants': constants_n,
|
||||
'prd_config': PRIBOR_CONFIG_N,
|
||||
'fs_params': FS_PARAMS_N,
|
||||
'block_ip_prd_config': block_ip_config_n,
|
||||
'block_kasseta_y5_prd_config': block_kasseta_y5_prd_config_n,
|
||||
'control_results': control_results_n,
|
||||
'current_litera': start_litera,
|
||||
}
|
||||
control_prd_n = test_control_n.TestPRD.new(init_data)
|
||||
add_child(control_prd_n)
|
||||
control_prd_n.connect('control_is_over', Callable(self, 'on_control_result'))
|
||||
var prd_n_module = prd.prd_dict[unit_name]
|
||||
unit_prd_n = prd_n_module.unit_control
|
||||
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
for temp in power_amplifier:
|
||||
temp.value1 = -70
|
||||
# Подписываемся на сигналы
|
||||
signaller.conn(signaller.start_contol_device, Callable(self, '_on_start_control'))
|
||||
unit_prd_n.connect('control_is_over', Callable(self, 'on_press_device'))
|
||||
unit_prd_n.connect('status_updated', Callable(self, '_on_status_updated'))
|
||||
# Устанавливаем начальный статус
|
||||
_update_status_text(unit_prd_n.get_current_status())
|
||||
on_press_device(unit_prd_n.self_name)
|
||||
|
||||
|
||||
func setup_timer() -> void:
|
||||
add_child(mashine_timer)
|
||||
mashine_timer.connect('timeout', Callable(self, 'on_state_mashine'))
|
||||
mashine_timer.wait_time = constants_n.STATE_MASHINE_TIMER
|
||||
mashine_timer.start()
|
||||
func _process(_delta: float) -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
set_frame($input_0, unit_prd_n.ems_g_sock_dic.ems_input_1)
|
||||
set_frame($input_1, unit_prd_n.ems_g_sock_dic.ems_input_2)
|
||||
set_frame($output_0, unit_prd_n.ems_g_sock_dic.ems_output_1)
|
||||
set_frame($output_1, unit_prd_n.ems_g_sock_dic.ems_output_2)
|
||||
|
||||
|
||||
func set_default_state() -> void:
|
||||
for group in get_tree().get_nodes_in_group('default_reset'):
|
||||
group.state = STATE_VAL.NONE
|
||||
func set_frame(node_frame: Node, val: int): node_frame.set_frame(val)
|
||||
|
||||
for group in get_tree().get_nodes_in_group('power_amplifier'):
|
||||
|
||||
func _on_start_control() -> void:
|
||||
set_default_state(get_tree().get_nodes_in_group('default_reset'))
|
||||
set_default_state(get_tree().get_nodes_in_group('power_amplifier'))
|
||||
for um in get_tree().get_nodes_in_group('power_amplifier'):
|
||||
um.value0 = [0, 0, 0, 0, 0, 0]
|
||||
find_labels(self)
|
||||
await get_tree().create_timer(1.0).timeout
|
||||
on_press_device(unit_prd_n.self_name)
|
||||
|
||||
|
||||
static func set_default_state(default_reset_array_node: Array) -> void:
|
||||
for group in default_reset_array_node:
|
||||
group.state = STATE_VAL.NONE
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
$control_result.text = 'Выполняется ...'
|
||||
$control_result.add_theme_color_override('font_color', Color.ALICE_BLUE)
|
||||
signaller.connect('режим_работа', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_журнал', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_эмс', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_настройки', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_контроль', Callable(self, 'on_mode_changed').bind(true))
|
||||
if unit_prd_n:
|
||||
_update_status_text(unit_prd_n.get_current_status())
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
prd_n_module.cmd_array.append([unit_prd_n.CmdCode.WRITE_ISA, [constants_n.ADDR_UG_LITERA_1, ug_work_1, constants_n.ADDR_UG_LITERA_2, ug_work_2]])
|
||||
#prd_n_module.cmd_array.append([unit_prd_n.CmdCode.WRITE_ISA, [constants_n.ADDR_UG_LITERA_1, ug_work_1, constants_n.ADDR_UG_LITERA_2, ug_work_2]])
|
||||
|
||||
|
||||
func on_line_changed(unit_pribor: Object) -> void:
|
||||
if not unit_pribor.online:
|
||||
set_default_state()
|
||||
static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dictionary)->void:
|
||||
for i_node_temperature in temperature_arr_node:
|
||||
var temperature_meta: String = i_node_temperature.get_meta('um')
|
||||
if not temperature_dic.has(temperature_meta): return
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta] if temperature_dic[temperature_meta] < 361 else -40
|
||||
|
||||
|
||||
func on_mode_changed(in_tree: bool) -> void:
|
||||
if not in_tree:
|
||||
mashine_timer.stop()
|
||||
signaller.emit_signal('interfer_off_all')
|
||||
prd_n_module.cmd_array.append([unit_prd_n.CmdCode.WRITE_ISA, [constants_n.ADDR_UG_LITERA_1, ug_work_1, constants_n.ADDR_UG_LITERA_2, ug_work_2]])
|
||||
else:
|
||||
set_default_state()
|
||||
control_prd_n.state = control_prd_n.STATE_MASHINE.INIT
|
||||
mashine_timer.start()
|
||||
|
||||
|
||||
func power_fill(pow_dic: Dictionary, fs_result: Dictionary) -> void:
|
||||
#if not control_prd_n.block_kasseta_y5_config.yau07 or not control_prd_n.block_kasseta_y5_config.ukp1 or not control_prd_n.block_kasseta_y5_config.ukp2:
|
||||
#return
|
||||
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
for i_powapm in power_amplifier:
|
||||
var powamp_meta: String = i_powapm.get_meta('um')
|
||||
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void:
|
||||
for i_node_powapm in power_amplifier_arr_node:
|
||||
var powamp_meta: String = i_node_powapm.get_meta('um')
|
||||
var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE
|
||||
if pow_dic[powamp_meta].size() < 6:
|
||||
status = STATE_VAL.ERROR
|
||||
else:
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_2: return
|
||||
if powamp_meta in ['um_7', 'um_8', 'um_9', 'um_10', 'um_11', 'um_12'] and not fs_result.fs_3: return
|
||||
i_powapm.value0 = pow_dic[powamp_meta]
|
||||
for i_p in pow_dic[powamp_meta]:
|
||||
if i_p < constants_n.POWER_THRESHOLD:
|
||||
status = STATE_VAL.ERROR
|
||||
i_powapm.state = status
|
||||
if not pow_dic.has(powamp_meta): return
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_2: return
|
||||
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_3: return
|
||||
i_node_powapm.value0 = pow_dic[powamp_meta]
|
||||
# Проверка: если ВСЕ значения в массиве < 1 → STATE_VAL.NONE
|
||||
var power_array: Array = pow_dic[powamp_meta]
|
||||
var all_below_one: bool = true
|
||||
for i_p in power_array:
|
||||
if i_p >= 1:
|
||||
all_below_one = false
|
||||
break
|
||||
|
||||
if all_below_one:
|
||||
i_node_powapm.state = STATE_VAL.NONE
|
||||
continue
|
||||
|
||||
var count_above_threshold = 0
|
||||
for i_p in pow_dic[powamp_meta]:
|
||||
if i_p >= POWER_THRESHOLD:
|
||||
count_above_threshold += 1
|
||||
|
||||
status = STATE_VAL.GOOD if count_above_threshold >= 3 else STATE_VAL.ERROR
|
||||
i_node_powapm.state = status
|
||||
|
||||
|
||||
func on_control_result(result_dic: Dictionary, power_dic: Dictionary) -> void:
|
||||
mashine_timer.stop()
|
||||
block_kasseta_y5_prd_config_n = control_prd_n.block_kasseta_y5_config
|
||||
func on_press_device(_device_name: String) -> void:
|
||||
var nodes_y5: Array = get_tree().get_nodes_in_group('y-5')
|
||||
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
|
||||
var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
|
||||
var power_amplifier_arr_node: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
var default_reset_array_node = get_tree().get_nodes_in_group('default_reset')
|
||||
var module_fs_2: Node = $kasseta_FS_ND/ref_A4
|
||||
var dou_2: Node = $dou2_A5
|
||||
var module_fs_3: Node = $kasseta_FS_ND/ref_A3
|
||||
var dou_3: Node = $dou3_A6
|
||||
var control_data: Dictionary = unit_prd_n.get_control_results()
|
||||
var for_control_result: Dictionary = {
|
||||
'nodes_y5': nodes_y5,
|
||||
'node_ip_power_arr': node_ip_power_arr,
|
||||
'fs_nodes': fs_nodes,
|
||||
'power_amplifier': power_amplifier_arr_node,
|
||||
'default_reset_array_node': default_reset_array_node,
|
||||
'module_fs_2': module_fs_2,
|
||||
'dou_2': dou_2,
|
||||
'module_fs_3': module_fs_3,
|
||||
'dou_3': dou_3,
|
||||
}
|
||||
for_control_result.merge(control_data, true)
|
||||
on_control_result(for_control_result)
|
||||
|
||||
|
||||
static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
temperature_fill(for_result_dic.power_amplifier, for_result_dic.temperature_um)
|
||||
var all_y5_good: bool = true
|
||||
var block_kasseta_y5_prd_config_n: Dictionary = for_result_dic.block_kasseta_y5_config
|
||||
var nodes_y5: Array = for_result_dic.nodes_y5
|
||||
for node_y5 in nodes_y5:
|
||||
var meta_y5 = node_y5.get_meta('y5')
|
||||
if block_kasseta_y5_prd_config_n.has(meta_y5):
|
||||
if block_kasseta_y5_prd_config_n['yau07'] == false:
|
||||
if not block_kasseta_y5_prd_config_n.yau07:
|
||||
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
|
||||
break
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_n[meta_y5] else STATE_VAL.ERROR
|
||||
else:
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_n[meta_y5] else STATE_VAL.ERROR
|
||||
# Проверяем состояние после установки
|
||||
if node_y5.state == STATE_VAL.ERROR:
|
||||
all_y5_good = false
|
||||
|
||||
block_ip_config_n = control_prd_n.block_ip_config
|
||||
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
|
||||
for power_supply in node_ip_power_arr:
|
||||
var block_ip_config_n: Dictionary = for_result_dic.block_ip_config
|
||||
for power_supply in for_result_dic.node_ip_power_arr:
|
||||
var meta_ip = power_supply.get_meta('ip')
|
||||
if block_ip_config_n.has(meta_ip) and block_kasseta_y5_prd_config_n.ug:
|
||||
if block_ip_config_n.has(meta_ip) and block_kasseta_y5_prd_config_n.ug and block_kasseta_y5_prd_config_n.yau07:
|
||||
power_supply.state = STATE_VAL.GOOD if block_ip_config_n[meta_ip][1] else STATE_VAL.ERROR
|
||||
else:
|
||||
power_supply.state = STATE_VAL.NONE
|
||||
# Проверяем состояние после установки
|
||||
if power_supply.state == STATE_VAL.ERROR:
|
||||
all_y5_good = false
|
||||
|
||||
var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
|
||||
for f in fs_nodes:
|
||||
if not for_result_dic.control_is_over:
|
||||
set_default_state(for_result_dic.default_reset_array_node)
|
||||
set_default_state(for_result_dic.power_amplifier)
|
||||
return
|
||||
var result_dic: Dictionary = for_result_dic.result_dic
|
||||
for f in for_result_dic.fs_nodes:
|
||||
var fs_meta: String = f.get_meta('fs')
|
||||
if result_dic.has(fs_meta):
|
||||
var new_state = result_dic[fs_meta]
|
||||
f.state = new_state
|
||||
result_dic[fs_meta] = new_state
|
||||
f.state = result_dic[fs_meta]
|
||||
|
||||
if result_dic.fs_2 == 1:
|
||||
$kasseta_FS_ND/ref_A4.state = STATE_VAL.GOOD if result_dic.dkm_2 else STATE_VAL.ERROR
|
||||
$dou2_A5.state = STATE_VAL.GOOD if result_dic.dou_2 else STATE_VAL.ERROR
|
||||
else:
|
||||
result_dic.fs_2 = 0
|
||||
if result_dic.fs_3 == 1:
|
||||
$kasseta_FS_ND/ref_A3.state = STATE_VAL.GOOD if result_dic.dkm_3 else STATE_VAL.ERROR
|
||||
$dou3_A6.state = STATE_VAL.GOOD if result_dic.dou_3 else STATE_VAL.ERROR
|
||||
else:
|
||||
result_dic.fs_3 = 0
|
||||
if not all_y5_good: return
|
||||
if result_dic.fs_2 == 1 and block_kasseta_y5_prd_config_n['yau07']:
|
||||
for_result_dic.module_fs_2.state = STATE_VAL.GOOD if result_dic.dkm_2 else STATE_VAL.ERROR
|
||||
for_result_dic.dou_2.state = STATE_VAL.GOOD if result_dic.dou_2 else STATE_VAL.ERROR
|
||||
|
||||
power_fill(power_dic, result_dic)
|
||||
if result_dic.fs_3 == 1 and block_kasseta_y5_prd_config_n['yau07']:
|
||||
for_result_dic.module_fs_3.state = STATE_VAL.GOOD if result_dic.dkm_3 else STATE_VAL.ERROR
|
||||
for_result_dic.dou_3.state = STATE_VAL.GOOD if result_dic.dou_3 else STATE_VAL.ERROR
|
||||
|
||||
var result = true
|
||||
for device in result_dic.values():
|
||||
if not device:
|
||||
result = false
|
||||
|
||||
var name_prd = control_prd_n.self_name
|
||||
if result:
|
||||
$control_result.text = 'Прибор ПРД-%s исправен' % name_prd
|
||||
$control_result.add_theme_color_override('font_color', Color.GREEN)
|
||||
else:
|
||||
$control_result.text = 'Прибор ПРД-%s неисправен' % name_prd
|
||||
$control_result.add_theme_color_override('font_color', Color.RED)
|
||||
if block_kasseta_y5_prd_config_n['yau07']:
|
||||
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD)
|
||||
|
||||
|
||||
func find_labels(node1: Node):
|
||||
@@ -246,3 +192,22 @@ func find_labels(node1: Node):
|
||||
node1.set_meta("tooltip_set", true)
|
||||
for child in node1.get_children():
|
||||
find_labels(child)
|
||||
|
||||
|
||||
func _on_status_updated(status_text: String) -> void:
|
||||
_update_status_text(status_text)
|
||||
|
||||
|
||||
func _update_status_text(text: String) -> void:
|
||||
$control_result.text = text
|
||||
# Можно добавить смену цвета в зависимости от статуса
|
||||
if "Ошибка" in text or "неисправен" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.RED)
|
||||
log.message(Logger.INFO, 'Прибор ПРД-%s неисправен' % [unit_prd_n.self_name])
|
||||
elif "Ограничена" in text or "Предупреждение" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.YELLOW)
|
||||
elif "исправен" in text or "завершён" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.GREEN)
|
||||
log.message(Logger.INFO, 'Прибор ПРД-%s исправен' % [unit_prd_n.self_name])
|
||||
else:
|
||||
$control_result.add_theme_color_override('font_color', Color.WHITE)
|
||||
|
||||
@@ -1,12 +1,35 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://dnuexoef2nnv5"]
|
||||
[gd_scene load_steps=12 format=3 uid="uid://dnuexoef2nnv5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cto2r4ipew65m" path="res://scenes/pribor-prd-n/pribor-prd-n.gd" id="1_bnnv3"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_is25t"]
|
||||
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="3_meukj"]
|
||||
[ext_resource type="PackedScene" uid="uid://bk1655p4e8y4u" path="res://scenes/контроль/кассета-у-5-нв.tscn" id="4_xkifg"]
|
||||
[ext_resource type="Script" uid="uid://crpedygm3gohi" path="res://scenes/контроль/кассета.gd" id="6_b5wvk"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcyxqni7gxvtq" path="res://scenes/контроль/блок-в.tscn" id="7_bnnv3"]
|
||||
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="7_eoqf2"]
|
||||
[ext_resource type="Texture2D" uid="uid://belwchvdktrw0" path="res://data/эмс-бланк.png" id="8_bnnv3"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwddxs24es81u" path="res://data/эмс-бланк-пост.png" id="9_is25t"]
|
||||
[ext_resource type="Texture2D" uid="uid://pfoscstbm025" path="res://data/эмс-бланк-перем.png" id="10_meukj"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvl3sq036gn75" path="res://data/эмс-бланк-замыкание.png" id="11_xkifg"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_1wf07"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("8_bnnv3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("9_is25t")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("10_meukj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("11_xkifg")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="pribor_prd_n" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -17,50 +40,50 @@ offset_right = 15.0
|
||||
offset_bottom = 30.0
|
||||
script = ExtResource("1_bnnv3")
|
||||
|
||||
[node name="maa2000_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_is25t")]
|
||||
[node name="maa2000_A23" parent="." groups=["power_supply"] instance=ExtResource("2_is25t")]
|
||||
layout_mode = 2
|
||||
offset_left = 8.0
|
||||
offset_top = 877.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 949.0
|
||||
offset_left = 47.0
|
||||
offset_top = 731.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 803.0
|
||||
fname = "MAA2000"
|
||||
rname = "A23"
|
||||
metadata/ip = "maa2000_2"
|
||||
|
||||
[node name="maa2000_A22" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_is25t")]
|
||||
[node name="maa2000_A22" parent="." groups=["power_supply"] instance=ExtResource("2_is25t")]
|
||||
layout_mode = 2
|
||||
offset_left = 485.0
|
||||
offset_top = 877.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 949.0
|
||||
offset_left = 524.0
|
||||
offset_top = 731.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 803.0
|
||||
fname = "MAA2000"
|
||||
rname = "A22"
|
||||
metadata/ip = "maa2000_1"
|
||||
|
||||
[node name="dou2_A5" parent="." groups=["default_reset"] instance=ExtResource("2_is25t")]
|
||||
layout_mode = 2
|
||||
offset_left = 485.0
|
||||
offset_top = 812.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 877.0
|
||||
offset_left = 524.0
|
||||
offset_top = 666.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 731.0
|
||||
fname = "ДОУ-2"
|
||||
rname = "A5"
|
||||
|
||||
[node name="dou3_A6" parent="." groups=["default_reset"] instance=ExtResource("2_is25t")]
|
||||
layout_mode = 2
|
||||
offset_left = 8.0
|
||||
offset_top = 812.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 877.0
|
||||
offset_left = 47.0
|
||||
offset_top = 666.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 731.0
|
||||
fname = "ДОУ-3"
|
||||
rname = "A6"
|
||||
|
||||
[node name="ref_ZZ3" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 812.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 949.0
|
||||
offset_left = 214.0
|
||||
offset_top = 666.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 803.0
|
||||
texture = ExtResource("3_meukj")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
@@ -79,19 +102,90 @@ text = "Панель
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="kasseta_U5" parent="." instance=ExtResource("4_xkifg")]
|
||||
[node name="kasseta_U5" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 242.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 432.0
|
||||
offset_left = 214.0
|
||||
offset_top = 96.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 286.0
|
||||
texture = ExtResource("3_meukj")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
patch_margin_right = 16
|
||||
patch_margin_bottom = 16
|
||||
script = ExtResource("6_b5wvk")
|
||||
|
||||
[node name="lbl_fname" type="Label" parent="kasseta_U5"]
|
||||
self_modulate = Color(1, 1, 1, 0.62)
|
||||
layout_mode = 0
|
||||
offset_left = 5.0
|
||||
offset_top = 7.0
|
||||
offset_right = 305.0
|
||||
offset_bottom = 35.0
|
||||
text = "Кассета У5"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ref_A24" parent="kasseta_U5" groups=["power_supply"] instance=ExtResource("7_eoqf2")]
|
||||
offset_left = 5.0
|
||||
offset_top = 32.0
|
||||
offset_right = 55.0
|
||||
offset_bottom = 182.0
|
||||
fname = "ИП5-25"
|
||||
rname = "A24"
|
||||
metadata/ip = "ip5_25"
|
||||
|
||||
[node name="ref_A30" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_eoqf2")]
|
||||
offset_left = 55.0
|
||||
offset_top = 32.0
|
||||
offset_right = 105.0
|
||||
offset_bottom = 182.0
|
||||
fname = "ЯУ-07Б"
|
||||
rname = "A30"
|
||||
metadata/y5 = "yau07"
|
||||
|
||||
[node name="ref_A26" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_eoqf2")]
|
||||
offset_left = 105.0
|
||||
offset_top = 32.0
|
||||
offset_right = 155.0
|
||||
offset_bottom = 182.0
|
||||
fname = "ЭМС-Г"
|
||||
rname = "A26"
|
||||
metadata/y5 = "ems"
|
||||
|
||||
[node name="ref_A27" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_eoqf2")]
|
||||
offset_left = 155.0
|
||||
offset_top = 32.0
|
||||
offset_right = 205.0
|
||||
offset_bottom = 182.0
|
||||
fname = "УГ"
|
||||
rname = "A27"
|
||||
metadata/y5 = "ug"
|
||||
|
||||
[node name="ref_A28" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_eoqf2")]
|
||||
offset_left = 205.0
|
||||
offset_top = 32.0
|
||||
offset_right = 255.0
|
||||
offset_bottom = 182.0
|
||||
fname = "УКП"
|
||||
rname = "A28"
|
||||
metadata/y5 = "ukp1"
|
||||
|
||||
[node name="ref_A29" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_eoqf2")]
|
||||
offset_left = 254.0
|
||||
offset_top = 32.0
|
||||
offset_right = 304.0
|
||||
offset_bottom = 182.0
|
||||
fname = "УКП"
|
||||
rname = "A29"
|
||||
metadata/y5 = "ukp2"
|
||||
|
||||
[node name="kasseta_FS_ND" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 432.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 622.0
|
||||
offset_left = 214.0
|
||||
offset_top = 286.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 476.0
|
||||
texture = ExtResource("3_meukj")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
@@ -118,7 +212,7 @@ offset_top = 32.0
|
||||
offset_right = 105.0
|
||||
offset_bottom = 182.0
|
||||
fname = "Блок ФС-3"
|
||||
rname = "A3"
|
||||
rname = "A4"
|
||||
|
||||
[node name="ref_A1" parent="kasseta_FS_ND" groups=["default_reset", "fs_group"] instance=ExtResource("7_eoqf2")]
|
||||
offset_left = 105.0
|
||||
@@ -126,7 +220,7 @@ offset_top = 32.0
|
||||
offset_right = 155.0
|
||||
offset_bottom = 182.0
|
||||
fname = "Модуль ФС"
|
||||
rname = "A1"
|
||||
rname = "A2"
|
||||
metadata/fs = "fs_3"
|
||||
|
||||
[node name="ref_A2" parent="kasseta_FS_ND" groups=["default_reset", "fs_group"] instance=ExtResource("7_eoqf2")]
|
||||
@@ -135,7 +229,7 @@ offset_top = 32.0
|
||||
offset_right = 205.0
|
||||
offset_bottom = 182.0
|
||||
fname = "Модуль ФС"
|
||||
rname = "A2"
|
||||
rname = "A1"
|
||||
metadata/fs = "fs_2"
|
||||
|
||||
[node name="ref_A4" parent="kasseta_FS_ND" groups=["default_reset"] instance=ExtResource("7_eoqf2")]
|
||||
@@ -144,14 +238,14 @@ offset_top = 32.0
|
||||
offset_right = 255.0
|
||||
offset_bottom = 182.0
|
||||
fname = "Блок ФС-2"
|
||||
rname = "A4"
|
||||
rname = "A3"
|
||||
|
||||
[node name="kasseta_P_1" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 622.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 812.0
|
||||
offset_left = 214.0
|
||||
offset_top = 476.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 666.0
|
||||
texture = ExtResource("3_meukj")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
@@ -160,7 +254,7 @@ patch_margin_bottom = 16
|
||||
script = ExtResource("6_b5wvk")
|
||||
fname = "Кассета П-1"
|
||||
|
||||
[node name="ref_A21" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_eoqf2")]
|
||||
[node name="ref_A21" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_eoqf2")]
|
||||
offset_left = 9.0
|
||||
offset_top = 33.0
|
||||
offset_right = 59.0
|
||||
@@ -169,7 +263,7 @@ fname = "ИП12-50"
|
||||
rname = "A21"
|
||||
metadata/ip = "ip12_50_1"
|
||||
|
||||
[node name="ref_A20" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_eoqf2")]
|
||||
[node name="ref_A20" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_eoqf2")]
|
||||
offset_left = 59.0
|
||||
offset_top = 33.0
|
||||
offset_right = 109.0
|
||||
@@ -178,7 +272,7 @@ fname = "ИП9-50"
|
||||
rname = "A20"
|
||||
metadata/ip = "ip9_50_1"
|
||||
|
||||
[node name="ref_A19" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_eoqf2")]
|
||||
[node name="ref_A19" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_eoqf2")]
|
||||
offset_left = 109.0
|
||||
offset_top = 33.0
|
||||
offset_right = 159.0
|
||||
@@ -200,153 +294,178 @@ vertical_alignment = 1
|
||||
|
||||
[node name="um1535_A7" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 242.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 337.0
|
||||
fname = "УМ1535Б"
|
||||
offset_left = 524.0
|
||||
offset_top = 96.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 191.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A7"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_1"
|
||||
|
||||
[node name="um1535_A8" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 337.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 432.0
|
||||
offset_left = 524.0
|
||||
offset_top = 191.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 286.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A8"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_2"
|
||||
|
||||
[node name="um1535_A9" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 432.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 527.0
|
||||
offset_left = 524.0
|
||||
offset_top = 286.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 381.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A9"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_3"
|
||||
|
||||
[node name="um1535_A10" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 527.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 622.0
|
||||
offset_left = 524.0
|
||||
offset_top = 381.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 476.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A10"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_4"
|
||||
|
||||
[node name="um1535_A11" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 622.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 717.0
|
||||
offset_left = 524.0
|
||||
offset_top = 476.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 571.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A11"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_5"
|
||||
|
||||
[node name="um1535_A12" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 717.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 812.0
|
||||
offset_left = 524.0
|
||||
offset_top = 571.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 666.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A12"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_6"
|
||||
|
||||
[node name="um1535_A13" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 242.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 337.0
|
||||
offset_left = 47.0
|
||||
offset_top = 96.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 191.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A13"
|
||||
value0_info = "Мощность, Вт"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_7"
|
||||
|
||||
[node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 337.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 432.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A14"
|
||||
value0_info = "Мощность, Вт"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_8"
|
||||
|
||||
[node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 432.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 527.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A15"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_9"
|
||||
|
||||
[node name="um1535_A16" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
[node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 527.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 622.0
|
||||
offset_left = 47.0
|
||||
offset_top = 191.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 286.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A16"
|
||||
value0_info = "Мощность, Вт"
|
||||
rname = "A14"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_10"
|
||||
|
||||
[node name="um1535_A17" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
[node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 622.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 717.0
|
||||
offset_left = 47.0
|
||||
offset_top = 286.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 381.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A17"
|
||||
value0_info = "Мощность, Вт"
|
||||
rname = "A15"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_11"
|
||||
|
||||
[node name="um1535_A18" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
[node name="um1535_A16" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 717.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 812.0
|
||||
offset_left = 47.0
|
||||
offset_top = 381.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 476.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A18"
|
||||
value0_info = "Мощность, Вт"
|
||||
rname = "A16"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_12"
|
||||
|
||||
[node name="um1535_A17" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 47.0
|
||||
offset_top = 476.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 571.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A17"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_13"
|
||||
|
||||
[node name="um1535_A18" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
|
||||
layout_mode = 0
|
||||
offset_left = 47.0
|
||||
offset_top = 571.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 666.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A18"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_14"
|
||||
|
||||
[node name="control_result" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 9.0
|
||||
offset_top = 960.0
|
||||
offset_right = 649.0
|
||||
offset_bottom = 1003.0
|
||||
offset_left = 49.0
|
||||
offset_top = 993.0
|
||||
offset_right = 689.0
|
||||
offset_bottom = 1036.0
|
||||
theme_override_font_sizes/font_size = 22
|
||||
horizontal_alignment = 1
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="input_0" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(495, 443)
|
||||
sprite_frames = SubResource("SpriteFrames_1wf07")
|
||||
|
||||
[node name="input_1" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(246, 440)
|
||||
sprite_frames = SubResource("SpriteFrames_1wf07")
|
||||
|
||||
[node name="output_0" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(497, 330)
|
||||
sprite_frames = SubResource("SpriteFrames_1wf07")
|
||||
|
||||
[node name="output_1" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(249, 331)
|
||||
sprite_frames = SubResource("SpriteFrames_1wf07")
|
||||
|
||||
[node name="line" type="Line2D" parent="."]
|
||||
position = Vector2(59, 920)
|
||||
scale = Vector2(1.03548, 1)
|
||||
points = PackedVector2Array(-8, 0, 61.8069, 0, 608, 0)
|
||||
width = 2.0
|
||||
default_color = Color(1, 1, 1, 0.352941)
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
@@ -1,234 +1,177 @@
|
||||
@tool
|
||||
extends 'res://scenes/контроль/прибор.gd'
|
||||
|
||||
const constants_v = {
|
||||
'POWER_UKP_1': 31,
|
||||
'POWER_UKP_2': 63,
|
||||
'DKM_BIT_4': 3,
|
||||
'DKM_BIT_5': 4,
|
||||
'BASE_ADDR_EMS_G': 0x120,
|
||||
'ADDR_UG_LITERA_1': 0x106,
|
||||
'ADDR_UG_LITERA_2': 0x108,
|
||||
'ADDR_UG_LITERA_3': 0x10A,
|
||||
'TEMP_THRESHOLD': 70,
|
||||
'POWER_THRESHOLD': 40,
|
||||
'RAY_DOU_NUM': 0x3,
|
||||
'ATT_UM_4': 0x2,
|
||||
'ATT_UM_5': 0x3,
|
||||
'POWER_UM': 100,
|
||||
'TIMER_DELAY': 10.0,
|
||||
'STATE_MASHINE_TIMER': 0.3,
|
||||
}
|
||||
# Конфигурация параметров для каждого прибора
|
||||
const PRIBOR_CONFIG_V := {
|
||||
'1в': {'angle': 0.0, 'sectors': [12, 16]},
|
||||
'2в': {'angle': 90.0, 'sectors': [15, 19]},
|
||||
'3в': {'angle': 180.0, 'sectors': [14, 18]},
|
||||
'4в': {'angle': 270.0, 'sectors': [13, 17]},
|
||||
}
|
||||
# Конфигурация частот и ширин для каждого ФС
|
||||
const FS_PARAMS_V := {
|
||||
4: {'freq': 1227.0, 'width': 100.0},
|
||||
5: {'freq': 1575.0, 'width': 110.0},
|
||||
}
|
||||
enum STATE_VAL { NONE = 0, GOOD = 1, ERROR = 2 }
|
||||
var block_ip_config_v := {
|
||||
'maa2000_1': [0, false],
|
||||
'maa2000_2': [1, false],
|
||||
'ip9_50_1': [2, false],
|
||||
'ip9_50_2': [3, false],
|
||||
'ip12_50_1': [4, false],
|
||||
'ip5_25': [7, false],
|
||||
}
|
||||
var block_kasseta_y5_prd_config_v: = {
|
||||
'yau07': false,
|
||||
'ems': false,
|
||||
'ug': false,
|
||||
'ukp1': false,
|
||||
'ukp2': false,
|
||||
}
|
||||
|
||||
# Основные переменные
|
||||
var start_litera: int = 4
|
||||
var ug_work_1: int = 2 ## Аттенюация усилителей мощности
|
||||
var ug_work_2: int = 3 ## Аттенюация усилителей мощности
|
||||
# Флаги и таймеры
|
||||
var mashine_timer: Timer = Timer.new()
|
||||
var prd_v_module: Object
|
||||
var unit_prd_v: Object
|
||||
var control_prd_v: Object
|
||||
# Результаты контроля
|
||||
var control_results_v: Dictionary = {
|
||||
'block_ip': false, # Проверка касет П1 и ИП МА2000
|
||||
'temperature': true, # Проверка температур УМ
|
||||
'dkm_4': false,
|
||||
'dkm_5': false,
|
||||
'dou_4': false,
|
||||
'dou_5': false,
|
||||
'fs_4': 2,
|
||||
'fs_5': 2,
|
||||
}
|
||||
var test_control_v = preload('res://scripts/pribor-prd.gd')
|
||||
var ctrl_pos = 70
|
||||
|
||||
|
||||
func on_state_mashine() -> void:
|
||||
control_prd_v.state_control_machine()
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
|
||||
initialize_connections()
|
||||
setup_timer()
|
||||
set_default_state()
|
||||
find_labels(self)
|
||||
|
||||
|
||||
func initialize_connections() -> void:
|
||||
var unit_name = get_meta('unit_name')[0]
|
||||
prd_v_module = prd.prd_dict[unit_name]
|
||||
unit_prd_v = prd_v_module.unit_yau07
|
||||
|
||||
unit_prd_v.connect('line_changed', Callable(self, 'on_line_changed'))
|
||||
var power_amplifiers: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
var init_data: Dictionary = {
|
||||
'control_label': $control_result,
|
||||
'power_amplifiers': power_amplifiers,
|
||||
'unit_prd': unit_prd_v,
|
||||
'module_prd' : prd_v_module,
|
||||
'constants': constants_v,
|
||||
'prd_config': PRIBOR_CONFIG_V,
|
||||
'fs_params': FS_PARAMS_V,
|
||||
'block_ip_prd_config': block_ip_config_v,
|
||||
'block_kasseta_y5_prd_config': block_kasseta_y5_prd_config_v,
|
||||
'control_results': control_results_v,
|
||||
'current_litera': start_litera,
|
||||
}
|
||||
control_prd_v = test_control_v.TestPRD.new(init_data)
|
||||
add_child(control_prd_v)
|
||||
control_prd_v.connect('control_is_over', Callable(self, 'on_control_result'))
|
||||
var prd_v_module = prd.prd_dict[unit_name]
|
||||
unit_prd_v = prd_v_module.unit_control
|
||||
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
for temp in power_amplifier:
|
||||
temp.value1 = -70
|
||||
# Подписываемся на сигналы
|
||||
signaller.conn(signaller.start_contol_device, Callable(self, '_on_start_control'))
|
||||
unit_prd_v.connect('control_is_over', Callable(self, 'on_press_device'))
|
||||
unit_prd_v.connect('status_updated', Callable(self, '_on_status_updated'))
|
||||
# Устанавливаем начальный статус
|
||||
_update_status_text(unit_prd_v.get_current_status())
|
||||
on_press_device(unit_prd_v.self_name)
|
||||
|
||||
|
||||
func setup_timer() -> void:
|
||||
add_child(mashine_timer)
|
||||
mashine_timer.connect('timeout', Callable(self, 'on_state_mashine'))
|
||||
mashine_timer.wait_time = constants_v.STATE_MASHINE_TIMER
|
||||
mashine_timer.start()
|
||||
func _process(_delta: float) -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
set_frame($input_0, unit_prd_v.ems_g_sock_dic.ems_input_1)
|
||||
set_frame($input_1, unit_prd_v.ems_g_sock_dic.ems_input_2)
|
||||
set_frame($output_0, unit_prd_v.ems_g_sock_dic.ems_output_1)
|
||||
set_frame($output_1, unit_prd_v.ems_g_sock_dic.ems_output_2)
|
||||
|
||||
|
||||
func set_default_state() -> void:
|
||||
for group in get_tree().get_nodes_in_group('default_reset'):
|
||||
group.state = STATE_VAL.NONE
|
||||
func set_frame(node_frame: Node, val: int): node_frame.set_frame(val)
|
||||
|
||||
for group in get_tree().get_nodes_in_group('power_amplifier'):
|
||||
|
||||
func _on_start_control() -> void:
|
||||
set_default_state(get_tree().get_nodes_in_group('default_reset'))
|
||||
set_default_state(get_tree().get_nodes_in_group('power_amplifier'))
|
||||
for um in get_tree().get_nodes_in_group('power_amplifier'):
|
||||
um.value0 = [0, 0, 0, 0, 0, 0]
|
||||
find_labels(self)
|
||||
await get_tree().create_timer(1.0).timeout
|
||||
on_press_device(unit_prd_v.self_name)
|
||||
|
||||
|
||||
static func set_default_state(default_reset_array_node: Array) -> void:
|
||||
for group in default_reset_array_node:
|
||||
group.state = STATE_VAL.NONE
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
$control_result.text = 'Выполняется ...'
|
||||
$control_result.add_theme_color_override('font_color', Color.ALICE_BLUE)
|
||||
signaller.connect('режим_работа', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_журнал', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_эмс', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_настройки', Callable(self, 'on_mode_changed').bind(false))
|
||||
signaller.connect('режим_контроль', Callable(self, 'on_mode_changed').bind(true))
|
||||
|
||||
if unit_prd_v:
|
||||
_update_status_text(unit_prd_v.get_current_status())
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
prd_v_module.cmd_array.append([unit_prd_v.CmdCode.WRITE_ISA, [constants_v.ADDR_UG_LITERA_1, ug_work_1, constants_v.ADDR_UG_LITERA_2, ug_work_2]])
|
||||
|
||||
|
||||
func on_line_changed(unit_pribor: Object) -> void:
|
||||
if not unit_pribor.online:
|
||||
set_default_state()
|
||||
static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dictionary)->void:
|
||||
for i_node_temperature in temperature_arr_node:
|
||||
var temperature_meta: String = i_node_temperature.get_meta('um')
|
||||
if not temperature_dic.has(temperature_meta): return
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta] if temperature_dic[temperature_meta] < 361 else -40
|
||||
|
||||
|
||||
func on_mode_changed(in_tree: bool) -> void:
|
||||
if not in_tree:
|
||||
mashine_timer.stop()
|
||||
prd_v_module.cmd_array.append([unit_prd_v.CmdCode.WRITE_ISA, [constants_v.ADDR_UG_LITERA_1, ug_work_1, constants_v.ADDR_UG_LITERA_2, ug_work_2]])
|
||||
signaller.emit_signal('interfer_off_all')
|
||||
else:
|
||||
set_default_state()
|
||||
control_prd_v.state = control_prd_v.STATE_MASHINE.INIT
|
||||
mashine_timer.start()
|
||||
|
||||
|
||||
func power_fill(pow_dic: Dictionary, fs_result: Dictionary) -> void:
|
||||
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
for i_powapm in power_amplifier:
|
||||
var powamp_meta: String = i_powapm.get_meta('um')
|
||||
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void:
|
||||
for i_node_powapm in power_amplifier_arr_node:
|
||||
var powamp_meta: String = i_node_powapm.get_meta('um')
|
||||
var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE
|
||||
if pow_dic[powamp_meta].size() < 6:
|
||||
status = STATE_VAL.ERROR
|
||||
else:
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_4: return
|
||||
if powamp_meta in ['um_7', 'um_8', 'um_9', 'um_10', 'um_11', 'um_12'] and not fs_result.fs_5: return
|
||||
i_powapm.value0 = pow_dic[powamp_meta]
|
||||
for i_p in pow_dic[powamp_meta]:
|
||||
if i_p < constants_v.POWER_THRESHOLD:
|
||||
status = STATE_VAL.ERROR
|
||||
i_powapm.state = status
|
||||
if not pow_dic.has(powamp_meta): return
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_4: return
|
||||
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_5: return
|
||||
i_node_powapm.value0 = pow_dic[powamp_meta]
|
||||
# Проверка: если ВСЕ значения в массиве < 1 → STATE_VAL.NONE
|
||||
var power_array: Array = pow_dic[powamp_meta]
|
||||
var all_below_one: bool = true
|
||||
for i_p in power_array:
|
||||
if i_p >= 1:
|
||||
all_below_one = false
|
||||
break
|
||||
|
||||
if all_below_one:
|
||||
i_node_powapm.state = STATE_VAL.NONE
|
||||
continue
|
||||
var count_above_threshold = 0
|
||||
for i_p in pow_dic[powamp_meta]:
|
||||
if i_p >= POWER_THRESHOLD:
|
||||
count_above_threshold += 1
|
||||
|
||||
status = STATE_VAL.GOOD if count_above_threshold >= 3 else STATE_VAL.ERROR
|
||||
i_node_powapm.state = status
|
||||
|
||||
|
||||
func on_control_result(result_dic: Dictionary, power_dic: Dictionary) -> void:
|
||||
mashine_timer.stop()
|
||||
block_kasseta_y5_prd_config_v = control_prd_v.block_kasseta_y5_config
|
||||
func on_press_device(_device_name: String) -> void:
|
||||
var nodes_y5: Array = get_tree().get_nodes_in_group('y-5')
|
||||
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
|
||||
var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
|
||||
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
|
||||
var default_reset_array_node: Array = get_tree().get_nodes_in_group('default_reset')
|
||||
var module_fs_4: Node = $kasseta_FS_VD/ref_A6
|
||||
var dou_4: Node = $dou4_A5
|
||||
var module_fs_5: Node = $kasseta_FS_VD/ref_A2
|
||||
var dou_5: Node = $dou5_A6
|
||||
var control_data = unit_prd_v.get_control_results()
|
||||
var for_control_result: Dictionary = {
|
||||
'nodes_y5': nodes_y5,
|
||||
'node_ip_power_arr': node_ip_power_arr,
|
||||
'fs_nodes': fs_nodes,
|
||||
'power_amplifier': power_amplifier,
|
||||
'default_reset_array_node': default_reset_array_node,
|
||||
'module_fs_4': module_fs_4,
|
||||
'dou_4': dou_4,
|
||||
'module_fs_5': module_fs_5,
|
||||
'dou_5': dou_5,
|
||||
}
|
||||
for_control_result.merge(control_data, true)
|
||||
on_control_result(for_control_result)
|
||||
|
||||
|
||||
static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
temperature_fill(for_result_dic.power_amplifier, for_result_dic.temperature_um)
|
||||
var all_y5_good: bool = true
|
||||
var block_kasseta_y5_prd_config_v: Dictionary = for_result_dic.block_kasseta_y5_config
|
||||
var nodes_y5: Array = for_result_dic.nodes_y5
|
||||
for node_y5 in nodes_y5:
|
||||
var meta_y5 = node_y5.get_meta('y5')
|
||||
if block_kasseta_y5_prd_config_v.has(meta_y5):
|
||||
if block_kasseta_y5_prd_config_v['yau07'] == false:
|
||||
if not block_kasseta_y5_prd_config_v.yau07:
|
||||
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
|
||||
break
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_v[meta_y5] else STATE_VAL.ERROR
|
||||
else:
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_v[meta_y5] else STATE_VAL.ERROR
|
||||
if node_y5.state == STATE_VAL.ERROR:
|
||||
all_y5_good = false
|
||||
|
||||
block_ip_config_v = control_prd_v.block_ip_config
|
||||
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
|
||||
for power_supply in node_ip_power_arr:
|
||||
var block_ip_config_v: Dictionary = for_result_dic.block_ip_config
|
||||
for power_supply in for_result_dic.node_ip_power_arr:
|
||||
var meta_ip = power_supply.get_meta('ip')
|
||||
if block_ip_config_v.has(meta_ip) and block_kasseta_y5_prd_config_v.ug:
|
||||
if block_ip_config_v.has(meta_ip) and block_kasseta_y5_prd_config_v.ug and block_kasseta_y5_prd_config_v.yau07:
|
||||
power_supply.state = STATE_VAL.GOOD if block_ip_config_v[meta_ip][1] else STATE_VAL.ERROR
|
||||
else:
|
||||
power_supply.state = STATE_VAL.NONE
|
||||
if power_supply.state == STATE_VAL.ERROR:
|
||||
all_y5_good = false
|
||||
|
||||
var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
|
||||
for f in fs_nodes:
|
||||
if not for_result_dic.control_is_over:
|
||||
set_default_state(for_result_dic.default_reset_array_node)
|
||||
set_default_state(for_result_dic.power_amplifier)
|
||||
return
|
||||
var result_dic: Dictionary = for_result_dic.result_dic
|
||||
for f in for_result_dic.fs_nodes:
|
||||
var fs_meta: String = f.get_meta('fs')
|
||||
if result_dic.has(fs_meta):
|
||||
var new_state = result_dic[fs_meta]
|
||||
f.state = new_state
|
||||
result_dic[fs_meta] = new_state
|
||||
f.state = result_dic[fs_meta]
|
||||
|
||||
if result_dic.fs_5 == 1:
|
||||
$kasseta_FS_VD/ref_A2.state = STATE_VAL.GOOD if result_dic.dkm_5 else STATE_VAL.ERROR
|
||||
$dou5_A6.state = STATE_VAL.GOOD if result_dic.dou_5 else STATE_VAL.ERROR
|
||||
else:
|
||||
result_dic.fs_5 = 0
|
||||
if result_dic.fs_4 == 1:
|
||||
$kasseta_FS_VD/ref_A6.state = STATE_VAL.GOOD if result_dic.dkm_4 else STATE_VAL.ERROR
|
||||
$dou4_A5.state = STATE_VAL.GOOD if result_dic.dou_4 else STATE_VAL.ERROR
|
||||
else:
|
||||
result_dic.fs_4 = 0
|
||||
power_fill(power_dic, result_dic)
|
||||
if not all_y5_good: return
|
||||
if result_dic.fs_5 == 1 and block_kasseta_y5_prd_config_v['yau07']:
|
||||
for_result_dic.module_fs_5.state = STATE_VAL.GOOD if result_dic.dkm_5 else STATE_VAL.ERROR
|
||||
for_result_dic.dou_5.state = STATE_VAL.GOOD if result_dic.dou_5 else STATE_VAL.ERROR
|
||||
|
||||
var result = true
|
||||
for device in result_dic.values():
|
||||
if not device:
|
||||
result = false
|
||||
if result_dic.fs_4 == 1 and block_kasseta_y5_prd_config_v['yau07']:
|
||||
for_result_dic.module_fs_4.state = STATE_VAL.GOOD if result_dic.dkm_4 else STATE_VAL.ERROR
|
||||
for_result_dic.dou_4.state = STATE_VAL.GOOD if result_dic.dou_4 else STATE_VAL.ERROR
|
||||
|
||||
var name_prd = control_prd_v.self_name
|
||||
if result:
|
||||
$control_result.text = 'Прибор ПРД-%s исправен' % name_prd
|
||||
$control_result.add_theme_color_override('font_color', Color.GREEN)
|
||||
else:
|
||||
$control_result.text = 'Прибор ПРД-%s неисправен' % name_prd
|
||||
$control_result.add_theme_color_override('font_color', Color.RED)
|
||||
if block_kasseta_y5_prd_config_v['yau07']:
|
||||
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD)
|
||||
|
||||
|
||||
func find_labels(node1: Node):
|
||||
@@ -245,3 +188,22 @@ func find_labels(node1: Node):
|
||||
node1.set_meta("tooltip_set", true)
|
||||
for child in node1.get_children():
|
||||
find_labels(child)
|
||||
|
||||
|
||||
func _on_status_updated(status_text: String) -> void:
|
||||
_update_status_text(status_text)
|
||||
|
||||
|
||||
func _update_status_text(text: String) -> void:
|
||||
$control_result.text = text
|
||||
# Можно добавить смену цвета в зависимости от статуса
|
||||
if "Ошибка" in text or "неисправен" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.RED)
|
||||
log.message(Logger.INFO, 'Прибор ПРД-%s неисправен' % [unit_prd_v.self_name])
|
||||
elif "Ограничена" in text or "Предупреждение" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.YELLOW)
|
||||
elif "исправен" in text or "завершён" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.GREEN)
|
||||
log.message(Logger.INFO, 'Прибор ПРД-%s исправен' % [unit_prd_v.self_name])
|
||||
else:
|
||||
$control_result.add_theme_color_override('font_color', Color.WHITE)
|
||||
|
||||
@@ -1,13 +1,36 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://cvskpe1ti3p45"]
|
||||
[gd_scene load_steps=13 format=3 uid="uid://cvskpe1ti3p45"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cvuosuvjaci1h" path="res://scenes/pribor-prd-v/pribor-prd-v.gd" id="1_c20s6"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_xpo4b"]
|
||||
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="3_wyy1b"]
|
||||
[ext_resource type="PackedScene" uid="uid://bk1655p4e8y4u" path="res://scenes/контроль/кассета-у-5-нв.tscn" id="4_gl2bl"]
|
||||
[ext_resource type="PackedScene" uid="uid://cd5sue1e8iyrv" path="res://scenes/pribor-prd-n/kasseta-fs-nd.tscn" id="5_nhd2k"]
|
||||
[ext_resource type="Script" uid="uid://crpedygm3gohi" path="res://scenes/контроль/кассета.gd" id="6_os4mt"]
|
||||
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="7_38u2b"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcyxqni7gxvtq" path="res://scenes/контроль/блок-в.tscn" id="8_4e87c"]
|
||||
[ext_resource type="Texture2D" uid="uid://belwchvdktrw0" path="res://data/эмс-бланк.png" id="9_4e87c"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwddxs24es81u" path="res://data/эмс-бланк-пост.png" id="10_g8fvp"]
|
||||
[ext_resource type="Texture2D" uid="uid://pfoscstbm025" path="res://data/эмс-бланк-перем.png" id="11_gsby4"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvl3sq036gn75" path="res://data/эмс-бланк-замыкание.png" id="12_vxfkm"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_s5gcy"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("9_4e87c")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("10_g8fvp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("11_gsby4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("12_vxfkm")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="pribor_prd_v" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -18,50 +41,50 @@ offset_right = 15.0
|
||||
offset_bottom = 30.0
|
||||
script = ExtResource("1_c20s6")
|
||||
|
||||
[node name="maa2000_A22" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_xpo4b")]
|
||||
[node name="maa2000_A22" parent="." groups=["power_supply"] instance=ExtResource("2_xpo4b")]
|
||||
layout_mode = 2
|
||||
offset_left = 485.0
|
||||
offset_top = 877.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 949.0
|
||||
offset_left = 524.0
|
||||
offset_top = 731.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 803.0
|
||||
fname = "MAA2000"
|
||||
rname = "A22"
|
||||
metadata/ip = "maa2000_1"
|
||||
|
||||
[node name="dou4_A5" parent="." groups=["default_reset"] instance=ExtResource("2_xpo4b")]
|
||||
layout_mode = 2
|
||||
offset_left = 485.0
|
||||
offset_top = 812.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 877.0
|
||||
offset_left = 524.0
|
||||
offset_top = 666.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 731.0
|
||||
fname = "ДОУ-4"
|
||||
rname = "A5"
|
||||
|
||||
[node name="maa2000_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_xpo4b")]
|
||||
[node name="maa2000_A23" parent="." groups=["power_supply"] instance=ExtResource("2_xpo4b")]
|
||||
layout_mode = 2
|
||||
offset_left = 8.0
|
||||
offset_top = 877.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 949.0
|
||||
offset_left = 47.0
|
||||
offset_top = 731.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 803.0
|
||||
fname = "MAA2000"
|
||||
rname = "A23"
|
||||
metadata/ip = "maa2000_2"
|
||||
|
||||
[node name="dou5_A6" parent="." groups=["default_reset"] instance=ExtResource("2_xpo4b")]
|
||||
layout_mode = 2
|
||||
offset_left = 8.0
|
||||
offset_top = 812.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 877.0
|
||||
offset_left = 47.0
|
||||
offset_top = 666.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 731.0
|
||||
fname = "ДОУ-5"
|
||||
rname = "A6"
|
||||
|
||||
[node name="ref_ZZ3" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 812.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 949.0
|
||||
offset_left = 214.0
|
||||
offset_top = 666.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 803.0
|
||||
texture = ExtResource("3_wyy1b")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
@@ -80,27 +103,98 @@ text = "Панель
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="kasseta_U5" parent="." instance=ExtResource("4_gl2bl")]
|
||||
[node name="kasseta_U5" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 242.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 432.0
|
||||
offset_left = 214.0
|
||||
offset_top = 96.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 286.0
|
||||
texture = ExtResource("3_wyy1b")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
patch_margin_right = 16
|
||||
patch_margin_bottom = 16
|
||||
script = ExtResource("6_os4mt")
|
||||
|
||||
[node name="lbl_fname" type="Label" parent="kasseta_U5"]
|
||||
self_modulate = Color(1, 1, 1, 0.62)
|
||||
layout_mode = 0
|
||||
offset_left = 5.0
|
||||
offset_top = 7.0
|
||||
offset_right = 305.0
|
||||
offset_bottom = 35.0
|
||||
text = "Кассета У5"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ref_A24" parent="kasseta_U5" groups=["power_supply"] instance=ExtResource("7_38u2b")]
|
||||
offset_left = 5.0
|
||||
offset_top = 32.0
|
||||
offset_right = 55.0
|
||||
offset_bottom = 182.0
|
||||
fname = "ИП5-25"
|
||||
rname = "A24"
|
||||
metadata/ip = "ip5_25"
|
||||
|
||||
[node name="ref_A30" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_38u2b")]
|
||||
offset_left = 55.0
|
||||
offset_top = 32.0
|
||||
offset_right = 105.0
|
||||
offset_bottom = 182.0
|
||||
fname = "ЯУ-07Б"
|
||||
rname = "A30"
|
||||
metadata/y5 = "yau07"
|
||||
|
||||
[node name="ref_A26" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_38u2b")]
|
||||
offset_left = 105.0
|
||||
offset_top = 32.0
|
||||
offset_right = 155.0
|
||||
offset_bottom = 182.0
|
||||
fname = "ЭМС-Г"
|
||||
rname = "A26"
|
||||
metadata/y5 = "ems"
|
||||
|
||||
[node name="ref_A27" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_38u2b")]
|
||||
offset_left = 155.0
|
||||
offset_top = 32.0
|
||||
offset_right = 205.0
|
||||
offset_bottom = 182.0
|
||||
fname = "УГ"
|
||||
rname = "A27"
|
||||
metadata/y5 = "ug"
|
||||
|
||||
[node name="ref_A28" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_38u2b")]
|
||||
offset_left = 205.0
|
||||
offset_top = 32.0
|
||||
offset_right = 255.0
|
||||
offset_bottom = 182.0
|
||||
fname = "УКП"
|
||||
rname = "A28"
|
||||
metadata/y5 = "ukp1"
|
||||
|
||||
[node name="ref_A29" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_38u2b")]
|
||||
offset_left = 254.0
|
||||
offset_top = 32.0
|
||||
offset_right = 304.0
|
||||
offset_bottom = 182.0
|
||||
fname = "УКП"
|
||||
rname = "A29"
|
||||
metadata/y5 = "ukp2"
|
||||
|
||||
[node name="kasseta_FS_VD" parent="." instance=ExtResource("5_nhd2k")]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 432.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 622.0
|
||||
offset_left = 214.0
|
||||
offset_top = 286.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 476.0
|
||||
fname = "Кассета ФС-ВД"
|
||||
|
||||
[node name="kasseta_P_1" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = 622.0
|
||||
offset_right = 485.0
|
||||
offset_bottom = 812.0
|
||||
offset_left = 214.0
|
||||
offset_top = 476.0
|
||||
offset_right = 524.0
|
||||
offset_bottom = 666.0
|
||||
texture = ExtResource("3_wyy1b")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
@@ -109,7 +203,7 @@ patch_margin_bottom = 16
|
||||
script = ExtResource("6_os4mt")
|
||||
fname = "Кассета П-1В"
|
||||
|
||||
[node name="ref_A19" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_38u2b")]
|
||||
[node name="ref_A19" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_38u2b")]
|
||||
offset_left = 9.0
|
||||
offset_top = 33.0
|
||||
offset_right = 59.0
|
||||
@@ -118,7 +212,7 @@ fname = "ИП9-50"
|
||||
rname = "A19"
|
||||
metadata/ip = "ip9_50_1"
|
||||
|
||||
[node name="ref_A20" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_38u2b")]
|
||||
[node name="ref_A20" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_38u2b")]
|
||||
offset_left = 59.0
|
||||
offset_top = 33.0
|
||||
offset_right = 109.0
|
||||
@@ -127,7 +221,7 @@ fname = "ИП9-50"
|
||||
rname = "A20"
|
||||
metadata/ip = "ip9_50_2"
|
||||
|
||||
[node name="ref_A21" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_38u2b")]
|
||||
[node name="ref_A21" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_38u2b")]
|
||||
offset_left = 109.0
|
||||
offset_top = 33.0
|
||||
offset_right = 159.0
|
||||
@@ -149,153 +243,178 @@ vertical_alignment = 1
|
||||
|
||||
[node name="um1535_A7" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 242.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 337.0
|
||||
fname = "УМ1535Б"
|
||||
offset_left = 524.0
|
||||
offset_top = 96.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 191.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A7"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_1"
|
||||
|
||||
[node name="um1535_A8" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 337.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 432.0
|
||||
offset_left = 524.0
|
||||
offset_top = 191.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 286.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A8"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_2"
|
||||
|
||||
[node name="um1535_A9" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 432.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 527.0
|
||||
offset_left = 524.0
|
||||
offset_top = 286.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 381.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A9"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_3"
|
||||
|
||||
[node name="um1535_A10" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 527.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 622.0
|
||||
offset_left = 524.0
|
||||
offset_top = 381.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 476.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A10"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_4"
|
||||
|
||||
[node name="um1535_A11" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 622.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 717.0
|
||||
offset_left = 524.0
|
||||
offset_top = 476.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 571.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A11"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_5"
|
||||
|
||||
[node name="um1535_A12" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 485.0
|
||||
offset_top = 717.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 812.0
|
||||
offset_left = 524.0
|
||||
offset_top = 571.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 666.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A12"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_6"
|
||||
|
||||
[node name="um1535_A13" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 242.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 337.0
|
||||
offset_left = 47.0
|
||||
offset_top = 96.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 191.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A13"
|
||||
value0_info = "Мощность, Вт"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_7"
|
||||
|
||||
[node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 337.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 432.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A14"
|
||||
value0_info = "Мощность, Вт"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_8"
|
||||
|
||||
[node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 432.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 527.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A15"
|
||||
value0_info = "Мощность, Вт"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_9"
|
||||
|
||||
[node name="um1535_A16" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
[node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 527.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 622.0
|
||||
offset_left = 47.0
|
||||
offset_top = 191.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 286.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A16"
|
||||
value0_info = "Мощность, Вт"
|
||||
rname = "A14"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_10"
|
||||
|
||||
[node name="um1535_A17" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
[node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 622.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 717.0
|
||||
offset_left = 47.0
|
||||
offset_top = 286.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 381.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A17"
|
||||
value0_info = "Мощность, Вт"
|
||||
rname = "A15"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_11"
|
||||
|
||||
[node name="um1535_A18" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
[node name="um1535_A16" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 717.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 812.0
|
||||
offset_left = 47.0
|
||||
offset_top = 381.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 476.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A18"
|
||||
value0_info = "Мощность, Вт"
|
||||
rname = "A16"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_12"
|
||||
|
||||
[node name="um1535_A17" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 47.0
|
||||
offset_top = 476.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 571.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A17"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_13"
|
||||
|
||||
[node name="um1535_A18" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
|
||||
layout_mode = 0
|
||||
offset_left = 47.0
|
||||
offset_top = 571.0
|
||||
offset_right = 214.0
|
||||
offset_bottom = 666.0
|
||||
fname = "УМ1535А"
|
||||
rname = "A18"
|
||||
value0_info = "Мощность"
|
||||
value1_info = "Температура,°C"
|
||||
metadata/um = "um_14"
|
||||
|
||||
[node name="input_0" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(496, 440)
|
||||
sprite_frames = SubResource("SpriteFrames_s5gcy")
|
||||
|
||||
[node name="input_1" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(248, 440)
|
||||
sprite_frames = SubResource("SpriteFrames_s5gcy")
|
||||
|
||||
[node name="output_0" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(496, 336)
|
||||
sprite_frames = SubResource("SpriteFrames_s5gcy")
|
||||
|
||||
[node name="output_1" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(248, 336)
|
||||
sprite_frames = SubResource("SpriteFrames_s5gcy")
|
||||
|
||||
[node name="line" type="Line2D" parent="."]
|
||||
position = Vector2(59, 920)
|
||||
scale = Vector2(1.03548, 1)
|
||||
points = PackedVector2Array(-8, 0, 61.8069, 0, 608, 0)
|
||||
width = 2.0
|
||||
default_color = Color(1, 1, 1, 0.352941)
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="control_result" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 9.0
|
||||
offset_top = 960.0
|
||||
offset_right = 649.0
|
||||
offset_bottom = 1003.0
|
||||
offset_left = 49.0
|
||||
offset_top = 993.0
|
||||
offset_right = 689.0
|
||||
offset_bottom = 1036.0
|
||||
theme_override_font_sizes/font_size = 22
|
||||
horizontal_alignment = 1
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
@@ -20,9 +20,9 @@ func _ready() -> void:
|
||||
|
||||
func on_timer(unit_name: StringName):
|
||||
var unit_uf = network.get_unit_instance(unit_name)
|
||||
status_uf() # отслеживание состояния прибора
|
||||
if unit_uf.online: # проверка ЯУ, внутреннего коммутатора и ИП-5Б
|
||||
control_ems(unit_uf.status) # проверка ЭМС ячеек
|
||||
status_uf() # отслеживание состояния прибора
|
||||
|
||||
|
||||
func on_line_changed(unit_uf):
|
||||
@@ -100,7 +100,7 @@ func status_uf() -> void:
|
||||
$lbl_header2.text = 'Прибор исправен'
|
||||
$lbl_header2.modulate = Color.GREEN
|
||||
else:
|
||||
$lbl_header2.text = 'Прибор не исправен'
|
||||
$lbl_header2.text = 'Прибор неисправен'
|
||||
$lbl_header2.modulate = Color.RED
|
||||
$lbl_header2.visible = true
|
||||
|
||||
|
||||
@@ -7,14 +7,16 @@
|
||||
[node name="pribor_uf" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_left = -121.0
|
||||
offset_right = -121.0
|
||||
script = ExtResource("1_7gtpa")
|
||||
|
||||
[node name="ref_uf" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 187.0
|
||||
offset_top = 247.0
|
||||
offset_right = 708.0
|
||||
offset_bottom = 955.0
|
||||
offset_left = 244.0
|
||||
offset_top = 128.0
|
||||
offset_right = 765.0
|
||||
offset_bottom = 836.0
|
||||
texture = ExtResource("2_ho0da")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
@@ -142,19 +144,25 @@ offset_bottom = 35.0
|
||||
text = "Кассета В-13"
|
||||
|
||||
[node name="lbl_header2" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 199.0
|
||||
offset_top = 974.0
|
||||
offset_right = 704.0
|
||||
offset_bottom = 1000.0
|
||||
offset_left = 252.0
|
||||
offset_top = 1009.0
|
||||
offset_right = 757.0
|
||||
offset_bottom = 1064.0
|
||||
theme_override_font_sizes/font_size = 22
|
||||
text = "Прибор не исправен
|
||||
"
|
||||
text = "Состояние неизвестно..."
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="timer" type="Timer" parent="."]
|
||||
autostart = true
|
||||
|
||||
[node name="line" type="Line2D" parent="."]
|
||||
position = Vector2(195, 950)
|
||||
scale = Vector2(1.03548, 1)
|
||||
points = PackedVector2Array(-8, 0, 61.8069, 0, 608, 0)
|
||||
width = 2.0
|
||||
default_color = Color(1, 1, 1, 0.352941)
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[connection signal="timeout" from="timer" to="." method="on_timer" binds= [&"уарэп-эмс"]]
|
||||
|
||||
@@ -17,10 +17,10 @@ script = ExtResource("1_46rp6")
|
||||
|
||||
[node name="ref_G1" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 70.0
|
||||
offset_top = 303.0
|
||||
offset_right = 660.0
|
||||
offset_bottom = 1085.0
|
||||
offset_left = 88.0
|
||||
offset_top = 128.0
|
||||
offset_right = 678.0
|
||||
offset_bottom = 910.0
|
||||
texture = ExtResource("1_6olof")
|
||||
patch_margin_left = 16
|
||||
patch_margin_top = 16
|
||||
@@ -29,10 +29,10 @@ patch_margin_bottom = 16
|
||||
|
||||
[node name="spt25_A1" parent="." instance=ExtResource("6_60xs3")]
|
||||
layout_mode = 0
|
||||
offset_left = 88.0
|
||||
offset_top = 319.0
|
||||
offset_right = 343.0
|
||||
offset_bottom = 749.0
|
||||
offset_left = 106.0
|
||||
offset_top = 144.0
|
||||
offset_right = 361.0
|
||||
offset_bottom = 574.0
|
||||
tooltip_text = "Ящик - 11, Позиция - 3"
|
||||
script = ExtResource("4_v0lil")
|
||||
unit_name = "уарэп-спт25-1"
|
||||
@@ -64,10 +64,10 @@ offset_bottom = 417.0
|
||||
|
||||
[node name="spt25_A2" parent="." instance=ExtResource("6_60xs3")]
|
||||
layout_mode = 0
|
||||
offset_left = 392.0
|
||||
offset_top = 320.0
|
||||
offset_right = 642.0
|
||||
offset_bottom = 750.0
|
||||
offset_left = 410.0
|
||||
offset_top = 145.0
|
||||
offset_right = 660.0
|
||||
offset_bottom = 575.0
|
||||
tooltip_text = "Ящик - 11, Позиция - 2"
|
||||
script = ExtResource("4_v0lil")
|
||||
unit_name = "уарэп-спт25-2"
|
||||
@@ -98,10 +98,10 @@ offset_right = 235.0
|
||||
offset_bottom = 417.0
|
||||
|
||||
[node name="sch3" parent="." instance=ExtResource("7_qu7ja")]
|
||||
offset_left = 88.0
|
||||
offset_top = 774.0
|
||||
offset_right = 643.0
|
||||
offset_bottom = 1059.0
|
||||
offset_left = 106.0
|
||||
offset_top = 599.0
|
||||
offset_right = 661.0
|
||||
offset_bottom = 884.0
|
||||
unit_name = "уарэп-щ3"
|
||||
fname = "Щ3 (контроль и управление питанием)"
|
||||
rname = "A1"
|
||||
|
||||
@@ -32,29 +32,29 @@ func disable_all():
|
||||
func on_data_received(data: PackedByteArray):
|
||||
|
||||
# Сеть 1. Использование
|
||||
$block_input1.state = STATE_VAL.GOOD if data[4] & (1 << 5) else STATE_VAL.ERROR
|
||||
$block_input1.state = STATE_VAL.GOOD if data[3] & (1 << 5) else STATE_VAL.ERROR
|
||||
# Сеть 1. Вход
|
||||
$block_input1.state0 = STATE_VAL.GOOD if ((data[4] & (1 << 1)) == 0) and ((data[4] & (1 << 3)) == 0) else STATE_VAL.ERROR
|
||||
$block_input1.state0 = STATE_VAL.GOOD if ((data[3] & (1 << 1)) == 0) and ((data[3] & (1 << 3)) == 0) else STATE_VAL.ERROR
|
||||
# Сеть 1. Неисправность блока инвертора 1 канала
|
||||
$block_input1.state1 = STATE_VAL.GOOD if (data[6] & (1 << 2)) == 0 else STATE_VAL.ERROR
|
||||
$block_input1.state1 = STATE_VAL.GOOD if (data[5] & (1 << 2)) == 0 else STATE_VAL.ERROR
|
||||
# Сеть 1. Перегрев 1 канала
|
||||
$block_input1.state2 = STATE_VAL.GOOD if (data[5] & (1 << 3)) == 0 else STATE_VAL.ERROR
|
||||
$block_input1.state2 = STATE_VAL.GOOD if (data[4] & (1 << 3)) == 0 else STATE_VAL.ERROR
|
||||
|
||||
# Сеть 2. Использование
|
||||
$block_input2.state = STATE_VAL.GOOD if data[4] & (1 << 6) else STATE_VAL.ERROR
|
||||
$block_input2.state = STATE_VAL.GOOD if data[3] & (1 << 6) else STATE_VAL.ERROR
|
||||
# Сеть 2. Вход
|
||||
$block_input2.state0 = STATE_VAL.GOOD if ((data[4] & (1 << 2)) == 0) and ((data[4] & (1 << 4)) == 0) else STATE_VAL.ERROR
|
||||
$block_input2.state0 = STATE_VAL.GOOD if ((data[3] & (1 << 2)) == 0) and ((data[3] & (1 << 4)) == 0) else STATE_VAL.ERROR
|
||||
# Сеть 2. Неисправность блока инвертора 2 канала
|
||||
$block_input2.state1 = STATE_VAL.GOOD if (data[6] & (1 << 3)) == 0 else STATE_VAL.ERROR
|
||||
$block_input2.state1 = STATE_VAL.GOOD if (data[5] & (1 << 3)) == 0 else STATE_VAL.ERROR
|
||||
# Сеть 2. Перегрев 2 канала
|
||||
$block_input2.state2 = STATE_VAL.GOOD if (data[5] & (1 << 4)) == 0 else STATE_VAL.ERROR
|
||||
$block_input2.state2 = STATE_VAL.GOOD if (data[4] & (1 << 4)) == 0 else STATE_VAL.ERROR
|
||||
|
||||
# Неисправность, напряжение меньше номинального, напряжение выше номинального
|
||||
$block_output.state0 = STATE_VAL.GOOD if ((data[4] & (1 << 0)) == 0) and ((data[4] & (1 << 7)) == 0) and ((data[5] & (1 << 2)) == 0) else STATE_VAL.ERROR
|
||||
$block_output.state0 = STATE_VAL.GOOD if ((data[3] & (1 << 0)) == 0) and ((data[3] & (1 << 7)) == 0) and ((data[4] & (1 << 2)) == 0) else STATE_VAL.ERROR
|
||||
# Перегрузка и короткое замыкание по выходу
|
||||
$block_output.state1 = STATE_VAL.GOOD if ((data[5] & (1 << 0)) == 0) and ((data[5] & (1 << 1)) == 0) else STATE_VAL.ERROR
|
||||
$block_output.state1 = STATE_VAL.GOOD if ((data[4] & (1 << 0)) == 0) and ((data[4] & (1 << 1)) == 0) else STATE_VAL.ERROR
|
||||
# Критическая температура
|
||||
$block_output.state2 = STATE_VAL.GOOD if ((data[5] & (1 << 5)) == 0) else STATE_VAL.ERROR
|
||||
$block_output.state2 = STATE_VAL.GOOD if ((data[4] & (1 << 5)) == 0) else STATE_VAL.ERROR
|
||||
|
||||
# Обобщённое состояние
|
||||
state = STATE_VAL.GOOD \
|
||||
|
||||
@@ -1,48 +1,208 @@
|
||||
extends Label
|
||||
# Используем более понятные имена переменных
|
||||
const STATUS_GOOD := {"text": "Исправно", "color": Color.GREEN, "font_color": Color.BLACK}
|
||||
const STATUS_BAD := {"text": "Отказ", "color": Color.RED, "font_color": Color.WHITE}
|
||||
var _is_uf_status_initialized: bool = false
|
||||
var is_prd_operational: bool = true
|
||||
var is_uf_operational: bool = false
|
||||
|
||||
enum PRD_STATE {
|
||||
NONE, # Нет связи
|
||||
GOOD, # Исправно
|
||||
ERR # Отказ
|
||||
}
|
||||
|
||||
enum DEVICE_STATUS {
|
||||
ONLINE, # Связь есть
|
||||
STATUS, # Статус исправности
|
||||
CONTROL # Контроль завершен
|
||||
}
|
||||
|
||||
const STATUS_CONFIG := {
|
||||
PRD_STATE.NONE: {"text": "Нет связи", "color": Color.WHITE, "font_color": Color.BLACK},
|
||||
PRD_STATE.GOOD: {"text": "Исправно", "color": Color.GREEN, "font_color": Color.BLACK},
|
||||
PRD_STATE.ERR: {"text": "Отказ", "color": Color.RED, "font_color": Color.WHITE}
|
||||
}
|
||||
|
||||
class DeviceObserver:
|
||||
var device_name: String
|
||||
var status: Array = [false, false, false] # [online, operational, control_complete]
|
||||
var last_results: Dictionary = {}
|
||||
|
||||
func update_online_state(online: bool) -> bool:
|
||||
if status[DEVICE_STATUS.ONLINE] != online:
|
||||
status[DEVICE_STATUS.ONLINE] = online
|
||||
return true
|
||||
return false
|
||||
|
||||
func update_control_results(results: Dictionary) -> bool:
|
||||
var changed := false
|
||||
last_results = results.duplicate()
|
||||
|
||||
if results.get('is_over_control', false):
|
||||
# Контроль завершен - проверяем все результаты
|
||||
var all_ok := true
|
||||
for key in results:
|
||||
if key != 'is_over_control' and not results[key]:
|
||||
all_ok = false
|
||||
break
|
||||
|
||||
if status[DEVICE_STATUS.STATUS] != all_ok or status[DEVICE_STATUS.CONTROL] != true:
|
||||
status[DEVICE_STATUS.STATUS] = all_ok
|
||||
status[DEVICE_STATUS.CONTROL] = true
|
||||
changed = true
|
||||
else:
|
||||
# Контроль в процессе - проверяем базовые параметры
|
||||
var basic_ok: bool = results.get('block_kasseta', false) and \
|
||||
results.get('block_ip', false) and \
|
||||
results.get('temperature', true)
|
||||
|
||||
if status[DEVICE_STATUS.STATUS] != basic_ok or status[DEVICE_STATUS.CONTROL] != false:
|
||||
status[DEVICE_STATUS.STATUS] = basic_ok
|
||||
status[DEVICE_STATUS.CONTROL] = false
|
||||
changed = true
|
||||
return changed
|
||||
|
||||
var device_observers: Dictionary = {}
|
||||
var overall_prd_state: PRD_STATE = PRD_STATE.NONE
|
||||
|
||||
func _ready() -> void:
|
||||
tooltip_text = 'Нет связи с приборами комплекса'
|
||||
for prd_module in prd.prd_dict.values():
|
||||
prd_module.connect('update_serviceability', Callable(self, 'on_serviceability_changed').bind(prd_module))
|
||||
var unit_uf: = network.get_unit_instance('уарэп-эмс')
|
||||
unit_uf.connect('data_received', Callable(self, 'on_uf_status_receive'))
|
||||
add_theme_color_override("font_color", Color.BLACK)
|
||||
|
||||
|
||||
func on_serviceability_changed(unit_prd_module: Object) -> void:
|
||||
var check_service: bool = true
|
||||
|
||||
# Инициализация наблюдателей
|
||||
_initialize_observers()
|
||||
|
||||
# Подписка на сигналы ПРД модулей
|
||||
for prd_module in prd.prd_dict.values():
|
||||
if prd_module.unit_yau07.online:
|
||||
if not unit_prd_module.serviceability:
|
||||
check_service = false
|
||||
if check_service != is_prd_operational:
|
||||
is_prd_operational = check_service
|
||||
_update_serviceability_display()
|
||||
# Подключаемся к контролю ПРД
|
||||
if prd_module.unit_control:
|
||||
prd_module.unit_control.connect('control_results_updated', Callable(self, '_on_prd_control_results').bind(prd_module))
|
||||
# Подключаемся к онлайн-статусу ЯУ-07
|
||||
if prd_module.unit_yau07:
|
||||
prd_module.unit_yau07.connect('line_changed', Callable(self, '_on_prd_online_changed').bind(prd_module))
|
||||
|
||||
# Подписка на УФ
|
||||
var unit_uf = network.get_unit_instance('уарэп-эмс')
|
||||
if unit_uf:
|
||||
unit_uf.data_received.connect(Callable(self, '_on_uf_status_receive'))
|
||||
|
||||
# Инициализация начального состояния
|
||||
_recalculate_overall_state()
|
||||
|
||||
|
||||
func _update_serviceability_display() -> void:
|
||||
var status := STATUS_GOOD if (is_uf_operational and is_prd_operational) else STATUS_BAD
|
||||
text = status.text
|
||||
modulate = status.color
|
||||
tooltip_text = 'Результаты обобщенного признака работоспособности изделия'
|
||||
add_theme_color_override("font_color", status.font_color)
|
||||
func _initialize_observers() -> void:
|
||||
var device_names := [
|
||||
'уарэп-яу07-1н', 'уарэп-яу07-1в', 'уарэп-яу07-1к',
|
||||
'уарэп-яу07-2н', 'уарэп-яу07-2в', 'уарэп-яу07-2к',
|
||||
'уарэп-яу07-3н', 'уарэп-яу07-3в', 'уарэп-яу07-3к',
|
||||
'уарэп-яу07-4н', 'уарэп-яу07-4в', 'уарэп-яу07-4к'
|
||||
]
|
||||
|
||||
for device_name in device_names:
|
||||
device_observers[device_name] = DeviceObserver.new()
|
||||
device_observers[device_name].device_name = device_name
|
||||
|
||||
|
||||
func on_uf_status_receive(unit_uf: Object) -> void:
|
||||
var KEMS_B = ((unit_uf.status[0] >> 0) & 1) and ((unit_uf.status[0] >> 3) & 1)
|
||||
var EMS_B_1 = ((unit_uf.status[0] >> 1) & 1) and ((unit_uf.status[0] >> 4) & 1)
|
||||
var EMS_B_2 = ((unit_uf.status[0] >> 2) & 1) and ((unit_uf.status[0] >> 5) & 1)
|
||||
var IP27B = ((unit_uf.status[2] >> 6) & 1)
|
||||
var check_service: bool = KEMS_B and EMS_B_1 and EMS_B_2 and IP27B
|
||||
if not _is_uf_status_initialized or check_service != is_uf_operational:
|
||||
is_uf_operational = check_service
|
||||
_update_serviceability_display()
|
||||
signaller.emit_signal('update_uf_serviceability', check_service)
|
||||
_is_uf_status_initialized = true
|
||||
func _on_prd_online_changed(line_status: Object, prd_module: Object) -> void:
|
||||
var online: bool = line_status.online
|
||||
var observer: DeviceObserver = device_observers.get(prd_module.prd_name)
|
||||
if observer and observer.update_online_state(online):
|
||||
_recalculate_overall_state()
|
||||
|
||||
|
||||
func _on_prd_control_results(results: Dictionary, prd_module: Object) -> void:
|
||||
var observer: DeviceObserver = device_observers.get(prd_module.prd_name)
|
||||
if observer and observer.update_control_results(results):
|
||||
_recalculate_overall_state()
|
||||
|
||||
|
||||
func _on_uf_status_receive(_unit_uf: Object) -> void:
|
||||
# Логика для УФ (раскомментируй если нужно)
|
||||
# var KEMS_B = ((unit_uf.status[0] >> 0) & 1) and ((unit_uf.status[0] >> 3) & 1)
|
||||
# var EMS_B_1 = ((unit_uf.status[0] >> 1) & 1) and ((unit_uf.status[0] >> 4) & 1)
|
||||
# var EMS_B_2 = ((unit_uf.status[0] >> 2) & 1) and ((unit_uf.status[0] >> 5) & 1)
|
||||
# var IP27B = ((unit_uf.status[2] >> 6) & 1)
|
||||
# var uf_operational = KEMS_B and EMS_B_1 and EMS_B_2 and IP27B
|
||||
# signaller.emit_signal('update_uf_serviceability', uf_operational)
|
||||
pass
|
||||
|
||||
|
||||
func _recalculate_overall_state() -> void:
|
||||
var new_state := PRD_STATE.NONE
|
||||
var has_online_devices := false
|
||||
var all_operational := true
|
||||
|
||||
for observer in device_observers.values():
|
||||
if observer.status[DEVICE_STATUS.ONLINE]:
|
||||
has_online_devices = true
|
||||
|
||||
if observer.status[DEVICE_STATUS.CONTROL]:
|
||||
# Если контроль завершен - строгая проверка
|
||||
if not observer.status[DEVICE_STATUS.STATUS]:
|
||||
all_operational = false
|
||||
break
|
||||
else:
|
||||
# Если контроль в процессе - мягкая проверка
|
||||
if not observer.status[DEVICE_STATUS.STATUS]:
|
||||
all_operational = false
|
||||
# Не прерываем, чтобы проверить все устройства
|
||||
|
||||
if has_online_devices:
|
||||
new_state = PRD_STATE.GOOD if all_operational else PRD_STATE.ERR
|
||||
else:
|
||||
new_state = PRD_STATE.NONE
|
||||
|
||||
if overall_prd_state != new_state:
|
||||
overall_prd_state = new_state
|
||||
_update_display()
|
||||
|
||||
|
||||
func _update_display() -> void:
|
||||
var config: Dictionary = STATUS_CONFIG[overall_prd_state].duplicate()
|
||||
|
||||
text = config.text
|
||||
modulate = config.color
|
||||
add_theme_color_override("font_color", config.font_color)
|
||||
tooltip_text = _get_tooltip_text()
|
||||
|
||||
|
||||
func _get_tooltip_text() -> String:
|
||||
match overall_prd_state:
|
||||
PRD_STATE.NONE:
|
||||
return "Нет связи с приборами комплекса"
|
||||
PRD_STATE.GOOD:
|
||||
return "Все приборы комплекса исправны"
|
||||
PRD_STATE.ERR:
|
||||
return "Обнаружены неисправности в комплексе"
|
||||
_:
|
||||
return "Неизвестное состояние"
|
||||
|
||||
|
||||
# Публичные методы для получения информации
|
||||
func get_device_status(device_name: String) -> Dictionary:
|
||||
var observer: DeviceObserver = device_observers.get(device_name)
|
||||
if observer:
|
||||
return {
|
||||
"online": observer.status[DEVICE_STATUS.ONLINE],
|
||||
"operational": observer.status[DEVICE_STATUS.STATUS],
|
||||
"control_complete": observer.status[DEVICE_STATUS.CONTROL],
|
||||
"last_results": observer.last_results.duplicate()
|
||||
}
|
||||
return {}
|
||||
|
||||
|
||||
func get_overall_status() -> Dictionary:
|
||||
var online_count := 0
|
||||
var operational_count := 0
|
||||
var control_complete_count := 0
|
||||
|
||||
for observer in device_observers.values():
|
||||
if observer.status[DEVICE_STATUS.ONLINE]:
|
||||
online_count += 1
|
||||
if observer.status[DEVICE_STATUS.STATUS]:
|
||||
operational_count += 1
|
||||
if observer.status[DEVICE_STATUS.CONTROL]:
|
||||
control_complete_count += 1
|
||||
|
||||
return {
|
||||
"overall_state": overall_prd_state,
|
||||
"online_devices": online_count,
|
||||
"operational_devices": operational_count,
|
||||
"total_devices": device_observers.size(),
|
||||
"control_complete_devices": control_complete_count
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://b5ykwyk5vpi6
|
||||
uid://b5ykwyk5vpi6
|
||||
|
||||
@@ -79,25 +79,10 @@ visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 5
|
||||
|
||||
[node name="lbl_ready" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1503.0
|
||||
offset_right = 1600.0
|
||||
offset_bottom = 27.0
|
||||
tooltip_text = "Готовность аппаратуры к работе"
|
||||
mouse_filter = 0
|
||||
theme_override_font_sizes/font_size = 14
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_o1r22")
|
||||
text = "Нет связи"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
script = ExtResource("8_tidwt")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="remote_control" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 1244.0
|
||||
offset_right = 1401.0
|
||||
offset_left = 1242.0
|
||||
offset_right = 1402.0
|
||||
offset_bottom = 27.0
|
||||
tooltip_text = "Комплекс находится под внешним управлением"
|
||||
mouse_filter = 0
|
||||
@@ -109,7 +94,7 @@ vertical_alignment = 1
|
||||
|
||||
[node name="тренаж_режим" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1404.0
|
||||
offset_left = 1405.0
|
||||
offset_right = 1501.0
|
||||
offset_bottom = 27.0
|
||||
tooltip_text = "Задействовать режим Тренаж"
|
||||
@@ -125,5 +110,20 @@ toggle_mode = true
|
||||
text = "Тренаж"
|
||||
script = ExtResource("9_41d34")
|
||||
|
||||
[node name="lbl_ready" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1504.0
|
||||
offset_right = 1600.0
|
||||
offset_bottom = 27.0
|
||||
tooltip_text = "Готовность аппаратуры к работе"
|
||||
mouse_filter = 0
|
||||
theme_override_font_sizes/font_size = 14
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_o1r22")
|
||||
text = "Нет связи"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
script = ExtResource("8_tidwt")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[connection signal="tab_changed" from="tab_switch" to="tab_switch" method="_on_tab_changed"]
|
||||
[connection signal="toggled" from="тренаж_режим" to="tab_switch" method="_on_button_trenaj_toggled"]
|
||||
[connection signal="toggled" from="тренаж_режим" to="tab_switch" method="_on_button_trenazh_toggled"]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
extends Button
|
||||
|
||||
func _ready():
|
||||
connect("toggled", Callable(self, "_on_button_toggled"))
|
||||
|
||||
|
||||
func _on_button_toggled(mode: bool):
|
||||
if mode:
|
||||
tooltip_text = "Режим \"Тренаж\" задействован\nТекущее состояние: включено"
|
||||
else:
|
||||
tooltip_text = "Задейстовать режим \"Тренаж\"\nТекущее состояние: отключено"
|
||||
extends Button
|
||||
|
||||
func _ready():
|
||||
connect("toggled", Callable(self, "_on_button_toggled"))
|
||||
|
||||
|
||||
func _on_button_toggled(mode: bool):
|
||||
if mode:
|
||||
tooltip_text = "Режим \"Тренаж\" задействован\nТекущее состояние: включено"
|
||||
else:
|
||||
tooltip_text = "Задейстовать режим \"Тренаж\"\nТекущее состояние: отключено"
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://roajn6c6wvc1
|
||||
uid://roajn6c6wvc1
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.7 KiB |
@@ -3,6 +3,5 @@
|
||||
[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")
|
||||
|
||||
@@ -373,7 +373,7 @@ func _process(delta) -> void:
|
||||
remove_child(req)
|
||||
req.queue_free()
|
||||
_req_count -= 1
|
||||
push_error('запрос \"%s\" не отправлен' % tile.url)
|
||||
push_error('запрос \"%s\" не отправлен' % tile.url) #TODO: For Deugs
|
||||
if _queue.is_empty():
|
||||
emit_signal('load_completed')
|
||||
|
||||
@@ -717,7 +717,7 @@ func set_coordinates(lon: float, lat: float, course: float) -> void:
|
||||
add_mark_from_lon_lat(ship_id, lon, lat, ship_instance, 0.0)
|
||||
else:
|
||||
_marks[ship_id].position = lonlat_to_world(lon, lat)
|
||||
ship_instance.rotation_degrees = fmod(270.0 + course, 360.0)
|
||||
ship_instance.rotation_degrees = fmod(course, 360.0)
|
||||
queue_redraw()
|
||||
|
||||
|
||||
@@ -727,7 +727,7 @@ func blend_mask(val: bool) -> void:
|
||||
|
||||
|
||||
func update_coordinates_label(lon: float, lat: float) -> void:
|
||||
coordinates_label = 'Координаты:\nNS:%f\nEW:%f' % [lat, lon]
|
||||
coordinates_label = 'Координаты: NS:%f, EW:%f' % [lat, lon]
|
||||
signaller.emit_signal('update_coordinates_map', coordinates_label)
|
||||
|
||||
|
||||
|
||||
80
scenes/контроль/control_prd.gd
Normal file
@@ -0,0 +1,80 @@
|
||||
extends Button
|
||||
|
||||
var base_style: StyleBoxFlat
|
||||
var tween
|
||||
var pulsing: bool = false
|
||||
var original_text: String
|
||||
|
||||
|
||||
func _ready():
|
||||
original_text = text
|
||||
_setup_styles()
|
||||
_setup_signals()
|
||||
|
||||
|
||||
func _setup_styles() -> void:
|
||||
if get("theme_override_styles/disabled") == null:
|
||||
base_style = StyleBoxFlat.new()
|
||||
base_style.border_color = Color(1.0, 0.5, 0.0)
|
||||
base_style.border_width_top = 4
|
||||
base_style.border_width_bottom = 4
|
||||
base_style.border_width_left = 4
|
||||
base_style.border_width_right = 4
|
||||
base_style.bg_color = Color(0.2, 0.2, 0.2)
|
||||
set("theme_override_styles/disabled", base_style)
|
||||
else:
|
||||
base_style = get("theme_override_styles/disabled")
|
||||
set("theme_override_colors/font_disabled_color", Color(1.0, 1.0, 1.0))
|
||||
|
||||
|
||||
func _setup_signals() -> void:
|
||||
connect("pressed", Callable(self, "_on_pressed"))
|
||||
|
||||
if not signaller:
|
||||
return
|
||||
var signals_to_connect := ["режим_работа", "режим_журнал", "режим_эмс", "режим_настройки", "режим_контроль"]
|
||||
for signal_name in signals_to_connect:
|
||||
if signaller.has_signal(signal_name):
|
||||
signaller.connect(signal_name, Callable(self, "_on_status_change"))
|
||||
|
||||
|
||||
func _on_pressed():
|
||||
disabled = true
|
||||
text = "Идет выполнение контроля"
|
||||
_start_pulse()
|
||||
|
||||
|
||||
func _start_pulse():
|
||||
if pulsing:
|
||||
return
|
||||
pulsing = true
|
||||
tween = create_tween()
|
||||
tween.set_loops()
|
||||
var color1 = Color(1.0, 0.5, 0.0) # оранжевый
|
||||
var color2 = Color(0.4, 0.4, 0.4) # серый
|
||||
tween.tween_property(base_style, "border_color", color2, 0.5)\
|
||||
.set_trans(Tween.TRANS_SINE)\
|
||||
.set_ease(Tween.EASE_IN_OUT)
|
||||
tween.tween_property(base_style, "border_color", color1, 0.5)\
|
||||
.set_trans(Tween.TRANS_SINE)\
|
||||
.set_ease(Tween.EASE_IN_OUT)
|
||||
|
||||
|
||||
func _stop_pulse():
|
||||
if tween:
|
||||
tween.kill()
|
||||
tween = null
|
||||
base_style.border_color = Color(1.0, 0.5, 0.0)
|
||||
pulsing = false
|
||||
disabled = false
|
||||
text = original_text
|
||||
tooltip_text = ''
|
||||
|
||||
|
||||
func _on_status_change():
|
||||
_stop_pulse()
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if tween:
|
||||
tween.kill()
|
||||
1
scenes/контроль/control_prd.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://xjs7owe2iexn
|
||||
@@ -35,7 +35,7 @@ signal pressed(control: PanelContainer)
|
||||
if not is_inside_tree():
|
||||
return
|
||||
$margin/vbox/grid1/level7.value = v
|
||||
$margin/vbox/grid1/level7.tint_progress = Color.RED if v > 70 else Color.WHITE
|
||||
$margin/vbox/grid1/level7.tint_progress = Color.RED if v >= 50 else Color.GOLD if v >= 40 else Color.WHITE
|
||||
|
||||
|
||||
@export var min_value0: float:
|
||||
@@ -191,8 +191,8 @@ func _enter_tree_defered():
|
||||
$margin/vbox/grid0/rname.text = rname
|
||||
$margin/vbox/grid0/fname.text = fname
|
||||
$margin/vbox/grid0/state.texture = textures[state]
|
||||
else:
|
||||
push_warning('обращение к %s вне дерева' % self)
|
||||
#else:
|
||||
#push_warning('обращение к %s вне дерева' % self) TODO: пишеться только когда заходишь в проект а дальше не используется
|
||||
|
||||
|
||||
func get_level_nodes() -> Array:
|
||||
@@ -273,10 +273,9 @@ theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u")
|
||||
script = SubResource("GDScript_oj3k3")
|
||||
textures = [ExtResource("1_n1aqt"), ExtResource("2_rim3u"), ExtResource("3_3w8fg")]
|
||||
value0 = [20.0, 30.0, 40.0, 50.0, 60.0, 70.0]
|
||||
value1 = 56.0
|
||||
min_value1 = -50.0
|
||||
max_value0 = 100.0
|
||||
max_value1 = 120.0
|
||||
min_value1 = -40.0
|
||||
max_value0 = 1400.0
|
||||
max_value1 = 55.0
|
||||
step0 = 1.0
|
||||
step1 = 1.0
|
||||
value_name0 = "P,%"
|
||||
@@ -476,12 +475,11 @@ layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
tooltip_text = "
|
||||
Текущее: 56.00
|
||||
Диапазон: -50.00…120.00"
|
||||
Текущее: 0.00
|
||||
Диапазон: -40.00…55.00"
|
||||
mouse_filter = 0
|
||||
min_value = -50.0
|
||||
max_value = 120.0
|
||||
value = 56.0
|
||||
min_value = -40.0
|
||||
max_value = 55.0
|
||||
fill_mode = 3
|
||||
nine_patch_stretch = true
|
||||
stretch_margin_left = 8
|
||||
|
||||
410
scenes/контроль/блок-к.tscn
Normal file
@@ -0,0 +1,410 @@
|
||||
[gd_scene load_steps=15 format=3 uid="uid://ffi1njkjceb5"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="1_uojqc"]
|
||||
[ext_resource type="Texture2D" uid="uid://dnreyfh3cd1k2" path="res://data/состояние-исправности-1.png" id="2_a8ar3"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6booa8753u5t" path="res://data/состояние-исправности-2.png" id="3_xwd13"]
|
||||
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="4_eobkx"]
|
||||
[ext_resource type="Texture2D" uid="uid://00871pb6moln" path="res://data/прогресс-фон-1.png" id="5_mg57e"]
|
||||
[ext_resource type="Texture2D" uid="uid://c1k856fxhrjnh" path="res://data/прогресс-заполнение-1.png" id="6_of7rd"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3nd2u"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_oj3k3"]
|
||||
script/source = "@tool
|
||||
class_name blok_v extends PanelContainer
|
||||
|
||||
@export var textures: Array
|
||||
@export var animation_duration: float = 1.5
|
||||
signal pressed(control: PanelContainer)
|
||||
|
||||
|
||||
## Значения уровней
|
||||
@export var value0: Array:
|
||||
set(v):
|
||||
value0.assign(v)
|
||||
var items: Array = get_level_nodes()
|
||||
var count: int = min(items.size(), v.size())
|
||||
for i in count:
|
||||
set_value0_animated(items[i], v[i])
|
||||
|
||||
|
||||
## Значение уровня
|
||||
@export var value1: float:
|
||||
set(v):
|
||||
value1 = v
|
||||
if not is_inside_tree():
|
||||
return
|
||||
$margin/vbox/grid1/level7.value = v
|
||||
$margin/vbox/grid1/level7.tint_progress = Color.RED if v >= 50 else Color.GOLD if v >= 40 else Color.WHITE
|
||||
|
||||
|
||||
@export var min_value0: float:
|
||||
set(v):
|
||||
min_value0 = v
|
||||
var items: = get_level_nodes()
|
||||
set_group_param(items, 'min_value', v)
|
||||
|
||||
|
||||
@export var min_value1: float:
|
||||
set(v):
|
||||
min_value1 = v
|
||||
if not is_inside_tree():
|
||||
return
|
||||
$margin/vbox/grid1/level7.min_value = v
|
||||
|
||||
|
||||
@export var max_value0: float:
|
||||
set(v):
|
||||
max_value0 = v
|
||||
var items: = get_level_nodes()
|
||||
set_group_param(items, 'max_value', v)
|
||||
|
||||
|
||||
@export var max_value1: float:
|
||||
set(v):
|
||||
max_value1 = v
|
||||
if not is_inside_tree():
|
||||
return
|
||||
$margin/vbox/grid1/level7.max_value = v
|
||||
|
||||
|
||||
@export var step0: float:
|
||||
set(v):
|
||||
step0 = v
|
||||
var items: = get_level_nodes()
|
||||
set_group_param(items, 'step', v)
|
||||
|
||||
|
||||
@export var step1: float:
|
||||
set(v):
|
||||
step1 = v
|
||||
if not is_inside_tree():
|
||||
return
|
||||
$margin/vbox/grid1/level7.step = v
|
||||
|
||||
|
||||
@export var value_name0: String:
|
||||
set(v):
|
||||
value_name0 = v
|
||||
var items: Array = get_name_nodes()
|
||||
set_group_param(items, 'text', v)
|
||||
|
||||
|
||||
@export var value_name1: String:
|
||||
set(v):
|
||||
value_name1 = v
|
||||
if not is_inside_tree():
|
||||
return
|
||||
$margin/vbox/grid2/lbl7.text = v
|
||||
|
||||
|
||||
@export var fname: String:
|
||||
set(v):
|
||||
fname = v
|
||||
if not is_inside_tree():
|
||||
return
|
||||
$margin/vbox/grid0/fname.text = v
|
||||
|
||||
|
||||
@export var rname: String:
|
||||
set(v):
|
||||
rname = v
|
||||
if not is_inside_tree():
|
||||
return
|
||||
$margin/vbox/grid0/rname.text = v
|
||||
|
||||
|
||||
@export var state: int:
|
||||
set(v):
|
||||
state = tools.clip_value(v, 0, textures.size() - 1)
|
||||
if not is_inside_tree():
|
||||
return
|
||||
$margin/vbox/grid0/state.texture = textures[state]
|
||||
|
||||
|
||||
@export var alignment: int:
|
||||
set(v):
|
||||
alignment = v
|
||||
if is_inside_tree():
|
||||
$margin/vbox.alignment = v
|
||||
|
||||
|
||||
@export var value0_info: String:
|
||||
set(v):
|
||||
value0_info = v
|
||||
|
||||
|
||||
@export var value1_info: String:
|
||||
set(v):
|
||||
value1_info = v
|
||||
|
||||
|
||||
func _on_button_pressed(): emit_signal('pressed', self)
|
||||
func set_value0(value: Array): value0.assign(value)
|
||||
func _enter_tree() -> void: call_deferred('_enter_tree_defered')
|
||||
|
||||
|
||||
func _ready():
|
||||
var items: Array = get_level_nodes()
|
||||
for item in items:
|
||||
item.connect('value_changed', on_level_changed.bind(item, value0_info))
|
||||
on_level_changed(item.value, item, value0_info)
|
||||
var level7: = $margin/vbox/grid1/level7
|
||||
level7.connect('value_changed', on_level_changed.bind(level7, value1_info))
|
||||
on_level_changed(level7.value, level7, value1_info)
|
||||
|
||||
|
||||
func on_level_changed(_val: float, item: TextureProgressBar, info: String):
|
||||
item.tooltip_text = '%s\\nТекущее: %0.2f\\nДиапазон: %0.2f…%0.2f' % [info, item.value, item.min_value, item.max_value]
|
||||
|
||||
|
||||
func set_group_param(items: Array, param: StringName, v) -> void:
|
||||
if not is_inside_tree():
|
||||
return
|
||||
if not get_tree():
|
||||
return
|
||||
for i in items.size():
|
||||
items[i].set(param, v)
|
||||
|
||||
|
||||
func set_value0_by_index(index: int, value: float) -> void:
|
||||
var items: Array = get_level_nodes()
|
||||
items[index].value = value
|
||||
|
||||
|
||||
func _enter_tree_defered():
|
||||
var items: Array = get_level_nodes()
|
||||
var count: int = min(items.size(), value0.size())
|
||||
for i in count:
|
||||
items[i].min_value = min_value0
|
||||
items[i].max_value = 1400 # max_value0: TODO для отладки
|
||||
items[i].step = step0
|
||||
items = get_name_nodes()
|
||||
set_group_param(items, 'text', value_name0)
|
||||
if is_inside_tree():
|
||||
$margin/vbox/grid1/level7.value = value1
|
||||
$margin/vbox/grid1/level7.min_value = min_value1
|
||||
$margin/vbox/grid1/level7.max_value = max_value1
|
||||
$margin/vbox/grid1/level7.step = step1
|
||||
$margin/vbox/grid2/lbl7.text = value_name1
|
||||
$margin/vbox.alignment = alignment
|
||||
$margin/vbox/grid0/rname.text = rname
|
||||
$margin/vbox/grid0/fname.text = fname
|
||||
$margin/vbox/grid0/state.texture = textures[state]
|
||||
|
||||
|
||||
func get_level_nodes() -> Array:
|
||||
if not is_inside_tree():
|
||||
return []
|
||||
if not get_tree():
|
||||
return []
|
||||
return [$margin/vbox/grid1/level1]
|
||||
|
||||
|
||||
func get_name_nodes() -> Array:
|
||||
if not is_inside_tree():
|
||||
return []
|
||||
if not get_tree():
|
||||
return []
|
||||
return [$margin/vbox/grid2/lbl1]
|
||||
|
||||
|
||||
func set_value0_animated(target_node, target_value: float) -> void:
|
||||
var tween: Tween = create_tween()
|
||||
tween.set_ease(Tween.EASE_OUT)
|
||||
tween.set_trans(Tween.TRANS_QUINT)
|
||||
tween.tween_property(target_node, 'value', target_value, animation_duration)
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_rceim"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8yvwo"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6qu57"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_mlxje"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3dspb"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_45hqb"]
|
||||
script/source = "@tool
|
||||
|
||||
extends MarginContainer
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
margins = [8, 8, 8, 8]
|
||||
|
||||
|
||||
@export var margins: Array:
|
||||
set(vals):
|
||||
add_theme_constant_override('margin_top', vals[0])
|
||||
add_theme_constant_override('margin_left', vals[1])
|
||||
add_theme_constant_override('margin_bottom', vals[2])
|
||||
add_theme_constant_override('margin_right', vals[3])
|
||||
get:
|
||||
var vals = [0, 0, 0, 0]
|
||||
vals[0] = get_theme_constant('margin_top')
|
||||
vals[1] = get_theme_constant('margin_left')
|
||||
vals[2] = get_theme_constant('margin_bottom')
|
||||
vals[3] = get_theme_constant('margin_right')
|
||||
return vals
|
||||
"
|
||||
|
||||
[node name="блок-к" type="PanelContainer"]
|
||||
editor_description = "Элемент замены из ЗИП"
|
||||
offset_right = 160.0
|
||||
offset_bottom = 88.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u")
|
||||
script = SubResource("GDScript_oj3k3")
|
||||
textures = [ExtResource("1_uojqc"), ExtResource("2_a8ar3"), ExtResource("3_xwd13")]
|
||||
value0 = [20.0, 30.0, 40.0, 50.0, 60.0, 70.0]
|
||||
value1 = -40.0
|
||||
min_value1 = -40.0
|
||||
max_value0 = 1400.0
|
||||
max_value1 = 55.0
|
||||
step0 = 1.0
|
||||
step1 = 1.0
|
||||
value_name0 = "P,%"
|
||||
value_name1 = "°C"
|
||||
fname = "Блок В"
|
||||
rname = "A1"
|
||||
|
||||
[node name="button" type="Button" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_rceim")
|
||||
theme_override_styles/disabled = SubResource("StyleBoxEmpty_8yvwo")
|
||||
theme_override_styles/hover = SubResource("StyleBoxEmpty_6qu57")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxEmpty_mlxje")
|
||||
theme_override_styles/normal = SubResource("StyleBoxEmpty_3dspb")
|
||||
|
||||
[node name="rect" type="NinePatchRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("4_eobkx")
|
||||
draw_center = false
|
||||
region_rect = Rect2(0, 0, 63, 63)
|
||||
patch_margin_left = 17
|
||||
patch_margin_top = 17
|
||||
patch_margin_right = 17
|
||||
patch_margin_bottom = 15
|
||||
|
||||
[node name="margin" type="MarginContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
script = SubResource("GDScript_45hqb")
|
||||
margins = [8, 8, 8, 8]
|
||||
|
||||
[node name="vbox" type="VBoxContainer" parent="margin"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="grid0" type="GridContainer" parent="margin/vbox"]
|
||||
layout_mode = 2
|
||||
columns = 3
|
||||
|
||||
[node name="state" type="TextureRect" parent="margin/vbox/grid0"]
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 6
|
||||
texture = ExtResource("1_uojqc")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="fname" type="Label" parent="margin/vbox/grid0"]
|
||||
self_modulate = Color(1, 1, 1, 0.627451)
|
||||
custom_minimum_size = Vector2(0, 20)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 17
|
||||
text = "Блок В"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="rname" type="Label" parent="margin/vbox/grid0"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 6
|
||||
theme_override_font_sizes/font_size = 18
|
||||
text = "A1"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="grid1" type="GridContainer" parent="margin/vbox"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 3
|
||||
columns = 7
|
||||
|
||||
[node name="level1" type="TextureProgressBar" parent="margin/vbox/grid1" groups=["уровни"]]
|
||||
custom_minimum_size = Vector2(30, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
tooltip_text = "
|
||||
Текущее: 0.00
|
||||
Диапазон: 0.00…1400.00"
|
||||
mouse_filter = 0
|
||||
max_value = 1400.0
|
||||
fill_mode = 3
|
||||
nine_patch_stretch = true
|
||||
stretch_margin_left = 8
|
||||
stretch_margin_top = 8
|
||||
stretch_margin_right = 8
|
||||
stretch_margin_bottom = 8
|
||||
texture_under = ExtResource("5_mg57e")
|
||||
texture_progress = ExtResource("6_of7rd")
|
||||
tint_under = Color(1, 1, 1, 0.419608)
|
||||
tint_progress = Color(0.890196, 0.486275, 0.196078, 1)
|
||||
|
||||
[node name="level7" type="TextureProgressBar" parent="margin/vbox/grid1"]
|
||||
custom_minimum_size = Vector2(30, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
tooltip_text = "
|
||||
Текущее: -40.00
|
||||
Диапазон: -40.00…60.00"
|
||||
mouse_filter = 0
|
||||
min_value = -40.0
|
||||
max_value = 55.0
|
||||
value = -40.0
|
||||
fill_mode = 3
|
||||
nine_patch_stretch = true
|
||||
stretch_margin_left = 8
|
||||
stretch_margin_top = 8
|
||||
stretch_margin_right = 8
|
||||
stretch_margin_bottom = 8
|
||||
texture_under = ExtResource("5_mg57e")
|
||||
texture_progress = ExtResource("6_of7rd")
|
||||
tint_under = Color(0.890196, 0.486275, 0.196078, 1)
|
||||
tint_over = Color(0.890196, 0.486275, 0.196078, 1)
|
||||
|
||||
[node name="grid2" type="GridContainer" parent="margin/vbox"]
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
columns = 7
|
||||
|
||||
[node name="lbl1" type="Label" parent="margin/vbox/grid2" groups=["названия"]]
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(30, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 8
|
||||
text = "P,%"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="lbl7" type="Label" parent="margin/vbox/grid2"]
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(30, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 8
|
||||
text = "°C"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[connection signal="pressed" from="button" to="." method="_on_button_pressed"]
|
||||
@@ -14,7 +14,7 @@ patch_margin_right = 16
|
||||
patch_margin_bottom = 16
|
||||
script = ExtResource("2_mdnod")
|
||||
|
||||
[node name="ref_A26" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("3_4a27g")]
|
||||
[node name="ref_A26" parent="." groups=["power_supply"] instance=ExtResource("3_4a27g")]
|
||||
offset_left = 10.0
|
||||
offset_top = 30.0
|
||||
offset_right = 60.0
|
||||
@@ -23,7 +23,7 @@ fname = "ИП9-50"
|
||||
rname = "A22"
|
||||
metadata/ip = "ip9_50_3"
|
||||
|
||||
[node name="ref_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("3_4a27g")]
|
||||
[node name="ref_A23" parent="." groups=["power_supply"] instance=ExtResource("3_4a27g")]
|
||||
offset_left = 60.0
|
||||
offset_top = 30.0
|
||||
offset_right = 110.0
|
||||
@@ -35,9 +35,10 @@ metadata/ip = "ip12_50_2"
|
||||
[node name="lbl_fname" type="Label" parent="."]
|
||||
self_modulate = Color(1, 1, 1, 0.62)
|
||||
layout_mode = 0
|
||||
offset_left = 5.0
|
||||
offset_left = 8.0
|
||||
offset_top = 5.0
|
||||
offset_right = 105.0
|
||||
offset_right = 112.0
|
||||
offset_bottom = 30.0
|
||||
text = "Касета П-2"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
@@ -31,7 +31,7 @@ offset_top = 32.0
|
||||
offset_right = 55.0
|
||||
offset_bottom = 182.0
|
||||
fname = "ИП5-25"
|
||||
rname = "A24"
|
||||
rname = "A31"
|
||||
metadata/ip = "ip5_25"
|
||||
|
||||
[node name="ref_A30" parent="." groups=["y-5"] instance=ExtResource("3_picsk")]
|
||||
@@ -40,7 +40,7 @@ offset_top = 32.0
|
||||
offset_right = 105.0
|
||||
offset_bottom = 182.0
|
||||
fname = "ЯУ-07Б"
|
||||
rname = "A30"
|
||||
rname = "A37"
|
||||
metadata/y5 = "yau07"
|
||||
|
||||
[node name="ref_A26" parent="." groups=["y-5"] instance=ExtResource("3_picsk")]
|
||||
@@ -49,7 +49,7 @@ offset_top = 32.0
|
||||
offset_right = 155.0
|
||||
offset_bottom = 182.0
|
||||
fname = "ЭМС-Г"
|
||||
rname = "A26"
|
||||
rname = "A33"
|
||||
metadata/y5 = "ems"
|
||||
|
||||
[node name="ref_A27" parent="." groups=["y-5"] instance=ExtResource("3_picsk")]
|
||||
@@ -58,7 +58,7 @@ offset_top = 32.0
|
||||
offset_right = 205.0
|
||||
offset_bottom = 182.0
|
||||
fname = "УГ"
|
||||
rname = "A27"
|
||||
rname = "A34"
|
||||
metadata/y5 = "ug"
|
||||
|
||||
[node name="ref_A28" parent="." groups=["y-5"] instance=ExtResource("3_picsk")]
|
||||
@@ -67,7 +67,7 @@ offset_top = 32.0
|
||||
offset_right = 255.0
|
||||
offset_bottom = 182.0
|
||||
fname = "УКП"
|
||||
rname = "A28"
|
||||
rname = "A36"
|
||||
metadata/y5 = "ukp1"
|
||||
|
||||
[node name="ref_A29" parent="." groups=["y-5"] instance=ExtResource("3_picsk")]
|
||||
@@ -76,5 +76,5 @@ offset_top = 32.0
|
||||
offset_right = 304.0
|
||||
offset_bottom = 182.0
|
||||
fname = "УКП"
|
||||
rname = "A29"
|
||||
rname = "A35"
|
||||
metadata/y5 = "ukp2"
|
||||
|
||||
@@ -1,16 +1,92 @@
|
||||
@tool
|
||||
|
||||
extends TextureButton
|
||||
|
||||
@onready var tween: Tween
|
||||
@export var state_colors: Array
|
||||
|
||||
func _on_toggled(toggled_on): $frame.visible = toggled_on
|
||||
func _enter_tree() -> void: $label.self_modulate = state_colors[state]
|
||||
|
||||
func _ready():
|
||||
toggle_mode = true
|
||||
focus_mode = Control.FOCUS_ALL
|
||||
connect("focus_entered", _on_focus_entered)
|
||||
connect("focus_exited", _on_focus_exited)
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
if has_node("label"):
|
||||
$label.self_modulate = state_colors[state]
|
||||
|
||||
|
||||
func update_progress_bar(target_value) -> void:
|
||||
if tween:
|
||||
tween.kill()
|
||||
tween = create_tween()
|
||||
tween.tween_property($control_progress, "value", target_value, 0.3)
|
||||
|
||||
|
||||
func _on_toggled(toggled_on):
|
||||
if has_node("frame"):
|
||||
$frame.visible = toggled_on
|
||||
|
||||
|
||||
func _on_focus_entered():
|
||||
button_pressed = true
|
||||
#enter_press() TODO: Пока что без выбора прибора
|
||||
|
||||
|
||||
func _on_focus_exited():
|
||||
pass
|
||||
|
||||
|
||||
func enter_press():
|
||||
var enter_event = InputEventAction.new()
|
||||
enter_event.action = "ui_accept"
|
||||
enter_event.pressed = true
|
||||
Input.parse_input_event(enter_event)
|
||||
|
||||
|
||||
@export var state: int:
|
||||
set(v):
|
||||
v = 0 if v < 0 else v % state_colors.size()
|
||||
state = v
|
||||
if is_inside_tree():
|
||||
if is_inside_tree() and has_node("label"):
|
||||
$label.self_modulate = state_colors[v]
|
||||
|
||||
|
||||
@export var progress_value: float = 0.0:
|
||||
set(v):
|
||||
progress_value = v
|
||||
|
||||
if is_inside_tree():
|
||||
update_progress_bar(v)
|
||||
var max_val = $control_progress.get('max_value')
|
||||
var percentage = (v / max_val) * 100.0
|
||||
$control_progress.tooltip_text = 'Процесс контроля %01d%%' % percentage
|
||||
|
||||
|
||||
@export var progress_visible: bool:
|
||||
set(v):
|
||||
progress_visible = v
|
||||
if is_inside_tree():
|
||||
$control_progress.visible = v
|
||||
|
||||
|
||||
@export var progress_max_value: int:
|
||||
set(v):
|
||||
progress_max_value = v
|
||||
if is_inside_tree():
|
||||
$control_progress.max_value = v
|
||||
|
||||
|
||||
@export var progress_min_value: int:
|
||||
set(v):
|
||||
progress_min_value = v
|
||||
if is_inside_tree():
|
||||
$control_progress.min_value = v
|
||||
|
||||
|
||||
@export var show_functional: bool:
|
||||
set(v):
|
||||
show_functional = v
|
||||
if is_inside_tree():
|
||||
$pic_functional.visible = v
|
||||
|
||||
@@ -35,6 +35,7 @@ const SETTING_TABLE = [
|
||||
['Кнопка «Подавление»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
|
||||
['Виртуальная клавиатура', TableEdit, TableToggle, 'Включить отображение экранной клавиатуры'],
|
||||
['Скрыть вкладку ЭМС 2', TableEdit, TableToggle, 'Отображать вкладку \\\"ЭМС-2\\\"'],
|
||||
['Отладка контроля', TableEdit, TableToggle, 'Отображать отладку контроля'],
|
||||
['Текущая версия ПО УАРЭП', TableEdit, TableEdit, 'Время сборки, версия и номер фиксации'],
|
||||
['уарэп-яу07-частный', TableEdit, TableEdit, 'IP-адрес для получения частных сообщений от ЯУ-07'],
|
||||
['уарэп-яу07-общий', TableEdit, TableEdit, 'IP-адрес для получения широковещательных сообщений от ЯУ-07'],
|
||||
@@ -64,7 +65,7 @@ const SETTING_TABLE = [
|
||||
['Адрес БПО правого борта', TableEdit, TableEdit, 'http-адрес для запроса состояния прибора БПО'],
|
||||
['Период опроса состояния БПО, секунды', TableEdit, TableEdit, 'Время в секундах' ],
|
||||
['Период опроса состояния АФСП, секунды', TableEdit, TableEdit, 'Время в секундах' ],
|
||||
['уареп-трасса', TableEdit, TableEdit, 'IP-адрес для связи с Трассой [<адрес этого узла>, <адрес удалённого узла>, <порт этого узла>, <порт удалённого узла>]'],
|
||||
['уарэп-трасса', TableEdit, TableEdit, 'IP-адрес для связи с Трассой [<адрес этого узла>, <адрес удалённого узла>, <порт этого узла>, <порт удалённого узла>]'],
|
||||
['Включить работу по своим целям', TableEdit, TableToggle, 'Разрешает работу в секторе со своей целью'],
|
||||
['Список своих протоколов', TableEdit, TableEdit, 'Список протоколов целей, по которым запрещено работать' ], ]
|
||||
|
||||
@@ -73,8 +74,9 @@ const TRASSA = 17
|
||||
const SUPPRESS = 18 ## Строка - Подавление
|
||||
const KEYBOARD = 19 ## Строка - Виртуальная клавиатура
|
||||
const HIDE_EMS2 = 20 ## Строка - Скрыть вкладку ЭМС 2
|
||||
const COMMIT = 21 ## Строка - Версия УАРЭП
|
||||
const GOS_BTN = 51 ## Разрешить работу по своим целям
|
||||
const DEBAG_CONTROL = 21## Строка - Отладка контроля
|
||||
const COMMIT = 22 ## Строка - Версия УАРЭП
|
||||
const GOS_BTN = 52 ## Разрешить работу по своим целям
|
||||
|
||||
var name_to_line_index: = {} ## Для преобразования названия параметра в номер строки
|
||||
|
||||
@@ -114,6 +116,11 @@ func on_ems2_pressed(btn) -> void:
|
||||
signaller.emit_signal('ems2_hide_pressed', state)
|
||||
|
||||
|
||||
func on_debag_control_pressed(btn) -> void:
|
||||
var state = btn.button_pressed
|
||||
signaller.emit_signal(\"debag_control_pressed\", state)
|
||||
|
||||
|
||||
func on_row_pressed(i_row: int):
|
||||
$scroll_set/table.clear_rows_selected()
|
||||
$scroll_set/table.set_row_selected(i_row, true)
|
||||
@@ -231,6 +238,10 @@ func button_settings():
|
||||
on_ems2_pressed(ems2_hide_node)
|
||||
var gos_node = $scroll_set/table.get_node2(1, GOS_BTN).get_children()[0]
|
||||
gos_node.connect('pressed', on_gos_pressed.bind(gos_node))
|
||||
var debag_control = $scroll_set/table.get_node2(1, DEBAG_CONTROL).get_children()[0]
|
||||
debag_control.connect('pressed', on_debag_control_pressed.bind(debag_control))
|
||||
debag_control.set_pressed(false)
|
||||
on_debag_control_pressed(debag_control)
|
||||
|
||||
|
||||
func _on_btn_save_settings_pressed():
|
||||
|
||||
@@ -31,7 +31,8 @@ var strob_band_begin: float ## Ширина строба в моме
|
||||
var strob_dir_begin: float ## Направление антенны в момент начала перетаскивания.
|
||||
var strob_width_begin: float ## Ширина строба по углу в момент начала перетаскивания.
|
||||
var view_mode: MapViewMode ## Режим отображения карты
|
||||
var thrs_dict: Dictionary ## Ссылка на словарь целей
|
||||
var thrs_dict: Dictionary ## Ссылка на словарь целей
|
||||
var gos_flag = true ## Флаг работать по своим целям
|
||||
var color_ecm: Color
|
||||
var color_select: Color
|
||||
var color_emit: Color
|
||||
@@ -55,6 +56,7 @@ 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 {
|
||||
@@ -78,6 +80,11 @@ enum MapViewMode {
|
||||
}
|
||||
|
||||
|
||||
enum AntBandState {
|
||||
ANT_BAND_READY = 1,
|
||||
ANT_BAND_FAILED = 0
|
||||
}
|
||||
|
||||
const VAL_TO_EVENT = {
|
||||
false: 'manual_control', ## Выбор целей и установка помех вручную.
|
||||
true: 'full_auto' } ## Выбор целей и установка помех автоматически.
|
||||
@@ -91,14 +98,21 @@ 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))
|
||||
color_closed = ProjectSettings.get_setting('application/interfer/closed_sectors', Color(0.0, 0.0, 0.0, 1.0))
|
||||
color_emit_sel = color_select
|
||||
color_closed_emit = color_closed
|
||||
|
||||
|
||||
color_select *= Color(1.0, 1.0, 1.0, 0.0)
|
||||
color_ecm *= Color(1.0, 1.0, 1.0, 0.0)
|
||||
color_emit_sel *= Color(1.0, 1.0, 1.0, 0.2)
|
||||
@@ -109,9 +123,7 @@ func on_settings_changed():
|
||||
|
||||
## Обработчик сигнала изменения списка целей.
|
||||
func on_threats_resized(ths: Dictionary):
|
||||
$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
|
||||
count_threats(ths)
|
||||
thrs_dict = ths
|
||||
|
||||
|
||||
@@ -144,10 +156,18 @@ 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
|
||||
@@ -188,16 +208,13 @@ 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)
|
||||
@@ -205,10 +222,6 @@ 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)
|
||||
@@ -522,6 +535,7 @@ 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
|
||||
@@ -529,7 +543,6 @@ func update_fs_colors():
|
||||
$btn_activate.self_modulate = Color.WHITE
|
||||
else:
|
||||
$btn_activate.self_modulate = Color.WHITE
|
||||
|
||||
|
||||
|
||||
func unsel_fs_all(need_btns_off: bool):
|
||||
@@ -565,7 +578,7 @@ func set_btns_disabled(value: bool, btn):
|
||||
btn.set_disabled(value)
|
||||
|
||||
|
||||
func on_interfer_prinuditelno (prenuditelno_sectors, btns):
|
||||
func on_interfer_prinuditelno(prenuditelno_sectors, btns):
|
||||
for key in prenuditelno_sectors:
|
||||
var sectors = []
|
||||
for sector in prenuditelno_sectors[key]:
|
||||
@@ -578,8 +591,9 @@ func on_interfer_prinuditelno (prenuditelno_sectors, btns):
|
||||
|
||||
|
||||
## Вызывается при получении информации о состоянии модулей ФС от КАПС РПБ.
|
||||
func on_fs_update_state(_fs_dict: Dictionary):
|
||||
pass
|
||||
func on_fs_update_state(fs_dict: Dictionary):
|
||||
for key in fs_dict.keys():
|
||||
fs_failed[key] = fs_dict[key].isg
|
||||
|
||||
|
||||
func on_btn_center_toggled(toggled_on: bool) -> void:
|
||||
@@ -625,6 +639,14 @@ func _on_btn_all_work_pressed() -> void:
|
||||
|
||||
|
||||
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 = ths.values().filter(func(th: threats.Threat): return th.proto != '').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
|
||||
|
||||
@@ -306,18 +306,18 @@ vertical_alignment = 1
|
||||
|
||||
[node name="coordinates_map" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 999.0
|
||||
offset_top = 128.0
|
||||
offset_right = 1111.0
|
||||
offset_bottom = 147.0
|
||||
offset_left = 660.0
|
||||
offset_top = -24.0
|
||||
offset_right = 772.0
|
||||
offset_bottom = -5.0
|
||||
text = "Координаты:"
|
||||
|
||||
[node name="scale_map" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 999.0
|
||||
offset_top = 202.0
|
||||
offset_right = 1109.0
|
||||
offset_bottom = 223.0
|
||||
offset_left = 1003.0
|
||||
offset_top = -24.0
|
||||
offset_right = 1113.0
|
||||
offset_bottom = -3.0
|
||||
text = "Масштаб:"
|
||||
|
||||
[node name="zoom_plus" type="Button" parent="."]
|
||||
|
||||
@@ -54,15 +54,15 @@ const EMS_G_BOARDS = {
|
||||
|
||||
## Таблица с данными для входов, первое значение - индекс устройства в ячейке КЭМС.
|
||||
const INPUT_KEMS = [
|
||||
[1 ,['УИЗП №1', 'Х7', '0.00', '0.00']],
|
||||
[1 ,['5П-26М', 'Х7', '0.00', '0.00']],
|
||||
[2 ,['УИЗПФ №1','Х8', '0.00', '0.00']],
|
||||
[3 ,['УИЗП №2', 'Х10', '0.00', '0.00']],
|
||||
[3 ,['НРЛС МР-231', 'Х10', '0.00', '0.00']],
|
||||
[4 ,['УИЗПФ №2','Х11', '0.00', '0.00']],
|
||||
[5 ,['УИЗП №3', 'Х13', '0.00', '0.00']],
|
||||
[5 ,['НРЛС-231-3', 'Х13', '0.00', '0.00']],
|
||||
[6 ,['УИЗПФ №3','Х14', '0.00', '0.00']],
|
||||
[7 ,['УИЗП №4', 'Х16', '0.00', '0.00']],
|
||||
[7 ,['3Р87-1Ф', 'Х16', '0.00', '0.00']],
|
||||
[8 ,['УИЗПФ №4','Х17', '0.00', '0.00']],
|
||||
[9 ,['УИЗП №5', 'Х19', '0.00', '0.00']],
|
||||
[9 ,['ПРЛ ИСБУ-23900', 'Х19', '0.00', '0.00']],
|
||||
[10,['УИЗПФ №5','Х20', '0.00', '0.00']],
|
||||
[11,['УИЗП №6', 'Х22', '0.00', '0.00']],
|
||||
[12,['УИЗПФ №6','Х23', '0.00', '0.00']],
|
||||
@@ -77,11 +77,11 @@ const INPUT_KEMS = [
|
||||
|
||||
## Таблица с данными для выходов, первое значение - индекс устройства в ячейке КЭМС.
|
||||
const OUTPUT_KEMS = [
|
||||
[47,['Бланк №1','Х6', '0.00', '0.00']],
|
||||
[48,['Бланк №2','Х9', '0.00', '0.00']],
|
||||
[49,['Бланк №3','Х12', '0.00', '0.00']],
|
||||
[50,['Бланк №4','Х15', '0.00', '0.00']],
|
||||
[51,['Бланк №5','Х18', '0.00', '0.00']],
|
||||
[47,['5П-26М','Х6', '0.00', '0.00']],
|
||||
[48,['НРЛС МР-231','Х9', '0.00', '0.00']],
|
||||
[49,['НРЛС-231-3','Х12', '0.00', '0.00']],
|
||||
[50,['3Р87-1Ф','Х15', '0.00', '0.00']],
|
||||
[51,['ПРЛ ИСБУ-23900','Х18', '0.00', '0.00']],
|
||||
[52,['Бланк №6','Х21', '0.00', '0.00']],
|
||||
[53,['Бланк №7','Х24', '0.00', '0.00']],
|
||||
[55,['Бланк_МП №1', 'X28 : 8', '0.00', '0.00']],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
extends Panel
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var unit_trassa = network.get_unit_instance('уарэп-трасса')
|
||||
unit_trassa.connect('line_changed', Callable(self, 'on_trassa_line_changed'))
|
||||
@@ -8,30 +9,30 @@ func _ready() -> void:
|
||||
|
||||
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)
|
||||
$'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 = '-'
|
||||
$'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)
|
||||
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)
|
||||
|
||||
@@ -93,6 +93,7 @@ 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 воздействий.
|
||||
@@ -125,6 +126,7 @@ 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]
|
||||
@@ -214,7 +216,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))
|
||||
|
||||
|
||||
@@ -266,7 +268,7 @@ func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> v
|
||||
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:
|
||||
@@ -278,7 +280,7 @@ func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> v
|
||||
ecm_active = false
|
||||
if ecm_active and (prd.fs_caps_id[ecm.nmfs] in fs_closed):
|
||||
interfer_off(ecm, unit_instance)
|
||||
|
||||
|
||||
var th_id = thr.id
|
||||
for ecm_i in thrs.keys():
|
||||
if thrs[ecm_i] == th_id:
|
||||
@@ -366,22 +368,29 @@ 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
|
||||
param['width'] = item.width * 1.5
|
||||
if (item.rkrp != '') and item.fflags.rkrp and auto_enabled:
|
||||
var krp = get_krp(item)
|
||||
if krp != '':
|
||||
interfer_name = krp
|
||||
set_rparams(item, param)
|
||||
if (param['width'] < settings.WIDTH_MIN):
|
||||
param['width'] = settings.WIDTH_MIN
|
||||
elif (param['width'] > settings.WIDTH_MAX):
|
||||
param['width'] = settings.WIDTH_MAX
|
||||
check_width(param)
|
||||
interfer_create(u, interfer_name, ecms, param, kni, id, thrs, SOURCE_INTERFER[0], power)
|
||||
|
||||
for item in fs_arr:
|
||||
@@ -390,10 +399,7 @@ 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]
|
||||
if (param['width'] < settings.WIDTH_MIN):
|
||||
param['width'] = settings.WIDTH_MIN
|
||||
elif (param['width'] > settings.WIDTH_MAX):
|
||||
param['width'] = settings.WIDTH_MAX
|
||||
check_width(param)
|
||||
interfer_create(u, interfer_name, ecms, param, kni, id, fs, SOURCE_INTERFER[1], power)
|
||||
|
||||
|
||||
@@ -433,7 +439,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'] = 1.0 # Необходимо добавить параметры управления
|
||||
param['period'] = param.get('period', PERIOD_DEFAULT)
|
||||
var key = dict.find_key(id)
|
||||
if source_interfer != SOURCE_INTERFER[2]:
|
||||
if key != null:
|
||||
@@ -454,13 +460,16 @@ 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:
|
||||
@@ -477,7 +486,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 emit_enable:
|
||||
if not ecm.modulation:
|
||||
ecm.svk = 0
|
||||
call_deferred('emit_signal', 'interfer_update', ecm)
|
||||
return
|
||||
@@ -512,8 +521,10 @@ 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):
|
||||
@@ -561,8 +572,11 @@ 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
|
||||
ecm.params['width'] = threat.width
|
||||
var width = threat.width * 1.5
|
||||
ecm.params['width'] = width
|
||||
check_width(ecm.params)
|
||||
if (threat.rkrp != '') and threat.fflags.rkrp and auto_enabled:
|
||||
var krp = get_krp(threat)
|
||||
if krp != '':
|
||||
@@ -599,12 +613,11 @@ 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']
|
||||
params['width'] = threat.rparams['width'] * 1.5
|
||||
else:
|
||||
params['width'] = threat.width
|
||||
params['width'] = threat.width * 1.5
|
||||
check_width(params)
|
||||
if threat.rparams.has('filename'):
|
||||
params['filename'] = threat.rparams['filename']
|
||||
|
||||
@@ -675,4 +688,8 @@ func set_th_emit(th: threats.Threat, ecm: Interfer):
|
||||
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
|
||||
|
||||
161
scripts/prd-ctl-config.gd
Normal file
@@ -0,0 +1,161 @@
|
||||
class_name PRDConfigManager
|
||||
extends RefCounted
|
||||
|
||||
## Менеджер конфигурации для системы контроля ПРД
|
||||
## Загружает и управляет настройками из JSON-конфигурации
|
||||
|
||||
#region CONSTANTS
|
||||
const CONFIG_PATH = "user://config/setting_prd_control.json"
|
||||
const DEFAULT_CONFIG_PATH = "res://config/setting_prd_control.json"
|
||||
#endregion
|
||||
|
||||
#region PRIVATE_VARIABLES
|
||||
var _config_data: Dictionary # Все данные конфигурации
|
||||
var _device_constants: Dictionary # Константы устройств
|
||||
var _base_configs: Dictionary # Базовые конфигурации
|
||||
var _device_configs: Dictionary # Конфигурации устройств
|
||||
var _data_indices: Dictionary # Индексы данных
|
||||
var _fs_keys: Dictionary # Ключи ФС (функциональных систем)
|
||||
var _temperature_constants: Dictionary # Константы температуры
|
||||
var _ems_input_bits_config: Dictionary # Конфигурация битов ввода ЭМС
|
||||
var _fs_rules: Array # Правила ФС
|
||||
|
||||
var _is_loaded: bool = false # Флаг успешной загрузки
|
||||
#endregion
|
||||
|
||||
#region INITIALIZATION
|
||||
func _init() -> void:
|
||||
"""Инициализация менеджера конфигурации"""
|
||||
_load_configuration()
|
||||
#endregion
|
||||
|
||||
#region PUBLIC_API
|
||||
## Проверяет, успешно ли загружена конфигурация
|
||||
func is_loaded() -> bool:
|
||||
return _is_loaded
|
||||
|
||||
## Возвращает все данные конфигурации
|
||||
func get_config_data() -> Dictionary:
|
||||
return _config_data.duplicate(true)
|
||||
|
||||
## Возвращает константы устройств
|
||||
func get_device_constants() -> Dictionary:
|
||||
return _device_constants.duplicate(true)
|
||||
|
||||
## Возвращает базовые конфигурации
|
||||
func get_base_configs() -> Dictionary:
|
||||
return _base_configs.duplicate(true)
|
||||
|
||||
## Возвращает конфигурации устройств
|
||||
func get_device_configs() -> Dictionary:
|
||||
return _device_configs.duplicate(true)
|
||||
|
||||
## Возвращает индексы данных
|
||||
func get_data_indices() -> Dictionary:
|
||||
return _data_indices.duplicate(true)
|
||||
|
||||
## Возвращает ключи ФС
|
||||
func get_fs_keys() -> Dictionary:
|
||||
return _fs_keys.duplicate(true)
|
||||
|
||||
## Возвращает константы температуры
|
||||
func get_temperature_constants() -> Dictionary:
|
||||
return _temperature_constants.duplicate(true)
|
||||
|
||||
## Возвращает конфигурацию битов ввода ЭМС
|
||||
func get_ems_input_bits_config() -> Dictionary:
|
||||
return _ems_input_bits_config.duplicate(true)
|
||||
|
||||
## Возвращает правила ФС
|
||||
func get_fs_rules() -> Array:
|
||||
return _fs_rules.duplicate(true)
|
||||
|
||||
## Возвращает индекс данных по ключу
|
||||
func get_data_index(key: String) -> int:
|
||||
return _data_indices.get(key, -1)
|
||||
#endregion
|
||||
|
||||
#region PRIVATE_METHODS
|
||||
## Загружает конфигурацию из JSON файла
|
||||
func _load_configuration() -> void:
|
||||
if not _ensure_config_exists():
|
||||
_is_loaded = false
|
||||
return
|
||||
|
||||
var config_file = FileAccess.open(CONFIG_PATH, FileAccess.READ)
|
||||
if config_file:
|
||||
var json_text = config_file.get_as_text()
|
||||
config_file.close()
|
||||
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(json_text)
|
||||
if parse_result == OK:
|
||||
_config_data = json.data
|
||||
_parse_config_data()
|
||||
_is_loaded = true
|
||||
else:
|
||||
push_error("Ошибка разбора JSON конфигурации: " + json.get_error_message())
|
||||
_is_loaded = false
|
||||
else:
|
||||
push_error("Ошибка загрузки файла конфигурации: " + CONFIG_PATH)
|
||||
_is_loaded = false
|
||||
|
||||
|
||||
## Парсит данные конфигурации по секциям
|
||||
func _parse_config_data() -> void:
|
||||
_device_constants = _convert_numbers(_config_data.get("device_constants", {}))
|
||||
_base_configs = _convert_numbers(_config_data.get("base_configs", {}))
|
||||
_device_configs = _convert_numbers(_config_data.get("device_configs", {}))
|
||||
_data_indices = _convert_numbers(_config_data.get("data_indices", {}))
|
||||
_fs_keys = _convert_numbers(_config_data.get("fs_keys", {}))
|
||||
_temperature_constants = _convert_numbers(_config_data.get("temperature_constants", {}))
|
||||
_ems_input_bits_config = _convert_numbers(_config_data.get("ems_input_bits_config", {}))
|
||||
_fs_rules = _convert_numbers(_config_data.get("fs_rules", []))
|
||||
|
||||
|
||||
## Конвертирует числовые значения в правильные типы (float -> int если возможно)
|
||||
static func _convert_numbers(value):
|
||||
if value is float:
|
||||
# Конвертируем float в int если нет дробной части
|
||||
if value == int(value):
|
||||
return int(value)
|
||||
return value
|
||||
elif value is Dictionary:
|
||||
var result = {}
|
||||
for key in value:
|
||||
result[key] = _convert_numbers(value[key])
|
||||
return result
|
||||
elif value is Array:
|
||||
var result = []
|
||||
for item in value:
|
||||
result.append(_convert_numbers(item))
|
||||
return result
|
||||
else:
|
||||
return value
|
||||
|
||||
|
||||
## Обеспечивает существование файла конфигурации
|
||||
## Создает папку и копирует дефолтный файл если нужно
|
||||
func _ensure_config_exists() -> bool:
|
||||
# Создаем папку конфигурации если не существует
|
||||
DirAccess.make_dir_recursive_absolute("user://config")
|
||||
|
||||
# Если файл уже существует - все ок
|
||||
if FileAccess.file_exists(CONFIG_PATH):
|
||||
return true
|
||||
|
||||
# Если дефолтного файла нет - ошибка
|
||||
if not FileAccess.file_exists(DEFAULT_CONFIG_PATH):
|
||||
return false
|
||||
|
||||
# Копируем дефолтный конфиг в user директорию
|
||||
var src := FileAccess.open(DEFAULT_CONFIG_PATH, FileAccess.READ)
|
||||
var dst := FileAccess.open(CONFIG_PATH, FileAccess.WRITE)
|
||||
if src == null or dst == null:
|
||||
return false
|
||||
|
||||
dst.store_string(src.get_as_text())
|
||||
src.close()
|
||||
dst.close()
|
||||
return true
|
||||
#endregion
|
||||
1
scripts/prd-ctl-config.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bi7elq60squds
|
||||
101
scripts/prd.gd
@@ -105,8 +105,8 @@ class Fs:
|
||||
[10, 20],
|
||||
[20, 30],
|
||||
[30, 40],
|
||||
[40, 50],
|
||||
[50, 55]]
|
||||
[40, 90],
|
||||
[90, 100]]
|
||||
|
||||
var index ## Индекс блока усилителей
|
||||
var modulation: bool ## Состояние модуляции
|
||||
@@ -151,22 +151,33 @@ class Fs:
|
||||
|
||||
|
||||
class PRD:
|
||||
enum STATE_DEVICE {
|
||||
NONE,
|
||||
GOOD,
|
||||
ERROR
|
||||
}
|
||||
var prd_name: String ## Имя прибора
|
||||
var unit_yau07 ## Юнит эмс
|
||||
var unit_yau07: Object ## Юнит эмс
|
||||
var unit_control: Object ## Класс проверки прибора ПРД
|
||||
var fs_dic: Dictionary ## Массив блоков ФС
|
||||
var yemsg_board: yemsboards.EmsBoard ## Плата ЭМС-Г
|
||||
var state = PrdState.WORK
|
||||
var cmd_array: Array ## Очередь команд
|
||||
var ug_online: bool = false ## Состояние ячейки УГ
|
||||
var serviceability: bool = false
|
||||
var set_ug_state: bool = true ## Необходимо ли записать в УГ настройки
|
||||
signal update_serviceability()
|
||||
signal update_serviceability(state: int) ## Сообщает изменение текущего состояния юнита ПРД
|
||||
var serviceability: int:
|
||||
set(v):
|
||||
if v != serviceability:
|
||||
serviceability = v
|
||||
emit_signal('update_serviceability', v)
|
||||
|
||||
func _init(u_name, u_yau07):
|
||||
prd_name = u_name
|
||||
unit_yau07 = u_yau07
|
||||
init_ems_g()
|
||||
|
||||
|
||||
func init_ems_g():
|
||||
var in_tbl: Array = []
|
||||
var out_tbl: Array = []
|
||||
@@ -199,11 +210,11 @@ class PRD:
|
||||
|
||||
|
||||
func on_line_changed(unit_ems):
|
||||
emit_signal('update_serviceability')
|
||||
if not unit_ems.online:
|
||||
yemsg_board.ems_load = yemsg_board.LoadState.NOT_DEFINED
|
||||
yemsg_board.set_wait()
|
||||
set_ug_state = true
|
||||
serviceability = STATE_DEVICE.NONE
|
||||
|
||||
func on_data_received(_u):
|
||||
set_prd_status()
|
||||
@@ -221,18 +232,76 @@ class PRD:
|
||||
return
|
||||
execute_cmd()
|
||||
|
||||
func set_prd_status():
|
||||
## Мониторинг состояния юнита прд
|
||||
func set_prd_status() -> void:
|
||||
# Обновление статуса платы ЯУ-07
|
||||
yemsg_board.set_status(unit_yau07.status)
|
||||
|
||||
# Проверка онлайн-статусов основных модулей
|
||||
ug_online = (unit_yau07.status[0] >> 1) & 1
|
||||
if not ug_online:
|
||||
set_ug_state = true
|
||||
var ukp_1_online = (unit_yau07.status[0] >> 2) & 1
|
||||
var ukp_2_online = (unit_yau07.status[0] >> 3) & 1
|
||||
var ems_g_online = (unit_yau07.status[0] & 1) & 1
|
||||
var check_serviceability = ug_online and ukp_1_online and ukp_2_online and ems_g_online
|
||||
if serviceability != check_serviceability:
|
||||
serviceability = check_serviceability
|
||||
emit_signal('update_serviceability')
|
||||
var ems_g_online = (unit_yau07.status[0] & 1) & 1
|
||||
|
||||
# Установка флага состояния УГ
|
||||
if not ug_online:
|
||||
set_ug_state = true
|
||||
|
||||
# Проверка источников питания
|
||||
var ip_online: bool = _check_dry_contact(unit_yau07.status, prd_name)
|
||||
var check_temperature_um: bool = unit_control.flags.temperature_ok
|
||||
var check_dic: Dictionary = {
|
||||
'ukp_1_online': ukp_1_online,
|
||||
'ukp_2_online': ukp_2_online,
|
||||
'ems_g_online': ems_g_online,
|
||||
'ip_online': ip_online,
|
||||
'ug_online': ug_online,
|
||||
'temperature_um': check_temperature_um
|
||||
}
|
||||
# Определение состояния обслуживания
|
||||
if unit_control:
|
||||
if unit_control.flags.control_is_over:
|
||||
serviceability = _set_serviceability_from_control_results(unit_control)
|
||||
else:
|
||||
serviceability = _set_serviceability_from_online_status(check_dic)
|
||||
|
||||
## Проверка онлайн-статуса сухих контактов
|
||||
static func _check_dry_contact(unit_yau07_status: PackedByteArray, self_name: String) -> bool:
|
||||
var bit_ip_config: Array = [0, 1, 2, 3, 4, 5, 6, 7]
|
||||
var is_k_type: bool = self_name in ['уарэп-яу07-1к', 'уарэп-яу07-2к', 'уарэп-яу07-3к', 'уарэп-яу07-4к']
|
||||
for bit in bit_ip_config:
|
||||
if not is_k_type and bit in [5, 6]: # Игнорируем биты 5 и 6 для всех приборов, кроме типа "к"
|
||||
continue
|
||||
var status: bool = unit_yau07_status[27] >> bit & 1
|
||||
if status:
|
||||
return false
|
||||
return true
|
||||
|
||||
## Установка состояния обслуживания на основе результатов контроля
|
||||
static func _set_serviceability_from_control_results(unit_ctrl: Object) -> int:
|
||||
var control_results = unit_ctrl.get_control_results()
|
||||
var result_dic = control_results.result_dic
|
||||
const CRITICAL_DEVICES: Array = [
|
||||
'fs_1', 'fs_2', 'fs_3', 'fs_4', 'fs_5', 'fs_6', 'fs_7',
|
||||
'dkm_1', 'dkm_2', 'dkm_3', 'dkm_4', 'dkm_5', 'dkm_6', 'dkm_7',
|
||||
'block_ip', 'dou_2', 'dou_3', 'dou_4', 'dou_5', 'dou_6', 'dou_7'
|
||||
]
|
||||
var all_ok: bool = true
|
||||
for device_key in CRITICAL_DEVICES:
|
||||
if result_dic.has(device_key) and result_dic[device_key] is bool:
|
||||
if not result_dic[device_key]:
|
||||
all_ok = false
|
||||
break
|
||||
return STATE_DEVICE.GOOD if all_ok else STATE_DEVICE.ERROR
|
||||
|
||||
## Установка состояния обслуживания на основе онлайн-статусов
|
||||
static func _set_serviceability_from_online_status(check_dic: Dictionary) -> int:
|
||||
var all_online: bool = true
|
||||
for status in check_dic:
|
||||
if not check_dic[status]:
|
||||
all_online = false
|
||||
break
|
||||
return STATE_DEVICE.NONE if all_online else STATE_DEVICE.ERROR
|
||||
|
||||
|
||||
func execute_cmd():
|
||||
@@ -277,12 +346,16 @@ class PRD:
|
||||
cmd_array.append([unit_yau07.CmdCode.WRITE_ISA, data_arr])
|
||||
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
check_dir()
|
||||
for prd_name in PRD_NAMES:
|
||||
var unit_prd = network.get_unit_instance(prd_name)
|
||||
var new_prd = PRD.new(prd_name, unit_prd)
|
||||
prd_dict[prd_name] = new_prd
|
||||
var unit_control = TestPRD.new({'unit_prd': unit_prd}, new_prd.cmd_array)
|
||||
add_child(unit_control)
|
||||
new_prd.unit_control = unit_control
|
||||
for key in FS_PRD.keys():
|
||||
var fs = Fs.new(key, FS_PRD[key][0])
|
||||
fs_dict[key] = fs
|
||||
|
||||
@@ -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: = 0.0
|
||||
const WIDTH_MIN: = 5.0
|
||||
const DUR_MAX: = 1000000.0
|
||||
const PERIOD_MAX: = 1000000.0
|
||||
const UM_MIN: = -5.0
|
||||
|
||||
@@ -182,6 +182,11 @@ signal kb_pressed(state)
|
||||
signal ems2_hide_pressed(state)
|
||||
|
||||
|
||||
## Вызывается при нажатии на кнопку отладки контроля
|
||||
## [param state] - состояние показа отладки контроля
|
||||
signal debag_control_pressed(state)
|
||||
|
||||
|
||||
## Вызывается при нажатии на кнопку экранной клавиатуры
|
||||
## [param state] - состояние скрытия кнопки ЭМС2
|
||||
signal emit_changed(state)
|
||||
@@ -216,6 +221,10 @@ signal sector_klaster (new_sector_data)
|
||||
signal clear_klaster ()
|
||||
|
||||
|
||||
## Вызывается при нажатии на кнопку "Запуск контроля".[br]
|
||||
signal start_contol_device()
|
||||
|
||||
|
||||
## Вызывается при программном отключении помехи.[br]
|
||||
## [param ecm] - выключаемая помеха ([b]true[/b]
|
||||
signal on_prog_ecm_off(ecm: interfer.Interfer)
|
||||
|
||||
@@ -34,6 +34,10 @@ class SPT25 extends unit.Unit:
|
||||
if not online:
|
||||
online = true
|
||||
emit_signal('line_changed', self)
|
||||
|
||||
#rx_data.reverse()
|
||||
var reverse_rx_data = process_packet_reverse(rx_data)
|
||||
|
||||
emit_signal('data_received', rx_data)
|
||||
|
||||
|
||||
@@ -47,3 +51,19 @@ class SPT25 extends unit.Unit:
|
||||
online = false
|
||||
emit_signal('line_changed', self)
|
||||
return rc
|
||||
|
||||
|
||||
## Производит переворот битов в байте в пакете по байтово
|
||||
static func process_packet_reverse(packet:PackedByteArray)->PackedByteArray:
|
||||
var result=PackedByteArray()
|
||||
for i in packet.size():
|
||||
result.append(reverse_bit(packet[i]))
|
||||
return result
|
||||
|
||||
|
||||
## Производит переворот битов в байте
|
||||
static func reverse_bit(b: int) -> int:
|
||||
b=((b&0xF0)>>4) | ((b&0x0F)<<4)
|
||||
b=((b&0xCC)>>2) | ((b&0x33)<<2)
|
||||
b=((b&0xAA)>>1) | ((b&0x55)<<1)
|
||||
return b
|
||||
|
||||
@@ -29,7 +29,8 @@ class Threat:
|
||||
var selected: bool ## Флаг, что цель выбрана.
|
||||
var auto_selected: bool = false ## Флаг автомата для целей
|
||||
var emit_state: int = 0 ## 0 - подавление не назначено, 1 - назначено, 2 - выполняется
|
||||
var nmfs:int ## Индекс модуля ФС, в зону действия которого попала цель
|
||||
var nmfs: int ## Индекс модуля ФС, в зону действия которого попала цель
|
||||
var priority: int ## Приоритет опасности цели
|
||||
|
||||
func _init(): clear_fflags()
|
||||
func _to_string() -> String: return 'номер: %d пеленг: %0.1f частота: %0.1f МГц' % [id, aoa, freq]
|
||||
@@ -142,6 +143,10 @@ 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()
|
||||
|
||||
@@ -7,6 +7,9 @@ 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; /* */
|
||||
@@ -14,9 +17,13 @@ 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 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; /* Индикация неисправности модулей ФС. Частота штриховки */
|
||||
|
||||
const int ant_band_count_0 = 2;
|
||||
const int ant_band_count_1 = 2;
|
||||
@@ -42,7 +49,8 @@ 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[28];
|
||||
uniform vec4 ant_band_c[ANTENAS_COUNT];
|
||||
uniform uint ant_band_m[ANTENAS_COUNT];
|
||||
const float d4 = 90.0;
|
||||
const float ds = 1.0;
|
||||
|
||||
@@ -79,6 +87,12 @@ 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);
|
||||
@@ -120,4 +134,9 @@ 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)
|
||||
|
||||
17
shaders/two-color.gdshader
Normal file
@@ -0,0 +1,17 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform vec3 grey = vec3(0.14, 0.13, 0.13);
|
||||
uniform vec3 orange = vec3(0.95, 0.55, 0.05);
|
||||
uniform float gamma = 2.0;
|
||||
|
||||
vec3 bw_to_2color(vec3 c, vec3 dark, vec3 light)
|
||||
{
|
||||
float l = pow(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722, gamma);
|
||||
return mix(light, dark, l);
|
||||
}
|
||||
|
||||
|
||||
void fragment()
|
||||
{
|
||||
COLOR.rgb = bw_to_2color(texture(TEXTURE, UV).rgb, grey, orange);
|
||||
}
|
||||
1
shaders/two-color.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://83fx15q1xlid
|
||||
@@ -301,6 +301,16 @@ func default_selector_size_proc(i_row: int, rect: Array) -> void:
|
||||
rect[3] += node_gap.y
|
||||
|
||||
|
||||
## Очищает в словаре nodes от невалидных ссылок
|
||||
func cleanup_invalid_selectors():
|
||||
var keys_to_remove = []
|
||||
for key in nodes:
|
||||
if key.begins_with(SLCT_PREFIX) and not is_instance_valid(nodes[key]):
|
||||
keys_to_remove.append(key)
|
||||
for key in keys_to_remove:
|
||||
nodes.erase(key)
|
||||
print_debug("Удален невалидный селектор: ", key)
|
||||
|
||||
##
|
||||
func clear_rows_selected():
|
||||
var rows_count: = get_rows_count()
|
||||
@@ -322,14 +332,15 @@ func _set_row_selected(i_row: int, selected: bool = true) -> void:
|
||||
push_error('нет такого ряда: %d (всего %d рядов)\n' % [i_row, rows_count])
|
||||
return
|
||||
if nodes.has(selector_key) and (not selected):
|
||||
var node = nodes[node_key]
|
||||
var selector = nodes[selector_key]
|
||||
nodes.erase(selector_key)
|
||||
if is_instance_valid(selector):
|
||||
node.remove_child(selector)
|
||||
var prnt = selector.get_parent_control()
|
||||
if prnt:
|
||||
prnt.remove_child(selector)
|
||||
selector.queue_free()
|
||||
else:
|
||||
push_warning('обращение к удалённому элементу \"%s\"' % selector_key)
|
||||
nodes.erase(selector_key)
|
||||
elif (not nodes.has(selector_key)) and selected:
|
||||
var selector = ScnSelector.instantiate()
|
||||
var rect: = [0, 0, 0, 0]
|
||||
@@ -448,6 +459,7 @@ func remove_row(i_row: int):
|
||||
|
||||
if nodes.has(sel_key):
|
||||
var selector = nodes[sel_key]
|
||||
if selector == null: return
|
||||
var prnt = selector.get_parent()
|
||||
prnt.remove_child(selector)
|
||||
selector.queue_free()
|
||||
@@ -484,8 +496,11 @@ func next_index(indexes: Array) -> void:
|
||||
func swap_nodes(nodes_copy, node_key_format, i0, i1) -> void:
|
||||
var key0 = node_key_format % [i0.y, i0.x]
|
||||
var key1 = node_key_format % [i1.y, i1.x]
|
||||
nodes_copy[key1] = nodes[key0]
|
||||
nodes_copy[key1].name = key1
|
||||
if is_instance_valid(nodes[key0]):
|
||||
nodes_copy[key1] = nodes[key0]
|
||||
nodes_copy[key1].name = key1
|
||||
else:
|
||||
print_debug("Ошибка: нод ", key0, " был освобожден")
|
||||
|
||||
|
||||
## Переназначает ключи в соответствии с размерами таблицы.
|
||||
|
||||