Compare commits
304 Commits
5dac4fae5e
...
29e5382c1e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29e5382c1e | ||
|
|
96436596d8 | ||
|
|
b3455947fd | ||
|
|
57fc201212 | ||
|
|
2abe5741eb | ||
|
|
ef063645ee | ||
|
|
4d0ea0f84e | ||
|
|
d7cba379cc | ||
|
|
f41e59b119 | ||
|
|
b919e6498f | ||
|
|
8039e6bcb4 | ||
|
|
4a928abc37 | ||
|
|
6c46acc6b6 | ||
|
|
94084fead0 | ||
|
|
e4dfdeb899 | ||
|
|
f41c0ee75c | ||
|
|
9fd258a745 | ||
|
|
49d7b71072 | ||
|
|
ba4d2458af | ||
|
|
407f9956fa | ||
|
|
33a5dea6a0 | ||
|
|
446f8b6afc | ||
|
|
d00fb92520 | ||
|
|
21a0c0c012 | ||
|
|
6f7bf0a5be | ||
|
|
193f0ab498 | ||
|
|
5c6b6e80c9 | ||
|
|
a2d56a7553 | ||
|
|
3eef38f56a | ||
|
|
159956e02f | ||
|
|
fb7853a5be | ||
|
|
cd34aa9100 | ||
|
|
4079d55aa5 | ||
|
|
7b80852017 | ||
|
|
68ab1b325d | ||
|
|
1cb3985c70 | ||
|
|
cf3b02cec2 | ||
|
|
c5da181fb7 | ||
|
|
528566e949 | ||
|
|
212ce180d1 | ||
|
|
261a994466 | ||
|
|
07b41211c7 | ||
|
|
0fc98c5e98 | ||
|
|
59da91d98c | ||
|
|
959ef1192c | ||
|
|
0b2c101a4b | ||
|
|
731ce8b3dd | ||
|
|
86716437cf | ||
|
|
901d160c50 | ||
|
|
26bb36a333 | ||
|
|
8c4a966654 | ||
|
|
aea48c7d9e | ||
|
|
dac7987585 | ||
|
|
190f06b72c | ||
|
|
c5bae21436 | ||
|
|
e48e8767e5 | ||
|
|
97bbd85622 | ||
|
|
de92de2994 | ||
|
|
df80508592 | ||
|
|
282a3a5218 | ||
|
|
e52f465654 | ||
|
|
8dac0449a3 | ||
|
|
4d1dc7a9c2 | ||
|
|
b27afc854e | ||
|
|
eabc48b95f | ||
|
|
f3be1e39db | ||
|
|
2f9ad52a9c | ||
|
|
398ff23291 | ||
|
|
d14d1724af | ||
|
|
720cba0ae5 | ||
|
|
609e051e2a | ||
|
|
bd43a6bae1 | ||
|
|
570966c862 | ||
|
|
3b3f9f7582 | ||
|
|
8f2b5aa05b | ||
|
|
ed32292bc4 | ||
|
|
d97f9191a3 | ||
|
|
dd7659b113 | ||
|
|
0d0c52856d | ||
|
|
1c8e2aa1d4 | ||
|
|
7bfa6413ba | ||
|
|
645df6d0b7 | ||
|
|
5988330ddb | ||
|
|
1a08b5ae50 | ||
|
|
3e0f667fc5 | ||
|
|
1f6b5d8f21 | ||
|
|
996aee4a17 | ||
|
|
984b1af114 | ||
|
|
42ed766c58 | ||
|
|
8f4134a911 | ||
|
|
15245b4586 | ||
|
|
5e9ef98301 | ||
|
|
9353da816d | ||
|
|
416e93c4e4 | ||
|
|
23acb2703e | ||
|
|
3c0fa8be82 | ||
|
|
ef5cffe093 | ||
|
|
aae9bc6795 | ||
|
|
6bcaf2561c | ||
|
|
ea4e464e9d | ||
|
|
043646a4a8 | ||
|
|
b91d2c6afe | ||
|
|
1bac9dc496 | ||
|
|
484ca3f320 | ||
|
|
36999bf3c1 | ||
|
|
54eb0df9cc | ||
|
|
8a8f9d7649 | ||
|
|
c7fd49eead | ||
|
|
61bf491425 | ||
|
|
27adb42238 | ||
|
|
abfb98db46 | ||
|
|
6950b09879 | ||
|
|
4ad5652737 | ||
|
|
f01b5316a7 | ||
|
|
7320dd47f2 | ||
|
|
d0d9e2630d | ||
|
|
f769d761db | ||
|
|
baff756648 | ||
|
|
42ca66d61d | ||
|
|
abcb5ec40c | ||
|
|
3e7c579a3d | ||
|
|
9eb9873c64 | ||
|
|
7373685e2a | ||
|
|
aedc9c3741 | ||
|
|
ab24add92b | ||
|
|
26fbee31c6 | ||
|
|
2bf5ead89a | ||
|
|
fa8b4146f0 | ||
|
|
486a2fb8b5 | ||
|
|
dd6393753c | ||
|
|
2f37068c61 | ||
|
|
6796d17b30 | ||
|
|
9a5c0122ad | ||
|
|
98c29329d0 | ||
|
|
28ab8f05c1 | ||
|
|
bbfae5e341 | ||
|
|
af4d96ed60 | ||
|
|
81ae47a3d9 | ||
|
|
6d46fb5b4c | ||
|
|
f87cb28e9b | ||
|
|
a074ab1b1e | ||
|
|
5407cb0570 | ||
|
|
8baf727e3f | ||
|
|
e2b0f09fb9 | ||
|
|
aee7e2d5d3 | ||
|
|
216c5f1960 | ||
|
|
6bbd8333f9 | ||
|
|
e372322806 | ||
|
|
309d23ea2c | ||
|
|
fa8d677d37 | ||
|
|
3b1d11af88 | ||
|
|
8fccaa0e66 | ||
|
|
0c85a85d7c | ||
|
|
f4f290849c | ||
|
|
2ffb35dd47 | ||
|
|
83549ec2a3 | ||
|
|
d198989ad2 | ||
|
|
d2f4c8017c | ||
|
|
e261ada3cd | ||
|
|
98d0ed1457 | ||
|
|
a06df2b832 | ||
|
|
2919b0174f | ||
|
|
7788a664b5 | ||
|
|
f4a6a4d465 | ||
|
|
1a72187683 | ||
|
|
ace3d2abbf | ||
|
|
0ab38309db | ||
|
|
cf89c1b1c9 | ||
|
|
55cfd32f66 | ||
|
|
5e10632fb6 | ||
|
|
44275fe92d | ||
|
|
1e0d10761a | ||
|
|
97b608a306 | ||
|
|
83aa1e3ac0 | ||
|
|
c244fc70ec | ||
|
|
dac0c55204 | ||
|
|
0f15c2f62c | ||
|
|
bbe15797ba | ||
|
|
72975500c7 | ||
|
|
906f01fd7a | ||
|
|
f37578d0bc | ||
|
|
3dc406431b | ||
|
|
3d9ed1a149 | ||
| c160d84ae6 | |||
|
|
964d41b822 | ||
|
|
af90c48694 | ||
|
|
8a06ab5fc9 | ||
|
|
d65dc6d0dc | ||
|
|
57f9494ad4 | ||
|
|
449b3d6e8c | ||
|
|
e7a240bc8a | ||
|
|
a2255610b5 | ||
|
|
57e7e0cc0b | ||
|
|
76a079dd23 | ||
|
|
fa84118149 | ||
|
|
ff85c6f80a | ||
|
|
a680537a1b | ||
|
|
63d6643475 | ||
|
|
cd39124daa | ||
|
|
8d3b80cf4c | ||
|
|
76ef0d4ac6 | ||
|
|
0292d2ef71 | ||
|
|
cda50a0e07 | ||
|
|
3a4a2c1eca | ||
|
|
a48d45d0b5 | ||
|
|
5b69f0f53f | ||
|
|
ea3509ffb0 | ||
|
|
3136fba978 | ||
|
|
40f0ac7ade | ||
|
|
3d161fd37f | ||
|
|
358fd20f53 | ||
|
|
f517066638 | ||
|
|
ffc1cd4c32 | ||
|
|
9b28fe1352 | ||
|
|
0a11dac42a | ||
|
|
f9e00e3976 | ||
|
|
bbb119017c | ||
|
|
2ca8e591e7 | ||
|
|
cd72001881 | ||
|
|
802ac0afd7 | ||
|
|
ef33862d37 | ||
|
|
0d67b086ba | ||
|
|
3b5bf2ce2c | ||
|
|
45c19973af | ||
|
|
7e3f1bfb81 | ||
|
|
f50810a152 | ||
|
|
fb6ea53d3c | ||
|
|
88e0ea58ab | ||
|
|
857d2a9f9d | ||
|
|
814f013da1 | ||
|
|
5d40fc1e1b | ||
|
|
69a72ae993 | ||
|
|
a8e7a1c6aa | ||
|
|
bbd3f9aa7f | ||
|
|
f2034a0edd | ||
|
|
b274a655cd | ||
|
|
36811852fc | ||
|
|
4057da3b75 | ||
|
|
304a8c6453 | ||
|
|
c9304134ca | ||
|
|
94f5159ad9 | ||
|
|
9a8763a9d7 | ||
|
|
788a62505f | ||
|
|
c8e67775a0 | ||
|
|
3073d49715 | ||
|
|
e2237742b4 | ||
|
|
f34984872e | ||
|
|
c0018044a5 | ||
|
|
cdb884f18d | ||
|
|
2f4ee7be3c | ||
|
|
e7076354b4 | ||
|
|
b44b0aafd1 | ||
|
|
cb1637e21c | ||
|
|
115004194b | ||
|
|
9156249e74 | ||
|
|
b3322ee591 | ||
|
|
9be115a535 | ||
|
|
92ff74efef | ||
|
|
4ea8a4c254 | ||
|
|
55253b0915 | ||
|
|
6dc31afa15 | ||
|
|
bd78e1010d | ||
|
|
12fbb1fd55 | ||
|
|
fd9cf0317f | ||
|
|
4843d3294a | ||
|
|
b7a5d24de8 | ||
|
|
0c36709b54 | ||
|
|
3eb35faa77 | ||
|
|
167048af54 | ||
|
|
f62dab4e4e | ||
|
|
7e31052148 | ||
|
|
6864b960fb | ||
|
|
426da5ff04 | ||
|
|
b69eaa29d9 | ||
|
|
c74d5ccdad | ||
|
|
a7c816e6ca | ||
|
|
f89540dfdc | ||
|
|
5ad837ea3e | ||
|
|
723f6535ac | ||
|
|
53f555690b | ||
|
|
662bf5cfc5 | ||
|
|
b74976842e | ||
|
|
df69a74411 | ||
|
|
c45842266a | ||
|
|
64703c46dc | ||
|
|
b022e9e418 | ||
|
|
428831d83f | ||
|
|
c1762514d6 | ||
|
|
f3a72a9150 | ||
|
|
cfa2911f92 | ||
|
|
ef28b9a4bd | ||
|
|
3c48402f96 | ||
|
|
a9a40f241a | ||
|
|
021eba8a08 | ||
|
|
3030eac0c9 | ||
|
|
0354c59128 | ||
|
|
b7fa8cca66 | ||
|
|
02f8a6a8c5 | ||
|
|
c270d652c3 | ||
|
|
98d1bdcca4 | ||
|
|
46930fa520 | ||
|
|
adf0b62578 | ||
|
|
23412f9d78 | ||
|
|
0497a5dadb |
14
.gitea/workflows/test.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
name: Локальный тест
|
||||
on: [push]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: [For testing repo]
|
||||
steps:
|
||||
- name: Тестовый шаг 1
|
||||
run: echo "🎉 Запуск без интернета"
|
||||
- name: Информация о системе
|
||||
run: |
|
||||
uname -a
|
||||
echo "Рабочая папка: $PWD"
|
||||
- name: Список файлов
|
||||
run: ls -la
|
||||
1
.gitignore
vendored
@@ -39,3 +39,4 @@ modbus/serial/__pycache__
|
||||
/scenes/pribor-prd-n/kasseta-fs-nd.tscn.bak
|
||||
|
||||
*.patch
|
||||
проверка.log
|
||||
|
||||
23
README.md
@@ -1,9 +1,23 @@
|
||||
# Разработка
|
||||
|
||||
- После клонирования запустить скрипт [`git-hooks-config.sh`](git-hooks-config.sh)
|
||||
- В среде **Windows** запуск скрипта [`git-hooks-config.sh`](git-hooks-config.sh) производить из оболочки `git bash`
|
||||
- При необходимости обновить [`settings.json`](settings.json)
|
||||
- Использовать выражения вида `ProjectSettings.set_setting('application/config/%s' % key_name`
|
||||
и `ProjectSettings.get_setting('application/config/%s % key_name)` для доступа к настройкам.
|
||||
- `key_name` брать из таблицы `res://scenes/настройки/настройки.gd/SETTING_TABLE`
|
||||
- Следовать [общим правилам](http://gitea.srez.local:3000/sasha80/dev-manual).
|
||||
- **Windows**: убедиться, что исполняемый файл не заблокирован в брандмауэре.
|
||||
Обычно блокировка происходит автоматически, а отмена блокировки требует
|
||||
вмешательства пользователя.
|
||||
|
||||
# Ссылки на составные части
|
||||
|
||||
- [Исполняемые файлы для шаблонов экспорта и редактора](http://gitea.srez.local:3000/sasha80/godot-bin)
|
||||
- [Проброс последовательных портов через Ethernet](http://gitea.srez.local:3000/sasha80/uart-forwarder)
|
||||
- [Сборка Godot из исходников](http://gitea.srez.local:3000/sasha80/godot-build)
|
||||
- [Сервер карт](http://gitea.srez.local:3000/sasha80/map-tiles)
|
||||
- [Генераторы PCM файлов для модулей ФС](http://gitea.srez.local:3000/danil_tim/Signals_to_the_MP-550)
|
||||
|
||||
# Ссылки на имитаторы
|
||||
|
||||
@@ -14,6 +28,7 @@
|
||||
- [ПО 5П28 Пульт П16](http://gitea.srez.local:3000/MaD_CaT/imi-5p28)
|
||||
- [ПО 5П28 АКНГ](http://gitea.srez.local:3000/sasha80/imi-5p28-navi)
|
||||
- [Трасса](http://gitea.srez.local:3000/lepshiy/imi-trassa)
|
||||
- [Информационный ЭМС](http://gitea.srez.local:3000/MaD_CaT/mp550_imi_emstg)
|
||||
|
||||
# Автоматизация тестирования
|
||||
|
||||
@@ -21,7 +36,7 @@
|
||||
|
||||
# Сборка исполняемого файла из консоли
|
||||
|
||||
- Запустить скрипт `build.sh`
|
||||
- Запустить скрипт [`build.sh`](build.sh)
|
||||
|
||||
# Взаимодействие с 5П-28
|
||||
|
||||
@@ -30,9 +45,3 @@
|
||||
необходимые для этого настройки.
|
||||
- Для доступа к последовательным портам расположенным на другом вычислительном модуле,
|
||||
следует использовать [проброс портов](http://gitea.srez.local:3000/sasha80/uart-forwarder).
|
||||
|
||||
# Разработка
|
||||
|
||||
- После клонирования запустить скрипт `git-hooks-config.sh`
|
||||
- В среде **Windows** запуск скрипта `git-hooks-config.sh` производить из оболочки `git bash`
|
||||
- Нужно обновить `settings.json`
|
||||
|
||||
76
check.sh
Normal file
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Использование: $0 <папка_для_поиска>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TARGET_DIR="$1"
|
||||
|
||||
if [ ! -d "$TARGET_DIR" ]; then
|
||||
echo "Ошибка: папка '$TARGET_DIR' не существует!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Поиск строк в двойных кавычках в файлах .gd (исключая комментарии)..."
|
||||
echo "Папка: $TARGET_DIR"
|
||||
echo "=========================================="
|
||||
|
||||
FOUND_MATCHES=0
|
||||
|
||||
# Используем Process Substitution вместо пайплайна в цикле
|
||||
while IFS= read -r file; do
|
||||
# Используем awk для поиска строк с кавычками, исключая комментарии
|
||||
# и экранированные кавычки
|
||||
MATCHES=$(awk '
|
||||
BEGIN { line_num = 0 }
|
||||
{
|
||||
line_num++
|
||||
original_line = $0
|
||||
line = $0
|
||||
|
||||
# Ищем первый #, который не находится внутри кавычек
|
||||
in_quote = 0
|
||||
for (i = 1; i <= length(line); i++) {
|
||||
char = substr(line, i, 1)
|
||||
prev_char = substr(line, i-1, 1)
|
||||
|
||||
# Если находим неэкранированную кавычку, меняем состояние
|
||||
if (char == "\"" && prev_char != "\\") {
|
||||
in_quote = !in_quote
|
||||
}
|
||||
|
||||
# Если находим # вне кавычек, обрезаем строку до этого места
|
||||
if (char == "#" && !in_quote) {
|
||||
line = substr(line, 1, i-1)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
# Удаляем начальные и конечные пробелы
|
||||
gsub(/^[[:space:]]+|[[:space:]]+$/, "", line)
|
||||
|
||||
if (index(original_line, "\"\"\"") == 0) {
|
||||
# Ищем непустые строки с двойными кавычками
|
||||
if (line ~ /"[^"\\]*"/) {
|
||||
print line_num ": " original_line
|
||||
}
|
||||
}
|
||||
}
|
||||
' "$file")
|
||||
|
||||
if [ -n "$MATCHES" ]; then
|
||||
FOUND_MATCHES=1
|
||||
echo "Файл: $file"
|
||||
echo "$MATCHES" | while IFS= read -r match_line; do
|
||||
echo " Строка $match_line"
|
||||
done
|
||||
echo ""
|
||||
fi
|
||||
done < <(find "$TARGET_DIR" -type f -name "*.gd" -not -path "./addons/*")
|
||||
|
||||
if [ "$FOUND_MATCHES" -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exit 1
|
||||
84
config/banned_ranges.json
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"ranges": [
|
||||
{
|
||||
"max": 404993123,
|
||||
"min": 402777013
|
||||
},
|
||||
{
|
||||
"max": 488584484,
|
||||
"min": 420111389
|
||||
},
|
||||
{
|
||||
"max": 559113065,
|
||||
"min": 549071634
|
||||
},
|
||||
{
|
||||
"max": 590394020,
|
||||
"min": 581828010
|
||||
},
|
||||
{
|
||||
"max": 671113646,
|
||||
"min": 661072214
|
||||
},
|
||||
{
|
||||
"max": 825534007,
|
||||
"min": 784914374
|
||||
},
|
||||
{
|
||||
"max": 964027611,
|
||||
"min": 931531905
|
||||
},
|
||||
{
|
||||
"max": 1097550064,
|
||||
"min": 1076907893
|
||||
},
|
||||
{
|
||||
"max": 1217532686,
|
||||
"min": 1173668071
|
||||
},
|
||||
{
|
||||
"max": 1529745530,
|
||||
"min": 1500072408
|
||||
},
|
||||
{
|
||||
"max": 1790501904,
|
||||
"min": 1703047870
|
||||
},
|
||||
{
|
||||
"max": 1903884888,
|
||||
"min": 1798093759
|
||||
},
|
||||
{
|
||||
"max": 1982005472,
|
||||
"min": 1917112535
|
||||
},
|
||||
{
|
||||
"max": 2174813389,
|
||||
"min": 2103855925
|
||||
},
|
||||
{
|
||||
"max": 2397985516,
|
||||
"min": 2299661838
|
||||
},
|
||||
{
|
||||
"max": 2696028220,
|
||||
"min": 2594107498
|
||||
},
|
||||
{
|
||||
"max": 3627192359,
|
||||
"min": 3576902218
|
||||
},
|
||||
{
|
||||
"max": 5215200272,
|
||||
"min": 5186186730
|
||||
},
|
||||
{
|
||||
"max": 5397018474,
|
||||
"min": 5255819232
|
||||
},
|
||||
{
|
||||
"max": 5967607190,
|
||||
"min": 5944388619
|
||||
}
|
||||
]
|
||||
}
|
||||
3454
config/complex.json
Normal file
15
config/service_config.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[MP550]
|
||||
host=192.168.11.105
|
||||
port=42023
|
||||
transmit_interval_ms=100
|
||||
|
||||
[RDMP]
|
||||
host=127.0.0.1
|
||||
port=55000
|
||||
identity=MP550Service
|
||||
keep_alive_interval_ms=9000
|
||||
|
||||
[Service]
|
||||
autorun=false
|
||||
host=192.168.11.102
|
||||
port=42022
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bymxiptkbufvs"
|
||||
path="res://.godot/imported/Скруглённый квадрат серый.png-2111d7338e52a03a41f05d6ffbbc3eb6.ctex"
|
||||
uid="uid://cwfdur4we51wo"
|
||||
path="res://.godot/imported/2разъединение.png-a5736ca86ce553a4d764d6fc09130f8a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Скруглённый квадрат серый.png"
|
||||
dest_files=["res://.godot/imported/Скруглённый квадрат серый.png-2111d7338e52a03a41f05d6ffbbc3eb6.ctex"]
|
||||
source_file="res://data/2разъединение.png"
|
||||
dest_files=["res://.godot/imported/2разъединение.png-a5736ca86ce553a4d764d6fc09130f8a.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b1dw06ahtftq2"
|
||||
path="res://.godot/imported/Окно частот0.png-79ada2e7504614b9bdf58bce1aff61fb.ctex"
|
||||
uid="uid://bajrbvv7twq7m"
|
||||
path="res://.godot/imported/2соединение.png-b014241f07700023165f09936094354c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Окно частот0.png"
|
||||
dest_files=["res://.godot/imported/Окно частот0.png-79ada2e7504614b9bdf58bce1aff61fb.ctex"]
|
||||
source_file="res://data/2соединение.png"
|
||||
dest_files=["res://.godot/imported/2соединение.png-b014241f07700023165f09936094354c.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 125 B |
@@ -2,16 +2,16 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://co5xj5uhjfk84"
|
||||
path="res://.godot/imported/Окно.png-ff4b5eac96df23ad4cd8e06dc32f5bb8.ctex"
|
||||
uid="uid://vqajxsh5xamt"
|
||||
path="res://.godot/imported/nine-patch.png-b3022b5c868bc85e271b731e8fa2ec8a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Окно.png"
|
||||
dest_files=["res://.godot/imported/Окно.png-ff4b5eac96df23ad4cd8e06dc32f5bb8.ctex"]
|
||||
source_file="res://data/nine-patch.png"
|
||||
dest_files=["res://.godot/imported/nine-patch.png-b3022b5c868bc85e271b731e8fa2ec8a.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
@@ -4,19 +4,6 @@
|
||||
|
||||
[resource]
|
||||
fallbacks = Array[Font]([ExtResource("1_cxid7")])
|
||||
cache/0/17/0/ascent = 0.0
|
||||
cache/0/17/0/descent = 0.0
|
||||
cache/0/17/0/underline_position = 0.0
|
||||
cache/0/17/0/underline_thickness = 0.0
|
||||
cache/0/17/0/scale = 1.0
|
||||
cache/0/17/0/kerning_overrides/17/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/16/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/18/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/14/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/8/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/15/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/13/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/20/0 = Vector2(0, 0)
|
||||
cache/0/16/0/ascent = 0.0
|
||||
cache/0/16/0/descent = 0.0
|
||||
cache/0/16/0/underline_position = 0.0
|
||||
@@ -30,6 +17,24 @@ cache/0/16/0/kerning_overrides/8/0 = Vector2(0, 0)
|
||||
cache/0/16/0/kerning_overrides/15/0 = Vector2(0, 0)
|
||||
cache/0/16/0/kerning_overrides/13/0 = Vector2(0, 0)
|
||||
cache/0/16/0/kerning_overrides/20/0 = Vector2(0, 0)
|
||||
cache/0/17/0/ascent = 0.0
|
||||
cache/0/17/0/descent = 0.0
|
||||
cache/0/17/0/underline_position = 0.0
|
||||
cache/0/17/0/underline_thickness = 0.0
|
||||
cache/0/17/0/scale = 1.0
|
||||
cache/0/17/0/kerning_overrides/17/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/16/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/18/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/14/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/8/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/15/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/13/0 = Vector2(0, 0)
|
||||
cache/0/17/0/kerning_overrides/20/0 = Vector2(0, 0)
|
||||
cache/0/22/0/ascent = 0.0
|
||||
cache/0/22/0/descent = 0.0
|
||||
cache/0/22/0/underline_position = 0.0
|
||||
cache/0/22/0/underline_thickness = 0.0
|
||||
cache/0/22/0/scale = 1.0
|
||||
cache/0/18/0/ascent = 0.0
|
||||
cache/0/18/0/descent = 0.0
|
||||
cache/0/18/0/underline_position = 0.0
|
||||
@@ -113,8 +118,3 @@ cache/0/19/0/descent = 0.0
|
||||
cache/0/19/0/underline_position = 0.0
|
||||
cache/0/19/0/underline_thickness = 0.0
|
||||
cache/0/19/0/scale = 1.0
|
||||
cache/0/22/0/ascent = 0.0
|
||||
cache/0/22/0/descent = 0.0
|
||||
cache/0/22/0/underline_position = 0.0
|
||||
cache/0/22/0/underline_thickness = 0.0
|
||||
cache/0/22/0/scale = 1.0
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 16 KiB |
BIN
data/Окно.png
|
Before Width: | Height: | Size: 16 KiB |
BIN
data/Передатчик.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
34
data/Передатчик.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c73tjrn8gr00o"
|
||||
path="res://.godot/imported/Передатчик.png-a9919ed2f6d748be55f63a536bcda2ff.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Передатчик.png"
|
||||
dest_files=["res://.godot/imported/Передатчик.png-a9919ed2f6d748be55f63a536bcda2ff.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
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
data/Приёмник.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
34
data/Приёмник.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c6etralq2tvxg"
|
||||
path="res://.godot/imported/Приёмник.png-37dec39ffb59b71e3909414fe8f5fd1e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Приёмник.png"
|
||||
dest_files=["res://.godot/imported/Приёмник.png-37dec39ffb59b71e3909414fe8f5fd1e.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
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://3siondd3feev"
|
||||
path="res://.godot/imported/Скруглённый прямоугольник белый.png-758adbfc4fc135ed0095e711422b8c0e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Скруглённый прямоугольник белый.png"
|
||||
dest_files=["res://.godot/imported/Скруглённый прямоугольник белый.png-758adbfc4fc135ed0095e711422b8c0e.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
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://7ody4v7qy36g"
|
||||
path="res://.godot/imported/Скруглённый прямоугольник серый.png-318eedc8abeb0fd535304028648863b7.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Скруглённый прямоугольник серый.png"
|
||||
dest_files=["res://.godot/imported/Скруглённый прямоугольник серый.png-318eedc8abeb0fd535304028648863b7.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/Состояние РЭС 2.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
34
data/Состояние РЭС 2.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://6ar7sux3vcv1"
|
||||
path="res://.godot/imported/Состояние РЭС 2.png-7acd4e8d9bd67ea07a3eadee4b22c22d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Состояние РЭС 2.png"
|
||||
dest_files=["res://.godot/imported/Состояние РЭС 2.png-7acd4e8d9bd67ea07a3eadee4b22c22d.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/Состояние РЭС 4.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
34
data/Состояние РЭС 4.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b85f1ne2wrwhg"
|
||||
path="res://.godot/imported/Состояние РЭС 4.png-d46f69e8c351fe747cf68bce4af4b8eb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Состояние РЭС 4.png"
|
||||
dest_files=["res://.godot/imported/Состояние РЭС 4.png-d46f69e8c351fe747cf68bce4af4b8eb.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
|
||||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 6.1 KiB |
BIN
data/Угловой квадрат3.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
34
data/Угловой квадрат3.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://docnrxrm2f022"
|
||||
path="res://.godot/imported/Угловой квадрат3.png-7973b0c96861e98d72e8e1ea32d59204.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Угловой квадрат3.png"
|
||||
dest_files=["res://.godot/imported/Угловой квадрат3.png-7973b0c96861e98d72e8e1ea32d59204.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: 707 B |
@@ -3,15 +3,15 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://busl8rb38lis"
|
||||
path="res://.godot/imported/Скруглённый прямоуг салатный.png-e10b4e8820d45ab6e79c4fba522af854.ctex"
|
||||
path="res://.godot/imported/матрица-конфликт.png-e109709def61ac1d626d23088b556664.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Скруглённый прямоуг салатный.png"
|
||||
dest_files=["res://.godot/imported/Скруглённый прямоуг салатный.png-e10b4e8820d45ab6e79c4fba522af854.ctex"]
|
||||
source_file="res://data/матрица-конфликт.png"
|
||||
dest_files=["res://.godot/imported/матрица-конфликт.png-e109709def61ac1d626d23088b556664.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
BIN
data/матрица-чисто.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
@@ -3,15 +3,15 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://djv8fkddcjucs"
|
||||
path="res://.godot/imported/Скруглённый квадрат белый.png-4793c453fe49bfbe7c9affd223331345.ctex"
|
||||
path="res://.godot/imported/матрица-чисто.png-43b162afe88b693461904505b377fae0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/Скруглённый квадрат белый.png"
|
||||
dest_files=["res://.godot/imported/Скруглённый квадрат белый.png-4793c453fe49bfbe7c9affd223331345.ctex"]
|
||||
source_file="res://data/матрица-чисто.png"
|
||||
dest_files=["res://.godot/imported/матрица-чисто.png-43b162afe88b693461904505b377fae0.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
34
data/разъединение.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b0wa068b6gl1y"
|
||||
path="res://.godot/imported/разъединение.png-285b8ee2e2b500484829beae0ee4e16b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/разъединение.png"
|
||||
dest_files=["res://.godot/imported/разъединение.png-285b8ee2e2b500484829beae0ee4e16b.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: 1.4 KiB |
@@ -2,16 +2,16 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bw3yv3smvaxqn"
|
||||
path="res://.godot/imported/nine-patch.png-798f7950fb3126b4e1ed0c39d9e4beba.ctex"
|
||||
uid="uid://blx6c1o1nogks"
|
||||
path="res://.godot/imported/связь.png-dc3eae4c11f71101d4ba94487cecfaaa.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://table/nine-patch.png"
|
||||
dest_files=["res://.godot/imported/nine-patch.png-798f7950fb3126b4e1ed0c39d9e4beba.ctex"]
|
||||
source_file="res://data/связь.png"
|
||||
dest_files=["res://.godot/imported/связь.png-dc3eae4c11f71101d4ba94487cecfaaa.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
34
data/соединение.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bf1e2xlk3x1aw"
|
||||
path="res://.godot/imported/соединение.png-aac09e55b0c5d57ef3c31c34daaf336b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://data/соединение.png"
|
||||
dest_files=["res://.godot/imported/соединение.png-aac09e55b0c5d57ef3c31c34daaf336b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
dot -Tpng "структура.dot" -o "структура.png"
|
||||
pandoc -f markdown_strict --verbose "README.md" > "README.doc"
|
||||
@@ -1,38 +0,0 @@
|
||||
digraph "Прибор УФ"
|
||||
{
|
||||
graph [nodesep=0.5, overlap = false];
|
||||
node [shape=box, overlap = false];
|
||||
eth0 [label="eth0", shape=cds];
|
||||
eth1 [label="eth1", shape=cds];
|
||||
eth2 [label="eth2", shape=cds];
|
||||
tty0 [label="tty0", shape=cds];
|
||||
tty1 [label="tty1", shape=cds];
|
||||
tty2 [label="tty2", shape=cds];
|
||||
proto_capsrpb [label="Протокол КАПС-РПБ"];
|
||||
proto_5p28 [label="Протокол 5П-28"];
|
||||
uarep_uart [label="UART ModBus"];
|
||||
uarep_ctl [label="ПО УАРЭП"];
|
||||
caps_rpb [label="СПО \"КАПС РПБ\""];
|
||||
p16 [label="П16", shape=plaintext, style=filled];
|
||||
spt25left [label="СПТ25 левый борт", shape=plaintext, style=filled];
|
||||
spt25right [label="СПТ25 правый борт", shape=plaintext, style=filled];
|
||||
|
||||
eth0 -> proto_5p28;
|
||||
eth1 -> proto_5p28;
|
||||
eth0 -> proto_capsrpb;
|
||||
eth1 -> proto_capsrpb;
|
||||
eth0 -> uarep_uart;
|
||||
eth1 -> uarep_uart;
|
||||
eth2 -> caps_rpb;
|
||||
proto_5p28 -> uarep_ctl;
|
||||
uarep_uart -> uarep_ctl;
|
||||
uarep_uart -> tty0;
|
||||
uarep_uart -> tty1;
|
||||
uarep_uart -> tty2;
|
||||
uarep_ctl -> caps_rpb;
|
||||
proto_capsrpb -> caps_rpb;
|
||||
p16 -> eth0 [style=invis]
|
||||
p16 -> eth1 [style=invis]
|
||||
spt25left -> tty0 [style=invis]
|
||||
spt25right -> tty1 [style=invis]
|
||||
}
|
||||
@@ -22,7 +22,7 @@ script_export_mode=0
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=2
|
||||
debug/export_console_wrapper=0
|
||||
binary_format/embed_pck=true
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
# - выполнение фиксации;
|
||||
# - выполнение слияния.
|
||||
|
||||
|
||||
GDSCRIPT_FILE="scripts/commit.gd"
|
||||
LOGFILE="проверка.log"
|
||||
HEAD="$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --short HEAD) $(git log -1 --format=%cd)"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
HEAD="Изменённый ${HEAD}"
|
||||
@@ -29,3 +29,6 @@ fi
|
||||
echo "extends Node" > ${GDSCRIPT_FILE}
|
||||
echo "# Файл сгенерирован автоматически! Не изменять вручную!" >> ${GDSCRIPT_FILE}
|
||||
echo "const VCS_HEAD = '${HEAD}'" >> ${GDSCRIPT_FILE}
|
||||
|
||||
echo "${HEAD}" > ${LOGFILE}
|
||||
./check.sh . >> ${LOGFILE}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
## ```
|
||||
## > iptables v1.8.2 (nf_tables)
|
||||
|
||||
|
||||
INI_FILE="/opt/5p28/device.ini" ## Путь к INI-файлу 5п28
|
||||
SECTION_NAME="navigat" ## Название секции INI-файла 5п28
|
||||
IP_PORT_NAME="port" ## Имя поля INI-файла 5п28 в котором хранится номер порта назначения
|
||||
|
||||
@@ -29,7 +29,6 @@ interfer/default_color0=Color(0.38, 0.47, 0.51, 1)
|
||||
interfer/default_color1=Color(0.39, 0.44, 0.5, 1)
|
||||
interfer/select_color=Color(1, 1, 1, 1)
|
||||
interfer/interfer_color=Color(0.9, 0.1, 0.25, 0.9)
|
||||
interfer/resend_timeout=1000.0
|
||||
config/external_cu=false
|
||||
config/unit_rr_request_period=20.0
|
||||
config/kems_files_path="user://kems/"
|
||||
@@ -38,6 +37,65 @@ config/settings_path="user://settings.json"
|
||||
config/unit_bpo_request_period=20.0
|
||||
interfer/emit_color=Color(0.9, 0.1, 0.25, 0.5)
|
||||
interfer/closed_sectors=Color(0, 0, 0, 1)
|
||||
"config/Адрес АФСП левого борта"=""
|
||||
"config/Адрес АФСП правого борта"=""
|
||||
"config/Адрес БПО левого борта"=""
|
||||
"config/Адрес БПО правого борта"=""
|
||||
"config/Виртуальная клавиатура"=false
|
||||
"config/Включить работу по своим целям"=true
|
||||
"config/Внешнее указание Трасса"=false
|
||||
"config/Внешнее управление"=false
|
||||
"config/Кнопка «JTIDS»"=false
|
||||
"config/Кнопка «К1»"=false
|
||||
"config/Кнопка «КУПД»"=false
|
||||
"config/Кнопка «ЛЧМ-1»"=false
|
||||
"config/Кнопка «МЧМ-1»"=false
|
||||
"config/Кнопка «ОЗП-1»"=false
|
||||
"config/Кнопка «ОРН-И1»"=false
|
||||
"config/Кнопка «ОРН-М2»"=false
|
||||
"config/Кнопка «ОРН»"=false
|
||||
"config/Кнопка «ПД-М2»"=false
|
||||
"config/Кнопка «ПД-М4»"=false
|
||||
"config/Кнопка «ПД-М4С»"=false
|
||||
"config/Кнопка «ПД-ЧМ»"=false
|
||||
"config/Кнопка «Подавление»"=false
|
||||
"config/Кнопка «СВ-И1»"=false
|
||||
"config/Кнопка «СВ-М2»"=false
|
||||
"config/Ограниченный режим"=false
|
||||
"config/Отладка контроля"=true
|
||||
"config/Период опроса состояния АФСП, секунды"=""
|
||||
"config/Период опроса состояния БПО, секунды"=""
|
||||
"config/Скрыть вкладку ЭМС 2"=true
|
||||
"config/Список своих протоколов"=""
|
||||
"config/Текущая версия ПО УАРЭП"="master 3bff1cd Tue Nov 4 15:33:24 2025 +0300"
|
||||
"config/Цвет кнопки \"Подавление\""="[0.905882358551025,0.00392156885936856,0.0,1.0]"
|
||||
"config/Цвет схемы"="[0.905954480171204,0.921875,0.8714599609375,1.0]"
|
||||
"config/Цвет фона схемы"="[0.258926391601563,0.274618297815323,0.27734375,1.0]"
|
||||
"config/Шаблон адреса сервера карт"="https://tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||
"config/навигация"=["*", 60000.0, true, true]
|
||||
"config/уарэп-5п28"=["127.0.0.1", 50777.0]
|
||||
"config/уарэп-капсрпб"=["127.0.0.1", "127.0.0.1", 42023.0, 42022.0, false, true]
|
||||
"config/уарэп-спт25-1"=["/home/user/tty0", 0.0, 19200.0, "N", 8.0, 1.0]
|
||||
"config/уарэп-спт25-2"=["/home/user/tty1", 0.0, 19200.0, "N", 8.0, 1.0]
|
||||
"config/уарэп-трасса"=["192.168.11.34", "192.168.11.105", 50200.0, 10004.0, false, true]
|
||||
"config/уарэп-щ3"=["/home/user/tty3", 7.0, 19200.0, "N", 8.0, 1.0, 50000.0]
|
||||
"config/уарэп-эмс"=["10.1.1.52", 50052.0, false, false]
|
||||
"config/уарэп-яу07-1в"=["10.1.1.12", 50012.0, false, false]
|
||||
"config/уарэп-яу07-1к"=["10.1.1.13", 50013.0, false, false]
|
||||
"config/уарэп-яу07-1н"=["10.1.1.11", 50011.0, false, false]
|
||||
"config/уарэп-яу07-2в"=["10.1.1.22", 50022.0, false, false]
|
||||
"config/уарэп-яу07-2к"=["10.1.1.23", 50023.0, false, false]
|
||||
"config/уарэп-яу07-2н"=["10.1.1.21", 50021.0, false, false]
|
||||
"config/уарэп-яу07-3в"=["10.1.1.32", 50032.0, false, false]
|
||||
"config/уарэп-яу07-3к"=["10.1.1.33", 50033.0, false, false]
|
||||
"config/уарэп-яу07-3н"=["10.1.1.31", 50031.0, false, false]
|
||||
"config/уарэп-яу07-4в"=["10.1.1.42", 50042.0, false, false]
|
||||
"config/уарэп-яу07-4к"=["10.1.1.43", 50043.0, false, false]
|
||||
"config/уарэп-яу07-4н"=["10.1.1.41", 50041.0, false, false]
|
||||
"config/уарэп-яу07-общий"=["*", 50000.0, true, true]
|
||||
"config/уарэп-яу07-частный"=["10.1.1.253", 50253.0, false, true]
|
||||
config/="[0.215686276555061,0.976470589637756,1.0,1.0]"
|
||||
"config/Цвет темы программы"=false
|
||||
|
||||
[autoload]
|
||||
|
||||
@@ -64,6 +122,7 @@ astrakb="*res://scripts/astra-kb.gd"
|
||||
prd="*res://scripts/prd.gd"
|
||||
navi="*res://scripts/navigation.gd"
|
||||
trassa="*res://scripts/trassa.gd"
|
||||
yemstg="*res://scripts/yemstg.gd"
|
||||
|
||||
[debug]
|
||||
|
||||
@@ -74,7 +133,6 @@ gdscript/warnings/unassigned_variable_op_assign=2
|
||||
gdscript/warnings/unused_signal=0
|
||||
gdscript/warnings/shadowed_variable=2
|
||||
gdscript/warnings/shadowed_variable_base_class=2
|
||||
gdscript/warnings/shadowed_global_identifier=2
|
||||
gdscript/warnings/unsafe_cast=1
|
||||
gdscript/warnings/assert_always_true=2
|
||||
gdscript/warnings/assert_always_false=2
|
||||
@@ -90,6 +148,7 @@ window/subwindows/embed_subwindows=false
|
||||
window/frame_pacing/android/enable_frame_pacing=false
|
||||
window/stretch/mode="canvas_items"
|
||||
window/dpi/allow_hidpi=false
|
||||
window/vsync/vsync_mode=0
|
||||
|
||||
[editor]
|
||||
|
||||
@@ -110,6 +169,7 @@ folder_colors={
|
||||
"res://scenes/bip/": "blue",
|
||||
"res://scenes/button-flat/": "blue",
|
||||
"res://scenes/button-scale/": "blue",
|
||||
"res://scenes/button-six-state/": "blue",
|
||||
"res://scenes/cell/": "blue",
|
||||
"res://scenes/count-all/": "blue",
|
||||
"res://scenes/count-danger/": "blue",
|
||||
@@ -121,6 +181,7 @@ folder_colors={
|
||||
"res://scenes/frame/": "blue",
|
||||
"res://scenes/grid-buttons-ecm/": "blue",
|
||||
"res://scenes/grid-side-panel/": "blue",
|
||||
"res://scenes/hranges/": "blue",
|
||||
"res://scenes/pribor-afsp/": "purple",
|
||||
"res://scenes/pribor-externals/": "purple",
|
||||
"res://scenes/pribor-prd-k/": "purple",
|
||||
@@ -134,8 +195,8 @@ folder_colors={
|
||||
"res://scenes/контроль/": "green",
|
||||
"res://scenes/настройки/": "green",
|
||||
"res://scenes/работа/": "green",
|
||||
"res://scenes/эмс-тг/": "green",
|
||||
"res://scenes/эмс/": "green",
|
||||
"res://scenes/эмс2/": "green",
|
||||
"res://scripts/": "pink",
|
||||
"res://shaders/": "pink",
|
||||
"res://table/": "blue"
|
||||
@@ -209,6 +270,8 @@ common/enable_object_picking=false
|
||||
renderer/rendering_method="gl_compatibility"
|
||||
renderer/rendering_method.mobile="gl_compatibility"
|
||||
shader_compiler/shader_cache/strip_debug=true
|
||||
textures/default_filters/anisotropic_filtering_level=0
|
||||
anti_aliasing/screen_space_roughness_limiter/enabled=false
|
||||
quality/driver/fallback_to_gles2=true
|
||||
|
||||
[shader_globals]
|
||||
@@ -217,3 +280,7 @@ tick_curent={
|
||||
"type": "int",
|
||||
"value": 0
|
||||
}
|
||||
random_value={
|
||||
"type": "float",
|
||||
"value": 0.0
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://da7w3vkhadfwe"]
|
||||
[gd_scene load_steps=14 format=3 uid="uid://da7w3vkhadfwe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://damy6n4u215pu" path="res://scenes/button-flat/nine-patch-button.gd" id="1_ui6sg"]
|
||||
[ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="2_0cn5u"]
|
||||
[ext_resource type="Shader" uid="uid://cdmmsf161l6yw" path="res://shaders/strips.gdshader" id="2_5ngiq"]
|
||||
[ext_resource type="Texture2D" uid="uid://cl8h2vaibabyi" path="res://data/кнопка-квадрат-1.png" id="3_tbv1w"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="1"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hhdyc"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("2_5ngiq")
|
||||
shader_parameter/rotation = 0.0
|
||||
shader_parameter/rotation = 0.785398
|
||||
shader_parameter/color = Vector4(1, 1, 1, 0.1)
|
||||
shader_parameter/width = 3.0
|
||||
shader_parameter/speed = 0.0
|
||||
@@ -56,13 +57,16 @@ offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
theme_override_styles/panel = SubResource("1")
|
||||
script = ExtResource("1_ui6sg")
|
||||
texture_state0 = ExtResource("2_0cn5u")
|
||||
texture_state1 = ExtResource("3_tbv1w")
|
||||
strips_rotation = 45.0
|
||||
|
||||
[node name="recommend" type="ReferenceRect" parent="."]
|
||||
visible = false
|
||||
z_as_relative = false
|
||||
layout_mode = 2
|
||||
border_color = Color(0, 0.549509, 0.921779, 1)
|
||||
border_width = 5.0
|
||||
border_color = Color(0.0941176, 0.0941176, 0.698039, 1)
|
||||
border_width = 10.0
|
||||
editor_only = false
|
||||
|
||||
[node name="back" type="Sprite2D" parent="."]
|
||||
@@ -72,6 +76,7 @@ texture = SubResource("PlaceholderTexture2D_6nup5")
|
||||
centered = false
|
||||
script = SubResource("GDScript_uyl5d")
|
||||
speed = 0.0
|
||||
strips_rotation = 0.785398
|
||||
|
||||
[node name="state" type="NinePatchRect" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
@@ -12,29 +12,35 @@ func is_toggle_mode(): return $button.is_toggle_mode()
|
||||
|
||||
var _pressed: = false
|
||||
|
||||
@export var texture_state0: Texture2D = preload('res://data/кнопка-квадрат-0.png'):
|
||||
@export var texture_state0: Texture2D:
|
||||
set(val):
|
||||
texture_state0 = val
|
||||
$state.set_texture(val)
|
||||
|
||||
|
||||
@export var texture_state1: Texture2D = preload('res://data/кнопка-квадрат-1.png'):
|
||||
@export var texture_state1: Texture2D:
|
||||
set(val):
|
||||
texture_state1 = val
|
||||
if is_inside_tree():
|
||||
$state.set_texture(val)
|
||||
|
||||
|
||||
@export var strips_rotation: float = 0.0:
|
||||
set(val):
|
||||
strips_rotation = val
|
||||
$back.strips_rotation = deg_to_rad(val)
|
||||
if is_inside_tree():
|
||||
$back.strips_rotation = deg_to_rad(val)
|
||||
|
||||
|
||||
@export var text: String = '':
|
||||
set(val):
|
||||
text = val
|
||||
$button.set_text(val)
|
||||
if is_inside_tree():
|
||||
$button.set_text(val)
|
||||
|
||||
|
||||
@export var btn_tooltip: String = '':
|
||||
set(val):
|
||||
btn_tooltip = val
|
||||
if is_inside_tree():
|
||||
$button.set_tooltip_text(val)
|
||||
|
||||
|
||||
@export var disabled: bool = false:
|
||||
@@ -64,7 +70,9 @@ var _pressed: = false
|
||||
|
||||
@export var font_size: int = 15:
|
||||
set(val):
|
||||
$button.add_theme_font_size_override('theme_override_font_sizes/font_size', val)
|
||||
font_size = val
|
||||
if is_inside_tree():
|
||||
$button.add_theme_font_size_override('theme_override_font_sizes/font_size', val)
|
||||
|
||||
|
||||
func set_pressed(val: bool):
|
||||
@@ -86,7 +94,19 @@ func _enter_tree() -> void:
|
||||
$back.scale = size
|
||||
$back.material.set('shader_parameter/scale', size / Vector2(20.0, 20.0))
|
||||
$button.connect('toggled', _on_button_toggled)
|
||||
$button.set_toggle_mode(toggle_mode)
|
||||
$button.add_theme_font_size_override('theme_override_font_sizes/font_size', font_size)
|
||||
pressed = _pressed
|
||||
$button.set_pressed(pressed)
|
||||
$button.set_disabled(disabled)
|
||||
$back.disabled = disabled
|
||||
$state.modulate.a = 0.5 if disabled else 1.0
|
||||
$button.set_tooltip_text(btn_tooltip)
|
||||
$button.set_text(text)
|
||||
|
||||
|
||||
func _on_settings_changed():
|
||||
pass
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
|
||||
77
scenes/button-six-state/six-state.tscn
Normal file
@@ -0,0 +1,77 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cixwl6xi22buo"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="1_ufod8"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_ufod8"]
|
||||
script/source = "@tool
|
||||
extends GridContainer
|
||||
|
||||
@export var text_check: Array[String]
|
||||
@export_file var image_states: Array[String]
|
||||
var txr_states: Array[CompressedTexture2D]
|
||||
|
||||
|
||||
@export var state: int = 0:
|
||||
set(val):
|
||||
state = val % image_states.size()
|
||||
if is_inside_tree():
|
||||
val %= txr_states.size()
|
||||
state = val
|
||||
$done.texture = txr_states[val]
|
||||
|
||||
|
||||
@export var pressed: bool = false:
|
||||
set(val):
|
||||
pressed = val
|
||||
if is_inside_tree():
|
||||
$check.button_pressed = pressed
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
txr_states.clear()
|
||||
for fn in image_states:
|
||||
txr_states.append(load(fn))
|
||||
$done.texture = txr_states[state]
|
||||
$check.button_pressed = pressed
|
||||
|
||||
|
||||
func connect_check(signal_name: StringName, callable: Callable):
|
||||
$check.connect(signal_name, callable)
|
||||
|
||||
|
||||
func disconnect_check(signal_name: StringName, callable: Callable):
|
||||
$check.disconnect(signal_name, callable)
|
||||
|
||||
|
||||
func _on_check_toggled(toggled_on: bool) -> void:
|
||||
$text.text = text_check[int(toggled_on)]
|
||||
"
|
||||
|
||||
[node name="six-state" type="GridContainer"]
|
||||
offset_right = 156.0
|
||||
offset_bottom = 24.0
|
||||
columns = 3
|
||||
script = SubResource("GDScript_ufod8")
|
||||
text_check = Array[String](["Запрещено", "Разрешено"])
|
||||
image_states = Array[String](["uid://c6nve6f8sfyj2", "uid://dnreyfh3cd1k2", "uid://c6booa8753u5t"])
|
||||
|
||||
[node name="done" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("1_ufod8")
|
||||
expand_mode = 3
|
||||
|
||||
[node name="text" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
text = "Запрещено"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="check" type="CheckButton" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
action_mode = 0
|
||||
|
||||
[connection signal="toggled" from="check" to="." method="_on_check_toggled"]
|
||||
@@ -1,44 +1,59 @@
|
||||
class_name Diagram extends Sprite2D
|
||||
class_name Diagram extends ColorRect
|
||||
|
||||
const NUM_OF_RANGE = 7
|
||||
const NUM_OF_DIRECTIONS = 4
|
||||
var fs_default_colors: Array[Color] ## Цвета по умолчанию для блоков ФС.
|
||||
const ANTS_COUNT: = 28
|
||||
const ANT_COLOR: = Color(0.38, 0.47, 0.51, 1.0)
|
||||
|
||||
@export var ant_color: Color = ANT_COLOR
|
||||
@export var SecZap: PackedScene
|
||||
@export var inner_radius_0: = 0.36 ## Внутренний радиус диаграммы в режиме РТО
|
||||
@export var inner_radius_1: = 0.855 ## Внутренний радиус диаграммы в обзора
|
||||
|
||||
var fs_default_colors: PackedColorArray ## Цвета по умолчанию для блоков ФС
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
signaller.connect('map_mode_changed', Callable(self, 'set_view_mode'))
|
||||
set_def_colors()
|
||||
ProjectSettings.connect('settings_changed', _on_settings_changed)
|
||||
_on_settings_changed()
|
||||
_init_def_colors()
|
||||
set_band_colors(fs_default_colors)
|
||||
|
||||
|
||||
func sv(val: float) -> float: return val / ($строб.scale.x / 2.0) * 0.125
|
||||
|
||||
func set_canvas_rotation(val: float) -> void: material.set('shader_parameter/rotation', val)
|
||||
func set_strob_visible(val: bool): $строб.visible = val
|
||||
func set_strob_center(val: Vector2): $строб.position = val
|
||||
func set_strob_dir(val: float): $строб.set_instance_shader_parameter('dir', val)
|
||||
func set_strob_width(val: float): $строб.set_instance_shader_parameter('width', val)
|
||||
func set_strob_band(val: float): $строб.set_instance_shader_parameter('band', val / 125.0)
|
||||
func set_strob_radius(val: float): $строб.set_instance_shader_parameter('radius', sv(val))
|
||||
func set_strob_color(val: Color): $строб.set_instance_shader_parameter('color', val)
|
||||
func set_band_failures(val: PackedInt32Array): material.set('shader_parameter/ant_band_m', val)
|
||||
func set_canvas_rotation(val: float): material.set('shader_parameter/rotation', val)
|
||||
func set_radius_inner_frac(val: float): material.set('shader_parameter/inner_radius', val)
|
||||
func set_strob_band(val: float): $строб.set_instance_shader_parameter('band', val / 125.0)
|
||||
func set_strob_center(val: Vector2): $строб.position = val
|
||||
func set_strob_color(val: Color): $строб.set_instance_shader_parameter('color', val)
|
||||
func set_strob_dir(val: float): $строб.set_instance_shader_parameter('dir', val)
|
||||
func set_strob_radius(val: float): $строб.set_instance_shader_parameter('radius', sv(val))
|
||||
func set_strob_visible(val: bool): $строб.visible = val
|
||||
func set_strob_width(val: float): $строб.set_instance_shader_parameter('width', val)
|
||||
|
||||
func get_strob_center() -> Vector2: return $строб.position
|
||||
func get_strob_visible() -> bool: return $строб.visible
|
||||
func get_strob_dir() -> float: return $строб.get_instance_shader_parameter('dir')
|
||||
func get_strob_width() -> float: return $строб.get_instance_shader_parameter('width')
|
||||
func get_strob_band() -> float: return $строб.get_instance_shader_parameter('band') * 125.0
|
||||
func get_strob_radius() -> float: return $строб.get_instance_shader_parameter('radius') * 125.0
|
||||
func get_strob_color() -> float: return $строб.get_instance_shader_parameter('color')
|
||||
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 get_canvas_rotation() -> float: return material.get('shader_parameter/rotation')
|
||||
func get_radius_outter() -> float: return size.x / scale.x
|
||||
func get_radius_inner_frac() -> float: return material.get('shader_parameter/inner_radius')
|
||||
func get_strob_band() -> float: return $строб.get_instance_shader_parameter('band') * 125.0
|
||||
func get_strob_center() -> Vector2: return $строб.position
|
||||
func get_strob_color() -> float: return $строб.get_instance_shader_parameter('color')
|
||||
func get_strob_dir() -> float: return $строб.get_instance_shader_parameter('dir')
|
||||
func get_strob_radius() -> float: return $строб.get_instance_shader_parameter('radius') * 125.0
|
||||
func get_strob_visible() -> bool: return $строб.visible
|
||||
func get_strob_width() -> float: return $строб.get_instance_shader_parameter('width')
|
||||
|
||||
func get_canvas_rotation() -> float: return material.get('shader_parameter/rotation')
|
||||
func get_radius_outter() -> float: return material.get('shader_parameter/radius_outter')
|
||||
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)
|
||||
## Выставляет цвета для секторов
|
||||
func set_band_colors(val: PackedColorArray):
|
||||
var image: = Image.create(val.size(), 1, false, Image.FORMAT_RGBA8)
|
||||
for x in val.size():
|
||||
image.set_pixel(x, 0, val[x])
|
||||
var tex: = ImageTexture.create_from_image(image)
|
||||
material.set('shader_parameter/sec_colors', tex)
|
||||
|
||||
|
||||
## Добавляет сектор запрета[br]
|
||||
## [param id] - Индекс сектора запрета.[br]
|
||||
@@ -82,35 +97,28 @@ func set_seczap(id: int, szv: Vector4):
|
||||
|
||||
func clear_all_seczap():
|
||||
for child in get_children():
|
||||
if child.name.begins_with("SECZAP"):
|
||||
if child.name.begins_with('SECZAP'):
|
||||
remove_child(child)
|
||||
child.queue_free()
|
||||
|
||||
|
||||
func set_seczap_color(id: int, color: Color):
|
||||
func set_seczap_color(id: int, c: Color):
|
||||
var seczap: = get_node('SECZAP%d' % id)
|
||||
seczap.set_instance_shader_parameter('color', color)
|
||||
seczap.set_instance_shader_parameter('color', c)
|
||||
|
||||
|
||||
func set_view_mode(val: int):
|
||||
if val == 1:
|
||||
$строб.hide()
|
||||
else:
|
||||
$строб.show()
|
||||
material.set('shader_parameter/mode', val)
|
||||
var inner_radius = inner_radius_1 if val == 1 else inner_radius_0
|
||||
material.set('shader_parameter/inner_radius', inner_radius)
|
||||
|
||||
|
||||
func _on_settings_changed():
|
||||
ant_color = ProjectSettings.get_setting('application/interfer/ant_color', ANT_COLOR)
|
||||
ant_color *= Color(1.0, 1.0, 1.0, 0.0)
|
||||
|
||||
|
||||
## Закрашивание по умолчанию блоков ФС цветами из настроек.
|
||||
func set_def_colors():
|
||||
var color0: Color = ProjectSettings.get_setting('application/interfer/default_color0', Color(0.38, 0.47, 0.51, 1.0))
|
||||
var color1: Color = ProjectSettings.get_setting('application/interfer/default_color1', Color(0.39, 0.44, 0.50, 1.0))
|
||||
color0 *= Color(1.0, 1.0, 1.0, 0.0)
|
||||
color1 *= Color(1.0, 1.0, 1.0, 0.0)
|
||||
var col_arr: Array = [color0, color1]
|
||||
var col = false
|
||||
for i in NUM_OF_RANGE:
|
||||
for j in NUM_OF_DIRECTIONS:
|
||||
fs_default_colors.append(col_arr[int(col)])
|
||||
col = not col
|
||||
col = not col
|
||||
set_band_colors(fs_default_colors)
|
||||
func _init_def_colors():
|
||||
fs_default_colors.clear()
|
||||
for i in ANTS_COUNT:
|
||||
fs_default_colors.append(ant_color)
|
||||
|
||||
@@ -1,25 +1,39 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://b5kjdyxuwsot5"]
|
||||
|
||||
[ext_resource type="Material" uid="uid://s6xe8igevnv2" path="res://shaders/antenas.tres" id="1_newdt"]
|
||||
[ext_resource type="Shader" uid="uid://dhipoo0ju5ebg" path="res://shaders/antenas.gdshader" id="1_8cjpq"]
|
||||
[ext_resource type="Script" uid="uid://b85scuflwlqom" path="res://scenes/diagram/diagram.gd" id="2_8xjuy"]
|
||||
[ext_resource type="PackedScene" uid="uid://c73ahpv8uiuc7" path="res://scenes/diagram/sector.tscn" id="3_tgnog"]
|
||||
[ext_resource type="Shader" uid="uid://k36g8tww5yo" path="res://shaders/sector.gdshader" id="4_obn6s"]
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_2bft1"]
|
||||
size = Vector2(1600, 1200)
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_oqtdt"]
|
||||
shader = ExtResource("1_8cjpq")
|
||||
shader_parameter/grid_cells_angle = 4
|
||||
shader_parameter/grid_layers_radius = 7
|
||||
shader_parameter/alpha = 0.5
|
||||
shader_parameter/inner_radius = 0.36
|
||||
shader_parameter/outer_radius = 1.0
|
||||
shader_parameter/grid_line_width = 0.0025
|
||||
shader_parameter/rotation = 0.0
|
||||
shader_parameter/ffr = 0.15
|
||||
shader_parameter/sfr = 0.0
|
||||
shader_parameter/pfr = 0.015
|
||||
shader_parameter/afr = 0.0
|
||||
shader_parameter/ant_band_m = PackedInt32Array(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)
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_lniyv"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("4_obn6s")
|
||||
|
||||
[node name="canvas" type="Sprite2D"]
|
||||
material = ExtResource("1_newdt")
|
||||
texture = SubResource("PlaceholderTexture2D_2bft1")
|
||||
centered = false
|
||||
[node name="canvas" type="ColorRect"]
|
||||
texture_filter = 1
|
||||
material = SubResource("ShaderMaterial_oqtdt")
|
||||
offset_right = 560.0
|
||||
offset_bottom = 560.0
|
||||
scale = Vector2(2, 2)
|
||||
script = ExtResource("2_8xjuy")
|
||||
SecZap = ExtResource("3_tgnog")
|
||||
|
||||
[node name="строб" parent="." instance=ExtResource("3_tgnog")]
|
||||
material = SubResource("ShaderMaterial_lniyv")
|
||||
position = Vector2(560, 560)
|
||||
scale = Vector2(1100, 1100)
|
||||
position = Vector2(280, 280)
|
||||
scale = Vector2(560, 560)
|
||||
|
||||
@@ -57,6 +57,7 @@ size_flags_vertical = 3
|
||||
tooltip_text = "Включает принудительную помеху"
|
||||
strips_rotation = 15.0
|
||||
text = "СРН"
|
||||
btn_tooltip = "Включает подавление радионавигации"
|
||||
metadata/rfi_name = "srn"
|
||||
|
||||
[node name="btn_jtids" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
||||
@@ -64,8 +65,10 @@ editor_description = "Кнопка для принудительного вкл
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
tooltip_text = "Включает подавление каналов связи типа JTIDS"
|
||||
strips_rotation = 15.0
|
||||
text = "JTIDS"
|
||||
btn_tooltip = "Включает подавление радиосвязи типа JTIDS"
|
||||
metadata/rfi_name = "sprs"
|
||||
|
||||
[node name="btn_kupd" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
||||
@@ -75,6 +78,7 @@ size_flags_vertical = 3
|
||||
tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД"
|
||||
strips_rotation = 15.0
|
||||
text = "КУПД"
|
||||
btn_tooltip = "Включает подавление каналов управления передачи данных"
|
||||
metadata/rfi_name = "kupd"
|
||||
|
||||
[node name="btn_panika" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
||||
@@ -84,6 +88,7 @@ size_flags_vertical = 3
|
||||
tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД"
|
||||
strips_rotation = 15.0
|
||||
text = "Паника"
|
||||
btn_tooltip = "Включает подавление JTIDS и КУПД"
|
||||
metadata/rfi_name = "<off>"
|
||||
|
||||
[node name="btn_cancel" parent="grd_forced" groups=["прин-секторы-срн"] instance=ExtResource("4_7ys3c")]
|
||||
@@ -92,4 +97,5 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 15.0
|
||||
text = "Очистить"
|
||||
btn_tooltip = "Выключает все сеансы помех"
|
||||
metadata/rfi_name = "<off>"
|
||||
|
||||
@@ -4,11 +4,13 @@ extends ScrollContainer
|
||||
## Отображает список помех в таблице.
|
||||
const CellLineEdit = preload('res://table/ячейка-2.tscn') ## Ячейка таблицы.
|
||||
const TableHeader = preload('res://table/header.tscn') ## Ячейка заголовок таблицы.
|
||||
const EmitLed = preload('res://scenes/frame-threats/emit-led.tscn') ## Ячейка символа излучения
|
||||
|
||||
const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader , TableHeader , TableHeader ] ## Описание ряда заголовка.
|
||||
const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit , CellLineEdit , EmitLed ] ## Описание ряда.
|
||||
const TABLE_HEADERS_TEXT = ['№', 'Название', 'Пеленг', 'Состояние' , 'Излучение' ] ## Заголовки таблицы.
|
||||
const TABLE_COLUMN_SIZE = [ 65, 80, 80, 130 , 90 ] ## Ширины колонок.
|
||||
|
||||
const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader , TableHeader ] ## Описание ряда заголовка.
|
||||
const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit , CellLineEdit ] ## Описание ряда.
|
||||
const TABLE_HEADERS_TEXT = ['№', 'Название', 'Пеленг', 'Состояние' ] ## Заголовки таблицы.
|
||||
const TABLE_COLUMN_SIZE = [ 65, 100, 90, 170 ] ## Ширины колонок.
|
||||
|
||||
## Состояние выполнения сеанса помехи
|
||||
const INTERFER_STATE = {
|
||||
@@ -37,7 +39,17 @@ const INTERFER_NAMES = {
|
||||
'k1': 'K1',
|
||||
'svm2': 'СВ-М2',
|
||||
'ozp1': 'ОЗП-1',
|
||||
'eprls': 'ЕПРЛС',}
|
||||
'elrs': 'ЕЛРС' }
|
||||
|
||||
|
||||
var SIGNALS_CONNECTIONS = [
|
||||
[signaller, 'interfer_new', 'on_interfer_new'],
|
||||
[signaller, 'interfer_off', 'on_interfer_off'],
|
||||
[signaller, 'rto_threat_unsel', 'on_rto_threat_unsel'],
|
||||
[signaller, 'rto_threat_sel', 'on_rto_threat_sel'],
|
||||
[interfer, 'interfer_update', 'on_interfer_update'],
|
||||
[interfer, 'interfer_recommendate', 'on_interfer_recommendate'],
|
||||
[interfer, 'interfer_resized', 'on_interfer_resized'] ]
|
||||
|
||||
|
||||
## Индексы колонок
|
||||
@@ -45,10 +57,15 @@ const COLUMN_NUMBER = 0
|
||||
const COLUMN_NAME = 1
|
||||
const COLUMN_AOA = 2
|
||||
const COLUMN_STATE = 3
|
||||
const COLUMN_EMITED = 4
|
||||
const TABLE_TEXT_ROWS = 4
|
||||
|
||||
var course = 0.0 ## Курс корабля
|
||||
var color_emit: Color
|
||||
var signal_conections: Array
|
||||
var ecms: Dictionary ## Словарь с помехами
|
||||
|
||||
func on_rto_threat_unsel(_th_id): $table.clear_rows_selected()
|
||||
func on_rto_threat_unsel(_th_id, _tbl_index): $table.clear_rows_selected()
|
||||
|
||||
|
||||
## Вызывается при нажатии указателем мыши на выбранный ряд.
|
||||
@@ -81,16 +98,20 @@ func on_rto_threat_sel(th_id: int, table_index):
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
var table_index: = Dictionary()
|
||||
signaller.connect('interfer_new', Callable(self, 'on_interfer_new').bind(table_index))
|
||||
signaller.connect('interfer_off', Callable(self, 'on_interfer_off').bind(table_index))
|
||||
signaller.connect('rto_threat_unsel', Callable(self, 'on_rto_threat_unsel'))
|
||||
signaller.connect('rto_threat_sel', Callable(self, 'on_rto_threat_sel').bind(table_index))
|
||||
interfer.connect('interfer_update', Callable(self, 'on_interfer_update').bind(table_index))
|
||||
interfer.connect('interfer_recommendate', Callable(self, 'on_interfer_recommendate'))
|
||||
for item in SIGNALS_CONNECTIONS:
|
||||
item.append(table_index)
|
||||
$table.connect('row_pressed', Callable(self, 'on_row_pressed'))
|
||||
call_deferred('init_table')
|
||||
var unit_nav = network.get_unit_instance('навигация')
|
||||
unit_nav.connect('data_received', on_navi_data_received)
|
||||
ProjectSettings.connect('settings_changed', on_settings_changed)
|
||||
signaller.connect('режим_работа', connect_all)
|
||||
signaller.connect('режим_контроль', disconnect_all)
|
||||
signaller.connect('режим_журнал', disconnect_all)
|
||||
signaller.connect('режим_эмс', disconnect_all)
|
||||
signaller.connect('режим_эмс2', disconnect_all)
|
||||
signaller.connect('режим_настройки', disconnect_all)
|
||||
connect_all()
|
||||
|
||||
|
||||
func init_table():
|
||||
@@ -102,9 +123,19 @@ func init_table():
|
||||
|
||||
func on_interfer_update(ecm, table_index):
|
||||
var row = map_th_to_row(ecm)
|
||||
if table_index.has(ecm.ispp):
|
||||
var i_row = table_index[ecm.ispp]
|
||||
$table.set_row_text(i_row, row)
|
||||
if not table_index.has(ecm.ispp): return
|
||||
var i_row = table_index[ecm.ispp]
|
||||
$table.set_row_text(i_row, row)
|
||||
var power: bool = prd.get_fs_power(ecm.nmfs)
|
||||
var emit_node = $table.get_node2(COLUMN_EMITED, i_row)
|
||||
var emit_txr = emit_node.get_node('texture-led')
|
||||
emit_txr.position.x = 40.0
|
||||
ecm.active = power
|
||||
if power:
|
||||
emit_txr.visible = true
|
||||
emit_txr.self_modulate = color_emit
|
||||
else:
|
||||
emit_txr.visible = false
|
||||
|
||||
|
||||
func on_interfer_new(ecm, table_index):
|
||||
@@ -116,18 +147,20 @@ func on_interfer_new(ecm, table_index):
|
||||
var i_row = $table.get_rows_count()
|
||||
$table.add_row(TABLE_ROW)
|
||||
$table.set_row_text(i_row, row)
|
||||
$table.set_row_editable(i_row, false)
|
||||
disable_edit($table, TABLE_TEXT_ROWS, i_row)
|
||||
$table.set_node_user_data(0, i_row, ecm)
|
||||
table_index[ecm.ispp] = i_row
|
||||
# Будем надеяться, что отложенные вызовы производятся в том же порядке
|
||||
$table.call_deferred('clear_rows_selected')
|
||||
$table.call_deferred('set_row_selected', i_row, true)
|
||||
$table.clear_rows_selected()
|
||||
$table.set_row_selected(i_row, true)
|
||||
if not interfer.auto_enabled:
|
||||
signaller.emit_signal('interfer_selected', ecm)
|
||||
|
||||
|
||||
func on_interfer_off(ecm, table_index):
|
||||
$table.remove_row(table_index[ecm.ispp])
|
||||
if not table_index.has(ecm.ispp):
|
||||
return
|
||||
var i_row = table_index[ecm.ispp]
|
||||
$table.remove_row(i_row)
|
||||
rehash(table_index)
|
||||
var sel_rows: Array
|
||||
$table.get_selected_rows(sel_rows)
|
||||
@@ -147,7 +180,7 @@ func rehash(table_index: Dictionary):
|
||||
## Преобразует цель в строку таблицы
|
||||
func map_th_to_row(ecm) -> Array:
|
||||
var row: = Array()
|
||||
row.resize(TABLE_ROW.size())
|
||||
row.resize(TABLE_ROW.size() - 1)
|
||||
row[COLUMN_NUMBER] = '%s' % ecm.ispp
|
||||
row[COLUMN_NAME] = ''
|
||||
if INTERFER_NAMES.has(ecm.krp):
|
||||
@@ -162,7 +195,7 @@ func map_th_to_row(ecm) -> Array:
|
||||
return row
|
||||
|
||||
|
||||
func on_interfer_recommendate(ecm):
|
||||
func on_interfer_recommendate(ecm, _tbl_index):
|
||||
var sel_rows: Array
|
||||
$table.get_selected_rows(sel_rows)
|
||||
if not len(sel_rows): return
|
||||
@@ -173,3 +206,48 @@ func on_interfer_recommendate(ecm):
|
||||
|
||||
func on_navi_data_received(data: Dictionary):
|
||||
course = data.get('k', 0.0)
|
||||
|
||||
|
||||
func on_settings_changed():
|
||||
var json_col = ProjectSettings.get_setting('application/config/%s' % 'Цвет кнопки \"Подавление\"', '[1.0, 1.0, 1.0, 1.0]')
|
||||
var arr_col = JSON.parse_string(json_col)
|
||||
color_emit = Color(arr_col[0], arr_col[1], arr_col[2], arr_col[3])
|
||||
|
||||
|
||||
## Отключает возможность редактирования LineEdit в таблице.[br]
|
||||
## [param tbl] - таблица,[br]
|
||||
## [param num_col] - номер колонки,[br]
|
||||
## [param i_row] - номер столбца.[br]
|
||||
func disable_edit(tbl, num_col: int, i_row: int):
|
||||
for col in num_col:
|
||||
var node: LineEdit = tbl.get_node2(col, i_row)
|
||||
node.editable = false
|
||||
|
||||
|
||||
func connect_all() -> void:
|
||||
signal_conections.clear()
|
||||
var table_index = SIGNALS_CONNECTIONS[0][3]
|
||||
for item in SIGNALS_CONNECTIONS:
|
||||
var proc = Callable(self, item[2]).bind(item[3])
|
||||
var rc = item[0].connect(item[1], proc)
|
||||
if rc == Error.OK:
|
||||
signal_conections.append([item[0], item[1], proc])
|
||||
else:
|
||||
var ers = error_string(rc)
|
||||
push_error('%s: %s %s %s' % [ers, item[0], item[1], item[2]])
|
||||
signaller.emit_signal('connect_work_signal')
|
||||
for ecm in ecms.values():
|
||||
on_interfer_new(ecm, table_index)
|
||||
|
||||
|
||||
func disconnect_all() -> void:
|
||||
var table_index = SIGNALS_CONNECTIONS[0][3]
|
||||
for item in signal_conections:
|
||||
item[0].disconnect(item[1], item[2])
|
||||
signal_conections.clear()
|
||||
$table.clear_rows()
|
||||
table_index.clear()
|
||||
|
||||
|
||||
func on_interfer_resized(ecms_dic: Dictionary, _tbl_index) -> void:
|
||||
ecms = ecms_dic
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://d012h4hxf2anf"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b3woliae871je" path="res://data/отметка-неопред.png" id="1_0a4l0"]
|
||||
[ext_resource type="Texture2D" uid="uid://blx6c1o1nogks" path="res://data/связь.png" id="1_0a4l0"]
|
||||
|
||||
[node name="emit-led" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -14,10 +14,11 @@ layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 26.0
|
||||
offset_top = 11.0
|
||||
offset_right = 3.0
|
||||
offset_bottom = -12.0
|
||||
offset_left = 25.0
|
||||
offset_top = 15.0
|
||||
offset_right = 17.0
|
||||
offset_bottom = 7.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scale = Vector2(0.3, 0.3)
|
||||
texture_normal = ExtResource("1_0a4l0")
|
||||
|
||||
@@ -5,17 +5,19 @@ class_name scroll_threats extends ScrollContainer
|
||||
|
||||
const CellLineEdit = preload('res://table/ячейка-2.tscn') ## Ячейка таблицы.
|
||||
const TableHeader = preload('res://table/header.tscn') ## Ячейка заголовок таблицы.
|
||||
const EmitLed = preload('res://scenes/frame-threats/emit-led.tscn') ## Ячейка заголовок таблицы.
|
||||
const EmitLed = preload('res://scenes/frame-threats/emit-led.tscn') ## Ячейка символа излучения
|
||||
|
||||
const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader, TableHeader , TableHeader ] ## Описание ряда заголовка.
|
||||
const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit, CellLineEdit, EmitLed ] ## Описание ряда.
|
||||
const TABLE_COLUMN_PARAM = ['id', 'aoa', 'freq', 'proto', 'emit' ] ## Параметры цели отображаемые в таблице.
|
||||
const TABLE_HEADERS_TEXT = ['№', 'Пеленг', 'Частота, МГц', 'Протокол', 'Помеха' ] ## Заголовки таблицы.
|
||||
const TABLE_HEADERS_TEXT = ['Номер', 'Пеленг', 'Частота, МГц', 'Протокол', 'Помеха' ] ## Заголовки таблицы.
|
||||
const TABLE_COLUMN_SIZE = [ 65, 70, 110, 140, 65] ## Ширины колонок.
|
||||
|
||||
const TABLE_TEXT_ROWS = 4
|
||||
const EMIT_STATE_COL = 4
|
||||
|
||||
var color_emit: Color
|
||||
|
||||
## Снимает выделение цели.
|
||||
func on_rto_threat_unsel(_th_id): $table.clear_rows_selected()
|
||||
|
||||
@@ -49,6 +51,7 @@ func _ready() -> void:
|
||||
signaller.connect('rto_threat_sel', Callable(self, 'on_rto_threat_sel').bind($table))
|
||||
signaller.connect('rto_threat_unsel', Callable(self, 'on_rto_threat_unsel'))
|
||||
$table.connect('row_pressed', Callable(self, 'on_row_pressed'))
|
||||
ProjectSettings.connect('settings_changed', on_settings_changed)
|
||||
call_deferred('init_table')
|
||||
|
||||
|
||||
@@ -74,7 +77,7 @@ func on_threat_update(th, table_index: Dictionary):
|
||||
emit_txr.self_modulate = Color.ORANGE
|
||||
elif th.emit_state == 2:
|
||||
emit_txr.visible = true
|
||||
emit_txr.self_modulate = Color.RED
|
||||
emit_txr.self_modulate = color_emit
|
||||
|
||||
|
||||
|
||||
@@ -128,3 +131,9 @@ func disable_edit(tbl, num_col: int, i_row: int):
|
||||
for col in num_col:
|
||||
var node: LineEdit = tbl.get_node2(col, i_row)
|
||||
node.editable = false
|
||||
|
||||
|
||||
func on_settings_changed():
|
||||
var json_col = ProjectSettings.get_setting('application/config/%s' % 'Цвет кнопки \"Подавление\"', '[1.0, 1.0, 1.0, 1.0]')
|
||||
var arr_col = JSON.parse_string(json_col)
|
||||
color_emit = Color(arr_col[0], arr_col[1], arr_col[2], arr_col[3])
|
||||
|
||||
@@ -13,6 +13,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "Откл."
|
||||
btn_tooltip = "Выключает помеху"
|
||||
disabled = true
|
||||
metadata/rfi_name = "off"
|
||||
|
||||
@@ -22,6 +23,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "МЧМ-1"
|
||||
btn_tooltip = "Включает помеху МЧМ-1"
|
||||
disabled = true
|
||||
metadata/rfi_name = "mchm1"
|
||||
|
||||
@@ -31,6 +33,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "СРН-И1"
|
||||
btn_tooltip = "Включает помеху СРН-И1"
|
||||
disabled = true
|
||||
metadata/rfi_name = "srni1"
|
||||
|
||||
@@ -40,6 +43,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "СРН-М2"
|
||||
btn_tooltip = "Включает помеху СРН-М2"
|
||||
disabled = true
|
||||
metadata/rfi_name = "srnm2"
|
||||
|
||||
@@ -49,6 +53,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "СРН-GPS"
|
||||
btn_tooltip = "Включает помеху СРН-GPS"
|
||||
disabled = true
|
||||
metadata/rfi_name = "srngps"
|
||||
|
||||
@@ -58,6 +63,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "ПД-М4"
|
||||
btn_tooltip = "Включает помеху МП-М4"
|
||||
disabled = true
|
||||
metadata/rfi_name = "pdm4"
|
||||
|
||||
@@ -67,6 +73,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "ПД-М2"
|
||||
btn_tooltip = "Включает помеху МП-М2"
|
||||
disabled = true
|
||||
metadata/rfi_name = "pdm2"
|
||||
|
||||
@@ -76,6 +83,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "ЛЧМ-1"
|
||||
btn_tooltip = "Включает помеху ЛЧМ-1"
|
||||
disabled = true
|
||||
metadata/rfi_name = "lchm1"
|
||||
|
||||
@@ -85,6 +93,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "ЛЧМ-2"
|
||||
btn_tooltip = "Включает помеху ЛЧМ-2"
|
||||
disabled = true
|
||||
metadata/rfi_name = "lchm2"
|
||||
|
||||
@@ -94,6 +103,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "ПД-М4С"
|
||||
btn_tooltip = "Включает помеху ПД-М4C"
|
||||
disabled = true
|
||||
metadata/rfi_name = "pdm4s"
|
||||
|
||||
@@ -103,6 +113,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "ПД-ЧМ"
|
||||
btn_tooltip = "Включает помеху ПД-ЧМ"
|
||||
disabled = true
|
||||
metadata/rfi_name = "pdchm"
|
||||
|
||||
@@ -112,6 +123,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "СВ-И1"
|
||||
btn_tooltip = "Включает помеху СВ-И1"
|
||||
disabled = true
|
||||
metadata/rfi_name = "svi1"
|
||||
|
||||
@@ -121,6 +133,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "K1"
|
||||
btn_tooltip = "Включает помеху К1"
|
||||
disabled = true
|
||||
metadata/rfi_name = "k1"
|
||||
|
||||
@@ -130,6 +143,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "СВ-М2"
|
||||
btn_tooltip = "Включает помеху СВ-М2"
|
||||
disabled = true
|
||||
metadata/rfi_name = "svm2"
|
||||
|
||||
@@ -139,6 +153,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "ОЗП-1"
|
||||
btn_tooltip = "Включает помеху ОЗП-1"
|
||||
disabled = true
|
||||
metadata/rfi_name = "ozp1"
|
||||
|
||||
@@ -147,6 +162,7 @@ layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
strips_rotation = 30.0
|
||||
text = "ЕРЛС"
|
||||
text = "ЕЛРС"
|
||||
btn_tooltip = "Включает помеху ЕЛРС"
|
||||
disabled = true
|
||||
metadata/rfi_name = "eprls"
|
||||
metadata/rfi_name = "elrs"
|
||||
|
||||
101
scenes/hranges/panel.gd
Normal file
@@ -0,0 +1,101 @@
|
||||
@tool
|
||||
|
||||
extends PanelContainer
|
||||
|
||||
## Предназначено для отображения диапазонов на горизонтальной шкале
|
||||
|
||||
@export_range(0.0, 1.0) var gap_top: float = 0.05 ## Зазор сверху
|
||||
@export_range(0.0, 1.0) var gap_bottom: float = 0.05 ## Зазор снизу
|
||||
var ranges_save: Dictionary[StringName, Array] ## <имя диапазона>: [диапазон(x - начало, y - конец), цвет]
|
||||
|
||||
|
||||
@export_file var image_file: String:
|
||||
set(val):
|
||||
image_file = val
|
||||
if is_inside_tree():
|
||||
_enter_tree()
|
||||
|
||||
|
||||
@export var back_color: Color:
|
||||
set(val):
|
||||
back_color = val
|
||||
if is_inside_tree():
|
||||
_enter_tree()
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
if ResourceLoader.exists(image_file):
|
||||
$grid/image.texture = load(image_file)
|
||||
$grid/canvas.self_modulate = back_color
|
||||
|
||||
|
||||
## Добавляет новый диапазон.
|
||||
func set_range(nm: StringName, x0: float, x1: float, col: Color) -> void:
|
||||
ranges_save[nm] = [Vector2(x0, x1), col]
|
||||
_on_resized()
|
||||
|
||||
|
||||
func set_range_color(nm: StringName, col: Color):
|
||||
if not ranges_save.has(nm):
|
||||
push_error('нет такого диапазона: \"%s\"' % nm)
|
||||
return false
|
||||
ranges_save[nm][1] = col
|
||||
var rng: = get_node_or_null(NodePath(nm))
|
||||
if not rng:
|
||||
push_error('нет такого элемента: \"%s\"' % nm)
|
||||
return false
|
||||
rng.color = col
|
||||
return true
|
||||
|
||||
|
||||
func clear_ranges():
|
||||
var l0 = ranges_save.size()
|
||||
ranges_save.clear()
|
||||
var l1 = ranges_save.size()
|
||||
_on_resized()
|
||||
return l1 < l0
|
||||
|
||||
|
||||
func del_range(nm: StringName) -> bool:
|
||||
var rc = ranges_save.erase(nm)
|
||||
_on_resized()
|
||||
return rc
|
||||
|
||||
|
||||
func _add_range_view(nm: StringName, x0: float, x1: float, col: Color):
|
||||
var rng = Polygon2D.new()
|
||||
var canvas = $grid/canvas
|
||||
var canvas_size = canvas.size
|
||||
var point0 = canvas_size * Vector2(x0, gap_bottom) ## лево низ
|
||||
var point1 = canvas_size * Vector2(x0, 1.0 - gap_top) ## лево верх
|
||||
var point2 = canvas_size * Vector2(x1, 1.0 - gap_top) ## право верх
|
||||
var point3 = canvas_size * Vector2(x1, gap_bottom) ## право низ
|
||||
rng.polygon = [point0, point1, point2, point3]
|
||||
rng.name = nm
|
||||
rng.color = col
|
||||
canvas.add_child(rng)
|
||||
|
||||
|
||||
## Удаляет заданный диапазон.
|
||||
func _del_range_view(nm: StringName) -> void:
|
||||
var canvas: = $grid/canvas
|
||||
var rng: = canvas.get_node(NodePath(nm))
|
||||
canvas.remove_child(rng)
|
||||
rng.queue_free()
|
||||
|
||||
|
||||
func _clear_ranges_view():
|
||||
var canvas: = $grid/canvas
|
||||
var range_views: = canvas.get_children()
|
||||
for rng in range_views:
|
||||
canvas.remove_child(rng)
|
||||
rng.queue_free()
|
||||
|
||||
|
||||
func _on_resized() -> void:
|
||||
_clear_ranges_view()
|
||||
for nm in ranges_save:
|
||||
var range_save = ranges_save[nm]
|
||||
var rng = range_save[0]
|
||||
var col = range_save[1]
|
||||
_add_range_view(nm, rng.x, rng.y, col)
|
||||
1
scenes/hranges/panel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://jtio1scc72bl
|
||||
38
scenes/hranges/panel.tscn
Normal file
@@ -0,0 +1,38 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://hr55mkcneaer"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://jtio1scc72bl" path="res://scenes/hranges/panel.gd" id="1_pg3d7"]
|
||||
[ext_resource type="Texture2D" uid="uid://c73tjrn8gr00o" path="res://data/Передатчик.png" id="2_ajqhv"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ajqhv"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_56wj8"]
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[node name="panel" type="PanelContainer"]
|
||||
offset_right = 400.0
|
||||
offset_bottom = 45.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_ajqhv")
|
||||
script = ExtResource("1_pg3d7")
|
||||
back_color = Color(0.601223, 0.601223, 0.601223, 1)
|
||||
|
||||
[node name="grid" type="GridContainer" parent="."]
|
||||
layout_mode = 2
|
||||
columns = 2
|
||||
|
||||
[node name="image" type="TextureRect" parent="grid"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_ajqhv")
|
||||
expand_mode = 3
|
||||
|
||||
[node name="canvas" type="PanelContainer" parent="grid"]
|
||||
self_modulate = Color(0.601223, 0.601223, 0.601223, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_56wj8")
|
||||
|
||||
[connection signal="resized" from="." to="." method="_on_resized"]
|
||||
@@ -23,7 +23,6 @@ metadata/DeviceName = &"Устройство РР левого борта"
|
||||
[node name="request" type="HTTPRequest" parent="."]
|
||||
use_threads = true
|
||||
script = ExtResource("2_4vyhj")
|
||||
request_url = null
|
||||
|
||||
[node name="timer" type="Timer" parent="request"]
|
||||
autostart = true
|
||||
|
||||
@@ -23,7 +23,6 @@ metadata/DeviceName = &"Устройство РР правого борта"
|
||||
[node name="request" type="HTTPRequest" parent="."]
|
||||
use_threads = true
|
||||
script = ExtResource("2_miwrd")
|
||||
request_url = null
|
||||
|
||||
[node name="timer" type="Timer" parent="request"]
|
||||
autostart = true
|
||||
|
||||
@@ -7,22 +7,27 @@ class_name pribor_afsp extends 'res://scenes/контроль/прибор.gd'
|
||||
@export var settings_path_to_url: String = '' ## Должно быть в ProjectSettings
|
||||
@export var settings_path_to_wait_time: String = '' ## Должно быть в ProjectSettings
|
||||
|
||||
signal receive_response_afp_bpo()
|
||||
|
||||
static var json_conv: JSON = JSON.new()
|
||||
static var node_maper = load('res://scenes/контроль/node-maper.gd')
|
||||
static var node_request: Node
|
||||
static var node_request_timer: Node
|
||||
var ctrl_pos = 0
|
||||
|
||||
# SystemName: "gen" DevList - там состояние связи с генератором по кан шине
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
ProjectSettings.connect('settings_changed', on_settings_chaged)
|
||||
node_request = $request
|
||||
node_request_timer = $request/timer
|
||||
on_settings_chaged()
|
||||
|
||||
|
||||
func on_settings_chaged():
|
||||
$request.request_url = ProjectSettings.get_setting('application/config/%s' % settings_path_to_url)
|
||||
$request/timer.wait_time = float(ProjectSettings.get_setting('application/config/%s' % settings_path_to_wait_time))
|
||||
tools.allways($request.request_url != null)
|
||||
node_request.request_url = ProjectSettings.get_setting('application/config/%s' % settings_path_to_url)
|
||||
node_request_timer.wait_time = float(ProjectSettings.get_setting('application/config/%s' % settings_path_to_wait_time))
|
||||
tools.allways(node_request.request_url != null)
|
||||
|
||||
|
||||
func _on_request_completed(result, _response_code, headers, body: PackedByteArray):
|
||||
@@ -30,7 +35,7 @@ func _on_request_completed(result, _response_code, headers, body: PackedByteArra
|
||||
var unit_instance: = network.get_unit_instance(unit_name)
|
||||
|
||||
if result != 0:
|
||||
var rs = $request.get_result_string(result)
|
||||
var rs = node_request.get_result_string(result)
|
||||
log.error('\"%s\"' % rs)
|
||||
if unit_instance.online:
|
||||
unit_instance.online = false
|
||||
@@ -93,6 +98,8 @@ func _on_request_completed(result, _response_code, headers, body: PackedByteArra
|
||||
node_maper.map_value_to_item(json_conv.data, child, 'value1')
|
||||
node_maper.map_error_codes_to_item(json_conv.data, child, 'state', 0)
|
||||
|
||||
emit_signal('receive_response_afp_bpo')
|
||||
|
||||
|
||||
## Вызывается при клике мыши на элементе.
|
||||
## [param block_a] - Кликнутый элемент.
|
||||
|
||||
@@ -10,12 +10,17 @@ class_name pribor_rtr extends 'res://scenes/контроль/прибор.gd'
|
||||
@export var settings_path2_to_url: String = '' ## Должно быть в ProjectSettings
|
||||
@export var settings_path_to_wait_time: String = '' ## Должно быть в ProjectSettings
|
||||
|
||||
signal receive_response_afp_bpo()
|
||||
|
||||
static var json_conv: JSON = JSON.new()
|
||||
static var node_maper = load('res://scenes/контроль/node-maper.gd')
|
||||
static var node_request_1: Node
|
||||
static var node_request_timer_1: Node
|
||||
static var node_request_2: Node
|
||||
static var node_request_timer_2: Node
|
||||
|
||||
|
||||
var ctrl_pos = 110
|
||||
|
||||
|
||||
var bort_to_node_name = {}
|
||||
var bort_to_unit_name = {}
|
||||
|
||||
@@ -23,6 +28,10 @@ var bort_to_unit_name = {}
|
||||
|
||||
func _ready() -> void:
|
||||
ProjectSettings.connect('settings_changed', on_settings_changed)
|
||||
node_request_1 = $request1
|
||||
node_request_timer_1 = $request1/timer
|
||||
node_request_2 = $request2
|
||||
node_request_timer_2 = $request2/timer
|
||||
on_settings_changed()
|
||||
find_labels(self)
|
||||
|
||||
@@ -30,17 +39,17 @@ func _ready() -> void:
|
||||
func on_settings_changed():
|
||||
bort_to_node_name.merge({this_bpo1_name: 'grid_bpo_a1', this_bpo2_name: 'grid_bpo_a2'}, true)
|
||||
bort_to_unit_name.merge({this_bpo1_name: unit_name1, this_bpo2_name: unit_name2})
|
||||
$request1.request_url = ProjectSettings.get_setting('application/config/%s' % settings_path1_to_url)
|
||||
$request1/timer.wait_time = float(ProjectSettings.get_setting('application/config/%s' % settings_path_to_wait_time))
|
||||
$request2.request_url = ProjectSettings.get_setting('application/config/%s' % settings_path2_to_url)
|
||||
$request2/timer.wait_time = float(ProjectSettings.get_setting('application/config/%s' % settings_path_to_wait_time))
|
||||
assert($request1.request_url != null)
|
||||
assert($request2.request_url != null)
|
||||
node_request_1.request_url = ProjectSettings.get_setting('application/config/%s' % settings_path1_to_url)
|
||||
node_request_timer_1.wait_time = float(ProjectSettings.get_setting('application/config/%s' % settings_path_to_wait_time))
|
||||
node_request_2.request_url = ProjectSettings.get_setting('application/config/%s' % settings_path2_to_url)
|
||||
node_request_timer_2.wait_time = float(ProjectSettings.get_setting('application/config/%s' % settings_path_to_wait_time))
|
||||
assert(node_request_1.request_url != null)
|
||||
assert(node_request_2.request_url != null)
|
||||
|
||||
|
||||
func _on_request_completed(result, _response_code, headers, body: PackedByteArray):
|
||||
if result != 0:
|
||||
var rs = $request1.get_result_string(result)
|
||||
var rs = node_request_1.get_result_string(result)
|
||||
push_error('\"%s\"' % rs)
|
||||
return
|
||||
|
||||
@@ -97,18 +106,20 @@ func _on_request_completed(result, _response_code, headers, body: PackedByteArra
|
||||
$mod_pit_g1.state = 1
|
||||
break
|
||||
|
||||
emit_signal('receive_response_afp_bpo')
|
||||
|
||||
|
||||
func find_labels(node1: Node):
|
||||
if node1 is Label:
|
||||
if node1.name in ["lbl_rname", "rname"]:
|
||||
if not node1.has_meta("tooltip_set"):
|
||||
if node1.name in ['lbl_rname', 'rname']:
|
||||
if not node1.has_meta('tooltip_set'):
|
||||
ctrl_pos += 1
|
||||
var box_number = ceili(float(ctrl_pos) / 10.0)
|
||||
var position_number = ctrl_pos % 10
|
||||
if position_number == 0:
|
||||
position_number = 10
|
||||
node1.tooltip_text = "Ящик - %d, Позиция - %d" % [box_number, position_number]
|
||||
node1.tooltip_text = 'Ящик - %d, Позиция - %d' % [box_number, position_number]
|
||||
node1.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
node1.set_meta("tooltip_set", true)
|
||||
node1.set_meta('tooltip_set', true)
|
||||
for child in node1.get_children():
|
||||
find_labels(child)
|
||||
|
||||
@@ -202,7 +202,6 @@ fname = "Яч. связи"
|
||||
[node name="request1" type="HTTPRequest" parent="."]
|
||||
use_threads = true
|
||||
script = ExtResource("4_crej3")
|
||||
request_url = null
|
||||
|
||||
[node name="timer" type="Timer" parent="request1"]
|
||||
autostart = true
|
||||
|
||||
@@ -16,11 +16,12 @@ func _ready() -> void:
|
||||
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
|
||||
temp.value1 = -100
|
||||
# Подписываемся на сигналы
|
||||
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'))
|
||||
find_labels(self)
|
||||
# Устанавливаем начальный статус
|
||||
_update_status_text(unit_prd_k.get_current_status())
|
||||
on_press_device(unit_prd_k.self_name)
|
||||
@@ -29,23 +30,17 @@ func _ready() -> void:
|
||||
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_frame(node_frame: Node, val: int): node_frame.set_frame(val)
|
||||
$input_0.set_frame(unit_prd_k.ems_g_sock_dic.ems_input_1)
|
||||
$input_1.set_frame(unit_prd_k.ems_g_sock_dic.ems_input_2)
|
||||
$input_2.set_frame(unit_prd_k.ems_g_sock_dic.ems_input_lit_1)
|
||||
$output_0.set_frame(unit_prd_k.ems_g_sock_dic.ems_output_1)
|
||||
$output_1.set_frame(unit_prd_k.ems_g_sock_dic.ems_output_2)
|
||||
$output_2.set_frame(unit_prd_k.ems_g_sock_dic.ems_output_lit_1)
|
||||
|
||||
|
||||
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:
|
||||
@@ -60,12 +55,6 @@ func _enter_tree() -> void:
|
||||
_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]])
|
||||
|
||||
|
||||
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')
|
||||
@@ -112,31 +101,19 @@ static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifi
|
||||
|
||||
|
||||
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
|
||||
if not is_inside_tree(): return
|
||||
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)
|
||||
control_data['nodes_y5'] = get_tree().get_nodes_in_group('y-5')
|
||||
control_data['node_ip_power_arr'] = get_tree().get_nodes_in_group('power_supply')
|
||||
control_data['fs_nodes'] = get_tree().get_nodes_in_group('fs_group')
|
||||
control_data['power_amplifier'] = get_tree().get_nodes_in_group('power_amplifier')
|
||||
control_data['default_reset_array_node'] = get_tree().get_nodes_in_group('default_reset')
|
||||
control_data['module_fs_1'] = $kasseta_fs_kd/ref_A2
|
||||
control_data['module_fs_6'] = $kasseta_fs_kd/ref_A4
|
||||
control_data['dou_6'] = $dou6_A7
|
||||
control_data['module_fs_7'] = $kasseta_fs_kd/ref_A7
|
||||
control_data['dou_7'] = $dou7_A8
|
||||
on_control_result(control_data)
|
||||
|
||||
|
||||
static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
@@ -160,7 +137,7 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
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
|
||||
power_supply.state = STATE_VAL.NONE
|
||||
# Проверяем состояние после установки
|
||||
if power_supply.state == STATE_VAL.ERROR:
|
||||
all_y5_good = false
|
||||
@@ -169,6 +146,7 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
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')
|
||||
@@ -196,33 +174,33 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
|
||||
func find_labels(node1: Node):
|
||||
if node1 is Label:
|
||||
if node1.name in ["lbl_rname", "rname"]:
|
||||
if not node1.has_meta("tooltip_set"):
|
||||
if node1.name in ['lbl_rname', 'rname']:
|
||||
if not node1.has_meta('tooltip_set'):
|
||||
ctrl_pos += 1
|
||||
var box_number = ceili(float(ctrl_pos) / 10.0)
|
||||
var position_number = ctrl_pos % 10
|
||||
if position_number == 0:
|
||||
position_number = 10
|
||||
node1.tooltip_text = "Ящик - %d, Позиция - %d" % [box_number, position_number]
|
||||
node1.tooltip_text = 'Ящик - %d, Позиция - %d' % [box_number, position_number]
|
||||
node1.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
node1.set_meta("tooltip_set", true)
|
||||
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)
|
||||
on_press_device(unit_prd_k.self_name)
|
||||
|
||||
|
||||
func _update_status_text(text: String) -> void:
|
||||
$control_result.text = text
|
||||
# Можно добавить смену цвета в зависимости от статуса
|
||||
if "Ошибка" in text or "неисправен" in 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:
|
||||
elif 'Ограничена' in text or 'Предупреждение' in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.YELLOW)
|
||||
elif "исправен" in text or "завершён" in text:
|
||||
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:
|
||||
|
||||
@@ -16,11 +16,12 @@ func _ready() -> void:
|
||||
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
|
||||
temp.value1 = -100
|
||||
# Подписываемся на сигналы
|
||||
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'))
|
||||
find_labels(self)
|
||||
# Устанавливаем начальный статус
|
||||
_update_status_text(unit_prd_n.get_current_status())
|
||||
on_press_device(unit_prd_n.self_name)
|
||||
@@ -29,13 +30,10 @@ func _ready() -> void:
|
||||
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_frame(node_frame: Node, val: int): node_frame.set_frame(val)
|
||||
$input_0.set_frame(unit_prd_n.ems_g_sock_dic.ems_input_1)
|
||||
$input_1.set_frame(unit_prd_n.ems_g_sock_dic.ems_input_2)
|
||||
$output_0.set_frame(unit_prd_n.ems_g_sock_dic.ems_output_1)
|
||||
$output_1.set_frame(unit_prd_n.ems_g_sock_dic.ems_output_2)
|
||||
|
||||
|
||||
func _on_start_control() -> void:
|
||||
@@ -43,9 +41,6 @@ func _on_start_control() -> void:
|
||||
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:
|
||||
@@ -60,12 +55,6 @@ func _enter_tree() -> void:
|
||||
_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]])
|
||||
|
||||
|
||||
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')
|
||||
@@ -103,6 +92,7 @@ static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifi
|
||||
|
||||
|
||||
func on_press_device(_device_name: String) -> void:
|
||||
if not is_inside_tree(): return
|
||||
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')
|
||||
@@ -150,7 +140,7 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
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
|
||||
power_supply.state = STATE_VAL.NONE
|
||||
# Проверяем состояние после установки
|
||||
if power_supply.state == STATE_VAL.ERROR:
|
||||
all_y5_good = false
|
||||
@@ -182,33 +172,33 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
|
||||
func find_labels(node1: Node):
|
||||
if node1 is Label:
|
||||
if node1.name in ["lbl_rname", "rname"]:
|
||||
if not node1.has_meta("tooltip_set"):
|
||||
if node1.name in ['lbl_rname', 'rname']:
|
||||
if not node1.has_meta('tooltip_set'):
|
||||
ctrl_pos += 1
|
||||
var box_number = ceili(float(ctrl_pos) / 10.0)
|
||||
var position_number = ctrl_pos % 10
|
||||
if position_number == 0:
|
||||
position_number = 10
|
||||
node1.tooltip_text = "Ящик - %d, Позиция - %d" % [box_number, position_number]
|
||||
node1.tooltip_text = 'Ящик - %d, Позиция - %d' % [box_number, position_number]
|
||||
node1.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
node1.set_meta("tooltip_set", true)
|
||||
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)
|
||||
on_press_device(unit_prd_n.self_name)
|
||||
|
||||
|
||||
func _update_status_text(text: String) -> void:
|
||||
$control_result.text = text
|
||||
# Можно добавить смену цвета в зависимости от статуса
|
||||
if "Ошибка" in text or "неисправен" in 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:
|
||||
elif 'Ограничена' in text or 'Предупреждение' in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.YELLOW)
|
||||
elif "исправен" in text or "завершён" in text:
|
||||
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:
|
||||
|
||||
@@ -16,11 +16,12 @@ func _ready() -> void:
|
||||
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
|
||||
temp.value1 = -100
|
||||
# Подписываемся на сигналы
|
||||
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'))
|
||||
find_labels(self)
|
||||
# Устанавливаем начальный статус
|
||||
_update_status_text(unit_prd_v.get_current_status())
|
||||
on_press_device(unit_prd_v.self_name)
|
||||
@@ -29,13 +30,10 @@ func _ready() -> void:
|
||||
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_frame(node_frame: Node, val: int): node_frame.set_frame(val)
|
||||
$input_0.set_frame(unit_prd_v.ems_g_sock_dic.ems_input_1)
|
||||
$input_1.set_frame(unit_prd_v.ems_g_sock_dic.ems_input_2)
|
||||
$output_0.set_frame(unit_prd_v.ems_g_sock_dic.ems_output_1)
|
||||
$output_1.set_frame(unit_prd_v.ems_g_sock_dic.ems_output_2)
|
||||
|
||||
|
||||
func _on_start_control() -> void:
|
||||
@@ -43,9 +41,6 @@ func _on_start_control() -> void:
|
||||
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:
|
||||
@@ -60,11 +55,6 @@ func _enter_tree() -> void:
|
||||
_update_status_text(unit_prd_v.get_current_status())
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
|
||||
|
||||
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')
|
||||
@@ -101,6 +91,7 @@ static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifi
|
||||
|
||||
|
||||
func on_press_device(_device_name: String) -> void:
|
||||
if not is_inside_tree(): return
|
||||
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')
|
||||
@@ -178,33 +169,33 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
|
||||
func find_labels(node1: Node):
|
||||
if node1 is Label:
|
||||
if node1.name in ["lbl_rname", "rname"]:
|
||||
if not node1.has_meta("tooltip_set"):
|
||||
if node1.name in ['lbl_rname', 'rname']:
|
||||
if not node1.has_meta('tooltip_set'):
|
||||
ctrl_pos += 1
|
||||
var box_number = ceili(float(ctrl_pos) / 10.0)
|
||||
var position_number = ctrl_pos % 10
|
||||
if position_number == 0:
|
||||
position_number = 10
|
||||
node1.tooltip_text = "Ящик - %d, Позиция - %d" % [box_number, position_number]
|
||||
node1.tooltip_text = 'Ящик - %d, Позиция - %d' % [box_number, position_number]
|
||||
node1.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
node1.set_meta("tooltip_set", true)
|
||||
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)
|
||||
on_press_device(unit_prd_v.self_name)
|
||||
|
||||
|
||||
func _update_status_text(text: String) -> void:
|
||||
$control_result.text = text
|
||||
# Можно добавить смену цвета в зависимости от статуса
|
||||
if "Ошибка" in text or "неисправен" in 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:
|
||||
elif 'Ограничена' in text or 'Предупреждение' in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.YELLOW)
|
||||
elif "исправен" in text or "завершён" in text:
|
||||
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:
|
||||
|
||||
@@ -1,126 +1,116 @@
|
||||
@tool
|
||||
class_name pribor_uf extends 'res://scenes/контроль/прибор.gd'
|
||||
|
||||
signal control_is_over(device_name: String) # Когда контроль завершен
|
||||
enum STATE_VAL {NONE = 0, GOOD = 1, ERROR = 2}
|
||||
const DEV_LIST: Array = ['00:1f.6', '07:00.0', '08:00.0', '0b:00.0']
|
||||
const USB_TRACKERBALL: String = '13ba:0018'
|
||||
const REVFF: String = '(rev ff)'
|
||||
var unit_uf: Object
|
||||
var uf_control: Object
|
||||
var ctrl_pos = 100
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if Engine.is_editor_hint(): return
|
||||
signaller.conn(signaller.start_contol_device, Callable(self, '_on_start_contol_device'))
|
||||
unit_uf = network.get_unit_instance('уарэп-эмс')
|
||||
unit_uf.connect('line_changed', on_line_changed)
|
||||
on_line_changed()
|
||||
#control_vk()
|
||||
control_ems(unit_uf.status)
|
||||
status_uf()
|
||||
uf_control = get_parent().uf_control
|
||||
signaller.connect('update_uf_serviceability', on_update_uf_serviceability)
|
||||
var uf_status = uf_control.get_current_status()
|
||||
control_ems(uf_status)
|
||||
find_labels(self)
|
||||
|
||||
|
||||
func _on_start_contol_device():
|
||||
on_line_changed()
|
||||
control_ems(unit_uf.status) # проверка ЭМС ячеек
|
||||
status_uf() # отслеживание состояния прибора
|
||||
func on_update_uf_serviceability(_state: int):
|
||||
control_ems(uf_control.get_current_status())
|
||||
|
||||
|
||||
func on_line_changed():
|
||||
if unit_uf.online: # проверка ЯУ, внутреннего коммутатора и ИП-5Б
|
||||
#func control_vk() -> void:
|
||||
#var out_usb_str = ''
|
||||
#var out_pci_str = ''
|
||||
#var out_usb = []
|
||||
#var out_pci = []
|
||||
#
|
||||
#OS.execute('lsusb', [], out_usb) # TODO: Не переносимое, платформозависимое
|
||||
#for element in out_usb:
|
||||
#out_usb_str += element
|
||||
#
|
||||
#OS.execute('lspci', [], out_pci) # TODO: Не переносимое, платформозависимое
|
||||
#for element in out_pci:
|
||||
#out_pci_str += element
|
||||
#
|
||||
#out_usb_str = out_usb_str.split('\n')
|
||||
#out_pci_str = out_pci_str.split('\n')
|
||||
#
|
||||
#var i: int = 0
|
||||
#
|
||||
#for string in out_usb_str:
|
||||
#if USB_TRACKERBALL in string:
|
||||
#i += 1
|
||||
#break
|
||||
#for string in out_pci_str:
|
||||
#for item in DEV_LIST:
|
||||
#if item in string:
|
||||
#i += 1
|
||||
#if REVFF in string:
|
||||
#i -= 1
|
||||
#break
|
||||
#
|
||||
#if i == (DEV_LIST.size() + 1):
|
||||
#$ref_uf/ref_bu1/ref_A8_BU.state = STATE_VAL.GOOD
|
||||
#else:
|
||||
#$ref_uf/ref_bu1/ref_A8_BU.state = STATE_VAL.ERROR
|
||||
|
||||
|
||||
func control_ems(status: Dictionary) -> void:
|
||||
if status['УФ-онлайн']:
|
||||
$ref_uf/ref_kassetav13/ref_A7_YAU07.state = STATE_VAL.GOOD
|
||||
$ref_uf/ref_kassetav13/ref_A3_IP5B.state = STATE_VAL.GOOD
|
||||
$ref_uf/ref_bu1/ref_A8_BU.state = STATE_VAL.GOOD
|
||||
$ref_uf/ref_kassetav13/ref_A9_ESW.state = STATE_VAL.GOOD
|
||||
$ref_uf/ref_bu1/ref_A8_BU.state = STATE_VAL.GOOD ## заглушка для зеленения ВК-110
|
||||
$ref_uf/ref_kassetav13/ref_A4_KEMS.state = STATE_VAL.GOOD if status['КЭМС-Б1'] else STATE_VAL.ERROR
|
||||
$ref_uf/ref_kassetav13/ref_A5_EMS.state = STATE_VAL.GOOD if status['ЭМС-Б1'] else STATE_VAL.ERROR
|
||||
$ref_uf/ref_kassetav13/ref_A6_EMS.state = STATE_VAL.GOOD if status['ЭМС-Б2'] else STATE_VAL.ERROR
|
||||
$ref_uf/ref_kassetav13/ref_A12_IP27B.state = STATE_VAL.GOOD if status['ИП220-27Б'] else STATE_VAL.ERROR
|
||||
else:
|
||||
$ref_uf/ref_kassetav13/ref_A7_YAU07.state = STATE_VAL.ERROR
|
||||
$ref_uf/ref_kassetav13/ref_A3_IP5B.state = STATE_VAL.NONE
|
||||
$ref_uf/ref_bu1/ref_A8_BU.state = STATE_VAL.NONE
|
||||
$ref_uf/ref_kassetav13/ref_A9_ESW.state = STATE_VAL.NONE
|
||||
$ref_uf/ref_kassetav13/ref_A4_KEMS.state = STATE_VAL.NONE
|
||||
$ref_uf/ref_kassetav13/ref_A5_EMS.state = STATE_VAL.NONE
|
||||
$ref_uf/ref_kassetav13/ref_A6_EMS.state = STATE_VAL.NONE
|
||||
$ref_uf/ref_kassetav13/ref_A3_IP5B.state = STATE_VAL.NONE
|
||||
$ref_uf/ref_kassetav13/ref_A9_ESW.state = STATE_VAL.NONE
|
||||
$ref_uf/ref_kassetav13/ref_A12_IP27B.state = STATE_VAL.NONE
|
||||
$ref_uf/ref_bu1/ref_A8_BU.state = STATE_VAL.NONE
|
||||
status_uf(status)
|
||||
|
||||
|
||||
func control_vk() -> void:
|
||||
var out_usb_str = ''
|
||||
var out_pci_str = ''
|
||||
var out_usb = []
|
||||
var out_pci = []
|
||||
|
||||
OS.execute('lsusb', [], out_usb) # TODO: Не переносимое, платформозависимое
|
||||
for element in out_usb:
|
||||
out_usb_str += element
|
||||
|
||||
OS.execute('lspci', [], out_pci) # TODO: Не переносимое, платформозависимое
|
||||
for element in out_pci:
|
||||
out_pci_str += element
|
||||
|
||||
out_usb_str = out_usb_str.split('\n')
|
||||
out_pci_str = out_pci_str.split('\n')
|
||||
|
||||
var i: int = 0
|
||||
|
||||
for string in out_usb_str:
|
||||
if USB_TRACKERBALL in string:
|
||||
i += 1
|
||||
break
|
||||
for string in out_pci_str:
|
||||
for item in DEV_LIST:
|
||||
if item in string:
|
||||
i += 1
|
||||
if REVFF in string:
|
||||
i -= 1
|
||||
break
|
||||
|
||||
if i == (DEV_LIST.size() + 1):
|
||||
$ref_uf/ref_bu1/ref_A8_BU.state = STATE_VAL.GOOD
|
||||
else:
|
||||
$ref_uf/ref_bu1/ref_A8_BU.state = STATE_VAL.ERROR
|
||||
|
||||
|
||||
func control_ems(status: Array) -> void:
|
||||
if status:
|
||||
$ref_uf/ref_kassetav13/ref_A4_KEMS.state = STATE_VAL.GOOD if ((status[0] >> 0) & 1) and ((status[0] >> 3) & 1) else STATE_VAL.ERROR
|
||||
$ref_uf/ref_kassetav13/ref_A5_EMS.state = STATE_VAL.GOOD if ((status[0] >> 1) & 1) and ((status[0] >> 4) & 1) else STATE_VAL.ERROR
|
||||
$ref_uf/ref_kassetav13/ref_A6_EMS.state = STATE_VAL.GOOD if ((status[0] >> 2) & 1) and ((status[0] >> 5) & 1) else STATE_VAL.ERROR
|
||||
$ref_uf/ref_kassetav13/ref_A12_IP27B.state = STATE_VAL.GOOD if ((status[2] >> 6) & 1) else STATE_VAL.ERROR
|
||||
|
||||
|
||||
func status_uf() -> void:
|
||||
var status_bu: int = $ref_uf/ref_bu1/ref_A8_BU.state
|
||||
var status_yau: int = $ref_uf/ref_kassetav13/ref_A7_YAU07.state
|
||||
var status_kyems: int = $ref_uf/ref_kassetav13/ref_A4_KEMS.state
|
||||
var status_yems0: int = $ref_uf/ref_kassetav13/ref_A5_EMS.state
|
||||
var status_yems1: int = $ref_uf/ref_kassetav13/ref_A6_EMS.state
|
||||
var status_ip5: int = $ref_uf/ref_kassetav13/ref_A3_IP5B.state
|
||||
var status_ip27: int = $ref_uf/ref_kassetav13/ref_A12_IP27B.state
|
||||
|
||||
if (status_yau == 1) and (status_bu == 1) and (status_kyems == 1) \
|
||||
and (status_yems0 == 1) and (status_yems1 == 1) and (status_ip5 == 1) and (status_ip27 == 1):
|
||||
$lbl_header2.text = 'Прибор исправен'
|
||||
$lbl_header2.modulate = Color.GREEN
|
||||
else:
|
||||
$lbl_header2.text = 'Прибор неисправен'
|
||||
$lbl_header2.modulate = Color.RED
|
||||
func status_uf(status_uf_dic: Dictionary) -> void:
|
||||
var is_ok: bool = true
|
||||
if not status_uf_dic['УФ-онлайн']:
|
||||
$lbl_header2.text = 'Ожидание связи с ЯУ-07Б'
|
||||
$lbl_header2.modulate = Color.WHITE
|
||||
elif status_uf_dic['УФ-онлайн']:
|
||||
for socket in status_uf_dic:
|
||||
if not status_uf_dic[socket]:
|
||||
is_ok = false
|
||||
if is_ok:
|
||||
$lbl_header2.text = 'Прибор исправен'
|
||||
$lbl_header2.modulate = Color.GREEN
|
||||
elif not is_ok:
|
||||
$lbl_header2.text = 'Прибор неисправен'
|
||||
$lbl_header2.modulate = Color.RED
|
||||
$lbl_header2.visible = true
|
||||
emit_signal('control_is_over', unit_uf.name)
|
||||
|
||||
|
||||
func find_labels(node1: Node):
|
||||
if node1 is Label:
|
||||
if node1.name in ["lbl_rname", "rname"]:
|
||||
if not node1.has_meta("tooltip_set"):
|
||||
if node1.name in ['lbl_rname', 'rname']:
|
||||
if not node1.has_meta('tooltip_set'):
|
||||
ctrl_pos += 1
|
||||
var box_number = ceili(float(ctrl_pos) / 10.0)
|
||||
var position_number = ctrl_pos % 10
|
||||
if position_number == 0:
|
||||
position_number = 10
|
||||
node1.tooltip_text = "Ящик - %d, Позиция - %d" % [box_number, position_number]
|
||||
node1.tooltip_text = 'Ящик - %d, Позиция - %d' % [box_number, position_number]
|
||||
node1.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
node1.set_meta("tooltip_set", true)
|
||||
node1.set_meta('tooltip_set', true)
|
||||
for child in node1.get_children():
|
||||
find_labels(child)
|
||||
|
||||
93
scenes/pribor-uf/uf-ctl.gd
Normal file
@@ -0,0 +1,93 @@
|
||||
class_name UFControl extends Node
|
||||
|
||||
signal update_uf_serviceability(status: int)
|
||||
|
||||
#region Константы и переменные
|
||||
enum StatusIndex {SOCKETS = 0, IP_220_27B = 2}
|
||||
enum STATE_VAL {NONE = 0, GOOD = 1, ERROR = 2}
|
||||
var unit_uf: Object
|
||||
var uf_status: Dictionary = {'УФ-онлайн': false, 'КЭМС-Б1': false, 'ЭМС-Б1': false, 'ЭМС-Б2': false, 'ИП220-27Б': false}
|
||||
|
||||
var _self_name: String
|
||||
var _serviceability: int = STATE_VAL.NONE
|
||||
var serviceability_uf: int:
|
||||
get:
|
||||
return _serviceability
|
||||
set(value):
|
||||
if value != _serviceability:
|
||||
_serviceability = value
|
||||
signaller.emit_signal('update_uf_serviceability', value)
|
||||
#endregion
|
||||
|
||||
#region Инициализация
|
||||
func _init(name_uf: String) -> void:
|
||||
_self_name = name_uf
|
||||
unit_uf = network.get_unit_instance(_self_name)
|
||||
unit_uf.connect('line_changed', on_line_changed)
|
||||
unit_uf.connect('data_received', on_data_received)
|
||||
#endregion
|
||||
|
||||
#region Обработчики сигналов
|
||||
func on_line_changed(status: Object) -> void:
|
||||
'''Обработка изменения состояния линии связи'''
|
||||
uf_status['УФ-онлайн'] = status.online
|
||||
update_serviceability()
|
||||
|
||||
func on_data_received(yau: Object) -> void:
|
||||
'''Обработка полученных данных от УФ'''
|
||||
var new_ems_status = control_ems(yau.status)
|
||||
var status_changed = false
|
||||
|
||||
# Обновляем только ключи КЭМС/ЭМС, сохраняя 'УФ-онлайн'
|
||||
for key in ['КЭМС-Б1', 'ЭМС-Б1', 'ЭМС-Б2', 'ИП220-27Б']:
|
||||
var old_value = uf_status.get(key, false)
|
||||
var new_value = new_ems_status.get(key, false)
|
||||
|
||||
if old_value != new_value:
|
||||
uf_status[key] = new_value
|
||||
status_changed = true
|
||||
|
||||
if status_changed:
|
||||
update_serviceability()
|
||||
#endregion
|
||||
|
||||
#region Статус и сервисабельность
|
||||
func get_current_status() -> Dictionary:
|
||||
'''Получение текущего статуса (только для чтения)'''
|
||||
return uf_status.duplicate(true)
|
||||
|
||||
func is_operational() -> bool:
|
||||
'''Проверка, все ли системы работают нормально'''
|
||||
return serviceability_uf and uf_status.get('УФ-онлайн', false)
|
||||
|
||||
|
||||
func update_serviceability() -> void:
|
||||
'''Обновление общего статуса сервисабельности'''
|
||||
var new_serviceability: int = STATE_VAL.GOOD
|
||||
|
||||
# Проверяем онлайн-статус
|
||||
if uf_status.get('УФ-онлайн', false) == false:
|
||||
new_serviceability = STATE_VAL.NONE
|
||||
else:
|
||||
# Проверяем все статусы КЭМС/ЭМС
|
||||
for key in ['КЭМС-Б1', 'ЭМС-Б1', 'ЭМС-Б2', 'ИП220-27Б']:
|
||||
if uf_status.get(key, true) == false:
|
||||
new_serviceability = STATE_VAL.ERROR
|
||||
break
|
||||
# Новое значение через setter
|
||||
self.serviceability_uf = new_serviceability
|
||||
#endregion
|
||||
|
||||
#region Вспомогательные методы
|
||||
static func control_ems(status: Array) -> Dictionary:
|
||||
'''Анализ статусов КЭМС/ЭМС'''
|
||||
var status_dic: Dictionary = {}
|
||||
if status.is_empty() or status.size() < 3:
|
||||
return status_dic
|
||||
|
||||
status_dic['КЭМС-Б1'] = bool((status[StatusIndex.SOCKETS] >> 0) & 1) and bool((status[StatusIndex.SOCKETS] >> 3) & 1)
|
||||
status_dic['ЭМС-Б1'] = bool((status[StatusIndex.SOCKETS] >> 1) & 1) and bool((status[StatusIndex.SOCKETS] >> 4) & 1)
|
||||
status_dic['ЭМС-Б2'] = bool((status[StatusIndex.SOCKETS] >> 2) & 1) and bool((status[StatusIndex.SOCKETS] >> 5) & 1)
|
||||
status_dic['ИП220-27Б'] = bool((status[StatusIndex.IP_220_27B] >> 6) & 1)
|
||||
return status_dic
|
||||
#endregion
|
||||
1
scenes/pribor-uf/uf-ctl.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b6avo0uvwrxnj
|
||||
285
scenes/tabs-switch/lbl-ready.gd
Normal file
@@ -0,0 +1,285 @@
|
||||
extends Label
|
||||
|
||||
enum DEVICE_STATE {
|
||||
NONE, # Нет связи
|
||||
GOOD, # Исправно
|
||||
ERR # Отказ
|
||||
}
|
||||
|
||||
enum DEVICE_STATUS {
|
||||
ONLINE, # Связь есть
|
||||
STATUS, # Статус исправности
|
||||
CONTROL # Контроль завершен
|
||||
}
|
||||
|
||||
const STATUS_CONFIG := {
|
||||
DEVICE_STATE.NONE: {'text': 'Нет связи', 'color': Color.WHITE, 'font_color': Color.BLACK},
|
||||
DEVICE_STATE.GOOD: {'text': 'Исправно', 'color': Color.GREEN, 'font_color': Color.BLACK},
|
||||
DEVICE_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
|
||||
|
||||
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: DEVICE_STATE = DEVICE_STATE.NONE
|
||||
var status_uf: int = DEVICE_STATE.NONE # Статус УФ (УАРЭП-ЭМС)
|
||||
|
||||
func _ready() -> void:
|
||||
tooltip_text = 'Нет связи с приборами комплекса'
|
||||
add_theme_color_override('font_color', Color.BLACK)
|
||||
|
||||
# Инициализация наблюдателей
|
||||
_initialize_observers()
|
||||
|
||||
# Подписка на сигналы ПРД модулей
|
||||
for prd_module in prd.prd_dict.values():
|
||||
# Подключаемся к контролю ПРД
|
||||
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))
|
||||
|
||||
# Подписка на УФ
|
||||
signaller.connect('update_uf_serviceability', _on_uf_status_receive)
|
||||
|
||||
# Инициализация начального состояния
|
||||
_recalculate_overall_state()
|
||||
|
||||
|
||||
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_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_status: int) -> void:
|
||||
if status_uf != unit_uf_status:
|
||||
status_uf = unit_uf_status
|
||||
_recalculate_overall_state()
|
||||
|
||||
|
||||
func _recalculate_overall_state() -> void:
|
||||
var new_state := DEVICE_STATE.NONE
|
||||
|
||||
# Проверяем статус ПРД
|
||||
var prd_state := DEVICE_STATE.NONE
|
||||
var has_online_prd := false
|
||||
var all_prd_operational := true
|
||||
|
||||
for observer in device_observers.values():
|
||||
if observer.status[DEVICE_STATUS.ONLINE]:
|
||||
has_online_prd = true
|
||||
|
||||
if observer.status[DEVICE_STATUS.CONTROL]:
|
||||
if not observer.status[DEVICE_STATUS.STATUS]:
|
||||
all_prd_operational = false
|
||||
break
|
||||
else:
|
||||
if not observer.status[DEVICE_STATUS.STATUS]:
|
||||
all_prd_operational = false
|
||||
|
||||
if has_online_prd:
|
||||
if all_prd_operational:
|
||||
prd_state = DEVICE_STATE.GOOD
|
||||
else:
|
||||
prd_state = DEVICE_STATE.ERR
|
||||
else:
|
||||
prd_state = DEVICE_STATE.NONE
|
||||
|
||||
# Комбинируем статусы по правилу:
|
||||
# 1. Если хоть один ERROR → ERROR
|
||||
# 2. Если нет ERROR и хоть один GOOD → GOOD
|
||||
# 3. Иначе → NONE
|
||||
|
||||
if prd_state == DEVICE_STATE.ERR or status_uf == DEVICE_STATE.ERR:
|
||||
new_state = DEVICE_STATE.ERR
|
||||
elif prd_state == DEVICE_STATE.GOOD or status_uf == DEVICE_STATE.GOOD:
|
||||
new_state = DEVICE_STATE.GOOD
|
||||
else:
|
||||
new_state = DEVICE_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:
|
||||
var tooltip := ''
|
||||
|
||||
# Получаем статистику по ПРД
|
||||
var prd_summary = _get_prd_summary()
|
||||
var uf_status_str = _get_uf_status_text()
|
||||
|
||||
match overall_prd_state:
|
||||
DEVICE_STATE.NONE:
|
||||
tooltip = 'Нет исправных систем в комплексе'
|
||||
DEVICE_STATE.GOOD:
|
||||
tooltip = 'Комплекс исправен'
|
||||
DEVICE_STATE.ERR:
|
||||
tooltip = 'Обнаружены неисправности в комплексе'
|
||||
|
||||
tooltip += '\n\nСтатус ПРД систем: ' + prd_summary
|
||||
tooltip += '\nСтатус УФ: ' + uf_status_str
|
||||
|
||||
# Детализация по источникам статуса
|
||||
tooltip += '\n\nСостояние систем:'
|
||||
|
||||
# ПРД системы
|
||||
var prd_ok_count = 0
|
||||
var prd_total = 0
|
||||
for observer in device_observers.values():
|
||||
if observer.status[DEVICE_STATUS.ONLINE]:
|
||||
prd_total += 1
|
||||
if observer.status[DEVICE_STATUS.STATUS]:
|
||||
prd_ok_count += 1
|
||||
|
||||
tooltip += '\nПРД: %d/%d исправно' % [prd_ok_count, prd_total]
|
||||
|
||||
# УФ система
|
||||
tooltip += '\nУФ: ' + _get_uf_status_text()
|
||||
|
||||
return tooltip
|
||||
|
||||
|
||||
func _get_prd_summary() -> String:
|
||||
var online_count := 0
|
||||
var operational_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 online_count == 0:
|
||||
return 'Нет связи'
|
||||
else:
|
||||
return '%d/%d исправно' % [operational_count, online_count]
|
||||
|
||||
|
||||
func _get_uf_status_text() -> String:
|
||||
match status_uf:
|
||||
DEVICE_STATE.NONE:
|
||||
return 'Нет данных'
|
||||
DEVICE_STATE.GOOD:
|
||||
return 'Исправен'
|
||||
DEVICE_STATE.ERR:
|
||||
return 'Неисправен'
|
||||
_:
|
||||
return 'Неизвестно'
|
||||
|
||||
|
||||
func _has_prd_errors() -> bool:
|
||||
for observer in device_observers.values():
|
||||
if observer.status[DEVICE_STATUS.ONLINE] and not observer.status[DEVICE_STATUS.STATUS]:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _has_operational_prd() -> bool:
|
||||
for observer in device_observers.values():
|
||||
if observer.status[DEVICE_STATUS.ONLINE] and observer.status[DEVICE_STATUS.STATUS]:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
# Публичные методы для получения информации
|
||||
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(),
|
||||
'status_uf': status_uf
|
||||
}
|
||||
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,
|
||||
'uf_status': status_uf
|
||||
}
|
||||
1
scenes/tabs-switch/lbl-ready.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b5ykwyk5vpi6
|
||||
@@ -1,6 +1,6 @@
|
||||
extends Label
|
||||
|
||||
enum PRD_STATE {
|
||||
enum DEVICE_STATE {
|
||||
NONE, # Нет связи
|
||||
GOOD, # Исправно
|
||||
ERR # Отказ
|
||||
@@ -13,9 +13,9 @@ enum DEVICE_STATUS {
|
||||
}
|
||||
|
||||
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}
|
||||
DEVICE_STATE.NONE: {'text': 'Нет связи', 'color': Color.WHITE, 'font_color': Color.BLACK},
|
||||
DEVICE_STATE.GOOD: {'text': 'Исправно', 'color': Color.GREEN, 'font_color': Color.BLACK},
|
||||
DEVICE_STATE.ERR: {'text': 'Отказ', 'color': Color.RED, 'font_color': Color.WHITE}
|
||||
}
|
||||
|
||||
class DeviceObserver:
|
||||
@@ -31,7 +31,6 @@ class DeviceObserver:
|
||||
|
||||
func update_control_results(results: Dictionary) -> bool:
|
||||
var changed := false
|
||||
last_results = results.duplicate()
|
||||
|
||||
if results.get('is_over_control', false):
|
||||
# Контроль завершен - проверяем все результаты
|
||||
@@ -58,11 +57,12 @@ class DeviceObserver:
|
||||
return changed
|
||||
|
||||
var device_observers: Dictionary = {}
|
||||
var overall_prd_state: PRD_STATE = PRD_STATE.NONE
|
||||
var overall_prd_state: DEVICE_STATE = DEVICE_STATE.NONE
|
||||
var status_uf: int = DEVICE_STATE.NONE # Статус УФ (УАРЭП-ЭМС)
|
||||
|
||||
func _ready() -> void:
|
||||
tooltip_text = 'Нет связи с приборами комплекса'
|
||||
add_theme_color_override("font_color", Color.BLACK)
|
||||
add_theme_color_override('font_color', Color.BLACK)
|
||||
|
||||
# Инициализация наблюдателей
|
||||
_initialize_observers()
|
||||
@@ -77,9 +77,7 @@ func _ready() -> void:
|
||||
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'))
|
||||
signaller.connect('update_uf_serviceability', _on_uf_status_receive)
|
||||
|
||||
# Инициализация начального состояния
|
||||
_recalculate_overall_state()
|
||||
@@ -111,41 +109,51 @@ func _on_prd_control_results(results: Dictionary, prd_module: Object) -> void:
|
||||
_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 _on_uf_status_receive(unit_uf_status: int) -> void:
|
||||
if status_uf != unit_uf_status:
|
||||
status_uf = unit_uf_status
|
||||
_recalculate_overall_state()
|
||||
|
||||
|
||||
func _recalculate_overall_state() -> void:
|
||||
var new_state := PRD_STATE.NONE
|
||||
var has_online_devices := false
|
||||
var all_operational := true
|
||||
var new_state := DEVICE_STATE.NONE
|
||||
|
||||
# Проверяем статус ПРД
|
||||
var prd_state := DEVICE_STATE.NONE
|
||||
var has_online_prd := false
|
||||
var all_prd_operational := true
|
||||
|
||||
for observer in device_observers.values():
|
||||
if observer.status[DEVICE_STATUS.ONLINE]:
|
||||
has_online_devices = true
|
||||
has_online_prd = true
|
||||
|
||||
if observer.status[DEVICE_STATUS.CONTROL]:
|
||||
# Если контроль завершен - строгая проверка
|
||||
if not observer.status[DEVICE_STATUS.STATUS]:
|
||||
all_operational = false
|
||||
all_prd_operational = false
|
||||
break
|
||||
else:
|
||||
# Если контроль в процессе - мягкая проверка
|
||||
if not observer.status[DEVICE_STATUS.STATUS]:
|
||||
all_operational = false
|
||||
# Не прерываем, чтобы проверить все устройства
|
||||
all_prd_operational = false
|
||||
|
||||
if has_online_devices:
|
||||
new_state = PRD_STATE.GOOD if all_operational else PRD_STATE.ERR
|
||||
if has_online_prd:
|
||||
if all_prd_operational:
|
||||
prd_state = DEVICE_STATE.GOOD
|
||||
else:
|
||||
prd_state = DEVICE_STATE.ERR
|
||||
else:
|
||||
new_state = PRD_STATE.NONE
|
||||
prd_state = DEVICE_STATE.NONE
|
||||
|
||||
# Комбинируем статусы по правилу:
|
||||
# 1. Если хоть один ERROR → ERROR
|
||||
# 2. Если нет ERROR и хоть один GOOD → GOOD
|
||||
# 3. Иначе → NONE
|
||||
|
||||
if prd_state == DEVICE_STATE.ERR or status_uf == DEVICE_STATE.ERR:
|
||||
new_state = DEVICE_STATE.ERR
|
||||
elif prd_state == DEVICE_STATE.GOOD or status_uf == DEVICE_STATE.GOOD:
|
||||
new_state = DEVICE_STATE.GOOD
|
||||
else:
|
||||
new_state = DEVICE_STATE.NONE
|
||||
|
||||
if overall_prd_state != new_state:
|
||||
overall_prd_state = new_state
|
||||
@@ -154,23 +162,90 @@ func _recalculate_overall_state() -> void:
|
||||
|
||||
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)
|
||||
add_theme_color_override('font_color', config.font_color)
|
||||
tooltip_text = _get_tooltip_text()
|
||||
|
||||
|
||||
func _get_tooltip_text() -> String:
|
||||
var tooltip := ''
|
||||
|
||||
# Получаем статистику по ПРД
|
||||
var prd_summary = _get_prd_summary()
|
||||
var uf_status_str = _get_uf_status_text()
|
||||
|
||||
match overall_prd_state:
|
||||
PRD_STATE.NONE:
|
||||
return "Нет связи с приборами комплекса"
|
||||
PRD_STATE.GOOD:
|
||||
return "Все приборы комплекса исправны"
|
||||
PRD_STATE.ERR:
|
||||
return "Обнаружены неисправности в комплексе"
|
||||
DEVICE_STATE.NONE:
|
||||
tooltip = 'Нет исправных систем в комплексе'
|
||||
DEVICE_STATE.GOOD:
|
||||
tooltip = 'Комплекс исправен'
|
||||
DEVICE_STATE.ERR:
|
||||
tooltip = 'Обнаружены неисправности в комплексе'
|
||||
|
||||
tooltip += '\n\nСтатус ПРД систем: ' + prd_summary
|
||||
tooltip += '\nСтатус УФ: ' + uf_status_str
|
||||
|
||||
# Детализация по источникам статуса
|
||||
tooltip += '\n\nСостояние систем:'
|
||||
|
||||
# ПРД системы
|
||||
var prd_ok_count = 0
|
||||
var prd_total = 0
|
||||
for observer in device_observers.values():
|
||||
if observer.status[DEVICE_STATUS.ONLINE]:
|
||||
prd_total += 1
|
||||
if observer.status[DEVICE_STATUS.STATUS]:
|
||||
prd_ok_count += 1
|
||||
|
||||
tooltip += '\nПРД: %d/%d исправно' % [prd_ok_count, prd_total]
|
||||
|
||||
# УФ система
|
||||
tooltip += '\nУФ: ' + _get_uf_status_text()
|
||||
|
||||
return tooltip
|
||||
|
||||
|
||||
func _get_prd_summary() -> String:
|
||||
var online_count := 0
|
||||
var operational_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 online_count == 0:
|
||||
return 'Нет связи'
|
||||
else:
|
||||
return '%d/%d исправно' % [operational_count, online_count]
|
||||
|
||||
|
||||
func _get_uf_status_text() -> String:
|
||||
match status_uf:
|
||||
DEVICE_STATE.NONE:
|
||||
return 'Нет данных'
|
||||
DEVICE_STATE.GOOD:
|
||||
return 'Исправен'
|
||||
DEVICE_STATE.ERR:
|
||||
return 'Неисправен'
|
||||
_:
|
||||
return "Неизвестное состояние"
|
||||
return 'Неизвестно'
|
||||
|
||||
|
||||
func _has_prd_errors() -> bool:
|
||||
for observer in device_observers.values():
|
||||
if observer.status[DEVICE_STATUS.ONLINE] and not observer.status[DEVICE_STATUS.STATUS]:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _has_operational_prd() -> bool:
|
||||
for observer in device_observers.values():
|
||||
if observer.status[DEVICE_STATUS.ONLINE] and observer.status[DEVICE_STATUS.STATUS]:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
# Публичные методы для получения информации
|
||||
@@ -178,10 +253,11 @@ 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()
|
||||
'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(),
|
||||
'status_uf': status_uf
|
||||
}
|
||||
return {}
|
||||
|
||||
@@ -200,9 +276,10 @@ func get_overall_status() -> Dictionary:
|
||||
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
|
||||
'overall_state': overall_prd_state,
|
||||
'online_devices': online_count,
|
||||
'operational_devices': operational_count,
|
||||
'total_devices': device_observers.size(),
|
||||
'control_complete_devices': control_complete_count,
|
||||
'uf_status': status_uf
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://b5ykwyk5vpi6
|
||||
uid://q7k2yihg057j
|
||||
|
||||
@@ -23,3 +23,17 @@ func _enter_tree() -> void:
|
||||
func on_setting_changed():
|
||||
var ext_cu = ProjectSettings.get_setting('application/config/Внешнее управление', false)
|
||||
get_parent().get_node('remote_control').visible = ext_cu
|
||||
apply_colors()
|
||||
|
||||
|
||||
func apply_colors():
|
||||
var is_light: bool = ProjectSettings.get_setting('application/config/Цвет темы программы', false)
|
||||
var style = StyleBoxFlat.new()
|
||||
if is_light:
|
||||
style.bg_color = Color.DARK_GRAY
|
||||
add_theme_stylebox_override('tabbar_background', style)
|
||||
add_theme_stylebox_override('panel', style)
|
||||
else:
|
||||
style.bg_color = Color(0.12, 0.12, 0.12)
|
||||
add_theme_stylebox_override('tabbar_background', style)
|
||||
add_theme_stylebox_override('panel', style)
|
||||
|
||||
@@ -1,52 +1,38 @@
|
||||
[gd_scene load_steps=20 format=3 uid="uid://3slb0i3pvowc"]
|
||||
[gd_scene load_steps=15 format=3 uid="uid://3slb0i3pvowc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvo6tcreqyuex" path="res://scenes/tabs-switch/tab-switch.gd" id="1_fg0vd"]
|
||||
[ext_resource type="PackedScene" uid="uid://b276iygic5itk" path="res://scenes/работа/работа.tscn" id="2_u7p16"]
|
||||
[ext_resource type="PackedScene" uid="uid://lwmw4egynmd1" path="res://scenes/контроль/контроль.tscn" id="3_txp0s"]
|
||||
[ext_resource type="PackedScene" uid="uid://trt0q8th3bn2" path="res://scenes/журнал/журнал.tscn" id="4_cu5k8"]
|
||||
[ext_resource type="PackedScene" uid="uid://dab6loryocc73" path="res://scenes/эмс/эмс.tscn" id="5_u71bh"]
|
||||
[ext_resource type="PackedScene" uid="uid://musb21x2u0xs" path="res://scenes/эмс2/эмс2.tscn" id="6_41d34"]
|
||||
[ext_resource type="PackedScene" uid="uid://musb21x2u0xs" path="res://scenes/эмс-тг/эмс-тг.tscn" id="6_41d34"]
|
||||
[ext_resource type="PackedScene" uid="uid://bnptm4rlp60dq" path="res://scenes/настройки/настройки.tscn" id="6_i8iv3"]
|
||||
[ext_resource type="Script" uid="uid://b5ykwyk5vpi6" path="res://scenes/tabs-switch/lbl_ready.gd" id="8_tidwt"]
|
||||
[ext_resource type="Script" path="res://scenes/tabs-switch/тренаж_режим.gd" id="9_41d34"]
|
||||
[ext_resource type="Script" uid="uid://q7k2yihg057j" path="res://scenes/tabs-switch/lbl_ready.gd" id="8_tidwt"]
|
||||
[ext_resource type="Script" uid="uid://roajn6c6wvc1" path="res://scenes/tabs-switch/тренаж-режим.gd" id="9_41d34"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tidwt"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_41d34"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_cw2ss"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_nmdfd"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_vap7n"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vap7n"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o1r22"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nmdfd"]
|
||||
bg_color = Color(0.061, 100, 0.051, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cw2ss"]
|
||||
bg_color = Color(0.473976, 0.473976, 0.473976, 1)
|
||||
bg_color = Color(0.47451, 0.47451, 0.47451, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nmdfd"]
|
||||
bg_color = Color(0, 100, 0, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_41d34"]
|
||||
bg_color = Color(0.39, 100, 0.327, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_imu1q"]
|
||||
|
||||
[node name="panel" type="Panel"]
|
||||
offset_right = 1600.0
|
||||
offset_bottom = 1200.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_tidwt")
|
||||
|
||||
[node name="tab_switch" type="TabContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 1600.0
|
||||
offset_bottom = 1200.0
|
||||
tooltip_text = "Переключает режимы работы программы"
|
||||
theme_override_styles/tab_focus = SubResource("StyleBoxEmpty_41d34")
|
||||
theme_override_styles/tab_disabled = SubResource("StyleBoxEmpty_cw2ss")
|
||||
theme_override_styles/tabbar_background = SubResource("StyleBoxEmpty_nmdfd")
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_vap7n")
|
||||
theme_override_styles/tabbar_background = SubResource("StyleBoxFlat_vap7n")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_vap7n")
|
||||
current_tab = 0
|
||||
script = ExtResource("1_fg0vd")
|
||||
|
||||
@@ -102,10 +88,9 @@ focus_mode = 0
|
||||
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_nmdfd")
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_cw2ss")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_41d34")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_imu1q")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_nmdfd")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_41d34")
|
||||
toggle_mode = true
|
||||
text = "Тренаж"
|
||||
script = ExtResource("9_41d34")
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
extends Button
|
||||
|
||||
func _ready():
|
||||
connect("toggled", Callable(self, "_on_button_toggled"))
|
||||
connect('toggled', Callable(self, '_on_button_toggled'))
|
||||
|
||||
|
||||
func _on_button_toggled(mode: bool):
|
||||
if mode:
|
||||
tooltip_text = "Режим \"Тренаж\" задействован\nТекущее состояние: включено"
|
||||
tooltip_text = 'Режим \"Тренаж\" задействован\nТекущее состояние: включено'
|
||||
else:
|
||||
tooltip_text = "Задейстовать режим \"Тренаж\"\nТекущее состояние: отключено"
|
||||
tooltip_text = 'Задейстовать режим \"Тренаж\"\nТекущее состояние: отключено'
|
||||
@@ -2,6 +2,9 @@
|
||||
extends CanvasGroup
|
||||
class_name MercatorTileMap
|
||||
|
||||
const VECTOR00: = Vector2(0, 0)
|
||||
const VECTOR11: = Vector2(1, 1)
|
||||
|
||||
## Отображение карт WEB Mercator
|
||||
|
||||
#http://10.1.1.220/osm_tiles/0/0/0.png
|
||||
@@ -26,10 +29,9 @@ const TILE_REQUEST_NAME: = 'tile_request_%d'
|
||||
@export_color_no_alpha() var back_color: = Color.BLACK
|
||||
@export var show_ship_radius: bool = true
|
||||
@export var ship_radius_km: float = 8.0
|
||||
@onready var scale_label: String
|
||||
@onready var coordinates_label: String
|
||||
@onready var threat_mark: PackedScene = load("res://scenes/tilemap/threat.tscn")
|
||||
@onready var ship_mark: PackedScene = load("res://scenes/tilemap/ship_mark.tscn")
|
||||
@onready var threat_mark: PackedScene = load('res://scenes/tilemap/threat.tscn')
|
||||
@onready var ship_mark: PackedScene = load('res://scenes/tilemap/ship-mark.tscn')
|
||||
var ship_id := 9999
|
||||
var ship_instance: Node2D = null
|
||||
const default_size: = 400.0
|
||||
@@ -89,7 +91,7 @@ var _marks: Dictionary = {}
|
||||
var _req_count: = 0
|
||||
var image: = Image.new()
|
||||
var image_load_proc: Callable
|
||||
var now: = 0
|
||||
var now: = 0.0
|
||||
var visible_marks_count: = 0
|
||||
var border1: ImageTexture
|
||||
var border2: ImageTexture
|
||||
@@ -227,9 +229,11 @@ func _input(e) -> void:
|
||||
if e.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
||||
if (not is_out_border1) and (not is_out_border2):
|
||||
increment_zoom(-zoom_step, lmp)
|
||||
update_scale_label()
|
||||
queue_redraw()
|
||||
elif e.button_index == MOUSE_BUTTON_WHEEL_UP:
|
||||
increment_zoom( zoom_step, lmp)
|
||||
update_scale_label()
|
||||
queue_redraw()
|
||||
if e.button_index == MOUSE_BUTTON_LEFT:
|
||||
_dragging = e.pressed
|
||||
@@ -256,22 +260,12 @@ func _input(e) -> void:
|
||||
signaller.emmit(signaller.map_user_panning)
|
||||
|
||||
|
||||
func multiply_zoom(multiplier: float, pivot: Vector2) -> void:
|
||||
var p1: = screen_to_world(_xyz, pivot)
|
||||
_xyz.z = clampf(_xyz.z * multiplier, min_zoom_level, max_zoom_level)
|
||||
var p2: = screen_to_world(_xyz, pivot)
|
||||
_xyz.x -= p2.x - p1.x
|
||||
_xyz.y -= p2.y - p1.y
|
||||
update_scale_label()
|
||||
|
||||
|
||||
func increment_zoom(increment: float, pivot: Vector2) -> void:
|
||||
var p1: = screen_to_world(_xyz, pivot)
|
||||
_xyz.z = clampf(_xyz.z + increment, min_zoom_level, max_zoom_level)
|
||||
var p2: = screen_to_world(_xyz, pivot)
|
||||
_xyz.x -= p2.x - p1.x
|
||||
_xyz.y -= p2.y - p1.y
|
||||
update_scale_label()
|
||||
|
||||
|
||||
func set_zoom(zoom: float, pivot: Vector2) -> void:
|
||||
@@ -280,14 +274,13 @@ func set_zoom(zoom: float, pivot: Vector2) -> void:
|
||||
var p2: = screen_to_world(_xyz, pivot)
|
||||
_xyz.x -= p2.x - p1.x
|
||||
_xyz.y -= p2.y - p1.y
|
||||
update_scale_label()
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
# Рисование плиток
|
||||
var z: float = min(max_zoom_level, _xyz.z)
|
||||
var t1: = screen_to_tile(Vector2(0, 0), z)
|
||||
var t2: = screen_to_tile($canvas.size, z) + Vector2(1, 1)
|
||||
var t1: = screen_to_tile(VECTOR00, z)
|
||||
var t2: = screen_to_tile($canvas.size, z) + VECTOR11
|
||||
is_out_border1 = true
|
||||
is_out_border2 = true
|
||||
for tx in range(t1.x, t2.x):
|
||||
@@ -373,17 +366,15 @@ func _process(delta) -> void:
|
||||
remove_child(req)
|
||||
req.queue_free()
|
||||
_req_count -= 1
|
||||
push_error('запрос \"%s\" не отправлен' % tile.url) #TODO: For Deugs
|
||||
push_error('запрос \"%s\" не отправлен' % tile.url)
|
||||
if _queue.is_empty():
|
||||
emit_signal('load_completed')
|
||||
|
||||
update_scale_label()
|
||||
|
||||
|
||||
func process_online(result):
|
||||
# ERROR: res://scenes/tilemap/tilemap.gd:396 - Invalid access to property or key 'online' on a base object of type 'Nil'.
|
||||
var unit_instance: = network.get_unit_instance('уарэп-карта')
|
||||
if not unit_instance: return
|
||||
if not unit_instance: return true
|
||||
|
||||
if result != HTTPRequest.RESULT_SUCCESS:
|
||||
if unit_instance.online:
|
||||
@@ -403,9 +394,8 @@ func _response(result, code, _headers: Array, body: PackedByteArray, req, tile:
|
||||
remove_child(req)
|
||||
req.queue_free()
|
||||
|
||||
if process_online(result):
|
||||
if not process_online(result):
|
||||
_queue[tile.i] = tile
|
||||
else:
|
||||
return
|
||||
|
||||
if code == 404:
|
||||
@@ -413,7 +403,7 @@ func _response(result, code, _headers: Array, body: PackedByteArray, req, tile:
|
||||
return
|
||||
|
||||
if Error.OK != image_load_proc.call(body):
|
||||
push_error('не удалось получить изображение (неверный формат?) из \"%s\"' % tile.url)
|
||||
push_error('не удалось получить изображение (неверный формат?) из \"%s\" (%d байт)' % [tile.url, body.size()])
|
||||
return
|
||||
|
||||
tile.texture = ImageTexture.create_from_image(image)
|
||||
@@ -642,7 +632,7 @@ class Tile:
|
||||
var x: int = 0
|
||||
var y: int = 0
|
||||
var z: int = 0
|
||||
var t: int = 0
|
||||
var t: float = 0.0
|
||||
var url: String = ''
|
||||
var texture: Texture2D = null
|
||||
|
||||
@@ -732,7 +722,7 @@ func update_coordinates_label(lon: float, lat: float) -> void:
|
||||
|
||||
|
||||
func update_scale_label() -> void:
|
||||
scale_label = 'Масштаб: ' + str(round(_xyz.z))
|
||||
var scale_label: = 'Масштаб: %f' % round(_xyz.z)
|
||||
signaller.emit_signal('update_scale_map', scale_label)
|
||||
|
||||
|
||||
@@ -745,7 +735,7 @@ func _on_threat_new(th) -> void:
|
||||
|
||||
|
||||
func _on_threat_update(th) -> void:
|
||||
var target = get_parent().get_node(str(th.id))
|
||||
var target = get_parent().get_node_or_null(str(th.id))
|
||||
if not target:
|
||||
return
|
||||
var new_position = lonlat_to_world(th.lon, th.lat)
|
||||
@@ -756,7 +746,7 @@ func _on_threat_update(th) -> void:
|
||||
|
||||
|
||||
func _on_threat_lost(th) -> void:
|
||||
var target = get_parent().get_node(str(th.id))
|
||||
var target = get_parent().get_node_or_null(str(th.id))
|
||||
if target:
|
||||
target.queue_free()
|
||||
|
||||
@@ -766,6 +756,7 @@ func zoom_in() -> void:
|
||||
return
|
||||
var center: Vector2 = $canvas.size / 2.0
|
||||
increment_zoom(zoom_step, center)
|
||||
update_scale_label()
|
||||
queue_redraw()
|
||||
|
||||
|
||||
@@ -774,23 +765,24 @@ func zoom_out() -> void:
|
||||
return
|
||||
var center: Vector2 = $canvas.size / 2.0
|
||||
increment_zoom(-zoom_step, center)
|
||||
update_scale_label()
|
||||
queue_redraw()
|
||||
|
||||
|
||||
func _on_zoom_plus_button_down() -> void:
|
||||
zoom_action = "in"
|
||||
zoom_action = 'in'
|
||||
perform_zoom()
|
||||
zoom_timer.start(0.3)
|
||||
|
||||
|
||||
func _on_zoom_minus_button_down() -> void:
|
||||
zoom_action = "out"
|
||||
zoom_action = 'out'
|
||||
perform_zoom()
|
||||
zoom_timer.start(0.3)
|
||||
|
||||
|
||||
func _on_zoom_button_up() -> void:
|
||||
zoom_action = ""
|
||||
zoom_action = ''
|
||||
zoom_timer.stop()
|
||||
|
||||
|
||||
@@ -800,8 +792,8 @@ func _on_zoom_timeout():
|
||||
|
||||
|
||||
func perform_zoom():
|
||||
if zoom_action != "":
|
||||
if zoom_action == "in":
|
||||
if zoom_action != '':
|
||||
if zoom_action == 'in':
|
||||
zoom_in()
|
||||
else:
|
||||
zoom_out()
|
||||
@@ -834,5 +826,4 @@ func draw_ship_radius() -> void:
|
||||
var radius_point_world = Vector2(ship_world_pos.x + radius_world, ship_world_pos.y)
|
||||
var radius_point_screen = world_to_screen(radius_point_world)
|
||||
var radius_screen = ship_screen_pos.distance_to(radius_point_screen)
|
||||
#draw_arc(ship_screen_pos, radius_screen, 0, TAU, 64, Color.ORANGE, 2.0) # отрисовка контура
|
||||
draw_circle(ship_screen_pos, radius_screen, Color.ORANGE_RED * Color(1, 1, 1, 0.1)) # отрисовка заливки
|
||||
|
||||
@@ -28,6 +28,7 @@ size = Vector2(400, 400)
|
||||
|
||||
[node name="tilemap" type="CanvasGroup" groups=["gui_items"]]
|
||||
script = ExtResource("1_l64tp")
|
||||
max_zoom_level_server = 11
|
||||
|
||||
[node name="canvas" type="TextureRect" parent="." groups=["gui_items"]]
|
||||
clip_contents = true
|
||||
|
||||
@@ -3,5 +3,7 @@ extends AnimatedSprite2D
|
||||
## Изменяет состояние значка "прибор на связи"
|
||||
func set_val(val: bool):
|
||||
set_frame(val)
|
||||
if val: modulate = Color(0.3, 1.0, 0.3, 1)
|
||||
else: modulate = Color(0.5, 0.5, 0.5, 1)
|
||||
if val:
|
||||
modulate = Color(0.3, 1.0, 0.3, 1)
|
||||
else:
|
||||
modulate = Color(0.5, 0.5, 0.5, 1)
|
||||