Compare commits
9 Commits
1a72187683
...
83549ec2a3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83549ec2a3 | ||
|
|
d198989ad2 | ||
|
|
d2f4c8017c | ||
|
|
e261ada3cd | ||
|
|
98d0ed1457 | ||
|
|
a06df2b832 | ||
|
|
2919b0174f | ||
|
|
7788a664b5 | ||
|
|
f4a6a4d465 |
@@ -1,8 +1,8 @@
|
||||
# Разработка
|
||||
|
||||
- После клонирования запустить скрипт `git-hooks-config.sh`
|
||||
- В среде **Windows** запуск скрипта `git-hooks-config.sh` производить из оболочки `git bash`
|
||||
- При необходимости обновить `settings.json`
|
||||
- После клонирования запустить скрипт [`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`
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
# Сборка исполняемого файла из консоли
|
||||
|
||||
- Запустить скрипт `build.sh`
|
||||
- Запустить скрипт [`build.sh`](build.sh)
|
||||
|
||||
# Взаимодействие с 5П-28
|
||||
|
||||
|
||||
@@ -1,26 +1,22 @@
|
||||
class_name Diagram extends ColorRect
|
||||
|
||||
const NUM_OF_RANGE = 7
|
||||
const NUM_OF_DIRECTIONS = 4
|
||||
const color0_default: Color = Color(0.38, 0.47, 0.51, 1.0)
|
||||
const color1_default: Color = Color(0.39, 0.44, 0.50, 1.0)
|
||||
var color0: Color = color0_default
|
||||
var color1: Color = color1_default
|
||||
|
||||
var fs_default_colors: PackedColorArray ## Цвета по умолчанию для блоков ФС
|
||||
var image: Image
|
||||
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:
|
||||
image = Image.create(NUM_OF_RANGE * NUM_OF_DIRECTIONS, 1, false, Image.FORMAT_RGBA8)
|
||||
signaller.connect('map_mode_changed', Callable(self, 'set_view_mode'))
|
||||
ProjectSettings.connect('settings_changed', _on_settings_changed)
|
||||
_on_settings_changed()
|
||||
set_def_colors()
|
||||
_init_def_colors()
|
||||
set_band_colors(fs_default_colors)
|
||||
|
||||
|
||||
func sv(val: float) -> float: return val / ($строб.scale.x / 2.0) * 0.125
|
||||
@@ -52,9 +48,10 @@ func get_strob_width() -> float: return $строб.get_instance_shader_pa
|
||||
|
||||
## Выставляет цвета для секторов
|
||||
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)
|
||||
var tex: = ImageTexture.create_from_image(image)
|
||||
material.set('shader_parameter/sec_colors', tex)
|
||||
|
||||
|
||||
@@ -100,7 +97,7 @@ 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()
|
||||
|
||||
@@ -116,17 +113,12 @@ func set_view_mode(val: int):
|
||||
|
||||
|
||||
func _on_settings_changed():
|
||||
color0 = ProjectSettings.get_setting('application/interfer/default_color0', color0_default)
|
||||
color1 = ProjectSettings.get_setting('application/interfer/default_color1', color1_default)
|
||||
color0 *= Color(1.0, 1.0, 1.0, 0.0)
|
||||
color1 *= Color(1.0, 1.0, 1.0, 0.0)
|
||||
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 col_arr: PackedColorArray = [color0, color1]
|
||||
for i in NUM_OF_RANGE:
|
||||
for j in NUM_OF_DIRECTIONS:
|
||||
fs_default_colors.append(col_arr[i & 1])
|
||||
i += 1
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -10,13 +10,16 @@ class_name pribor_afsp extends 'res://scenes/контроль/прибор.gd'
|
||||
static var json_conv: JSON = JSON.new()
|
||||
static var node_maper = load('res://scenes/контроль/node-maper.gd')
|
||||
var ctrl_pos = 0
|
||||
|
||||
var request_url: Node
|
||||
var time_req: Node
|
||||
# SystemName: "gen" DevList - там состояние связи с генератором по кан шине
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
ProjectSettings.connect('settings_changed', on_settings_chaged)
|
||||
on_settings_chaged()
|
||||
request_url = $request
|
||||
time_req = $request/timer
|
||||
|
||||
|
||||
func on_settings_chaged():
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -138,7 +138,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
|
||||
|
||||
@@ -13,9 +13,9 @@ enum DEVICE_STATUS {
|
||||
}
|
||||
|
||||
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}
|
||||
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:
|
||||
@@ -62,7 +62,7 @@ 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()
|
||||
@@ -161,15 +161,15 @@ func _recalculate_overall_state() -> void:
|
||||
|
||||
|
||||
func _update_display() -> void:
|
||||
var config: Dictionary
|
||||
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 tooltip := ''
|
||||
|
||||
# Получаем статистику по ПРД
|
||||
var prd_summary = _get_prd_summary()
|
||||
@@ -177,17 +177,17 @@ func _get_tooltip_text() -> String:
|
||||
|
||||
match overall_prd_state:
|
||||
DEVICE_STATE.NONE:
|
||||
tooltip = "Нет исправных систем в комплексе"
|
||||
tooltip = 'Нет исправных систем в комплексе'
|
||||
DEVICE_STATE.GOOD:
|
||||
tooltip = "Комплекс исправен"
|
||||
tooltip = 'Комплекс исправен'
|
||||
DEVICE_STATE.ERR:
|
||||
tooltip = "Обнаружены неисправности в комплексе"
|
||||
tooltip = 'Обнаружены неисправности в комплексе'
|
||||
|
||||
tooltip += "\n\nСтатус ПРД систем: " + prd_summary
|
||||
tooltip += "\nСтатус УФ: " + uf_status_str
|
||||
tooltip += '\n\nСтатус ПРД систем: ' + prd_summary
|
||||
tooltip += '\nСтатус УФ: ' + uf_status_str
|
||||
|
||||
# Детализация по источникам статуса
|
||||
tooltip += "\n\nСостояние систем:"
|
||||
tooltip += '\n\nСостояние систем:'
|
||||
|
||||
# ПРД системы
|
||||
var prd_ok_count = 0
|
||||
@@ -198,10 +198,10 @@ func _get_tooltip_text() -> String:
|
||||
if observer.status[DEVICE_STATUS.STATUS]:
|
||||
prd_ok_count += 1
|
||||
|
||||
tooltip += "\nПРД: %d/%d исправно" % [prd_ok_count, prd_total]
|
||||
tooltip += '\nПРД: %d/%d исправно' % [prd_ok_count, prd_total]
|
||||
|
||||
# УФ система
|
||||
tooltip += "\nУФ: " + _get_uf_status_text()
|
||||
tooltip += '\nУФ: ' + _get_uf_status_text()
|
||||
|
||||
return tooltip
|
||||
|
||||
@@ -217,21 +217,21 @@ func _get_prd_summary() -> String:
|
||||
operational_count += 1
|
||||
|
||||
if online_count == 0:
|
||||
return "Нет связи"
|
||||
return 'Нет связи'
|
||||
else:
|
||||
return "%d/%d исправно" % [operational_count, online_count]
|
||||
return '%d/%d исправно' % [operational_count, online_count]
|
||||
|
||||
|
||||
func _get_uf_status_text() -> String:
|
||||
match status_uf:
|
||||
DEVICE_STATE.NONE:
|
||||
return "Нет данных"
|
||||
return 'Нет данных'
|
||||
DEVICE_STATE.GOOD:
|
||||
return "Исправен"
|
||||
return 'Исправен'
|
||||
DEVICE_STATE.ERR:
|
||||
return "Неисправен"
|
||||
return 'Неисправен'
|
||||
_:
|
||||
return "Неизвестно"
|
||||
return 'Неизвестно'
|
||||
|
||||
|
||||
func _has_prd_errors() -> bool:
|
||||
@@ -253,11 +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,
|
||||
"status_uf": status_uf
|
||||
'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 {}
|
||||
|
||||
@@ -276,10 +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,
|
||||
"uf_status": status_uf
|
||||
'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
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
[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://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" uid="uid://b5ykwyk5vpi6" 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"]
|
||||
|
||||
@@ -21,6 +21,8 @@ const RESULT_STRINGS = {
|
||||
|
||||
@export var request_url: String = ''
|
||||
|
||||
signal sending_request() ## Отправка запроса
|
||||
|
||||
|
||||
func get_result_string(result: Result):
|
||||
return RESULT_STRINGS[result] if RESULT_STRINGS.has(result) else '<неизвестный код результата HTTPRequest - %d>' % result
|
||||
@@ -32,3 +34,4 @@ func _on_request_timer():
|
||||
var rc: = request(request_url)
|
||||
if rc != Error.OK:
|
||||
push_error('%s: \"%s\"' % [error_string(rc), request_url])
|
||||
emit_signal('sending_request')
|
||||
|
||||
@@ -163,8 +163,6 @@ func _enter_tree() -> void:
|
||||
vals[2] = get_theme_constant('margin_bottom')
|
||||
vals[3] = get_theme_constant('margin_right')
|
||||
return vals
|
||||
|
||||
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_kqhju"]
|
||||
|
||||
@@ -54,12 +54,12 @@ func _on_settings_changed():
|
||||
var json_col_w = ProjectSettings.get_setting('application/config/%s' % 'Цвет фона схемы', '[0.0, 0.0, 0.0, 0.0]')
|
||||
var arr_col_w = JSON.parse_string(json_col_w)
|
||||
white_color = Color(arr_col_w[0], arr_col_w[1], arr_col_w[2], arr_col_w[3]) if arr_col_w else Color.DIM_GRAY
|
||||
|
||||
|
||||
var black_color = ProjectSettings.get_setting('application/config/%s' % 'Цвет схемы', Color.WHITE_SMOKE)
|
||||
var json_col_b = ProjectSettings.get_setting('application/config/%s' % 'Цвет схемы', '[1.0, 1.0, 1.0, 1.0]')
|
||||
var arr_col_b = JSON.parse_string(json_col_b)
|
||||
black_color = Color(arr_col_b[0], arr_col_b[1], arr_col_b[2], arr_col_b[3]) if arr_col_b else Color.WHITE_SMOKE
|
||||
|
||||
|
||||
$pic_functional.material.set('shader_parameter/white', white_color)
|
||||
$pic_functional.material.set('shader_parameter/black', black_color)
|
||||
|
||||
@@ -108,3 +108,16 @@ func _on_settings_changed():
|
||||
show_functional = v
|
||||
if is_inside_tree():
|
||||
$pic_functional.visible = v
|
||||
|
||||
|
||||
@export var timeout_tween: float:
|
||||
# Создаем твин для анимации с плавным началом и концом
|
||||
set(v):
|
||||
$control_progress.value = 0.0
|
||||
var local_tween = create_tween()
|
||||
local_tween.tween_property($control_progress, "value", v, v)\
|
||||
.set_trans(Tween.TRANS_SINE)\
|
||||
.set_ease(Tween.EASE_IN_OUT)
|
||||
|
||||
local_tween.tween_callback(func():
|
||||
$control_progress.visible = false)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://c3cyog3gy24ft" path="res://data/У-ЭП.png" id="16_gjf0t"]
|
||||
[ext_resource type="Script" uid="uid://xjs7owe2iexn" path="res://scenes/контроль/control_prd.gd" id="18_lbx5w"]
|
||||
[ext_resource type="Texture2D" uid="uid://b2vf7en1jj8dv" path="res://data/У-РЭП-РПД-В.png" id="20_l5wui"]
|
||||
[ext_resource type="Script" path="res://scenes/контроль/panel_container.gd" id="21_l5wui"]
|
||||
[ext_resource type="Script" uid="uid://j16hg3u2uvu5" path="res://scenes/контроль/panel_container.gd" id="21_l5wui"]
|
||||
[ext_resource type="Texture2D" uid="uid://cllxcfa130vqu" path="res://data/УА-РЭП.png" id="22_1s34a"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_iqgf5"]
|
||||
@@ -110,6 +110,7 @@ func _ready():
|
||||
uf_control = UFControl.new('уарэп-эмс')
|
||||
signaller.connect('update_uf_serviceability', Callable(self, 'on_update_uf_serviceability').bind(pribor_node))
|
||||
|
||||
|
||||
# Пиктограммы приборов, которые отображают состояние подключения только
|
||||
for pribor_node in get_tree().get_nodes_in_group('pribor_pics'):
|
||||
var unit_name = pribor_node.get_meta('unit_name')
|
||||
@@ -166,14 +167,24 @@ func on_pribor_press(pribor_path, header_text, pribor_node):
|
||||
pribor.add_to_group('pribor_items')
|
||||
add_child(pribor)
|
||||
update_pribor_items_visibility()
|
||||
if pribor_node.get_meta('unit_name')[0] == 'уарэп-афсп-левый' or pribor_node.get_meta('unit_name')[0] == 'уарэп-афсп-правый':
|
||||
var req = pribor.request_url
|
||||
req.connect('sending_request', Callable(self, 'on_sending_request').bind(pribor_node, pribor.time_req.wait_time))
|
||||
|
||||
|
||||
# Вызов при отправке запроса на селфтест АФСП
|
||||
func on_sending_request(node: Node, time_req: float) -> void:
|
||||
node.progress_max_value = time_req
|
||||
node.progress_visible = true
|
||||
node.timeout_tween = time_req
|
||||
|
||||
|
||||
## Прием сигналов о текущем состояниях приборах
|
||||
func on_serviceability_changed(state: int, prd_pribor_node: Node)-> void:
|
||||
func on_serviceability_changed(state: int, prd_pribor_node: Node) -> void:
|
||||
prd_pribor_node.state = state
|
||||
|
||||
|
||||
func on_update_uf_serviceability(uf_serviceaability: int, uf_pribor: Node)-> void:
|
||||
func on_update_uf_serviceability(uf_serviceaability: int, uf_pribor: Node) -> void:
|
||||
uf_pribor.state = uf_serviceaability
|
||||
|
||||
|
||||
@@ -558,6 +569,7 @@ stretch_mode = 4
|
||||
flip_h = true
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(100, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/online_proc = "on_line_changed"
|
||||
metadata/unit_name = ["уарэп-яу07-1н"]
|
||||
|
||||
@@ -643,18 +655,20 @@ frame_progress = 0.72355
|
||||
[node name="pribor_uf" type="TextureButton" parent="." groups=["pribor_buttons"]]
|
||||
editor_description = "Кнопка для выбора прибора."
|
||||
layout_mode = 0
|
||||
offset_left = 1183.0
|
||||
offset_top = 558.0
|
||||
offset_right = 1294.0
|
||||
offset_left = 1188.0
|
||||
offset_top = 581.0
|
||||
offset_right = 1285.0
|
||||
offset_bottom = 743.0
|
||||
size_flags_horizontal = 15
|
||||
size_flags_vertical = 15
|
||||
toggle_mode = true
|
||||
action_mode = 0
|
||||
texture_normal = ExtResource("2_0nvm1")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 0
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-эмс"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -753,6 +767,7 @@ texture_normal = ExtResource("3_hhadv")
|
||||
stretch_mode = 0
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = [&"уарэп-бпо-1", &"уарэп-бпо-2"]
|
||||
metadata/online_proc = "online_change_arr"
|
||||
|
||||
@@ -781,16 +796,6 @@ patch_margin_top = 16
|
||||
patch_margin_right = 16
|
||||
patch_margin_bottom = 16
|
||||
|
||||
[node name="label2" type="Label" parent="pribor_rtr"]
|
||||
layout_mode = 0
|
||||
offset_left = 11.0
|
||||
offset_top = -49.0
|
||||
offset_right = 94.0
|
||||
offset_bottom = -30.0
|
||||
text = "РТР"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="pic_functional" type="TextureRect" parent="pribor_rtr"]
|
||||
visible = false
|
||||
z_index = 1
|
||||
@@ -827,8 +832,8 @@ editor_description = "Кнопка для выбора прибора."
|
||||
layout_mode = 0
|
||||
offset_left = 1053.0
|
||||
offset_top = 425.0
|
||||
offset_right = 1886.0
|
||||
offset_bottom = 1065.0
|
||||
offset_right = 1853.0
|
||||
offset_bottom = 1025.0
|
||||
scale = Vector2(0.2, 0.2)
|
||||
pivot_offset = Vector2(-10, -65)
|
||||
size_flags_horizontal = 15
|
||||
@@ -836,9 +841,11 @@ size_flags_vertical = 15
|
||||
toggle_mode = true
|
||||
action_mode = 0
|
||||
texture_normal = ExtResource("9_iqgf5")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 0
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = [&"уарэп-афсп-левый"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -857,9 +864,9 @@ vertical_alignment = 1
|
||||
visible = false
|
||||
self_modulate = Color(0.890196, 0.486275, 0.196078, 1)
|
||||
layout_mode = 0
|
||||
offset_left = -60.0
|
||||
offset_top = -165.0
|
||||
offset_right = 130.0
|
||||
offset_left = -55.0
|
||||
offset_top = -170.0
|
||||
offset_right = 125.0
|
||||
offset_bottom = 10.0
|
||||
scale = Vector2(5, 5)
|
||||
texture = ExtResource("4_rasbe")
|
||||
@@ -869,17 +876,6 @@ patch_margin_top = 16
|
||||
patch_margin_right = 16
|
||||
patch_margin_bottom = 16
|
||||
|
||||
[node name="label2" type="Label" parent="pribor_afsp_1"]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = -245.0
|
||||
offset_right = 272.0
|
||||
offset_bottom = -225.0
|
||||
scale = Vector2(5, 5)
|
||||
text = "АФСП 1"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="pic_functional" type="TextureRect" parent="pribor_afsp_1"]
|
||||
visible = false
|
||||
z_index = 1
|
||||
@@ -911,13 +907,36 @@ scale = Vector2(3, 2.981)
|
||||
sprite_frames = SubResource("SpriteFrames_foasq")
|
||||
frame_progress = 0.72355
|
||||
|
||||
[node name="control_progress" type="TextureProgressBar" parent="pribor_afsp_1"]
|
||||
visible = false
|
||||
offset_left = 15.0
|
||||
offset_top = 735.0
|
||||
offset_right = 815.0
|
||||
offset_bottom = 775.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
tooltip_text = "
|
||||
Текущее: 0.00"
|
||||
mouse_filter = 0
|
||||
max_value = 30.0
|
||||
value = 8.0
|
||||
nine_patch_stretch = true
|
||||
stretch_margin_left = 5
|
||||
stretch_margin_top = 5
|
||||
stretch_margin_right = 5
|
||||
stretch_margin_bottom = 5
|
||||
texture_under = ExtResource("9_w6m6a")
|
||||
texture_progress = ExtResource("10_lbx5w")
|
||||
tint_under = Color(1, 1, 1, 0.419608)
|
||||
tint_progress = Color(0.890196, 0.486275, 0.196078, 1)
|
||||
|
||||
[node name="pribor_afsp_2" type="TextureButton" parent="." groups=["pribor_buttons"]]
|
||||
editor_description = "Кнопка для выбора прибора."
|
||||
layout_mode = 0
|
||||
offset_left = 1243.0
|
||||
offset_top = 425.0
|
||||
offset_right = 2076.0
|
||||
offset_bottom = 1065.0
|
||||
offset_right = 2043.0
|
||||
offset_bottom = 1025.0
|
||||
scale = Vector2(0.2, 0.2)
|
||||
pivot_offset = Vector2(-10, -65)
|
||||
size_flags_horizontal = 15
|
||||
@@ -925,10 +944,12 @@ size_flags_vertical = 15
|
||||
toggle_mode = true
|
||||
action_mode = 0
|
||||
texture_normal = ExtResource("9_iqgf5")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 0
|
||||
flip_h = true
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = [&"уарэп-афсп-правый"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -948,8 +969,8 @@ visible = false
|
||||
self_modulate = Color(0.890196, 0.486275, 0.196078, 1)
|
||||
layout_mode = 0
|
||||
offset_left = -50.0
|
||||
offset_top = -165.0
|
||||
offset_right = 140.0
|
||||
offset_top = -170.0
|
||||
offset_right = 130.0
|
||||
offset_bottom = 10.0
|
||||
scale = Vector2(5, 5)
|
||||
texture = ExtResource("4_rasbe")
|
||||
@@ -959,17 +980,6 @@ patch_margin_top = 16
|
||||
patch_margin_right = 16
|
||||
patch_margin_bottom = 16
|
||||
|
||||
[node name="label2" type="Label" parent="pribor_afsp_2"]
|
||||
layout_mode = 0
|
||||
offset_left = 175.0
|
||||
offset_top = -240.0
|
||||
offset_right = 272.0
|
||||
offset_bottom = -220.0
|
||||
scale = Vector2(5, 5)
|
||||
text = "АФСП 2"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="pic_functional" type="TextureRect" parent="pribor_afsp_2"]
|
||||
visible = false
|
||||
z_index = 1
|
||||
@@ -1001,21 +1011,46 @@ scale = Vector2(3, 2.981)
|
||||
sprite_frames = SubResource("SpriteFrames_foasq")
|
||||
frame_progress = 0.72355
|
||||
|
||||
[node name="control_progress" type="TextureProgressBar" parent="pribor_afsp_2"]
|
||||
visible = false
|
||||
offset_left = 20.0
|
||||
offset_top = 735.0
|
||||
offset_right = 825.0
|
||||
offset_bottom = 775.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
tooltip_text = "
|
||||
Текущее: 0.00"
|
||||
mouse_filter = 0
|
||||
max_value = 30.0
|
||||
value = 8.0
|
||||
nine_patch_stretch = true
|
||||
stretch_margin_left = 5
|
||||
stretch_margin_top = 5
|
||||
stretch_margin_right = 5
|
||||
stretch_margin_bottom = 5
|
||||
texture_under = ExtResource("9_w6m6a")
|
||||
texture_progress = ExtResource("10_lbx5w")
|
||||
tint_under = Color(1, 1, 1, 0.419608)
|
||||
tint_progress = Color(0.890196, 0.486275, 0.196078, 1)
|
||||
|
||||
[node name="pribor_uyep" type="TextureButton" parent="." groups=["pribor_buttons"]]
|
||||
editor_description = "Кнопка для выбора прибора."
|
||||
layout_mode = 0
|
||||
offset_left = 1313.0
|
||||
offset_top = 558.0
|
||||
offset_right = 1407.0
|
||||
offset_top = 584.0
|
||||
offset_right = 1394.0
|
||||
offset_bottom = 744.0
|
||||
size_flags_horizontal = 15
|
||||
size_flags_vertical = 15
|
||||
toggle_mode = true
|
||||
action_mode = 0
|
||||
texture_normal = ExtResource("5_kvnex")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 0
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-щ3", "уарэп-спт25-1", "уарэп-спт25-2"]
|
||||
metadata/online_proc = "online_change_arr"
|
||||
|
||||
@@ -1091,6 +1126,7 @@ stretch_mode = 4
|
||||
flip_h = true
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-2в"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -1189,6 +1225,7 @@ stretch_mode = 4
|
||||
flip_h = true
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-2н"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -1289,6 +1326,7 @@ stretch_mode = 4
|
||||
flip_h = true
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-2к"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -1387,6 +1425,7 @@ stretch_mode = 4
|
||||
flip_h = true
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-3в"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -1485,6 +1524,7 @@ stretch_mode = 4
|
||||
flip_h = true
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-3н"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -1583,6 +1623,7 @@ stretch_mode = 4
|
||||
flip_h = true
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 1, 0, 1), Color(1, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-3к"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -1681,6 +1722,7 @@ stretch_mode = 4
|
||||
flip_h = true
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(100, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-1в"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -1778,6 +1820,7 @@ stretch_mode = 4
|
||||
flip_h = true
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(100, 0, 0, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-1к"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -1875,6 +1918,7 @@ texture_normal = ExtResource("6_i1yfn")
|
||||
stretch_mode = 4
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-4в"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -1972,6 +2016,7 @@ texture_normal = ExtResource("6_i1yfn")
|
||||
stretch_mode = 4
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-4н"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
@@ -2069,6 +2114,7 @@ texture_normal = ExtResource("6_i1yfn")
|
||||
stretch_mode = 4
|
||||
script = ExtResource("3_4pt7j")
|
||||
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
|
||||
timeout_tween = null
|
||||
metadata/unit_name = ["уарэп-яу07-4к"]
|
||||
metadata/online_proc = "on_line_changed"
|
||||
|
||||
|
||||
@@ -389,8 +389,8 @@ texture_normal = ExtResource("14_ggrwd")
|
||||
[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"]
|
||||
[connection signal="toggled" from="btn_center" to="." method="on_btn_center_toggled"]
|
||||
[connection signal="button_down" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_down"]
|
||||
[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_button_up"]
|
||||
[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_up"]
|
||||
[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_button_up"]
|
||||
[connection signal="button_down" from="zoom_minus" to="tilemap" method="_on_zoom_minus_button_down"]
|
||||
[connection signal="button_up" from="zoom_minus" to="tilemap" method="_on_zoom_button_up"]
|
||||
[connection signal="pressed" from="btn_all_work" to="." method="_on_btn_all_work_pressed"]
|
||||
|
||||
@@ -1140,7 +1140,7 @@ static func _create_fs_mapping(s_name: String) -> Dictionary:
|
||||
|
||||
## Получение статуса ФС
|
||||
static func on_fs_state(packet_type_7: Dictionary, fs_mapping: Dictionary, fs_results: Dictionary, fs_rules_config: Array) -> Dictionary:
|
||||
var updated_results := fs_results
|
||||
var updated_results := fs_results.duplicate()
|
||||
for fs_num in packet_type_7:
|
||||
if not (fs_num in fs_mapping and fs_mapping[fs_num]['condition']):
|
||||
continue
|
||||
@@ -1209,19 +1209,19 @@ static func power_um_ukp(status: PackedByteArray, litera: int, pwr_result: Array
|
||||
static func update_max_power_values(power_data: Array, max_power_values: Array) -> Array:
|
||||
if power_data.size() != 6:
|
||||
if max_power_values.is_empty():
|
||||
max_power_values = power_data
|
||||
max_power_values = power_data.duplicate()
|
||||
elif power_data[0] > max_power_values[0]:
|
||||
max_power_values = power_data
|
||||
max_power_values = power_data.duplicate()
|
||||
return max_power_values
|
||||
|
||||
if max_power_values.is_empty():
|
||||
max_power_values = power_data
|
||||
max_power_values = power_data.duplicate()
|
||||
else:
|
||||
for i in 6:
|
||||
if power_data[i] > max_power_values[i]:
|
||||
max_power_values[i] = power_data[i]
|
||||
|
||||
return max_power_values
|
||||
return max_power_values.duplicate()
|
||||
|
||||
|
||||
## Подготовка принятых данных по контролю для передачи в сцену
|
||||
@@ -1288,7 +1288,7 @@ static func check_dou_result(control_dic: Dictionary, power_dic: Dictionary, pri
|
||||
|
||||
var ray_dic: Dictionary = power_dic[litera]
|
||||
# Проверка наличия данных
|
||||
if ray_dic[RAY_m5].size() == 0 or \
|
||||
if ray_dic[RAY_m5].size() == 0 or \
|
||||
ray_dic[RAY_5 ].size() == 0 or \
|
||||
ray_dic[RAY_15].size() == 0 or \
|
||||
ray_dic[RAY_25].size() == 0 or \
|
||||
@@ -1301,7 +1301,7 @@ static func check_dou_result(control_dic: Dictionary, power_dic: Dictionary, pri
|
||||
var low_power_by_position: Array = [0, 0, 0, 0, 0, 0] # Счетчики для 6 позиций
|
||||
for ray_key in [RAY_m5, RAY_5, RAY_15, RAY_25, RAY_35, RAY_45]:
|
||||
var power_array: Array = ray_dic[ray_key]
|
||||
for i in range(power_array.size()):
|
||||
for i in power_array.size():
|
||||
if power_array[i] < cnst.POWER_THRESHOLD:
|
||||
low_power_by_position[i] += 1
|
||||
|
||||
@@ -1322,7 +1322,7 @@ func _deep_copy_power_structure() -> Dictionary:
|
||||
for litera in power_for_litera:
|
||||
copy[litera] = {}
|
||||
for ray_type in power_for_litera[litera]:
|
||||
copy[litera][ray_type] = power_for_litera[litera][ray_type]
|
||||
copy[litera][ray_type] = power_for_litera[litera][ray_type].duplicate()
|
||||
return copy
|
||||
|
||||
## Восстановление состояний по умолчанию
|
||||
@@ -1358,6 +1358,7 @@ func restore_default_states() -> void:
|
||||
|
||||
_set_status('Состояния сброшены к значениям по умолчанию')
|
||||
|
||||
|
||||
## Получение текущих состояний для отладки
|
||||
func get_current_states() -> Dictionary:
|
||||
return {
|
||||
|
||||
@@ -152,7 +152,7 @@ func on_data_capsrpb_received(unit: capsrpb.CapsRpb, threats: Dictionary):
|
||||
if not unit.json_dic.has('sa'): return
|
||||
|
||||
var mis = unit.json_dic['mis']
|
||||
bpo_mode_rx = int(unit.json_dic['sa'])
|
||||
bpo_mode_rx = int(unit.json_dic['sa']) as AFSP_BPO_MODE
|
||||
var sz: = threats.size()
|
||||
for dic_th in mis:
|
||||
if dic_th is not Dictionary:
|
||||
|
||||
Reference in New Issue
Block a user