Доработка. Кнопка показа схемы и снятие выбора прибора

This commit is contained in:
kira-a-k
2025-11-24 20:01:44 +03:00
parent d51c16b98e
commit de876c9a76
41 changed files with 2184 additions and 2771 deletions

View File

@@ -36,4 +36,4 @@
- После клонирования запустить скрипт `git-hooks-config.sh` - После клонирования запустить скрипт `git-hooks-config.sh`
- В среде **Windows** запуск скрипта `git-hooks-config.sh` производить из оболочки `git bash` - В среде **Windows** запуск скрипта `git-hooks-config.sh` производить из оболочки `git bash`
- Нужно обновить `settings.json` - Нужно обновить `settings.json`
- поиск циклических зависимостей - поиск циклических зависимостей (не реализованно)

View File

@@ -35,8 +35,10 @@ func get_radius_outter() -> float: return material.get('shader_parameter/radius
func get_radius_inner_0() -> float: return material.get('shader_parameter/radius_inner_0') func get_radius_inner_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_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_colors(val: Array): material.set('shader_parameter/ant_band_c', val)
func set_band_failures(val: Array): material.set('shader_parameter/ant_band_m', val)
## Добавляет сектор запрета[br] ## Добавляет сектор запрета[br]
## [param id] - Индекс сектора запрета.[br] ## [param id] - Индекс сектора запрета.[br]

View File

@@ -65,7 +65,7 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
strips_rotation = 15.0 strips_rotation = 15.0
text = "JTIDS" text = "СПРС"
metadata/rfi_name = "sprs" metadata/rfi_name = "sprs"
[node name="btn_kupd" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")] [node name="btn_kupd" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]

View File

@@ -8,7 +8,7 @@ const TableHeader = preload('res://table/header.tscn') ## Ячейка за
const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader , TableHeader ] ## Описание ряда заголовка. const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader , TableHeader ] ## Описание ряда заголовка.
const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit , CellLineEdit ] ## Описание ряда. const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit , CellLineEdit ] ## Описание ряда.
const TABLE_HEADERS_TEXT = ['', 'Название', 'Пеленг', 'Состояние' ] ## Заголовки таблицы. const TABLE_HEADERS_TEXT = ['', 'Название', 'Пеленг', 'Состояние' ] ## Заголовки таблицы.
const TABLE_COLUMN_SIZE = [ 65, 100, 90, 195 ] ## Ширины колонок. const TABLE_COLUMN_SIZE = [ 65, 100, 90, 170 ] ## Ширины колонок.
## Состояние выполнения сеанса помехи ## Состояние выполнения сеанса помехи
const INTERFER_STATE = { const INTERFER_STATE = {

View File

@@ -147,6 +147,6 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
strips_rotation = 30.0 strips_rotation = 30.0
text = "ЕРЛС" text = "ЕПРЛС"
disabled = true disabled = true
metadata/rfi_name = "eprls" metadata/rfi_name = "eprls"

View File

@@ -30,9 +30,7 @@ autostart = true
[node name="bort" parent="." instance=ExtResource("3_d7iti")] [node name="bort" parent="." instance=ExtResource("3_d7iti")]
layout_mode = 0 layout_mode = 0
offset_left = 24.0
offset_top = 27.7778 offset_top = 27.7778
offset_right = 604.0
offset_bottom = 1216.78 offset_bottom = 1216.78
metadata/DeviceName = &"Устройство РР левого борта" metadata/DeviceName = &"Устройство РР левого борта"

View File

@@ -7,9 +7,9 @@
[node name="pribor_afsp" type="Control"] [node name="pribor_afsp" type="Control"]
layout_mode = 3 layout_mode = 3
anchors_preset = 0 anchors_preset = 0
offset_left = 82.0 offset_left = 81.0
offset_top = 108.0 offset_top = 108.0
offset_right = 82.0 offset_right = 81.0
offset_bottom = 108.0 offset_bottom = 108.0
scale = Vector2(1, 0.9) scale = Vector2(1, 0.9)
script = ExtResource("1_tfses") script = ExtResource("1_tfses")
@@ -30,9 +30,9 @@ autostart = true
[node name="bort" parent="." instance=ExtResource("3_xpxb5")] [node name="bort" parent="." instance=ExtResource("3_xpxb5")]
layout_mode = 0 layout_mode = 0
offset_left = 12.0 offset_left = -11.0
offset_top = -59.0 offset_top = -59.0
offset_right = 592.0 offset_right = 569.0
offset_bottom = 1130.0 offset_bottom = 1130.0
metadata/DeviceName = &"Устройство РР правого борта" metadata/DeviceName = &"Устройство РР правого борта"

View File

@@ -99,4 +99,4 @@ func _on_request_completed(result, _response_code, headers, body: PackedByteArra
func _on_item_pressed(block_a: Control): func _on_item_pressed(block_a: Control):
var metas = block_a.get_meta_list() var metas = block_a.get_meta_list()
for n in metas: for n in metas:
var _v = block_a.get_meta(n) var v = block_a.get_meta(n)

View File

@@ -9,9 +9,9 @@
layout_mode = 3 layout_mode = 3
anchors_preset = 0 anchors_preset = 0
offset_left = 115.0 offset_left = 115.0
offset_top = 148.0 offset_top = 150.0
offset_right = 115.0 offset_right = 115.0
offset_bottom = 148.0 offset_bottom = 150.0
script = ExtResource("1_bhc4e") script = ExtResource("1_bhc4e")
prefix_path = "DeviceDescription[DeviceName]" prefix_path = "DeviceDescription[DeviceName]"
this_bpo1_name = "Устройство БПО левого борта" this_bpo1_name = "Устройство БПО левого борта"
@@ -24,10 +24,10 @@ settings_path_to_wait_time = "Период опроса состояния БП
[node name="mod_pit_g1" parent="." instance=ExtResource("2_jp6m0")] [node name="mod_pit_g1" parent="." instance=ExtResource("2_jp6m0")]
layout_mode = 2 layout_mode = 2
offset_left = 9.0 offset_left = 40.0
offset_top = 377.0 offset_top = 535.0
offset_right = 529.0 offset_right = 560.0
offset_bottom = 447.0 offset_bottom = 605.0
size_flags_horizontal = 7 size_flags_horizontal = 7
size_flags_vertical = 7 size_flags_vertical = 7
fname = "Модуль электропитания" fname = "Модуль электропитания"
@@ -35,20 +35,20 @@ rname = "G1"
[node name="blok_bpo_a1" parent="." instance=ExtResource("2_jp6m0")] [node name="blok_bpo_a1" parent="." instance=ExtResource("2_jp6m0")]
layout_mode = 0 layout_mode = 0
offset_left = 9.0 offset_left = 40.0
offset_top = -23.0 offset_top = 135.0
offset_right = 529.0 offset_right = 560.0
offset_bottom = 172.0 offset_bottom = 330.0
show_state = false show_state = false
fname = "Блок БПО левого борта" fname = "Блок БПО левого борта"
rname = "А1" rname = "А1"
[node name="grid_bpo_a1" type="GridContainer" parent="."] [node name="grid_bpo_a1" type="GridContainer" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 19.0 offset_left = 50.0
offset_top = 17.0 offset_top = 175.0
offset_right = 467.0 offset_right = 498.0
offset_bottom = 162.0 offset_bottom = 320.0
columns = 4 columns = 4
[node name="kanal1" parent="grid_bpo_a1" groups=["потребитель-питания"] instance=ExtResource("2_jp6m0")] [node name="kanal1" parent="grid_bpo_a1" groups=["потребитель-питания"] instance=ExtResource("2_jp6m0")]
@@ -108,30 +108,30 @@ fname = "Канал 8"
metadata/state = "SelfTest[0].SystemList[0].DevList[7]['TestPassed']" metadata/state = "SelfTest[0].SystemList[0].DevList[7]['TestPassed']"
[node name="yas_bpo_a1" parent="." groups=["потребитель-питания"] instance=ExtResource("3_jcpjs")] [node name="yas_bpo_a1" parent="." groups=["потребитель-питания"] instance=ExtResource("3_jcpjs")]
offset_left = 469.0 offset_left = 500.0
offset_top = 17.0 offset_top = 175.0
offset_right = 519.0 offset_right = 550.0
offset_bottom = 162.0 offset_bottom = 320.0
show_rname = false show_rname = false
self_size = Vector2i(50, 145) self_size = Vector2i(50, 145)
fname = "Яч. связи" fname = "Яч. связи"
[node name="blok_bpo_a2" parent="." instance=ExtResource("2_jp6m0")] [node name="blok_bpo_a2" parent="." instance=ExtResource("2_jp6m0")]
layout_mode = 0 layout_mode = 0
offset_left = 9.0 offset_left = 40.0
offset_top = 177.0 offset_top = 335.0
offset_right = 529.0 offset_right = 560.0
offset_bottom = 372.0 offset_bottom = 530.0
show_state = false show_state = false
fname = "Блок БПО правого борта" fname = "Блок БПО правого борта"
rname = "А2" rname = "А2"
[node name="grid_bpo_a2" type="GridContainer" parent="."] [node name="grid_bpo_a2" type="GridContainer" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 19.0 offset_left = 50.0
offset_top = 217.0 offset_top = 375.0
offset_right = 467.0 offset_right = 498.0
offset_bottom = 362.0 offset_bottom = 520.0
columns = 4 columns = 4
[node name="kanal1" parent="grid_bpo_a2" groups=["потребитель-питания", "управляется-по-шине-2"] instance=ExtResource("2_jp6m0")] [node name="kanal1" parent="grid_bpo_a2" groups=["потребитель-питания", "управляется-по-шине-2"] instance=ExtResource("2_jp6m0")]
@@ -191,10 +191,10 @@ fname = "Канал 8"
metadata/state = "SelfTest[0].SystemList[0].DevList[7]['TestPassed']" metadata/state = "SelfTest[0].SystemList[0].DevList[7]['TestPassed']"
[node name="yas_bpo_a2" parent="." groups=["потребитель-питания"] instance=ExtResource("3_jcpjs")] [node name="yas_bpo_a2" parent="." groups=["потребитель-питания"] instance=ExtResource("3_jcpjs")]
offset_left = 469.0 offset_left = 500.0
offset_top = 217.0 offset_top = 375.0
offset_right = 519.0 offset_right = 550.0
offset_bottom = 362.0 offset_bottom = 520.0
show_rname = false show_rname = false
self_size = Vector2i(50, 145) self_size = Vector2i(50, 145)
fname = "Яч. связи" fname = "Яч. связи"

View File

@@ -49,7 +49,7 @@ offset_top = 33.0
offset_right = 155.0 offset_right = 155.0
offset_bottom = 183.0 offset_bottom = 183.0
fname = "Блок ФС-2" fname = "Блок ФС-2"
rname = "A6" rname = "A2"
[node name="ref_A6" parent="." groups=["default_reset", "fs_group"] instance=ExtResource("3_kqnvt")] [node name="ref_A6" parent="." groups=["default_reset", "fs_group"] instance=ExtResource("3_kqnvt")]
offset_left = 155.0 offset_left = 155.0
@@ -57,7 +57,7 @@ offset_top = 33.0
offset_right = 205.0 offset_right = 205.0
offset_bottom = 183.0 offset_bottom = 183.0
fname = "Модуль ФС" fname = "Модуль ФС"
rname = "A3" rname = "A5"
metadata/fs = "fs_6" metadata/fs = "fs_6"
[node name="ref_A5" parent="." groups=["default_reset", "fs_group"] instance=ExtResource("3_kqnvt")] [node name="ref_A5" parent="." groups=["default_reset", "fs_group"] instance=ExtResource("3_kqnvt")]
@@ -66,7 +66,7 @@ offset_top = 33.0
offset_right = 255.0 offset_right = 255.0
offset_bottom = 183.0 offset_bottom = 183.0
fname = "Модуль ФС" fname = "Модуль ФС"
rname = "A2" rname = "A3"
metadata/fs = "fs_7" metadata/fs = "fs_7"
[node name="ref_A7" parent="." groups=["default_reset"] instance=ExtResource("3_kqnvt")] [node name="ref_A7" parent="." groups=["default_reset"] instance=ExtResource("3_kqnvt")]
@@ -75,4 +75,4 @@ offset_top = 33.0
offset_right = 305.0 offset_right = 305.0
offset_bottom = 183.0 offset_bottom = 183.0
fname = "Блок ФС-6" fname = "Блок ФС-6"
rname = "A5" rname = "A6"

View File

@@ -1,172 +1,252 @@
@tool @tool
extends 'res://scenes/контроль/прибор.gd' extends 'res://scenes/контроль/прибор.gd'
const constants_k: Dictionary = {
'POWER_UKP_1': 31,
'POWER_UKP_2': 63,
'DKM_BIT_1': 0,
'DKM_BIT_6': 5,
'DKM_BIT_7': 6,
'BASE_ADDR_EMS_G': 0x120,
'ADDR_UG_LITERA_1': 0x106,
'ADDR_UG_LITERA_2': 0x108,
'ADDR_UG_LITERA_3': 0x10A,
'TEMP_THRESHOLD': 40,
'POWER_THRESHOLD': 40,
'RAY_DOU_NUM': 0x3,
'ATT_UM_1': 0x0,
'ATT_UM_6': 0x3,
'ATT_UM_7': 0x2,
'POWER_UM': 100,
'TIMER_DELAY': 10.0,
'STATE_MASHINE_TIMER': 0.3,
}
# Конфигурация параметров для каждого прибора
const PRIBOR_CONFIG := {
'': {'angle': 0.0, 'sectors': [0, 20, 24]},
'': {'angle': 90.0, 'sectors': [3, 23, 27]},
'': {'angle': 180.0, 'sectors': [2, 22, 26]},
'': {'angle': 270.0, 'sectors': [1, 21, 25]},
}
# Конфигурация частот и ширин для каждого ФС
const FS_PARAMS := {
1: {'freq': 450.0, 'width': 80.0},
6: {'freq': 2450.0, 'width': 110.0},
7: {'freq': 4750.0, 'width': 110.0}
}
enum STATE_VAL { NONE = 0, GOOD = 1, ERROR = 2 } enum STATE_VAL { NONE = 0, GOOD = 1, ERROR = 2 }
var block_ip_config_k := {
'maa2000_1': [0, false],
'maa2000_2': [1, false],
'ip9_50_1': [2, false],
'ip9_50_2': [3, false],
'ip12_50_1': [4, false],
'ip9_50_3': [5, false],
'ip12_50_2': [6, false],
'ip5_25': [7, false],
}
var block_kasseta_y5_prd_config_k: = {
'yau07': false,
'ems': false,
'ug': false,
'ukp1': false,
'ukp2': false,
}
# Основные переменные # Основные переменные
var start_litera: int = 1
var ug_work_1: int = 3 ## Аттенюация усилителей мощности
var ug_work_2: int = 2 ## Аттенюация усилителей мощности
var ug_work_3: int = 0 ## Аттенюация усилителей мощности
var mashine_timer: Timer = Timer.new()
var prd_k_module: Object
var unit_prd_k: Object var unit_prd_k: Object
var control_prd_k: Object
# Результаты контроля
var control_results_k: Dictionary = {
'block_ip': false, # Проверка касет П1 и ИП МА2000
'temperature': true,
'dkm_1': false,
'dkm_6': false,
'dkm_7': false,
'dou_6': false,
'dou_7': false,
'fs_1': 2,
'fs_6': 2,
'fs_7': 2,
}
var test_control_k = preload('res://scripts/pribor-prd.gd')
var ctrl_pos = 30 var ctrl_pos = 30
func _ready() -> void: func _ready() -> void:
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
var unit_name = get_meta('unit_name')[0]
var prd_k_module = prd.prd_dict[unit_name]
unit_prd_k = prd_k_module.unit_control
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
for temp in power_amplifier:
temp.value1 = -70
# Подписываемся на сигналы
unit_prd_k.connect('control_is_over', Callable(self, 'on_press_device'))
unit_prd_k.connect('status_updated', Callable(self, '_on_status_updated'))
# Устанавливаем начальный статус
_update_status_text(unit_prd_k.get_current_status())
on_press_device()
initialize_connections()
func _process(_delta: float) -> void: setup_timer()
if Engine.is_editor_hint(): set_default_state()
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)
func start_control() -> void:
set_default_state(get_tree().get_nodes_in_group('default_reset'), get_tree().get_nodes_in_group('power_amplifier'))
find_labels(self) find_labels(self)
static func set_default_state(default_reset_array_node: Array, power_amplifier_arr_node: Array) -> void: func on_state_mashine() -> void:
for group in default_reset_array_node: control_prd_k.state_control_machine()
func initialize_connections() -> void:
var unit_name = get_meta('unit_name')[0]
prd_k_module = prd.prd_dict[unit_name]
unit_prd_k = prd_k_module.unit_yau07
unit_prd_k.connect('line_changed', Callable(self, 'on_line_changed'))
var power_amplifiers: Array = get_tree().get_nodes_in_group('power_amplifier')
var init_data: Dictionary = {
'control_label': $control_result,
'power_amplifiers': power_amplifiers,
'unit_prd': unit_prd_k,
'module_prd' : prd_k_module,
'constants': constants_k,
'prd_config': PRIBOR_CONFIG,
'fs_params': FS_PARAMS,
'block_ip_prd_config': block_ip_config_k,
'block_kasseta_y5_prd_config': block_kasseta_y5_prd_config_k,
'control_results': control_results_k,
'current_litera': start_litera,
}
control_prd_k = test_control_k.TestPRD.new(init_data)
add_child(control_prd_k)
control_prd_k.connect('control_is_over', Callable(self, 'on_control_result'))
func setup_timer() -> void:
add_child(mashine_timer)
mashine_timer.connect('timeout', Callable(self, 'on_state_mashine'))
mashine_timer.wait_time = constants_k.STATE_MASHINE_TIMER
mashine_timer.start()
func set_default_state() -> void:
for group in get_tree().get_nodes_in_group('default_reset'):
group.state = STATE_VAL.NONE group.state = STATE_VAL.NONE
for group in power_amplifier_arr_node: for group in get_tree().get_nodes_in_group('power_amplifier'):
group.state = STATE_VAL.NONE group.state = STATE_VAL.NONE
func _enter_tree() -> void: func _enter_tree() -> void:
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
if unit_prd_k: $control_result.text = 'Выполняется ...'
_update_status_text(unit_prd_k.get_current_status()) $control_result.add_theme_color_override('font_color', Color.ALICE_BLUE)
signaller.connect('режим_работа', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_журнал', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_эмс', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_настройки', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_контроль', Callable(self, 'on_mode_changed').bind(true))
func _exit_tree() -> void: func _exit_tree() -> void:
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
#prd_k_module.cmd_array.append([unit_prd_k.CmdCode.WRITE_ISA, [constants_k.ADDR_UG_LITERA_1, ug_work_1, constants_k.ADDR_UG_LITERA_2, ug_work_2, constants_k.ADDR_UG_LITERA_3, ug_work_3]]) prd_k_module.cmd_array.append([unit_prd_k.CmdCode.WRITE_ISA, [constants_k.ADDR_UG_LITERA_1, ug_work_1, constants_k.ADDR_UG_LITERA_2, ug_work_2, constants_k.ADDR_UG_LITERA_3, ug_work_3]])
static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dictionary)->void: func on_line_changed(unit_pribor: Object) -> void:
for i_node_temperature in temperature_arr_node: if not unit_pribor.online:
var temperature_meta: String = i_node_temperature.get_meta('um') set_default_state()
if not temperature_dic.has(temperature_meta): return
i_node_temperature.value1 = temperature_dic[temperature_meta] if temperature_dic[temperature_meta] < 361 else -40
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void: func on_mode_changed(in_tree: bool) -> void:
for i_node_temperature in power_amplifier_arr_node: if not in_tree:
var powamp_meta: String = i_node_temperature.get_meta('um') mashine_timer.stop()
var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE 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]])
if not pow_dic.has(powamp_meta): return signaller.emit_signal('interfer_off_all')
# Проверки fs_result else:
if powamp_meta == 'um_8' and not fs_result.fs_1: return set_default_state()
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_6: return control_prd_k.state = control_prd_k.STATE_MASHINE.INIT
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_7: return mashine_timer.start()
if powamp_meta == 'um_8':
i_node_temperature.value0 = [pow_dic[powamp_meta][5]]
status = STATE_VAL.ERROR if pow_dic[powamp_meta][5] < POWER_THRESHOLD else STATE_VAL.GOOD
else:
i_node_temperature.value0 = pow_dic[powamp_meta]
# Проверки 3 значения = исправен
var count_above_threshold = 0
for i_p in pow_dic[powamp_meta]:
if i_p >= POWER_THRESHOLD:
count_above_threshold += 1
status = STATE_VAL.GOOD if count_above_threshold >= 3 else STATE_VAL.ERROR
i_node_temperature.state = status
func on_press_device() -> void: func power_fill(pow_dic: Dictionary, fs_result: Dictionary) -> void:
var nodes_y5: Array = get_tree().get_nodes_in_group('y-5') #if not control_prd_k.block_kasseta_y5_config.yau07 or not control_prd_k.block_kasseta_y5_config.ukp1 or not control_prd_k.block_kasseta_y5_config.ukp2:
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply') #return
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 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') for i_powapm in power_amplifier:
var module_fs_1: Node = $kasseta_fs_kd/ref_A2 var powamp_meta: String = i_powapm.get_meta('um')
var module_fs_6: Node = $kasseta_fs_kd/ref_A4 var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE
var dou_6: Node = $dou6_A7 if pow_dic:
var module_fs_7: Node = $kasseta_fs_kd/ref_A7 if not pow_dic.has(powamp_meta):
var dou_7: Node = $dou7_A8 break
var control_data: Dictionary = unit_prd_k.get_control_results() if pow_dic[powamp_meta].size() < 6:
var for_control_result: Dictionary = { status = STATE_VAL.ERROR
'nodes_y5': nodes_y5, else:
'node_ip_power_arr': node_ip_power_arr, if powamp_meta == 'um_7' and not fs_result.fs_1: return
'fs_nodes': fs_nodes, if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_6: return
'power_amplifier': power_amplifier, if powamp_meta in ['um_8', 'um_9', 'um_10', 'um_11', 'um_12', 'um_13'] and not fs_result.fs_7: return
'default_reset_array_node': default_reset_array_node, i_powapm.value0 = pow_dic[powamp_meta]
'module_fs_1': module_fs_1, for i_p in pow_dic[powamp_meta]:
'module_fs_6': module_fs_6, if i_p < constants_k.POWER_THRESHOLD:
'dou_6': dou_6, status = STATE_VAL.ERROR
'module_fs_7': module_fs_7, i_powapm.state = status
'dou_7': dou_7,
}
for_control_result.merge(control_data, true)
on_control_result(for_control_result)
static func on_control_result(for_result_dic: Dictionary) -> void: func on_control_result(result_dic: Dictionary, power_dic: Dictionary) -> void:
temperature_fill(for_result_dic.power_amplifier, for_result_dic.temperature_um) mashine_timer.stop()
block_kasseta_y5_prd_config_k = control_prd_k.block_kasseta_y5_config
var block_kasseta_y5_prd_config_k: Dictionary = for_result_dic.block_kasseta_y5_config var nodes_y5: Array = get_tree().get_nodes_in_group('y-5')
var nodes_y5: Array = for_result_dic.nodes_y5
for node_y5 in nodes_y5: for node_y5 in nodes_y5:
var meta_y5 = node_y5.get_meta('y5') var meta_y5 = node_y5.get_meta('y5')
if block_kasseta_y5_prd_config_k.has(meta_y5): if block_kasseta_y5_prd_config_k.has(meta_y5):
if not block_kasseta_y5_prd_config_k['yau07']: if block_kasseta_y5_prd_config_k['yau07'] == false:
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
else: break
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_k[meta_y5] else STATE_VAL.ERROR node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_k[meta_y5] else STATE_VAL.ERROR
var block_ip_config_k: Dictionary = for_result_dic.block_ip_config block_ip_config_k = control_prd_k.block_ip_config
for power_supply in for_result_dic.node_ip_power_arr: var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
for power_supply in node_ip_power_arr:
var meta_ip = power_supply.get_meta('ip') var meta_ip = power_supply.get_meta('ip')
if block_ip_config_k.has(meta_ip) and block_kasseta_y5_prd_config_k.ug and block_kasseta_y5_prd_config_k.yau07: if block_ip_config_k.has(meta_ip) and block_kasseta_y5_prd_config_k.ug:
power_supply.state = STATE_VAL.GOOD if block_ip_config_k[meta_ip][1] else STATE_VAL.ERROR power_supply.state = STATE_VAL.GOOD if block_ip_config_k[meta_ip][1] else STATE_VAL.ERROR
else:
power_supply.state = STATE_VAL.NONE
if not for_result_dic.control_is_over: var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
set_default_state(for_result_dic.default_reset_array_node, for_result_dic.power_amplifier) for f in fs_nodes:
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') var fs_meta: String = f.get_meta('fs')
if result_dic.has(fs_meta): if result_dic.has(fs_meta):
f.state = result_dic[fs_meta] var new_state = result_dic[fs_meta]
f.state = new_state
result_dic[fs_meta] = new_state
if result_dic.fs_1 == 1 and block_kasseta_y5_prd_config_k['yau07']: if result_dic.fs_1 == 1:
for_result_dic.module_fs_1.state = STATE_VAL.GOOD if result_dic.dkm_1 else STATE_VAL.ERROR $kasseta_fs_kd/ref_A2.state = STATE_VAL.GOOD if result_dic.dkm_1 else STATE_VAL.ERROR
else:
result_dic.fs_1 = false
if result_dic.fs_6 == 1:
$kasseta_fs_kd/ref_A4.state = STATE_VAL.GOOD if result_dic.dkm_6 else STATE_VAL.ERROR
$dou6_A7.state = STATE_VAL.GOOD if result_dic.dou_6 else STATE_VAL.ERROR
else:
result_dic.fs_6 = false
if result_dic.fs_7 == 1:
$kasseta_fs_kd/ref_A7.state = STATE_VAL.GOOD if result_dic.dkm_7 else STATE_VAL.ERROR
$dou7_A8.state = STATE_VAL.GOOD if result_dic.dou_7 else STATE_VAL.ERROR
else:
result_dic.fs_7 = false
if result_dic.fs_6 == 1 and block_kasseta_y5_prd_config_k['yau07']: power_fill(power_dic, result_dic)
for_result_dic.module_fs_6.state = STATE_VAL.GOOD if result_dic.dkm_6 else STATE_VAL.ERROR
for_result_dic.dou_6.state = STATE_VAL.GOOD if result_dic.dou_6 else STATE_VAL.ERROR
if result_dic.fs_7 == 1 and block_kasseta_y5_prd_config_k['yau07']: var result = true
for_result_dic.module_fs_7.state = STATE_VAL.GOOD if result_dic.dkm_7 else STATE_VAL.ERROR for device in result_dic.values():
for_result_dic.dou_7.state = STATE_VAL.GOOD if result_dic.dou_7 else STATE_VAL.ERROR if not device:
result = false
if block_kasseta_y5_prd_config_k['yau07']:
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD) var name_prd = control_prd_k.self_name
if result:
$control_result.text = 'Прибор ПРД-%s исправен' % name_prd
$control_result.add_theme_color_override('font_color', Color.GREEN)
else:
$control_result.text = 'Прибор ПРД-%s неисправен' % name_prd
$control_result.add_theme_color_override('font_color', Color.RED)
func find_labels(node1: Node): func find_labels(node1: Node):
@@ -183,22 +263,3 @@ func find_labels(node1: Node):
node1.set_meta("tooltip_set", true) node1.set_meta("tooltip_set", true)
for child in node1.get_children(): for child in node1.get_children():
find_labels(child) find_labels(child)
func _on_status_updated(status_text: String) -> void:
_update_status_text(status_text)
func _update_status_text(text: String) -> void:
$control_result.text = text
# Можно добавить смену цвета в зависимости от статуса
if "Ошибка" in text or "неисправен" in text:
$control_result.add_theme_color_override('font_color', Color.RED)
log.message(Logger.INFO, 'Прибор ПРД-%s неисправен' % [unit_prd_k.self_name])
elif "Ограничена" in text or "Предупреждение" in text:
$control_result.add_theme_color_override('font_color', Color.YELLOW)
elif "исправен" in text or "завершён" in text:
$control_result.add_theme_color_override('font_color', Color.GREEN)
log.message(Logger.INFO, 'Прибор ПРД-%s исправен' % [unit_prd_k.self_name])
else:
$control_result.add_theme_color_override('font_color', Color.WHITE)

View File

@@ -1,39 +1,14 @@
[gd_scene load_steps=16 format=3 uid="uid://m5s87q7m66lj"] [gd_scene load_steps=10 format=3 uid="uid://m5s87q7m66lj"]
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="1_8dmgr"] [ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="1_8dmgr"]
[ext_resource type="Script" uid="uid://cwvikiygf8b1m" path="res://scenes/pribor-prd-k/pribor-prd-k.gd" id="1_tpdyp"] [ext_resource type="Script" uid="uid://cwvikiygf8b1m" path="res://scenes/pribor-prd-k/pribor-prd-k.gd" id="1_tpdyp"]
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="2_14h25"] [ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="2_14h25"]
[ext_resource type="PackedScene" uid="uid://cm5jd4gjrrpba" path="res://scenes/контроль/кассета-у-5-к.tscn" id="2_tb85r"] [ext_resource type="PackedScene" uid="uid://cm5jd4gjrrpba" path="res://scenes/контроль/кассета-у-5-к.tscn" id="2_tb85r"]
[ext_resource type="PackedScene" uid="uid://bcyxqni7gxvtq" path="res://scenes/контроль/блок-в.tscn" id="5_c7lv8"] [ext_resource type="PackedScene" uid="uid://bcyxqni7gxvtq" path="res://scenes/контроль/блок-в.tscn" id="5_c7lv8"]
[ext_resource type="PackedScene" uid="uid://ffi1njkjceb5" path="res://scenes/контроль/блок-к.tscn" id="6_wd1vi"]
[ext_resource type="PackedScene" uid="uid://bmagw8nd0ulhj" path="res://scenes/pribor-prd-k/kasseta-fs-kd.tscn" id="7_ia27q"] [ext_resource type="PackedScene" uid="uid://bmagw8nd0ulhj" path="res://scenes/pribor-prd-k/kasseta-fs-kd.tscn" id="7_ia27q"]
[ext_resource type="Script" uid="uid://crpedygm3gohi" path="res://scenes/контроль/кассета.gd" id="7_xpa2n"] [ext_resource type="Script" uid="uid://crpedygm3gohi" path="res://scenes/контроль/кассета.gd" id="7_xpa2n"]
[ext_resource type="PackedScene" uid="uid://dq31j24gv5vi4" path="res://scenes/контроль/кассета-п-2.tscn" id="8_6fdp7"] [ext_resource type="PackedScene" uid="uid://dq31j24gv5vi4" path="res://scenes/контроль/кассета-п-2.tscn" id="8_6fdp7"]
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="8_la5yt"] [ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="8_la5yt"]
[ext_resource type="Texture2D" uid="uid://belwchvdktrw0" path="res://data/эмс-бланк.png" id="10_c7lv8"]
[ext_resource type="Texture2D" uid="uid://bwddxs24es81u" path="res://data/эмс-бланк-пост.png" id="11_wd1vi"]
[ext_resource type="Texture2D" uid="uid://pfoscstbm025" path="res://data/эмс-бланк-перем.png" id="12_bjebg"]
[ext_resource type="Texture2D" uid="uid://dvl3sq036gn75" path="res://data/эмс-бланк-замыкание.png" id="13_kc77u"]
[sub_resource type="SpriteFrames" id="SpriteFrames_di0aa"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("10_c7lv8")
}, {
"duration": 1.0,
"texture": ExtResource("11_wd1vi")
}, {
"duration": 1.0,
"texture": ExtResource("12_bjebg")
}, {
"duration": 1.0,
"texture": ExtResource("13_kc77u")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="pribor_prd_k" type="Control"] [node name="pribor_prd_k" type="Control"]
layout_mode = 3 layout_mode = 3
@@ -46,55 +21,55 @@ script = ExtResource("1_tpdyp")
[node name="kasseta_u5" parent="." instance=ExtResource("2_tb85r")] [node name="kasseta_u5" parent="." instance=ExtResource("2_tb85r")]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 96.0 offset_top = 242.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 286.0 offset_bottom = 432.0
[node name="maa2000_A22" parent="." groups=["power_supply"] instance=ExtResource("1_8dmgr")] [node name="maa2000_A22" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("1_8dmgr")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 761.0 offset_top = 907.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 803.0 offset_bottom = 949.0
fname = "MAA2000" fname = "MAA2000"
rname = "A28" rname = "A28"
metadata/ip = "maa2000_1" metadata/ip = "maa2000_1"
[node name="dou6_A7" parent="." groups=["default_reset"] instance=ExtResource("1_8dmgr")] [node name="dou6_A7" parent="." groups=["default_reset"] instance=ExtResource("1_8dmgr")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 716.0 offset_top = 862.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 761.0 offset_bottom = 907.0
fname = "ДОУ-6" fname = "ДОУ-6"
rname = "A7" rname = "A7"
[node name="maa2000_A23" parent="." groups=["power_supply"] instance=ExtResource("1_8dmgr")] [node name="maa2000_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("1_8dmgr")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 761.0 offset_top = 907.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 803.0 offset_bottom = 949.0
fname = "MAA2000" fname = "MAA2000"
rname = "A27" rname = "A27"
metadata/ip = "maa2000_2" metadata/ip = "maa2000_2"
[node name="dou7_A8" parent="." groups=["default_reset"] instance=ExtResource("1_8dmgr")] [node name="dou7_A8" parent="." groups=["default_reset"] instance=ExtResource("1_8dmgr")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 666.0 offset_top = 812.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 714.0 offset_bottom = 860.0
fname = "ДОУ-7" fname = "ДОУ-7"
rname = "A8" rname = "A8"
[node name="ref_ZZ3" type="NinePatchRect" parent="."] [node name="ref_ZZ3" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 666.0 offset_top = 812.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 803.0 offset_bottom = 949.0
texture = ExtResource("2_14h25") texture = ExtResource("2_14h25")
patch_margin_left = 16 patch_margin_left = 16
patch_margin_top = 16 patch_margin_top = 16
@@ -115,175 +90,175 @@ vertical_alignment = 1
[node name="um1535_A10" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="um1535_A10" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 96.0 offset_top = 242.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 191.0 offset_bottom = 337.0
value0 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] value0 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
fname = "УМ1535Б" fname = "УМ1535Б"
rname = "A10" rname = "A10"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_1" metadata/um = "um_1"
[node name="um1535_A11" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="um1535_A11" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 191.0 offset_top = 337.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 286.0 offset_bottom = 432.0
fname = "УМ1535Б" fname = "УМ1535Б"
rname = "A11" rname = "A11"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_2" metadata/um = "um_2"
[node name="um1535_A12" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="um1535_A12" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 286.0 offset_top = 432.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 381.0 offset_bottom = 527.0
fname = "УМ1535Б" fname = "УМ1535Б"
rname = "A12" rname = "A12"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_3" metadata/um = "um_3"
[node name="um1535_A13" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="um1535_A13" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 381.0 offset_top = 527.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 476.0 offset_bottom = 622.0
fname = "УМ1535Б" fname = "УМ1535Б"
rname = "A13" rname = "A13"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_4" metadata/um = "um_4"
[node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 476.0 offset_top = 622.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 571.0 offset_bottom = 717.0
fname = "УМ1535Б" fname = "УМ1535Б"
rname = "A14" rname = "A14"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_5" metadata/um = "um_5"
[node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 571.0 offset_top = 717.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 666.0 offset_bottom = 812.0
fname = "УМ1535Б" fname = "УМ1535Б"
rname = "A15" rname = "A15"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_6" metadata/um = "um_6"
[node name="блок-к" parent="." groups=["power_amplifier"] instance=ExtResource("6_wd1vi")] [node name="utm80_A9" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 666.0 offset_top = 812.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 761.0 offset_bottom = 907.0
fname = "УТМ80" fname = "УТМ80"
rname = "A9" rname = "A9"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_8" metadata/um = "um_7"
[node name="rm1620m_A16" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="rm1620m_A16" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 96.0 offset_top = 242.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 191.0 offset_bottom = 337.0
fname = "РМ16-20М" fname = "УМ1535Б"
rname = "A16" rname = "A16"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_9" metadata/um = "um_8"
[node name="rm1620m_A17" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="rm1620m_A17" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 191.0 offset_top = 337.0
offset_right = 212.0 offset_right = 173.0
offset_bottom = 286.0 offset_bottom = 432.0
fname = "РМ16-20М" fname = "УМ1535Б"
rname = "A17" rname = "A17"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_10" metadata/um = "um_9"
[node name="rm1620m_A18" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="rm1620m_A18" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 286.0 offset_top = 432.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 381.0 offset_bottom = 527.0
fname = "РМ16-20М" fname = "УМ1535Б"
rname = "A18" rname = "A18"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_11" metadata/um = "um_10"
[node name="rm1620m_A19" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="rm1620m_A19" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 381.0 offset_top = 527.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 476.0 offset_bottom = 622.0
fname = "РМ16-20М" fname = "УМ1535Б"
rname = "A19" rname = "A19"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_12" metadata/um = "um_11"
[node name="rm1620m_A20" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="rm1620m_A20" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 476.0 offset_top = 622.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 571.0 offset_bottom = 717.0
fname = "РМ16-20М" fname = "УМ1535Б"
rname = "A20" rname = "A20"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_13" metadata/um = "um_12"
[node name="rm1620m_A21" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="rm1620m_A21" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 571.0 offset_top = 717.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 666.0 offset_bottom = 812.0
fname = "РМ16-20М" fname = "УМ1535Б"
rname = "A21" rname = "A21"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_14" metadata/um = "um_13"
[node name="kasseta_fs_kd" parent="." instance=ExtResource("7_ia27q")] [node name="kasseta_fs_kd" parent="." instance=ExtResource("7_ia27q")]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 286.0 offset_top = 432.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 476.0 offset_bottom = 622.0
fname = "Кассета ФС-КД" fname = "Кассета ФС-КД"
[node name="kasseta_p_1" type="NinePatchRect" parent="."] [node name="kasseta_p_1" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 476.0 offset_top = 622.0
offset_right = 379.0 offset_right = 340.0
offset_bottom = 666.0 offset_bottom = 812.0
texture = ExtResource("2_14h25") texture = ExtResource("2_14h25")
patch_margin_left = 16 patch_margin_left = 16
patch_margin_top = 16 patch_margin_top = 16
@@ -292,7 +267,7 @@ patch_margin_bottom = 16
script = ExtResource("7_xpa2n") script = ExtResource("7_xpa2n")
fname = "Кассета П-1" fname = "Кассета П-1"
[node name="ref_A26" parent="kasseta_p_1" groups=["power_supply"] instance=ExtResource("8_la5yt")] [node name="ref_A26" parent="kasseta_p_1" groups=["default_reset", "power_supply"] instance=ExtResource("8_la5yt")]
offset_left = 9.0 offset_left = 9.0
offset_top = 33.0 offset_top = 33.0
offset_right = 59.0 offset_right = 59.0
@@ -301,7 +276,7 @@ fname = "ИП9-50"
rname = "A23" rname = "A23"
metadata/ip = "ip9_50_1" metadata/ip = "ip9_50_1"
[node name="ref_A23" parent="kasseta_p_1" groups=["power_supply"] instance=ExtResource("8_la5yt")] [node name="ref_A23" parent="kasseta_p_1" groups=["default_reset", "power_supply"] instance=ExtResource("8_la5yt")]
offset_left = 59.0 offset_left = 59.0
offset_top = 33.0 offset_top = 33.0
offset_right = 109.0 offset_right = 109.0
@@ -310,7 +285,7 @@ fname = "ИП9-50"
rname = "A24" rname = "A24"
metadata/ip = "ip9_50_2" metadata/ip = "ip9_50_2"
[node name="ref_A24" parent="kasseta_p_1" groups=["power_supply"] instance=ExtResource("8_la5yt")] [node name="ref_A24" parent="kasseta_p_1" groups=["default_reset", "power_supply"] instance=ExtResource("8_la5yt")]
offset_left = 109.0 offset_left = 109.0
offset_top = 33.0 offset_top = 33.0
offset_right = 159.0 offset_right = 159.0
@@ -322,9 +297,9 @@ metadata/ip = "ip12_50_1"
[node name="lbl_fname" type="Label" parent="kasseta_p_1"] [node name="lbl_fname" type="Label" parent="kasseta_p_1"]
self_modulate = Color(1, 1, 1, 0.62) self_modulate = Color(1, 1, 1, 0.62)
layout_mode = 0 layout_mode = 0
offset_left = 2.0 offset_left = 7.0
offset_top = 8.0 offset_top = 8.0
offset_right = 162.0 offset_right = 159.0
offset_bottom = 33.0 offset_bottom = 33.0
text = "Кассета П-1" text = "Кассета П-1"
horizontal_alignment = 1 horizontal_alignment = 1
@@ -332,56 +307,18 @@ vertical_alignment = 1
[node name="kasseta_p_2" parent="." instance=ExtResource("8_6fdp7")] [node name="kasseta_p_2" parent="." instance=ExtResource("8_6fdp7")]
layout_mode = 0 layout_mode = 0
offset_left = 404.0 offset_left = 365.0
offset_top = 476.0 offset_top = 622.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 666.0 offset_bottom = 812.0
fname = "Кассета П-2" fname = "Кассета П-2"
[node name="input_0" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(392, 472)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="input_1" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(444, 472)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="input_2" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(294, 473)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="output_0" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(394, 318)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="output_1" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(444, 318)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="output_2" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(294, 318)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="control_result" type="Label" parent="."] [node name="control_result" type="Label" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 49.0 offset_left = 9.0
offset_top = 993.0 offset_top = 960.0
offset_right = 689.0 offset_right = 649.0
offset_bottom = 1036.0 offset_bottom = 1003.0
theme_override_font_sizes/font_size = 22 text = "Прибор ПРД- неисправен"
horizontal_alignment = 1 horizontal_alignment = 1
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="line" type="Line2D" parent="."]
position = Vector2(59, 920)
scale = Vector2(1.03548, 1)
points = PackedVector2Array(-8, 0, 61.8069, 0, 608, 0)
width = 2.0
default_color = Color(1, 1, 1, 0.352941)
metadata/_edit_lock_ = true

View File

@@ -1,159 +1,235 @@
@tool @tool
extends 'res://scenes/контроль/прибор.gd' extends 'res://scenes/контроль/прибор.gd'
const constants_n = {
'POWER_UKP_1': 31,
'POWER_UKP_2': 63,
'DKM_BIT_2': 1,
'DKM_BIT_3': 2,
'BASE_ADDR_EMS_G': 0x120,
'ADDR_UG_LITERA_1': 0x106,
'ADDR_UG_LITERA_2': 0x108,
'ADDR_UG_LITERA_3': 0x10A,
'TEMP_THRESHOLD': 70,
'POWER_THRESHOLD': 40,
'RAY_DOU_NUM': 0x3,
'ATT_UM_2': 0x2,
'ATT_UM_3': 0x3,
'POWER_UM': 100,
'TIMER_DELAY': 10.0,
'STATE_MASHINE_TIMER': 0.3,
}
# Конфигурация параметров для каждого прибора
const PRIBOR_CONFIG_N := {
'': {'angle': 0.0, 'sectors': [4, 8]},
'': {'angle': 90.0, 'sectors': [7, 11]},
'': {'angle': 180.0, 'sectors': [6, 10]},
'': {'angle': 270.0, 'sectors': [5, 9]},
}
# Конфигурация частот и ширин для каждого ФС
const FS_PARAMS_N := {
2: {'freq': 932.0, 'width': 100.0},
3: {'freq': 1157.0, 'width': 100.0}
}
enum STATE_VAL { NONE = 0, GOOD = 1, ERROR = 2 } enum STATE_VAL { NONE = 0, GOOD = 1, ERROR = 2 }
var block_ip_config_n:= {
'maa2000_1': [0, false],
'maa2000_2': [1, false],
'ip9_50_1': [2, false],
'ip9_50_2': [3, false],
'ip12_50_1': [4, false],
'ip5_25': [7, false],
}
var block_kasseta_y5_prd_config_n: = {
'yau07': false,
'ems': false,
'ug': false,
'ukp1': false,
'ukp2': false,
}
# Основные переменные # Основные переменные
var start_litera: int = 2
var ug_work_1: int = 2 ## Аттенюация усилителей мощности
var ug_work_2: int = 3 ## Аттенюация усилителей мощности
# Флаги и таймеры
var mashine_timer: Timer = Timer.new()
var prd_n_module: Object
var unit_prd_n: Object var unit_prd_n: Object
var control_prd_n: Object
# Результаты контроля
var control_results_n: Dictionary = {
'block_ip': false, # Проверка касет П1 и ИП МА2000
'temperature': true, # Проверка температур УМ
'dkm_2': false,
'dkm_3': false,
'dou_2': false,
'dou_3': false,
'fs_2': 2,
'fs_3': 2,
}
var test_control_n = preload('res://scripts/pribor-prd.gd')
var ctrl_pos = 0 var ctrl_pos = 0
################################
func on_state_mashine() -> void:
control_prd_n.state_control_machine()
func _ready() -> void: func _ready() -> void:
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
var unit_name = get_meta('unit_name')[0]
var prd_n_module = prd.prd_dict[unit_name]
unit_prd_n = prd_n_module.unit_control
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
for temp in power_amplifier:
temp.value1 = -70
# Подписываемся на сигналы
unit_prd_n.connect('control_is_over', Callable(self, 'on_press_device'))
unit_prd_n.connect('status_updated', Callable(self, '_on_status_updated'))
# Устанавливаем начальный статус
_update_status_text(unit_prd_n.get_current_status())
start_control()
on_press_device()
initialize_connections()
func _process(_delta: float) -> void: setup_timer()
if Engine.is_editor_hint(): set_default_state()
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)
func start_control() -> void:
set_default_state(get_tree().get_nodes_in_group('default_reset'), get_tree().get_nodes_in_group('power_amplifier'))
find_labels(self) find_labels(self)
static func set_default_state(default_reset_array_node: Array, power_amplifier_arr_node: Array) -> void: func initialize_connections() -> void:
for group in default_reset_array_node: var unit_name = get_meta('unit_name')[0]
prd_n_module = prd.prd_dict[unit_name]
unit_prd_n = prd_n_module.unit_yau07
unit_prd_n.connect('line_changed', Callable(self, 'on_line_changed'))
var power_amplifiers: Array = get_tree().get_nodes_in_group('power_amplifier')
var init_data: Dictionary = {
'control_label': $control_result,
'power_amplifiers': power_amplifiers,
'unit_prd': unit_prd_n,
'module_prd' : prd_n_module,
'constants': constants_n,
'prd_config': PRIBOR_CONFIG_N,
'fs_params': FS_PARAMS_N,
'block_ip_prd_config': block_ip_config_n,
'block_kasseta_y5_prd_config': block_kasseta_y5_prd_config_n,
'control_results': control_results_n,
'current_litera': start_litera,
}
control_prd_n = test_control_n.TestPRD.new(init_data)
add_child(control_prd_n)
control_prd_n.connect('control_is_over', Callable(self, 'on_control_result'))
func setup_timer() -> void:
add_child(mashine_timer)
mashine_timer.connect('timeout', Callable(self, 'on_state_mashine'))
mashine_timer.wait_time = constants_n.STATE_MASHINE_TIMER
mashine_timer.start()
func set_default_state() -> void:
for group in get_tree().get_nodes_in_group('default_reset'):
group.state = STATE_VAL.NONE group.state = STATE_VAL.NONE
for group in power_amplifier_arr_node: for group in get_tree().get_nodes_in_group('power_amplifier'):
group.state = STATE_VAL.NONE group.state = STATE_VAL.NONE
func _enter_tree() -> void: func _enter_tree() -> void:
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
if unit_prd_n: $control_result.text = 'Выполняется ...'
_update_status_text(unit_prd_n.get_current_status()) $control_result.add_theme_color_override('font_color', Color.ALICE_BLUE)
signaller.connect('режим_работа', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_журнал', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_эмс', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_настройки', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_контроль', Callable(self, 'on_mode_changed').bind(true))
func _exit_tree() -> void: func _exit_tree() -> void:
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
#prd_n_module.cmd_array.append([unit_prd_n.CmdCode.WRITE_ISA, [constants_n.ADDR_UG_LITERA_1, ug_work_1, constants_n.ADDR_UG_LITERA_2, ug_work_2]]) prd_n_module.cmd_array.append([unit_prd_n.CmdCode.WRITE_ISA, [constants_n.ADDR_UG_LITERA_1, ug_work_1, constants_n.ADDR_UG_LITERA_2, ug_work_2]])
static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dictionary)->void: func on_line_changed(unit_pribor: Object) -> void:
for i_node_temperature in temperature_arr_node: if not unit_pribor.online:
var temperature_meta: String = i_node_temperature.get_meta('um') set_default_state()
if not temperature_dic.has(temperature_meta): return
i_node_temperature.value1 = temperature_dic[temperature_meta] if temperature_dic[temperature_meta] < 361 else -40
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void: func on_mode_changed(in_tree: bool) -> void:
for i_node_powapm in power_amplifier_arr_node: if not in_tree:
var powamp_meta: String = i_node_powapm.get_meta('um') mashine_timer.stop()
signaller.emit_signal('interfer_off_all')
prd_n_module.cmd_array.append([unit_prd_n.CmdCode.WRITE_ISA, [constants_n.ADDR_UG_LITERA_1, ug_work_1, constants_n.ADDR_UG_LITERA_2, ug_work_2]])
else:
set_default_state()
control_prd_n.state = control_prd_n.STATE_MASHINE.INIT
mashine_timer.start()
func power_fill(pow_dic: Dictionary, fs_result: Dictionary) -> void:
#if not control_prd_n.block_kasseta_y5_config.yau07 or not control_prd_n.block_kasseta_y5_config.ukp1 or not control_prd_n.block_kasseta_y5_config.ukp2:
#return
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
for i_powapm in power_amplifier:
var powamp_meta: String = i_powapm.get_meta('um')
var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE
if not pow_dic.has(powamp_meta): return if pow_dic[powamp_meta].size() < 6:
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_2: return status = STATE_VAL.ERROR
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_3: return else:
i_node_powapm.value0 = pow_dic[powamp_meta] if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_2: return
var count_above_threshold = 0 if powamp_meta in ['um_7', 'um_8', 'um_9', 'um_10', 'um_11', 'um_12'] and not fs_result.fs_3: return
for i_p in pow_dic[powamp_meta]: i_powapm.value0 = pow_dic[powamp_meta]
if i_p >= POWER_THRESHOLD: for i_p in pow_dic[powamp_meta]:
count_above_threshold += 1 if i_p < constants_n.POWER_THRESHOLD:
status = STATE_VAL.ERROR
status = STATE_VAL.GOOD if count_above_threshold >= 3 else STATE_VAL.ERROR i_powapm.state = status
i_node_powapm.state = status
func on_press_device() -> void: func on_control_result(result_dic: Dictionary, power_dic: Dictionary) -> void:
mashine_timer.stop()
block_kasseta_y5_prd_config_n = control_prd_n.block_kasseta_y5_config
var nodes_y5: Array = get_tree().get_nodes_in_group('y-5') var nodes_y5: Array = get_tree().get_nodes_in_group('y-5')
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
var power_amplifier_arr_node: Array = get_tree().get_nodes_in_group('power_amplifier')
var default_reset_array_node = get_tree().get_nodes_in_group('default_reset')
var module_fs_2: Node = $kasseta_FS_ND/ref_A4
var dou_2: Node = $dou2_A5
var module_fs_3: Node = $kasseta_FS_ND/ref_A3
var dou_3: Node = $dou3_A6
var control_data: Dictionary = unit_prd_n.get_control_results()
var for_control_result: Dictionary = {
'nodes_y5': nodes_y5,
'node_ip_power_arr': node_ip_power_arr,
'fs_nodes': fs_nodes,
'power_amplifier': power_amplifier_arr_node,
'default_reset_array_node': default_reset_array_node,
'module_fs_2': module_fs_2,
'dou_2': dou_2,
'module_fs_3': module_fs_3,
'dou_3': dou_3,
}
for_control_result.merge(control_data, true)
on_control_result(for_control_result)
static func on_control_result(for_result_dic: Dictionary) -> void:
temperature_fill(for_result_dic.power_amplifier, for_result_dic.temperature_um)
var block_kasseta_y5_prd_config_n: Dictionary = for_result_dic.block_kasseta_y5_config
var nodes_y5: Array = for_result_dic.nodes_y5
for node_y5 in nodes_y5: for node_y5 in nodes_y5:
var meta_y5 = node_y5.get_meta('y5') var meta_y5 = node_y5.get_meta('y5')
if block_kasseta_y5_prd_config_n.has(meta_y5): if block_kasseta_y5_prd_config_n.has(meta_y5):
if not block_kasseta_y5_prd_config_n.yau07: if block_kasseta_y5_prd_config_n['yau07'] == false:
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
else: break
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_n[meta_y5] else STATE_VAL.ERROR node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_n[meta_y5] else STATE_VAL.ERROR
var block_ip_config_n: Dictionary = for_result_dic.block_ip_config block_ip_config_n = control_prd_n.block_ip_config
for power_supply in for_result_dic.node_ip_power_arr: var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
for power_supply in node_ip_power_arr:
var meta_ip = power_supply.get_meta('ip') var meta_ip = power_supply.get_meta('ip')
if block_ip_config_n.has(meta_ip) and block_kasseta_y5_prd_config_n.ug and block_kasseta_y5_prd_config_n.yau07: if block_ip_config_n.has(meta_ip) and block_kasseta_y5_prd_config_n.ug:
power_supply.state = STATE_VAL.GOOD if block_ip_config_n[meta_ip][1] else STATE_VAL.ERROR power_supply.state = STATE_VAL.GOOD if block_ip_config_n[meta_ip][1] else STATE_VAL.ERROR
else:
power_supply.state = STATE_VAL.NONE
if not for_result_dic.control_is_over: var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
set_default_state(for_result_dic.default_reset_array_node, for_result_dic.power_amplifier) for f in fs_nodes:
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') var fs_meta: String = f.get_meta('fs')
if result_dic.has(fs_meta): if result_dic.has(fs_meta):
f.state = result_dic[fs_meta] var new_state = result_dic[fs_meta]
f.state = new_state
result_dic[fs_meta] = new_state
if result_dic.fs_2 == 1 and block_kasseta_y5_prd_config_n['yau07']: if result_dic.fs_2 == 1:
for_result_dic.module_fs_2.state = STATE_VAL.GOOD if result_dic.dkm_2 else STATE_VAL.ERROR $kasseta_FS_ND/ref_A4.state = STATE_VAL.GOOD if result_dic.dkm_2 else STATE_VAL.ERROR
for_result_dic.dou_2.state = STATE_VAL.GOOD if result_dic.dou_2 else STATE_VAL.ERROR $dou2_A5.state = STATE_VAL.GOOD if result_dic.dou_2 else STATE_VAL.ERROR
else:
result_dic.fs_2 = 0
if result_dic.fs_3 == 1:
$kasseta_FS_ND/ref_A3.state = STATE_VAL.GOOD if result_dic.dkm_3 else STATE_VAL.ERROR
$dou3_A6.state = STATE_VAL.GOOD if result_dic.dou_3 else STATE_VAL.ERROR
else:
result_dic.fs_3 = 0
if result_dic.fs_3 == 1 and block_kasseta_y5_prd_config_n['yau07']: power_fill(power_dic, result_dic)
for_result_dic.module_fs_3.state = STATE_VAL.GOOD if result_dic.dkm_3 else STATE_VAL.ERROR
for_result_dic.dou_3.state = STATE_VAL.GOOD if result_dic.dou_3 else STATE_VAL.ERROR var result = true
for device in result_dic.values():
if block_kasseta_y5_prd_config_n['yau07']: if not device:
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD) result = false
var name_prd = control_prd_n.self_name
if result:
$control_result.text = 'Прибор ПРД-%s исправен' % name_prd
$control_result.add_theme_color_override('font_color', Color.GREEN)
else:
$control_result.text = 'Прибор ПРД-%s неисправен' % name_prd
$control_result.add_theme_color_override('font_color', Color.RED)
func find_labels(node1: Node): func find_labels(node1: Node):
@@ -170,22 +246,3 @@ func find_labels(node1: Node):
node1.set_meta("tooltip_set", true) node1.set_meta("tooltip_set", true)
for child in node1.get_children(): for child in node1.get_children():
find_labels(child) find_labels(child)
func _on_status_updated(status_text: String) -> void:
_update_status_text(status_text)
func _update_status_text(text: String) -> void:
$control_result.text = text
# Можно добавить смену цвета в зависимости от статуса
if "Ошибка" in text or "неисправен" in text:
$control_result.add_theme_color_override('font_color', Color.RED)
log.message(Logger.INFO, 'Прибор ПРД-%s неисправен' % [unit_prd_n.self_name])
elif "Ограничена" in text or "Предупреждение" in text:
$control_result.add_theme_color_override('font_color', Color.YELLOW)
elif "исправен" in text or "завершён" in text:
$control_result.add_theme_color_override('font_color', Color.GREEN)
log.message(Logger.INFO, 'Прибор ПРД-%s исправен' % [unit_prd_n.self_name])
else:
$control_result.add_theme_color_override('font_color', Color.WHITE)

View File

@@ -1,35 +1,12 @@
[gd_scene load_steps=12 format=3 uid="uid://dnuexoef2nnv5"] [gd_scene load_steps=8 format=3 uid="uid://dnuexoef2nnv5"]
[ext_resource type="Script" uid="uid://cto2r4ipew65m" path="res://scenes/pribor-prd-n/pribor-prd-n.gd" id="1_bnnv3"] [ext_resource type="Script" uid="uid://cto2r4ipew65m" path="res://scenes/pribor-prd-n/pribor-prd-n.gd" id="1_bnnv3"]
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_is25t"] [ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_is25t"]
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="3_meukj"] [ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="3_meukj"]
[ext_resource type="PackedScene" uid="uid://bk1655p4e8y4u" path="res://scenes/контроль/кассета-у-5-нв.tscn" id="4_xkifg"]
[ext_resource type="Script" uid="uid://crpedygm3gohi" path="res://scenes/контроль/кассета.gd" id="6_b5wvk"] [ext_resource type="Script" uid="uid://crpedygm3gohi" path="res://scenes/контроль/кассета.gd" id="6_b5wvk"]
[ext_resource type="PackedScene" uid="uid://bcyxqni7gxvtq" path="res://scenes/контроль/блок-в.tscn" id="7_bnnv3"] [ext_resource type="PackedScene" uid="uid://bcyxqni7gxvtq" path="res://scenes/контроль/блок-в.tscn" id="7_bnnv3"]
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="7_eoqf2"] [ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="7_eoqf2"]
[ext_resource type="Texture2D" uid="uid://belwchvdktrw0" path="res://data/эмс-бланк.png" id="8_bnnv3"]
[ext_resource type="Texture2D" uid="uid://bwddxs24es81u" path="res://data/эмс-бланк-пост.png" id="9_is25t"]
[ext_resource type="Texture2D" uid="uid://pfoscstbm025" path="res://data/эмс-бланк-перем.png" id="10_meukj"]
[ext_resource type="Texture2D" uid="uid://dvl3sq036gn75" path="res://data/эмс-бланк-замыкание.png" id="11_xkifg"]
[sub_resource type="SpriteFrames" id="SpriteFrames_1wf07"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("8_bnnv3")
}, {
"duration": 1.0,
"texture": ExtResource("9_is25t")
}, {
"duration": 1.0,
"texture": ExtResource("10_meukj")
}, {
"duration": 1.0,
"texture": ExtResource("11_xkifg")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="pribor_prd_n" type="Control"] [node name="pribor_prd_n" type="Control"]
layout_mode = 3 layout_mode = 3
@@ -40,50 +17,50 @@ offset_right = 15.0
offset_bottom = 30.0 offset_bottom = 30.0
script = ExtResource("1_bnnv3") script = ExtResource("1_bnnv3")
[node name="maa2000_A23" parent="." groups=["power_supply"] instance=ExtResource("2_is25t")] [node name="maa2000_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_is25t")]
layout_mode = 2 layout_mode = 2
offset_left = 47.0 offset_left = 8.0
offset_top = 731.0 offset_top = 877.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 803.0 offset_bottom = 949.0
fname = "MAA2000" fname = "MAA2000"
rname = "A23" rname = "A23"
metadata/ip = "maa2000_2" metadata/ip = "maa2000_2"
[node name="maa2000_A22" parent="." groups=["power_supply"] instance=ExtResource("2_is25t")] [node name="maa2000_A22" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_is25t")]
layout_mode = 2 layout_mode = 2
offset_left = 524.0 offset_left = 485.0
offset_top = 731.0 offset_top = 877.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 803.0 offset_bottom = 949.0
fname = "MAA2000" fname = "MAA2000"
rname = "A22" rname = "A22"
metadata/ip = "maa2000_1" metadata/ip = "maa2000_1"
[node name="dou2_A5" parent="." groups=["default_reset"] instance=ExtResource("2_is25t")] [node name="dou2_A5" parent="." groups=["default_reset"] instance=ExtResource("2_is25t")]
layout_mode = 2 layout_mode = 2
offset_left = 524.0 offset_left = 485.0
offset_top = 666.0 offset_top = 812.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 731.0 offset_bottom = 877.0
fname = "ДОУ-2" fname = "ДОУ-2"
rname = "A5" rname = "A5"
[node name="dou3_A6" parent="." groups=["default_reset"] instance=ExtResource("2_is25t")] [node name="dou3_A6" parent="." groups=["default_reset"] instance=ExtResource("2_is25t")]
layout_mode = 2 layout_mode = 2
offset_left = 47.0 offset_left = 8.0
offset_top = 666.0 offset_top = 812.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 731.0 offset_bottom = 877.0
fname = "ДОУ-3" fname = "ДОУ-3"
rname = "A6" rname = "A6"
[node name="ref_ZZ3" type="NinePatchRect" parent="."] [node name="ref_ZZ3" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 666.0 offset_top = 812.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 803.0 offset_bottom = 949.0
texture = ExtResource("3_meukj") texture = ExtResource("3_meukj")
patch_margin_left = 16 patch_margin_left = 16
patch_margin_top = 16 patch_margin_top = 16
@@ -102,90 +79,19 @@ text = "Панель
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="kasseta_U5" type="NinePatchRect" parent="."] [node name="kasseta_U5" parent="." instance=ExtResource("4_xkifg")]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 96.0 offset_top = 242.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 286.0 offset_bottom = 432.0
texture = ExtResource("3_meukj")
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
script = ExtResource("6_b5wvk")
[node name="lbl_fname" type="Label" parent="kasseta_U5"]
self_modulate = Color(1, 1, 1, 0.62)
layout_mode = 0
offset_left = 5.0
offset_top = 7.0
offset_right = 305.0
offset_bottom = 35.0
text = "Кассета У5"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ref_A24" parent="kasseta_U5" groups=["power_supply"] instance=ExtResource("7_eoqf2")]
offset_left = 5.0
offset_top = 32.0
offset_right = 55.0
offset_bottom = 182.0
fname = "ИП5-25"
rname = "A24"
metadata/ip = "ip5_25"
[node name="ref_A30" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_eoqf2")]
offset_left = 55.0
offset_top = 32.0
offset_right = 105.0
offset_bottom = 182.0
fname = "ЯУ-07Б"
rname = "A30"
metadata/y5 = "yau07"
[node name="ref_A26" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_eoqf2")]
offset_left = 105.0
offset_top = 32.0
offset_right = 155.0
offset_bottom = 182.0
fname = "ЭМС-Г"
rname = "A26"
metadata/y5 = "ems"
[node name="ref_A27" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_eoqf2")]
offset_left = 155.0
offset_top = 32.0
offset_right = 205.0
offset_bottom = 182.0
fname = "УГ"
rname = "A27"
metadata/y5 = "ug"
[node name="ref_A28" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_eoqf2")]
offset_left = 205.0
offset_top = 32.0
offset_right = 255.0
offset_bottom = 182.0
fname = "УКП"
rname = "A28"
metadata/y5 = "ukp1"
[node name="ref_A29" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_eoqf2")]
offset_left = 254.0
offset_top = 32.0
offset_right = 304.0
offset_bottom = 182.0
fname = "УКП"
rname = "A29"
metadata/y5 = "ukp2"
[node name="kasseta_FS_ND" type="NinePatchRect" parent="."] [node name="kasseta_FS_ND" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 286.0 offset_top = 432.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 476.0 offset_bottom = 622.0
texture = ExtResource("3_meukj") texture = ExtResource("3_meukj")
patch_margin_left = 16 patch_margin_left = 16
patch_margin_top = 16 patch_margin_top = 16
@@ -212,7 +118,7 @@ offset_top = 32.0
offset_right = 105.0 offset_right = 105.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "Блок ФС-3" fname = "Блок ФС-3"
rname = "A4" rname = "A3"
[node name="ref_A1" parent="kasseta_FS_ND" groups=["default_reset", "fs_group"] instance=ExtResource("7_eoqf2")] [node name="ref_A1" parent="kasseta_FS_ND" groups=["default_reset", "fs_group"] instance=ExtResource("7_eoqf2")]
offset_left = 105.0 offset_left = 105.0
@@ -220,7 +126,7 @@ offset_top = 32.0
offset_right = 155.0 offset_right = 155.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "Модуль ФС" fname = "Модуль ФС"
rname = "A2" rname = "A1"
metadata/fs = "fs_3" metadata/fs = "fs_3"
[node name="ref_A2" parent="kasseta_FS_ND" groups=["default_reset", "fs_group"] instance=ExtResource("7_eoqf2")] [node name="ref_A2" parent="kasseta_FS_ND" groups=["default_reset", "fs_group"] instance=ExtResource("7_eoqf2")]
@@ -229,7 +135,7 @@ offset_top = 32.0
offset_right = 205.0 offset_right = 205.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "Модуль ФС" fname = "Модуль ФС"
rname = "A1" rname = "A2"
metadata/fs = "fs_2" metadata/fs = "fs_2"
[node name="ref_A4" parent="kasseta_FS_ND" groups=["default_reset"] instance=ExtResource("7_eoqf2")] [node name="ref_A4" parent="kasseta_FS_ND" groups=["default_reset"] instance=ExtResource("7_eoqf2")]
@@ -238,14 +144,14 @@ offset_top = 32.0
offset_right = 255.0 offset_right = 255.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "Блок ФС-2" fname = "Блок ФС-2"
rname = "A3" rname = "A4"
[node name="kasseta_P_1" type="NinePatchRect" parent="."] [node name="kasseta_P_1" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 476.0 offset_top = 622.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 666.0 offset_bottom = 812.0
texture = ExtResource("3_meukj") texture = ExtResource("3_meukj")
patch_margin_left = 16 patch_margin_left = 16
patch_margin_top = 16 patch_margin_top = 16
@@ -254,7 +160,7 @@ patch_margin_bottom = 16
script = ExtResource("6_b5wvk") script = ExtResource("6_b5wvk")
fname = "Кассета П-1" fname = "Кассета П-1"
[node name="ref_A21" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_eoqf2")] [node name="ref_A21" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_eoqf2")]
offset_left = 9.0 offset_left = 9.0
offset_top = 33.0 offset_top = 33.0
offset_right = 59.0 offset_right = 59.0
@@ -263,7 +169,7 @@ fname = "ИП12-50"
rname = "A21" rname = "A21"
metadata/ip = "ip12_50_1" metadata/ip = "ip12_50_1"
[node name="ref_A20" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_eoqf2")] [node name="ref_A20" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_eoqf2")]
offset_left = 59.0 offset_left = 59.0
offset_top = 33.0 offset_top = 33.0
offset_right = 109.0 offset_right = 109.0
@@ -272,7 +178,7 @@ fname = "ИП9-50"
rname = "A20" rname = "A20"
metadata/ip = "ip9_50_1" metadata/ip = "ip9_50_1"
[node name="ref_A19" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_eoqf2")] [node name="ref_A19" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_eoqf2")]
offset_left = 109.0 offset_left = 109.0
offset_top = 33.0 offset_top = 33.0
offset_right = 159.0 offset_right = 159.0
@@ -294,182 +200,153 @@ vertical_alignment = 1
[node name="um1535_A7" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A7" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 96.0 offset_top = 242.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 191.0 offset_bottom = 337.0
fname = "УМ1535А" fname = "УМ1535Б"
rname = "A7" rname = "A7"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_1" metadata/um = "um_1"
[node name="um1535_A8" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A8" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 191.0 offset_top = 337.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 286.0 offset_bottom = 432.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A8" rname = "A8"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_2" metadata/um = "um_2"
[node name="um1535_A9" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A9" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 286.0 offset_top = 432.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 381.0 offset_bottom = 527.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A9" rname = "A9"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_3" metadata/um = "um_3"
[node name="um1535_A10" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A10" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 381.0 offset_top = 527.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 476.0 offset_bottom = 622.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A10" rname = "A10"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_4" metadata/um = "um_4"
[node name="um1535_A11" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A11" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 476.0 offset_top = 622.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 571.0 offset_bottom = 717.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A11" rname = "A11"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_5" metadata/um = "um_5"
[node name="um1535_A12" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A12" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 571.0 offset_top = 717.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 666.0 offset_bottom = 812.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A12" rname = "A12"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_6" metadata/um = "um_6"
[node name="um1535_A13" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A13" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 96.0 offset_top = 242.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 191.0 offset_bottom = 337.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A13" rname = "A13"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_9" metadata/um = "um_7"
[node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 191.0 offset_top = 337.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 286.0 offset_bottom = 432.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A14" rname = "A14"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_10" metadata/um = "um_8"
[node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 286.0 offset_top = 432.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 381.0 offset_bottom = 527.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A15" rname = "A15"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_11" metadata/um = "um_9"
[node name="um1535_A16" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A16" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 381.0 offset_top = 527.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 476.0 offset_bottom = 622.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A16" rname = "A16"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_12" metadata/um = "um_10"
[node name="um1535_A17" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A17" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 476.0 offset_top = 622.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 571.0 offset_bottom = 717.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A17" rname = "A17"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_13" metadata/um = "um_11"
[node name="um1535_A18" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")] [node name="um1535_A18" parent="." groups=["power_amplifier"] instance=ExtResource("7_bnnv3")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 571.0 offset_top = 717.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 666.0 offset_bottom = 812.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A18" rname = "A18"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_14" metadata/um = "um_12"
[node name="control_result" type="Label" parent="."] [node name="control_result" type="Label" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 49.0 offset_left = 9.0
offset_top = 993.0 offset_top = 960.0
offset_right = 689.0 offset_right = 649.0
offset_bottom = 1036.0 offset_bottom = 1003.0
theme_override_font_sizes/font_size = 22
horizontal_alignment = 1 horizontal_alignment = 1
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="input_0" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(495, 443)
sprite_frames = SubResource("SpriteFrames_1wf07")
[node name="input_1" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(246, 440)
sprite_frames = SubResource("SpriteFrames_1wf07")
[node name="output_0" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(497, 330)
sprite_frames = SubResource("SpriteFrames_1wf07")
[node name="output_1" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(249, 331)
sprite_frames = SubResource("SpriteFrames_1wf07")
[node name="line" type="Line2D" parent="."]
position = Vector2(59, 920)
scale = Vector2(1.03548, 1)
points = PackedVector2Array(-8, 0, 61.8069, 0, 608, 0)
width = 2.0
default_color = Color(1, 1, 1, 0.352941)
metadata/_edit_lock_ = true

View File

@@ -1,158 +1,234 @@
@tool @tool
extends 'res://scenes/контроль/прибор.gd' extends 'res://scenes/контроль/прибор.gd'
const constants_v = {
'POWER_UKP_1': 31,
'POWER_UKP_2': 63,
'DKM_BIT_4': 3,
'DKM_BIT_5': 4,
'BASE_ADDR_EMS_G': 0x120,
'ADDR_UG_LITERA_1': 0x106,
'ADDR_UG_LITERA_2': 0x108,
'ADDR_UG_LITERA_3': 0x10A,
'TEMP_THRESHOLD': 70,
'POWER_THRESHOLD': 40,
'RAY_DOU_NUM': 0x3,
'ATT_UM_4': 0x2,
'ATT_UM_5': 0x3,
'POWER_UM': 100,
'TIMER_DELAY': 10.0,
'STATE_MASHINE_TIMER': 0.3,
}
# Конфигурация параметров для каждого прибора
const PRIBOR_CONFIG_V := {
'': {'angle': 0.0, 'sectors': [12, 16]},
'': {'angle': 90.0, 'sectors': [15, 19]},
'': {'angle': 180.0, 'sectors': [14, 18]},
'': {'angle': 270.0, 'sectors': [13, 17]},
}
# Конфигурация частот и ширин для каждого ФС
const FS_PARAMS_V := {
4: {'freq': 1227.0, 'width': 100.0},
5: {'freq': 1575.0, 'width': 110.0},
}
enum STATE_VAL { NONE = 0, GOOD = 1, ERROR = 2 } enum STATE_VAL { NONE = 0, GOOD = 1, ERROR = 2 }
var block_ip_config_v := {
'maa2000_1': [0, false],
'maa2000_2': [1, false],
'ip9_50_1': [2, false],
'ip9_50_2': [3, false],
'ip12_50_1': [4, false],
'ip5_25': [7, false],
}
var block_kasseta_y5_prd_config_v: = {
'yau07': false,
'ems': false,
'ug': false,
'ukp1': false,
'ukp2': false,
}
# Основные переменные # Основные переменные
var start_litera: int = 4
var ug_work_1: int = 2 ## Аттенюация усилителей мощности
var ug_work_2: int = 3 ## Аттенюация усилителей мощности
# Флаги и таймеры
var mashine_timer: Timer = Timer.new()
var prd_v_module: Object
var unit_prd_v: Object var unit_prd_v: Object
var control_prd_v: Object
# Результаты контроля
var control_results_v: Dictionary = {
'block_ip': false, # Проверка касет П1 и ИП МА2000
'temperature': true, # Проверка температур УМ
'dkm_4': false,
'dkm_5': false,
'dou_4': false,
'dou_5': false,
'fs_4': 2,
'fs_5': 2,
}
var test_control_v = preload('res://scripts/pribor-prd.gd')
var ctrl_pos = 70 var ctrl_pos = 70
func on_state_mashine() -> void:
control_prd_v.state_control_machine()
func _ready() -> void: func _ready() -> void:
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
var unit_name = get_meta('unit_name')[0]
var prd_v_module = prd.prd_dict[unit_name]
unit_prd_v = prd_v_module.unit_control
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
for temp in power_amplifier:
temp.value1 = -70
# Подписываемся на сигналы
unit_prd_v.connect('control_is_over', Callable(self, 'on_press_device'))
unit_prd_v.connect('status_updated', Callable(self, '_on_status_updated'))
# Устанавливаем начальный статус
_update_status_text(unit_prd_v.get_current_status())
on_press_device()
initialize_connections()
func _process(_delta: float) -> void: setup_timer()
if Engine.is_editor_hint(): set_default_state()
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)
func start_control() -> void:
set_default_state(get_tree().get_nodes_in_group('default_reset'), get_tree().get_nodes_in_group('power_amplifier'))
find_labels(self) find_labels(self)
static func set_default_state(default_reset_array_node: Array, power_amplifier_arr_node: Array) -> void: func initialize_connections() -> void:
for group in default_reset_array_node: var unit_name = get_meta('unit_name')[0]
prd_v_module = prd.prd_dict[unit_name]
unit_prd_v = prd_v_module.unit_yau07
unit_prd_v.connect('line_changed', Callable(self, 'on_line_changed'))
var power_amplifiers: Array = get_tree().get_nodes_in_group('power_amplifier')
var init_data: Dictionary = {
'control_label': $control_result,
'power_amplifiers': power_amplifiers,
'unit_prd': unit_prd_v,
'module_prd' : prd_v_module,
'constants': constants_v,
'prd_config': PRIBOR_CONFIG_V,
'fs_params': FS_PARAMS_V,
'block_ip_prd_config': block_ip_config_v,
'block_kasseta_y5_prd_config': block_kasseta_y5_prd_config_v,
'control_results': control_results_v,
'current_litera': start_litera,
}
control_prd_v = test_control_v.TestPRD.new(init_data)
add_child(control_prd_v)
control_prd_v.connect('control_is_over', Callable(self, 'on_control_result'))
func setup_timer() -> void:
add_child(mashine_timer)
mashine_timer.connect('timeout', Callable(self, 'on_state_mashine'))
mashine_timer.wait_time = constants_v.STATE_MASHINE_TIMER
mashine_timer.start()
func set_default_state() -> void:
for group in get_tree().get_nodes_in_group('default_reset'):
group.state = STATE_VAL.NONE group.state = STATE_VAL.NONE
for group in power_amplifier_arr_node: for group in get_tree().get_nodes_in_group('power_amplifier'):
group.state = STATE_VAL.NONE group.state = STATE_VAL.NONE
func _enter_tree() -> void: func _enter_tree() -> void:
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
if unit_prd_v: $control_result.text = 'Выполняется ...'
_update_status_text(unit_prd_v.get_current_status()) $control_result.add_theme_color_override('font_color', Color.ALICE_BLUE)
signaller.connect('режим_работа', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_журнал', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_эмс', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_настройки', Callable(self, 'on_mode_changed').bind(false))
signaller.connect('режим_контроль', Callable(self, 'on_mode_changed').bind(true))
func _exit_tree() -> void: func _exit_tree() -> void:
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
#prd_v_module.cmd_array.append([unit_prd_v.CmdCode.WRITE_ISA, [constants_v.ADDR_UG_LITERA_1, ug_work_1, constants_v.ADDR_UG_LITERA_2, ug_work_2]]) prd_v_module.cmd_array.append([unit_prd_v.CmdCode.WRITE_ISA, [constants_v.ADDR_UG_LITERA_1, ug_work_1, constants_v.ADDR_UG_LITERA_2, ug_work_2]])
static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dictionary)->void: func on_line_changed(unit_pribor: Object) -> void:
for i_node_temperature in temperature_arr_node: if not unit_pribor.online:
var temperature_meta: String = i_node_temperature.get_meta('um') set_default_state()
if not temperature_dic.has(temperature_meta): return
i_node_temperature.value1 = temperature_dic[temperature_meta] if temperature_dic[temperature_meta] < 361 else -40
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void: func on_mode_changed(in_tree: bool) -> void:
for i_node_powapm in power_amplifier_arr_node: if not in_tree:
var powamp_meta: String = i_node_powapm.get_meta('um') mashine_timer.stop()
var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE prd_v_module.cmd_array.append([unit_prd_v.CmdCode.WRITE_ISA, [constants_v.ADDR_UG_LITERA_1, ug_work_1, constants_v.ADDR_UG_LITERA_2, ug_work_2]])
if not pow_dic.has(powamp_meta): return signaller.emit_signal('interfer_off_all')
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_4: return else:
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_5: return set_default_state()
i_node_powapm.value0 = pow_dic[powamp_meta] control_prd_v.state = control_prd_v.STATE_MASHINE.INIT
var count_above_threshold = 0 mashine_timer.start()
for i_p in pow_dic[powamp_meta]:
if i_p >= POWER_THRESHOLD:
count_above_threshold += 1
status = STATE_VAL.GOOD if count_above_threshold >= 3 else STATE_VAL.ERROR
i_node_powapm.state = status
func on_press_device() -> void: func power_fill(pow_dic: Dictionary, fs_result: Dictionary) -> 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 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') for i_powapm in power_amplifier:
var module_fs_4: Node = $kasseta_FS_VD/ref_A6 var powamp_meta: String = i_powapm.get_meta('um')
var dou_4: Node = $dou4_A5 var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE
var module_fs_5: Node = $kasseta_FS_VD/ref_A2 if pow_dic[powamp_meta].size() < 6:
var dou_5: Node = $dou5_A6 status = STATE_VAL.ERROR
var control_data = unit_prd_v.get_control_results() else:
var for_control_result: Dictionary = { if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_4: return
'nodes_y5': nodes_y5, if powamp_meta in ['um_7', 'um_8', 'um_9', 'um_10', 'um_11', 'um_12'] and not fs_result.fs_5: return
'node_ip_power_arr': node_ip_power_arr, i_powapm.value0 = pow_dic[powamp_meta]
'fs_nodes': fs_nodes, for i_p in pow_dic[powamp_meta]:
'power_amplifier': power_amplifier, if i_p < constants_v.POWER_THRESHOLD:
'default_reset_array_node': default_reset_array_node, status = STATE_VAL.ERROR
'module_fs_4': module_fs_4, i_powapm.state = status
'dou_4': dou_4,
'module_fs_5': module_fs_5,
'dou_5': dou_5,
}
for_control_result.merge(control_data, true)
on_control_result(for_control_result)
static func on_control_result(for_result_dic: Dictionary) -> void: func on_control_result(result_dic: Dictionary, power_dic: Dictionary) -> void:
temperature_fill(for_result_dic.power_amplifier, for_result_dic.temperature_um) mashine_timer.stop()
block_kasseta_y5_prd_config_v = control_prd_v.block_kasseta_y5_config
var block_kasseta_y5_prd_config_v: Dictionary = for_result_dic.block_kasseta_y5_config var nodes_y5: Array = get_tree().get_nodes_in_group('y-5')
var nodes_y5: Array = for_result_dic.nodes_y5
for node_y5 in nodes_y5: for node_y5 in nodes_y5:
var meta_y5 = node_y5.get_meta('y5') var meta_y5 = node_y5.get_meta('y5')
if block_kasseta_y5_prd_config_v.has(meta_y5): if block_kasseta_y5_prd_config_v.has(meta_y5):
if not block_kasseta_y5_prd_config_v.yau07: if block_kasseta_y5_prd_config_v['yau07'] == false:
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
else: break
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_v[meta_y5] else STATE_VAL.ERROR node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_v[meta_y5] else STATE_VAL.ERROR
var block_ip_config_v: Dictionary = for_result_dic.block_ip_config
for power_supply in for_result_dic.node_ip_power_arr:
var meta_ip = power_supply.get_meta('ip')
if block_ip_config_v.has(meta_ip) and block_kasseta_y5_prd_config_v.ug and block_kasseta_y5_prd_config_v.yau07:
power_supply.state = STATE_VAL.GOOD if block_ip_config_v[meta_ip][1] else STATE_VAL.ERROR
else:
power_supply.state = STATE_VAL.NONE
if not for_result_dic.control_is_over: block_ip_config_v = control_prd_v.block_ip_config
set_default_state(for_result_dic.default_reset_array_node, for_result_dic.power_amplifier) var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
return for power_supply in node_ip_power_arr:
var result_dic: Dictionary = for_result_dic.result_dic var meta_ip = power_supply.get_meta('ip')
for f in for_result_dic.fs_nodes: if block_ip_config_v.has(meta_ip) and block_kasseta_y5_prd_config_v.ug:
power_supply.state = STATE_VAL.GOOD if block_ip_config_v[meta_ip][1] else STATE_VAL.ERROR
var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
for f in fs_nodes:
var fs_meta: String = f.get_meta('fs') var fs_meta: String = f.get_meta('fs')
if result_dic.has(fs_meta): if result_dic.has(fs_meta):
f.state = result_dic[fs_meta] var new_state = result_dic[fs_meta]
f.state = new_state
result_dic[fs_meta] = new_state
if result_dic.fs_5 == 1 and block_kasseta_y5_prd_config_v['yau07']: if result_dic.fs_5 == 1:
for_result_dic.module_fs_5.state = STATE_VAL.GOOD if result_dic.dkm_5 else STATE_VAL.ERROR $kasseta_FS_VD/ref_A2.state = STATE_VAL.GOOD if result_dic.dkm_5 else STATE_VAL.ERROR
for_result_dic.dou_5.state = STATE_VAL.GOOD if result_dic.dou_5 else STATE_VAL.ERROR $dou5_A6.state = STATE_VAL.GOOD if result_dic.dou_5 else STATE_VAL.ERROR
else:
if result_dic.fs_4 == 1 and block_kasseta_y5_prd_config_v['yau07']: result_dic.fs_5 = 0
for_result_dic.module_fs_4.state = STATE_VAL.GOOD if result_dic.dkm_4 else STATE_VAL.ERROR if result_dic.fs_4 == 1:
for_result_dic.dou_4.state = STATE_VAL.GOOD if result_dic.dou_4 else STATE_VAL.ERROR $kasseta_FS_VD/ref_A6.state = STATE_VAL.GOOD if result_dic.dkm_4 else STATE_VAL.ERROR
$dou4_A5.state = STATE_VAL.GOOD if result_dic.dou_4 else STATE_VAL.ERROR
if block_kasseta_y5_prd_config_v['yau07']: else:
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD) result_dic.fs_4 = 0
power_fill(power_dic, result_dic)
var result = true
for device in result_dic.values():
if not device:
result = false
var name_prd = control_prd_v.self_name
if result:
$control_result.text = 'Прибор ПРД-%s исправен' % name_prd
$control_result.add_theme_color_override('font_color', Color.GREEN)
else:
$control_result.text = 'Прибор ПРД-%s неисправен' % name_prd
$control_result.add_theme_color_override('font_color', Color.RED)
func find_labels(node1: Node): func find_labels(node1: Node):
@@ -169,22 +245,3 @@ func find_labels(node1: Node):
node1.set_meta("tooltip_set", true) node1.set_meta("tooltip_set", true)
for child in node1.get_children(): for child in node1.get_children():
find_labels(child) find_labels(child)
func _on_status_updated(status_text: String) -> void:
_update_status_text(status_text)
func _update_status_text(text: String) -> void:
$control_result.text = text
# Можно добавить смену цвета в зависимости от статуса
if "Ошибка" in text or "неисправен" in text:
$control_result.add_theme_color_override('font_color', Color.RED)
log.message(Logger.INFO, 'Прибор ПРД-%s неисправен' % [unit_prd_v.self_name])
elif "Ограничена" in text or "Предупреждение" in text:
$control_result.add_theme_color_override('font_color', Color.YELLOW)
elif "исправен" in text or "завершён" in text:
$control_result.add_theme_color_override('font_color', Color.GREEN)
log.message(Logger.INFO, 'Прибор ПРД-%s исправен' % [unit_prd_v.self_name])
else:
$control_result.add_theme_color_override('font_color', Color.WHITE)

View File

@@ -1,36 +1,13 @@
[gd_scene load_steps=13 format=3 uid="uid://cvskpe1ti3p45"] [gd_scene load_steps=9 format=3 uid="uid://cvskpe1ti3p45"]
[ext_resource type="Script" uid="uid://cvuosuvjaci1h" path="res://scenes/pribor-prd-v/pribor-prd-v.gd" id="1_c20s6"] [ext_resource type="Script" uid="uid://cvuosuvjaci1h" path="res://scenes/pribor-prd-v/pribor-prd-v.gd" id="1_c20s6"]
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_xpo4b"] [ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_xpo4b"]
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="3_wyy1b"] [ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="3_wyy1b"]
[ext_resource type="PackedScene" uid="uid://bk1655p4e8y4u" path="res://scenes/контроль/кассета-у-5-нв.tscn" id="4_gl2bl"]
[ext_resource type="PackedScene" uid="uid://cd5sue1e8iyrv" path="res://scenes/pribor-prd-n/kasseta-fs-nd.tscn" id="5_nhd2k"] [ext_resource type="PackedScene" uid="uid://cd5sue1e8iyrv" path="res://scenes/pribor-prd-n/kasseta-fs-nd.tscn" id="5_nhd2k"]
[ext_resource type="Script" uid="uid://crpedygm3gohi" path="res://scenes/контроль/кассета.gd" id="6_os4mt"] [ext_resource type="Script" uid="uid://crpedygm3gohi" path="res://scenes/контроль/кассета.gd" id="6_os4mt"]
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="7_38u2b"] [ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="7_38u2b"]
[ext_resource type="PackedScene" uid="uid://bcyxqni7gxvtq" path="res://scenes/контроль/блок-в.tscn" id="8_4e87c"] [ext_resource type="PackedScene" uid="uid://bcyxqni7gxvtq" path="res://scenes/контроль/блок-в.tscn" id="8_4e87c"]
[ext_resource type="Texture2D" uid="uid://belwchvdktrw0" path="res://data/эмс-бланк.png" id="9_4e87c"]
[ext_resource type="Texture2D" uid="uid://bwddxs24es81u" path="res://data/эмс-бланк-пост.png" id="10_g8fvp"]
[ext_resource type="Texture2D" uid="uid://pfoscstbm025" path="res://data/эмс-бланк-перем.png" id="11_gsby4"]
[ext_resource type="Texture2D" uid="uid://dvl3sq036gn75" path="res://data/эмс-бланк-замыкание.png" id="12_vxfkm"]
[sub_resource type="SpriteFrames" id="SpriteFrames_s5gcy"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("9_4e87c")
}, {
"duration": 1.0,
"texture": ExtResource("10_g8fvp")
}, {
"duration": 1.0,
"texture": ExtResource("11_gsby4")
}, {
"duration": 1.0,
"texture": ExtResource("12_vxfkm")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="pribor_prd_v" type="Control"] [node name="pribor_prd_v" type="Control"]
layout_mode = 3 layout_mode = 3
@@ -41,50 +18,50 @@ offset_right = 15.0
offset_bottom = 30.0 offset_bottom = 30.0
script = ExtResource("1_c20s6") script = ExtResource("1_c20s6")
[node name="maa2000_A22" parent="." groups=["power_supply"] instance=ExtResource("2_xpo4b")] [node name="maa2000_A22" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_xpo4b")]
layout_mode = 2 layout_mode = 2
offset_left = 524.0 offset_left = 485.0
offset_top = 731.0 offset_top = 877.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 803.0 offset_bottom = 949.0
fname = "MAA2000" fname = "MAA2000"
rname = "A22" rname = "A22"
metadata/ip = "maa2000_1" metadata/ip = "maa2000_1"
[node name="dou4_A5" parent="." groups=["default_reset"] instance=ExtResource("2_xpo4b")] [node name="dou4_A5" parent="." groups=["default_reset"] instance=ExtResource("2_xpo4b")]
layout_mode = 2 layout_mode = 2
offset_left = 524.0 offset_left = 485.0
offset_top = 666.0 offset_top = 812.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 731.0 offset_bottom = 877.0
fname = "ДОУ-4" fname = "ДОУ-4"
rname = "A5" rname = "A5"
[node name="maa2000_A23" parent="." groups=["power_supply"] instance=ExtResource("2_xpo4b")] [node name="maa2000_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_xpo4b")]
layout_mode = 2 layout_mode = 2
offset_left = 47.0 offset_left = 8.0
offset_top = 731.0 offset_top = 877.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 803.0 offset_bottom = 949.0
fname = "MAA2000" fname = "MAA2000"
rname = "A23" rname = "A23"
metadata/ip = "maa2000_2" metadata/ip = "maa2000_2"
[node name="dou5_A6" parent="." groups=["default_reset"] instance=ExtResource("2_xpo4b")] [node name="dou5_A6" parent="." groups=["default_reset"] instance=ExtResource("2_xpo4b")]
layout_mode = 2 layout_mode = 2
offset_left = 47.0 offset_left = 8.0
offset_top = 666.0 offset_top = 812.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 731.0 offset_bottom = 877.0
fname = "ДОУ-5" fname = "ДОУ-5"
rname = "A6" rname = "A6"
[node name="ref_ZZ3" type="NinePatchRect" parent="."] [node name="ref_ZZ3" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 666.0 offset_top = 812.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 803.0 offset_bottom = 949.0
texture = ExtResource("3_wyy1b") texture = ExtResource("3_wyy1b")
patch_margin_left = 16 patch_margin_left = 16
patch_margin_top = 16 patch_margin_top = 16
@@ -103,98 +80,27 @@ text = "Панель
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="kasseta_U5" type="NinePatchRect" parent="."] [node name="kasseta_U5" parent="." instance=ExtResource("4_gl2bl")]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 96.0 offset_top = 242.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 286.0 offset_bottom = 432.0
texture = ExtResource("3_wyy1b")
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
script = ExtResource("6_os4mt")
[node name="lbl_fname" type="Label" parent="kasseta_U5"]
self_modulate = Color(1, 1, 1, 0.62)
layout_mode = 0
offset_left = 5.0
offset_top = 7.0
offset_right = 305.0
offset_bottom = 35.0
text = "Кассета У5"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ref_A24" parent="kasseta_U5" groups=["power_supply"] instance=ExtResource("7_38u2b")]
offset_left = 5.0
offset_top = 32.0
offset_right = 55.0
offset_bottom = 182.0
fname = "ИП5-25"
rname = "A24"
metadata/ip = "ip5_25"
[node name="ref_A30" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_38u2b")]
offset_left = 55.0
offset_top = 32.0
offset_right = 105.0
offset_bottom = 182.0
fname = "ЯУ-07Б"
rname = "A30"
metadata/y5 = "yau07"
[node name="ref_A26" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_38u2b")]
offset_left = 105.0
offset_top = 32.0
offset_right = 155.0
offset_bottom = 182.0
fname = "ЭМС-Г"
rname = "A26"
metadata/y5 = "ems"
[node name="ref_A27" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_38u2b")]
offset_left = 155.0
offset_top = 32.0
offset_right = 205.0
offset_bottom = 182.0
fname = "УГ"
rname = "A27"
metadata/y5 = "ug"
[node name="ref_A28" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_38u2b")]
offset_left = 205.0
offset_top = 32.0
offset_right = 255.0
offset_bottom = 182.0
fname = "УКП"
rname = "A28"
metadata/y5 = "ukp1"
[node name="ref_A29" parent="kasseta_U5" groups=["y-5"] instance=ExtResource("7_38u2b")]
offset_left = 254.0
offset_top = 32.0
offset_right = 304.0
offset_bottom = 182.0
fname = "УКП"
rname = "A29"
metadata/y5 = "ukp2"
[node name="kasseta_FS_VD" parent="." instance=ExtResource("5_nhd2k")] [node name="kasseta_FS_VD" parent="." instance=ExtResource("5_nhd2k")]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 286.0 offset_top = 432.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 476.0 offset_bottom = 622.0
fname = "Кассета ФС-ВД" fname = "Кассета ФС-ВД"
[node name="kasseta_P_1" type="NinePatchRect" parent="."] [node name="kasseta_P_1" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 214.0 offset_left = 175.0
offset_top = 476.0 offset_top = 622.0
offset_right = 524.0 offset_right = 485.0
offset_bottom = 666.0 offset_bottom = 812.0
texture = ExtResource("3_wyy1b") texture = ExtResource("3_wyy1b")
patch_margin_left = 16 patch_margin_left = 16
patch_margin_top = 16 patch_margin_top = 16
@@ -203,7 +109,7 @@ patch_margin_bottom = 16
script = ExtResource("6_os4mt") script = ExtResource("6_os4mt")
fname = "Кассета П-1В" fname = "Кассета П-1В"
[node name="ref_A19" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_38u2b")] [node name="ref_A19" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_38u2b")]
offset_left = 9.0 offset_left = 9.0
offset_top = 33.0 offset_top = 33.0
offset_right = 59.0 offset_right = 59.0
@@ -212,7 +118,7 @@ fname = "ИП9-50"
rname = "A19" rname = "A19"
metadata/ip = "ip9_50_1" metadata/ip = "ip9_50_1"
[node name="ref_A20" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_38u2b")] [node name="ref_A20" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_38u2b")]
offset_left = 59.0 offset_left = 59.0
offset_top = 33.0 offset_top = 33.0
offset_right = 109.0 offset_right = 109.0
@@ -221,7 +127,7 @@ fname = "ИП9-50"
rname = "A20" rname = "A20"
metadata/ip = "ip9_50_2" metadata/ip = "ip9_50_2"
[node name="ref_A21" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_38u2b")] [node name="ref_A21" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_38u2b")]
offset_left = 109.0 offset_left = 109.0
offset_top = 33.0 offset_top = 33.0
offset_right = 159.0 offset_right = 159.0
@@ -243,182 +149,153 @@ vertical_alignment = 1
[node name="um1535_A7" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A7" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 96.0 offset_top = 242.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 191.0 offset_bottom = 337.0
fname = "УМ1535А" fname = "УМ1535Б"
rname = "A7" rname = "A7"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_1" metadata/um = "um_1"
[node name="um1535_A8" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A8" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 191.0 offset_top = 337.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 286.0 offset_bottom = 432.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A8" rname = "A8"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_2" metadata/um = "um_2"
[node name="um1535_A9" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A9" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 286.0 offset_top = 432.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 381.0 offset_bottom = 527.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A9" rname = "A9"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_3" metadata/um = "um_3"
[node name="um1535_A10" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A10" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 381.0 offset_top = 527.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 476.0 offset_bottom = 622.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A10" rname = "A10"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_4" metadata/um = "um_4"
[node name="um1535_A11" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A11" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 476.0 offset_top = 622.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 571.0 offset_bottom = 717.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A11" rname = "A11"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_5" metadata/um = "um_5"
[node name="um1535_A12" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A12" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 524.0 offset_left = 485.0
offset_top = 571.0 offset_top = 717.0
offset_right = 691.0 offset_right = 652.0
offset_bottom = 666.0 offset_bottom = 812.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A12" rname = "A12"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_6" metadata/um = "um_6"
[node name="um1535_A13" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A13" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 96.0 offset_top = 242.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 191.0 offset_bottom = 337.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A13" rname = "A13"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_9" metadata/um = "um_7"
[node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A14" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 191.0 offset_top = 337.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 286.0 offset_bottom = 432.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A14" rname = "A14"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_10" metadata/um = "um_8"
[node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A15" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 286.0 offset_top = 432.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 381.0 offset_bottom = 527.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A15" rname = "A15"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_11" metadata/um = "um_9"
[node name="um1535_A16" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A16" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 381.0 offset_top = 527.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 476.0 offset_bottom = 622.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A16" rname = "A16"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_12" metadata/um = "um_10"
[node name="um1535_A17" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A17" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 476.0 offset_top = 622.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 571.0 offset_bottom = 717.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A17" rname = "A17"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_13" metadata/um = "um_11"
[node name="um1535_A18" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")] [node name="um1535_A18" parent="." groups=["power_amplifier"] instance=ExtResource("8_4e87c")]
layout_mode = 0 layout_mode = 0
offset_left = 47.0 offset_left = 8.0
offset_top = 571.0 offset_top = 717.0
offset_right = 214.0 offset_right = 175.0
offset_bottom = 666.0 offset_bottom = 812.0
fname = "УМ1535А" fname = "УМ1535А"
rname = "A18" rname = "A18"
value0_info = "Мощность" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_14" metadata/um = "um_12"
[node name="input_0" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(496, 440)
sprite_frames = SubResource("SpriteFrames_s5gcy")
[node name="input_1" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(248, 440)
sprite_frames = SubResource("SpriteFrames_s5gcy")
[node name="output_0" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(496, 336)
sprite_frames = SubResource("SpriteFrames_s5gcy")
[node name="output_1" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(248, 336)
sprite_frames = SubResource("SpriteFrames_s5gcy")
[node name="line" type="Line2D" parent="."]
position = Vector2(59, 920)
scale = Vector2(1.03548, 1)
points = PackedVector2Array(-8, 0, 61.8069, 0, 608, 0)
width = 2.0
default_color = Color(1, 1, 1, 0.352941)
metadata/_edit_lock_ = true
[node name="control_result" type="Label" parent="."] [node name="control_result" type="Label" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 49.0 offset_left = 9.0
offset_top = 993.0 offset_top = 960.0
offset_right = 689.0 offset_right = 649.0
offset_bottom = 1036.0 offset_bottom = 1003.0
theme_override_font_sizes/font_size = 22
horizontal_alignment = 1 horizontal_alignment = 1
metadata/_edit_lock_ = true metadata/_edit_lock_ = true

View File

@@ -100,7 +100,7 @@ func status_uf() -> void:
$lbl_header2.text = 'Прибор исправен' $lbl_header2.text = 'Прибор исправен'
$lbl_header2.modulate = Color.GREEN $lbl_header2.modulate = Color.GREEN
else: else:
$lbl_header2.text = 'Прибор неисправен' $lbl_header2.text = 'Прибор не исправен'
$lbl_header2.modulate = Color.RED $lbl_header2.modulate = Color.RED
$lbl_header2.visible = true $lbl_header2.visible = true

View File

@@ -7,16 +7,14 @@
[node name="pribor_uf" type="Control"] [node name="pribor_uf" type="Control"]
layout_mode = 3 layout_mode = 3
anchors_preset = 0 anchors_preset = 0
offset_left = -121.0
offset_right = -121.0
script = ExtResource("1_7gtpa") script = ExtResource("1_7gtpa")
[node name="ref_uf" type="NinePatchRect" parent="."] [node name="ref_uf" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 244.0 offset_left = 187.0
offset_top = 128.0 offset_top = 247.0
offset_right = 765.0 offset_right = 708.0
offset_bottom = 836.0 offset_bottom = 955.0
texture = ExtResource("2_ho0da") texture = ExtResource("2_ho0da")
patch_margin_left = 16 patch_margin_left = 16
patch_margin_top = 16 patch_margin_top = 16
@@ -144,25 +142,19 @@ offset_bottom = 35.0
text = "Кассета В-13" text = "Кассета В-13"
[node name="lbl_header2" type="Label" parent="."] [node name="lbl_header2" type="Label" parent="."]
visible = false
layout_mode = 0 layout_mode = 0
offset_left = 252.0 offset_left = 199.0
offset_top = 1009.0 offset_top = 974.0
offset_right = 757.0 offset_right = 704.0
offset_bottom = 1064.0 offset_bottom = 1000.0
theme_override_font_sizes/font_size = 22 theme_override_font_sizes/font_size = 22
text = "Состояние неизвестно..." text = "Прибор не исправен
"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="timer" type="Timer" parent="."] [node name="timer" type="Timer" parent="."]
autostart = true autostart = true
[node name="line" type="Line2D" parent="."]
position = Vector2(195, 950)
scale = Vector2(1.03548, 1)
points = PackedVector2Array(-8, 0, 61.8069, 0, 608, 0)
width = 2.0
default_color = Color(1, 1, 1, 0.352941)
metadata/_edit_lock_ = true
[connection signal="timeout" from="timer" to="." method="on_timer" binds= [&"уарэп-эмс"]] [connection signal="timeout" from="timer" to="." method="on_timer" binds= [&"уарэп-эмс"]]

View File

@@ -17,10 +17,10 @@ script = ExtResource("1_46rp6")
[node name="ref_G1" type="NinePatchRect" parent="."] [node name="ref_G1" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 88.0 offset_left = 70.0
offset_top = 128.0 offset_top = 303.0
offset_right = 678.0 offset_right = 660.0
offset_bottom = 910.0 offset_bottom = 1085.0
texture = ExtResource("1_6olof") texture = ExtResource("1_6olof")
patch_margin_left = 16 patch_margin_left = 16
patch_margin_top = 16 patch_margin_top = 16
@@ -29,10 +29,10 @@ patch_margin_bottom = 16
[node name="spt25_A1" parent="." instance=ExtResource("6_60xs3")] [node name="spt25_A1" parent="." instance=ExtResource("6_60xs3")]
layout_mode = 0 layout_mode = 0
offset_left = 106.0 offset_left = 88.0
offset_top = 144.0 offset_top = 319.0
offset_right = 361.0 offset_right = 343.0
offset_bottom = 574.0 offset_bottom = 749.0
tooltip_text = "Ящик - 11, Позиция - 3" tooltip_text = "Ящик - 11, Позиция - 3"
script = ExtResource("4_v0lil") script = ExtResource("4_v0lil")
unit_name = "уарэп-спт25-1" unit_name = "уарэп-спт25-1"
@@ -64,10 +64,10 @@ offset_bottom = 417.0
[node name="spt25_A2" parent="." instance=ExtResource("6_60xs3")] [node name="spt25_A2" parent="." instance=ExtResource("6_60xs3")]
layout_mode = 0 layout_mode = 0
offset_left = 410.0 offset_left = 392.0
offset_top = 145.0 offset_top = 320.0
offset_right = 660.0 offset_right = 642.0
offset_bottom = 575.0 offset_bottom = 750.0
tooltip_text = "Ящик - 11, Позиция - 2" tooltip_text = "Ящик - 11, Позиция - 2"
script = ExtResource("4_v0lil") script = ExtResource("4_v0lil")
unit_name = "уарэп-спт25-2" unit_name = "уарэп-спт25-2"
@@ -98,10 +98,10 @@ offset_right = 235.0
offset_bottom = 417.0 offset_bottom = 417.0
[node name="sch3" parent="." instance=ExtResource("7_qu7ja")] [node name="sch3" parent="." instance=ExtResource("7_qu7ja")]
offset_left = 106.0 offset_left = 88.0
offset_top = 599.0 offset_top = 774.0
offset_right = 661.0 offset_right = 643.0
offset_bottom = 884.0 offset_bottom = 1059.0
unit_name = "уарэп-щ3" unit_name = "уарэп-щ3"
fname = "Щ3 (контроль и управление питанием)" fname = "Щ3 (контроль и управление питанием)"
rname = "A1" rname = "A1"

View File

@@ -4,7 +4,7 @@ const STATUS_GOOD := {"text": "Исправно", "color": Color.GREEN, "font_co
const STATUS_BAD := {"text": "Отказ", "color": Color.RED, "font_color": Color.WHITE} const STATUS_BAD := {"text": "Отказ", "color": Color.RED, "font_color": Color.WHITE}
var _is_uf_status_initialized: bool = false var _is_uf_status_initialized: bool = false
var is_prd_operational: bool = true var is_prd_operational: bool = true
var is_uf_operational: bool = true var is_uf_operational: bool = false
func _ready() -> void: func _ready() -> void:

View File

@@ -79,10 +79,25 @@ visible = false
layout_mode = 2 layout_mode = 2
metadata/_tab_index = 5 metadata/_tab_index = 5
[node name="lbl_ready" type="Label" parent="."]
layout_mode = 0
offset_left = 1503.0
offset_right = 1600.0
offset_bottom = 27.0
tooltip_text = "Готовность аппаратуры к работе"
mouse_filter = 0
theme_override_font_sizes/font_size = 14
theme_override_styles/normal = SubResource("StyleBoxFlat_o1r22")
text = "Нет связи"
horizontal_alignment = 1
vertical_alignment = 1
script = ExtResource("8_tidwt")
metadata/_edit_lock_ = true
[node name="remote_control" type="Label" parent="."] [node name="remote_control" type="Label" parent="."]
layout_mode = 2 layout_mode = 2
offset_left = 1242.0 offset_left = 1244.0
offset_right = 1402.0 offset_right = 1401.0
offset_bottom = 27.0 offset_bottom = 27.0
tooltip_text = "Комплекс находится под внешним управлением" tooltip_text = "Комплекс находится под внешним управлением"
mouse_filter = 0 mouse_filter = 0
@@ -94,7 +109,7 @@ vertical_alignment = 1
[node name="тренаж_режим" type="Button" parent="."] [node name="тренаж_режим" type="Button" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 1405.0 offset_left = 1404.0
offset_right = 1501.0 offset_right = 1501.0
offset_bottom = 27.0 offset_bottom = 27.0
tooltip_text = "Задействовать режим Тренаж" tooltip_text = "Задействовать режим Тренаж"
@@ -110,20 +125,5 @@ toggle_mode = true
text = "Тренаж" text = "Тренаж"
script = ExtResource("9_41d34") script = ExtResource("9_41d34")
[node name="lbl_ready" type="Label" parent="."]
layout_mode = 0
offset_left = 1504.0
offset_right = 1600.0
offset_bottom = 27.0
tooltip_text = "Готовность аппаратуры к работе"
mouse_filter = 0
theme_override_font_sizes/font_size = 14
theme_override_styles/normal = SubResource("StyleBoxFlat_o1r22")
text = "Нет связи"
horizontal_alignment = 1
vertical_alignment = 1
script = ExtResource("8_tidwt")
metadata/_edit_lock_ = true
[connection signal="tab_changed" from="tab_switch" to="tab_switch" method="_on_tab_changed"] [connection signal="tab_changed" from="tab_switch" to="tab_switch" method="_on_tab_changed"]
[connection signal="toggled" from="тренаж_режим" to="tab_switch" method="_on_button_trenazh_toggled"] [connection signal="toggled" from="тренаж_режим" to="tab_switch" method="_on_button_trenaj_toggled"]

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://ce5mtxqd1ndru"] [gd_scene load_steps=2 format=3 uid="uid://ce5mtxqd1ndru"]
[ext_resource type="Texture2D" uid="uid://cgqo5gucd2be0" path="res://scenes/tilemap/dot.png" id="2_rq0y0"] [ext_resource type="Texture2D" uid="uid://cgqo5gucd2be0" path="res://data/dot.png" id="2_rq0y0"]
[node name="rect" type="TextureRect"] [node name="rect" type="TextureRect"]
offset_left = -16.0 offset_left = -16.0

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://c2523fcn14gn4"] [gd_scene load_steps=2 format=3 uid="uid://c2523fcn14gn4"]
[ext_resource type="Texture2D" uid="uid://cj1f2uy6qfvki" path="res://scenes/tilemap/23900.png" id="1_v0nwa"] [ext_resource type="Texture2D" uid="uid://cj1f2uy6qfvki" path="res://data/23900.png" id="1_v0nwa"]
[node name="23900" type="Sprite2D"] [node name="23900" type="Sprite2D"]
scale = Vector2(0.496934, 0.496934) scale = Vector2(0.496934, 0.496934)

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://cv342kc1jj5hb"] [gd_scene load_steps=2 format=3 uid="uid://cv342kc1jj5hb"]
[ext_resource type="Texture2D" uid="uid://mobingoxskg1" path="res://scenes/tilemap/threat.png" id="1_pvxsy"] [ext_resource type="Texture2D" uid="uid://mobingoxskg1" path="res://data/threat.png" id="1_pvxsy"]
[node name="Threat" type="Sprite2D"] [node name="Threat" type="Sprite2D"]
scale = Vector2(0.0244268, 0.0244268) scale = Vector2(0.0244268, 0.0244268)

View File

@@ -373,7 +373,7 @@ func _process(delta) -> void:
remove_child(req) remove_child(req)
req.queue_free() req.queue_free()
_req_count -= 1 _req_count -= 1
push_error('запрос \"%s\" не отправлен' % tile.url) #TODO: For Deugs push_error('запрос \"%s\" не отправлен' % tile.url)
if _queue.is_empty(): if _queue.is_empty():
emit_signal('load_completed') emit_signal('load_completed')
@@ -727,7 +727,7 @@ func blend_mask(val: bool) -> void:
func update_coordinates_label(lon: float, lat: float) -> void: func update_coordinates_label(lon: float, lat: float) -> void:
coordinates_label = 'Координаты:\nNS:%f\nEW:%f' % [lat, lon] coordinates_label = 'Координаты: NS:%f, EW:%f' % [lat, lon]
signaller.emit_signal('update_coordinates_map', coordinates_label) signaller.emit_signal('update_coordinates_map', coordinates_label)

View File

@@ -35,7 +35,7 @@ signal pressed(control: PanelContainer)
if not is_inside_tree(): if not is_inside_tree():
return return
$margin/vbox/grid1/level7.value = v $margin/vbox/grid1/level7.value = v
$margin/vbox/grid1/level7.tint_progress = Color.RED if v >= 50 else Color.GOLD if v >= 40 else Color.WHITE $margin/vbox/grid1/level7.tint_progress = Color.RED if v > 70 else Color.WHITE
@export var min_value0: float: @export var min_value0: float:
@@ -191,8 +191,8 @@ func _enter_tree_defered():
$margin/vbox/grid0/rname.text = rname $margin/vbox/grid0/rname.text = rname
$margin/vbox/grid0/fname.text = fname $margin/vbox/grid0/fname.text = fname
$margin/vbox/grid0/state.texture = textures[state] $margin/vbox/grid0/state.texture = textures[state]
#else: else:
#push_warning('обращение к %s вне дерева' % self) TODO: пишеться только когда заходишь в проект а дальше не используется push_warning('обращение к %s вне дерева' % self)
func get_level_nodes() -> Array: func get_level_nodes() -> Array:
@@ -273,9 +273,10 @@ theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u")
script = SubResource("GDScript_oj3k3") script = SubResource("GDScript_oj3k3")
textures = [ExtResource("1_n1aqt"), ExtResource("2_rim3u"), ExtResource("3_3w8fg")] textures = [ExtResource("1_n1aqt"), ExtResource("2_rim3u"), ExtResource("3_3w8fg")]
value0 = [20.0, 30.0, 40.0, 50.0, 60.0, 70.0] value0 = [20.0, 30.0, 40.0, 50.0, 60.0, 70.0]
min_value1 = -40.0 value1 = 56.0
max_value0 = 1400.0 min_value1 = -50.0
max_value1 = 55.0 max_value0 = 100.0
max_value1 = 120.0
step0 = 1.0 step0 = 1.0
step1 = 1.0 step1 = 1.0
value_name0 = "P,%" value_name0 = "P,%"
@@ -475,11 +476,12 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = " tooltip_text = "
Текущее: 0.00 Текущее: 56.00
Диапазон: -40.00…60.00" Диапазон: -50.00…120.00"
mouse_filter = 0 mouse_filter = 0
min_value = -40.0 min_value = -50.0
max_value = 55.0 max_value = 120.0
value = 56.0
fill_mode = 3 fill_mode = 3
nine_patch_stretch = true nine_patch_stretch = true
stretch_margin_left = 8 stretch_margin_left = 8

View File

@@ -14,7 +14,7 @@ patch_margin_right = 16
patch_margin_bottom = 16 patch_margin_bottom = 16
script = ExtResource("2_mdnod") script = ExtResource("2_mdnod")
[node name="ref_A26" parent="." groups=["power_supply"] instance=ExtResource("3_4a27g")] [node name="ref_A26" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("3_4a27g")]
offset_left = 10.0 offset_left = 10.0
offset_top = 30.0 offset_top = 30.0
offset_right = 60.0 offset_right = 60.0
@@ -23,7 +23,7 @@ fname = "ИП9-50"
rname = "A22" rname = "A22"
metadata/ip = "ip9_50_3" metadata/ip = "ip9_50_3"
[node name="ref_A23" parent="." groups=["power_supply"] instance=ExtResource("3_4a27g")] [node name="ref_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("3_4a27g")]
offset_left = 60.0 offset_left = 60.0
offset_top = 30.0 offset_top = 30.0
offset_right = 110.0 offset_right = 110.0
@@ -35,10 +35,9 @@ metadata/ip = "ip12_50_2"
[node name="lbl_fname" type="Label" parent="."] [node name="lbl_fname" type="Label" parent="."]
self_modulate = Color(1, 1, 1, 0.62) self_modulate = Color(1, 1, 1, 0.62)
layout_mode = 0 layout_mode = 0
offset_left = 8.0 offset_left = 5.0
offset_top = 5.0 offset_top = 5.0
offset_right = 112.0 offset_right = 105.0
offset_bottom = 30.0 offset_bottom = 30.0
text = "Касета П-2"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1

View File

@@ -31,7 +31,7 @@ offset_top = 32.0
offset_right = 55.0 offset_right = 55.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "ИП5-25" fname = "ИП5-25"
rname = "A31" rname = "A24"
metadata/ip = "ip5_25" metadata/ip = "ip5_25"
[node name="ref_A30" parent="." groups=["y-5"] instance=ExtResource("3_picsk")] [node name="ref_A30" parent="." groups=["y-5"] instance=ExtResource("3_picsk")]
@@ -40,7 +40,7 @@ offset_top = 32.0
offset_right = 105.0 offset_right = 105.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "ЯУ-07Б" fname = "ЯУ-07Б"
rname = "A37" rname = "A30"
metadata/y5 = "yau07" metadata/y5 = "yau07"
[node name="ref_A26" parent="." groups=["y-5"] instance=ExtResource("3_picsk")] [node name="ref_A26" parent="." groups=["y-5"] instance=ExtResource("3_picsk")]
@@ -49,7 +49,7 @@ offset_top = 32.0
offset_right = 155.0 offset_right = 155.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "ЭМС-Г" fname = "ЭМС-Г"
rname = "A33" rname = "A26"
metadata/y5 = "ems" metadata/y5 = "ems"
[node name="ref_A27" parent="." groups=["y-5"] instance=ExtResource("3_picsk")] [node name="ref_A27" parent="." groups=["y-5"] instance=ExtResource("3_picsk")]
@@ -58,7 +58,7 @@ offset_top = 32.0
offset_right = 205.0 offset_right = 205.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "УГ" fname = "УГ"
rname = "A34" rname = "A27"
metadata/y5 = "ug" metadata/y5 = "ug"
[node name="ref_A28" parent="." groups=["y-5"] instance=ExtResource("3_picsk")] [node name="ref_A28" parent="." groups=["y-5"] instance=ExtResource("3_picsk")]
@@ -67,7 +67,7 @@ offset_top = 32.0
offset_right = 255.0 offset_right = 255.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "УКП" fname = "УКП"
rname = "A36" rname = "A28"
metadata/y5 = "ukp1" metadata/y5 = "ukp1"
[node name="ref_A29" parent="." groups=["y-5"] instance=ExtResource("3_picsk")] [node name="ref_A29" parent="." groups=["y-5"] instance=ExtResource("3_picsk")]
@@ -76,5 +76,5 @@ offset_top = 32.0
offset_right = 304.0 offset_right = 304.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "УКП" fname = "УКП"
rname = "A35" rname = "A29"
metadata/y5 = "ukp2" metadata/y5 = "ukp2"

View File

@@ -1,85 +1,39 @@
@tool @tool
extends TextureButton extends TextureButton
@onready var tween: Tween
@export var state_colors: Array @export var state_colors: Array
func _on_toggled(toggled_on): $frame.visible = toggled_on
func _ready():
toggle_mode = true
focus_mode = Control.FOCUS_ALL
connect("focus_entered", _on_focus_entered)
connect("focus_exited", _on_focus_exited)
func _enter_tree() -> void: func _enter_tree() -> void:
if has_node("label"): $label.self_modulate = state_colors[state]
$label.self_modulate = state_colors[state] ProjectSettings.connect('settings_changed', _on_settings_changed)
func update_progress_bar(target_value) -> void: func _exit_tree() -> void:
if tween: ProjectSettings.disconnect('settings_changed', _on_settings_changed)
tween.kill()
tween = create_tween()
tween.tween_property($control_progress, "value", target_value, 0.3)
func _on_toggled(toggled_on): func _on_settings_changed():
if has_node("frame"): if not is_inside_tree(): return
$frame.visible = toggled_on var white_color = ProjectSettings.get_setting('Схема прибора. Белый цвет', Color.DIM_GRAY)
var black_color = ProjectSettings.get_setting('Схема прибора. Чёрный цвет', Color.CORAL)
$pic_functional.material.set('shader_parameter/white', white_color)
func _on_focus_entered(): $pic_functional.material.set('shader_parameter/black', black_color)
button_pressed = true
#enter_press() TODO: Пока что без выбора прибора
func _on_focus_exited():
pass
func enter_press():
var enter_event = InputEventAction.new()
enter_event.action = "ui_accept"
enter_event.pressed = true
Input.parse_input_event(enter_event)
@export var state: int: @export var state: int:
set(v): set(v):
v = 0 if v < 0 else v % state_colors.size() v = 0 if v < 0 else v % state_colors.size()
state = v state = v
if is_inside_tree() and has_node("label"): if is_inside_tree():
$label.self_modulate = state_colors[v] $label.self_modulate = state_colors[v]
@export var progress_value: float = 0.0: @export var show_functional: bool:
set(v): set(v):
progress_value = v show_functional = v
if is_inside_tree(): if is_inside_tree():
update_progress_bar(v) $pic_functional.visible = v
var max_val = $control_progress.get('max_value')
var percentage = (v / max_val) * 100.0
$control_progress.tooltip_text = 'Процесс контроля %01d%%' % percentage
@export var progress_visible: bool:
set(v):
progress_visible = v
if is_inside_tree():
$control_progress.visible = v
@export var progress_max_value: int:
set(v):
progress_max_value = v
if is_inside_tree():
$control_progress.max_value = v
@export var progress_min_value: int:
set(v):
progress_min_value = v
if is_inside_tree():
$control_progress.min_value = v

File diff suppressed because it is too large Load Diff

View File

@@ -9,6 +9,7 @@ script/source = "class_name configure extends Panel
const TableHeader = preload('res://table/header.tscn') const TableHeader = preload('res://table/header.tscn')
const TableToggle = preload('res://table/settings-toggle.tscn') const TableToggle = preload('res://table/settings-toggle.tscn')
const TableEdit = preload('res://table/ячейка-2.tscn') const TableEdit = preload('res://table/ячейка-2.tscn')
const TableColor = preload('res://table/color-picker.tscn')
const ALIGNMENT = [HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER] const ALIGNMENT = [HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER]
const HEADER_ROW = [TableHeader, TableHeader] const HEADER_ROW = [TableHeader, TableHeader]
@@ -35,7 +36,6 @@ const SETTING_TABLE = [
['Кнопка «Подавление»', TableEdit, TableToggle, 'Разрешить отображение кнопки'], ['Кнопка «Подавление»', TableEdit, TableToggle, 'Разрешить отображение кнопки'],
['Виртуальная клавиатура', TableEdit, TableToggle, 'Включить отображение экранной клавиатуры'], ['Виртуальная клавиатура', TableEdit, TableToggle, 'Включить отображение экранной клавиатуры'],
['Скрыть вкладку ЭМС 2', TableEdit, TableToggle, 'Отображать вкладку \\\"ЭМС-2\\\"'], ['Скрыть вкладку ЭМС 2', TableEdit, TableToggle, 'Отображать вкладку \\\"ЭМС-2\\\"'],
['Отладка контроля', TableEdit, TableToggle, 'Отображать отладку контроля'],
['Текущая версия ПО УАРЭП', TableEdit, TableEdit, 'Время сборки, версия и номер фиксации'], ['Текущая версия ПО УАРЭП', TableEdit, TableEdit, 'Время сборки, версия и номер фиксации'],
['уарэп-яу07-частный', TableEdit, TableEdit, 'IP-адрес для получения частных сообщений от ЯУ-07'], ['уарэп-яу07-частный', TableEdit, TableEdit, 'IP-адрес для получения частных сообщений от ЯУ-07'],
['уарэп-яу07-общий', TableEdit, TableEdit, 'IP-адрес для получения широковещательных сообщений от ЯУ-07'], ['уарэп-яу07-общий', TableEdit, TableEdit, 'IP-адрес для получения широковещательных сообщений от ЯУ-07'],
@@ -67,16 +67,17 @@ const SETTING_TABLE = [
['Период опроса состояния АФСП, секунды', TableEdit, TableEdit, 'Время в секундах' ], ['Период опроса состояния АФСП, секунды', TableEdit, TableEdit, 'Время в секундах' ],
['уарэп-трасса', TableEdit, TableEdit, 'IP-адрес для связи с Трассой [<адрес этого узла>, <адрес удалённого узла>, <порт этого узла>, <порт удалённого узла>]'], ['уарэп-трасса', TableEdit, TableEdit, 'IP-адрес для связи с Трассой [<адрес этого узла>, <адрес удалённого узла>, <порт этого узла>, <порт удалённого узла>]'],
['Включить работу по своим целям', TableEdit, TableToggle, 'Разрешает работу в секторе со своей целью'], ['Включить работу по своим целям', TableEdit, TableToggle, 'Разрешает работу в секторе со своей целью'],
['Список своих протоколов', TableEdit, TableEdit, 'Список протоколов целей, по которым запрещено работать' ], ] ['Список своих протоколов', TableEdit, TableEdit, 'Список протоколов целей, по которым запрещено работать' ],
['Схема прибора. Белый цвет', TableEdit, TableColor, 'Настройка отображаемого цвета фона' ],
['Схема прибора. Чёрный цвет', TableEdit, TableColor, 'Настройка отображаемого цвета схемы' ], ]
const EXTERNAL_CU = 16 ## Внешнее целеуказание const EXTERNAL_CU = 16 ## Внешнее целеуказание
const TRASSA = 17 const TRASSA = 17
const SUPPRESS = 18 ## Строка - Подавление const SUPPRESS = 18 ## Строка - Подавление
const KEYBOARD = 19 ## Строка - Виртуальная клавиатура const KEYBOARD = 19 ## Строка - Виртуальная клавиатура
const HIDE_EMS2 = 20 ## Строка - Скрыть вкладку ЭМС 2 const HIDE_EMS2 = 20 ## Строка - Скрыть вкладку ЭМС 2
const DEBAG_CONTROL = 21## Строка - Отладка контроля const COMMIT = 21 ## Строка - Версия УАРЭП
const COMMIT = 22 ## Строка - Версия УАРЭП const GOS_BTN = 51 ## Разрешить работу по своим целям
const GOS_BTN = 52 ## Разрешить работу по своим целям
var name_to_line_index: = {} ## Для преобразования названия параметра в номер строки var name_to_line_index: = {} ## Для преобразования названия параметра в номер строки
@@ -116,11 +117,6 @@ func on_ems2_pressed(btn) -> void:
signaller.emit_signal('ems2_hide_pressed', state) signaller.emit_signal('ems2_hide_pressed', state)
func on_debag_control_pressed(btn) -> void:
var state = btn.button_pressed
signaller.emit_signal(\"debag_control_pressed\", state)
func on_row_pressed(i_row: int): func on_row_pressed(i_row: int):
$scroll_set/table.clear_rows_selected() $scroll_set/table.clear_rows_selected()
$scroll_set/table.set_row_selected(i_row, true) $scroll_set/table.set_row_selected(i_row, true)
@@ -238,10 +234,6 @@ func button_settings():
on_ems2_pressed(ems2_hide_node) on_ems2_pressed(ems2_hide_node)
var gos_node = $scroll_set/table.get_node2(1, GOS_BTN).get_children()[0] var gos_node = $scroll_set/table.get_node2(1, GOS_BTN).get_children()[0]
gos_node.connect('pressed', on_gos_pressed.bind(gos_node)) gos_node.connect('pressed', on_gos_pressed.bind(gos_node))
var debag_control = $scroll_set/table.get_node2(1, DEBAG_CONTROL).get_children()[0]
debag_control.connect('pressed', on_debag_control_pressed.bind(debag_control))
debag_control.set_pressed(false)
on_debag_control_pressed(debag_control)
func _on_btn_save_settings_pressed(): func _on_btn_save_settings_pressed():

View File

@@ -56,6 +56,7 @@ var fs_selected: Dictionary ## Словарь выбранных сектор
var fs_active: Dictionary ## Словарь секторов назначенных на подавление var fs_active: Dictionary ## Словарь секторов назначенных на подавление
var fs_emit: Dictionary ## Словарь секторов назначенных на подавление var fs_emit: Dictionary ## Словарь секторов назначенных на подавление
var fs_closed: Dictionary ## Словарь для секторов запрета var fs_closed: Dictionary ## Словарь для секторов запрета
var fs_failed: Array ## Индикация сломанных секторов (модули ФС). AntBandState.ANT_BAND_READY - исправен, AntBandState.ANT_BAND_FAILURE - сломан.
## Состояние перетаскивания. ## Состояние перетаскивания.
enum DragFSM { enum DragFSM {
@@ -79,6 +80,11 @@ enum MapViewMode {
} }
enum AntBandState {
ANT_BAND_READY = 1,
ANT_BAND_FAILED = 0
}
const VAL_TO_EVENT = { const VAL_TO_EVENT = {
false: 'manual_control', ## Выбор целей и установка помех вручную. false: 'manual_control', ## Выбор целей и установка помех вручную.
true: 'full_auto' } ## Выбор целей и установка помех автоматически. true: 'full_auto' } ## Выбор целей и установка помех автоматически.
@@ -92,6 +98,12 @@ func on_threat_selected(th, ecm_btns): on_rto_threat_sel(th.id, ecm_btns)
func on_enter_tree() -> void: call_deferred('on_button_strobe_pressed') func on_enter_tree() -> void: call_deferred('on_button_strobe_pressed')
func clear_all_klaster(): $canvas.clear_all_seczap()
func on_user_panning(): $btn_center.button_pressed = false
func on_settings_changed(): func on_settings_changed():
gos_flag = ProjectSettings.get_setting('application/config/Включить работу по своим целям', true) gos_flag = ProjectSettings.get_setting('application/config/Включить работу по своим целям', true)
color_emit = ProjectSettings.get_setting('application/interfer/emit_color', Color(0.58, 0.47, 0.51, 1.0)) color_emit = ProjectSettings.get_setting('application/interfer/emit_color', Color(0.58, 0.47, 0.51, 1.0))
@@ -144,10 +156,18 @@ func _exit_tree() -> void:
timer1.queue_free() timer1.queue_free()
func init_fs_failed():
var sectors_count = $canvas.fs_default_colors.size()
fs_failed.resize(sectors_count)
for i in fs_failed.size():
fs_failed[i] = AntBandState.ANT_BAND_READY
## Производит инициализацию. ## Производит инициализацию.
func _ready(): func _ready():
ProjectSettings.connect('settings_changed', on_settings_changed) ProjectSettings.connect('settings_changed', on_settings_changed)
on_settings_changed() on_settings_changed()
init_fs_failed()
min_zoom = ProjectSettings.get_setting('application/config/map_minimum_zoom', 5) min_zoom = ProjectSettings.get_setting('application/config/map_minimum_zoom', 5)
max_zoom = ProjectSettings.get_setting('application/config/map_maximum_zoom', 19) max_zoom = ProjectSettings.get_setting('application/config/map_maximum_zoom', 19)
drag_fsm = DragFSM.OFF drag_fsm = DragFSM.OFF
@@ -188,16 +208,13 @@ func _ready():
func sector_klaster(sector_data): func sector_klaster(sector_data):
if sector_data["draw"]: if sector_data['draw']:
var rect: Rect2 = sector_data["rect"] var rect: Rect2 = sector_data['rect']
var color: Color = sector_data["color"] var color: Color = sector_data['color']
var id: int = sector_data["index"] var id: int = sector_data['index']
$canvas.add_seczap(id, Vector4(rect.position.x, rect.position.y, rect.size.x, rect.size.y)) $canvas.add_seczap(id, Vector4(rect.position.x, rect.position.y, rect.size.x, rect.size.y))
$canvas.set_seczap_color(id, color) $canvas.set_seczap_color(id, color)
else:
pass
func clear_all_klaster(): $canvas.clear_all_seczap()
func on_navi_data_received(data: Dictionary): func on_navi_data_received(data: Dictionary):
var k = data.get('k', 0.0) var k = data.get('k', 0.0)
@@ -205,10 +222,6 @@ func on_navi_data_received(data: Dictionary):
course = k course = k
func on_user_panning():
$btn_center.button_pressed = false
func on_chk_interfer_prinuditelno(_interfer_sectors): func on_chk_interfer_prinuditelno(_interfer_sectors):
$chk_auto.set_pressed_no_signal(false) $chk_auto.set_pressed_no_signal(false)
on_value_changed(false) on_value_changed(false)
@@ -522,6 +535,7 @@ func update_fs_colors():
else: else:
fs_colors[key] = color_select fs_colors[key] = color_select
$canvas.set_band_colors(fs_colors) $canvas.set_band_colors(fs_colors)
$canvas.set_band_failures(fs_failed)
if fs_emit.size(): if fs_emit.size():
if $btn_activate.pressed: if $btn_activate.pressed:
$btn_activate.self_modulate = Color.RED $btn_activate.self_modulate = Color.RED
@@ -564,7 +578,7 @@ func set_btns_disabled(value: bool, btn):
btn.set_disabled(value) btn.set_disabled(value)
func on_interfer_prinuditelno(prenuditelno_sectors, btns): func on_interfer_prinuditelno (prenuditelno_sectors, btns):
for key in prenuditelno_sectors: for key in prenuditelno_sectors:
var sectors = [] var sectors = []
for sector in prenuditelno_sectors[key]: for sector in prenuditelno_sectors[key]:
@@ -577,8 +591,9 @@ func on_interfer_prinuditelno(prenuditelno_sectors, btns):
## Вызывается при получении информации о состоянии модулей ФС от КАПС РПБ. ## Вызывается при получении информации о состоянии модулей ФС от КАПС РПБ.
func on_fs_update_state(_fs_dict: Dictionary): func on_fs_update_state(fs_dict: Dictionary):
pass for key in fs_dict.keys():
fs_failed[key] = fs_dict[key].isg
func on_btn_center_toggled(toggled_on: bool) -> void: func on_btn_center_toggled(toggled_on: bool) -> void:

View File

@@ -306,18 +306,18 @@ vertical_alignment = 1
[node name="coordinates_map" type="Label" parent="."] [node name="coordinates_map" type="Label" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 999.0 offset_left = 660.0
offset_top = 128.0 offset_top = -24.0
offset_right = 1111.0 offset_right = 772.0
offset_bottom = 147.0 offset_bottom = -5.0
text = "Координаты:" text = "Координаты:"
[node name="scale_map" type="Label" parent="."] [node name="scale_map" type="Label" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 999.0 offset_left = 1003.0
offset_top = 202.0 offset_top = -24.0
offset_right = 1109.0 offset_right = 1113.0
offset_bottom = 223.0 offset_bottom = -3.0
text = "Масштаб:" text = "Масштаб:"
[node name="zoom_plus" type="Button" parent="."] [node name="zoom_plus" type="Button" parent="."]

View File

@@ -1,5 +1,6 @@
extends Panel extends Panel
func _ready() -> void: func _ready() -> void:
var unit_trassa = network.get_unit_instance('уарэп-трасса') var unit_trassa = network.get_unit_instance('уарэп-трасса')
unit_trassa.connect('line_changed', Callable(self, 'on_trassa_line_changed')) unit_trassa.connect('line_changed', Callable(self, 'on_trassa_line_changed'))
@@ -8,30 +9,30 @@ func _ready() -> void:
func on_trassa_line_changed(unit_trassa): func on_trassa_line_changed(unit_trassa):
if unit_trassa.online: if unit_trassa.online:
$"454/СостояниеРэс3".self_modulate = Color.WEB_GREEN $'454/СостояниеРэс3'.self_modulate = Color.WEB_GREEN
$"СкруглённыйПрямоугольникБелый/Label3".text = 'Трасса' $'СкруглённыйПрямоугольникБелый/Label3'.text = 'Трасса'
$"СкруглённыйПрямоугольникБелый/Label4".text = 'Трасса' $'СкруглённыйПрямоугольникБелый/Label4'.text = 'Трасса'
$"СкруглённыйПрямоугольникБелый/Label5".text = 'Активный' $'СкруглённыйПрямоугольникБелый/Label5'.text = 'Активный'
$"СкруглённыйПрямоугольникБелый/Label6".text = str(unit_trassa.daa) $'СкруглённыйПрямоугольникБелый/Label6'.text = str(unit_trassa.daa)
$"СкруглённыйПрямоугольникБелый/Label7".text = str(unit_trassa.dap) $'СкруглённыйПрямоугольникБелый/Label7'.text = str(unit_trassa.dap)
$"СкруглённыйПрямоугольникБелый/Label8".text = '1' $'СкруглённыйПрямоугольникБелый/Label8'.text = '1'
$"СкруглённыйПрямоугольникБелый/Label9".text = str(unit_trassa.lfb) $'СкруглённыйПрямоугольникБелый/Label9'.text = str(unit_trassa.lfb)
$"СкруглённыйПрямоугольникБелый/Label10".text = str(unit_trassa.lfb) $'СкруглённыйПрямоугольникБелый/Label10'.text = str(unit_trassa.lfb)
else: else:
$"454/СостояниеРэс3".self_modulate = Color.WHITE $'454/СостояниеРэс3'.self_modulate = Color.WHITE
$"СкруглённыйПрямоугольникБелый/Label3".text = '-' $'СкруглённыйПрямоугольникБелый/Label3'.text = '-'
$"СкруглённыйПрямоугольникБелый/Label4".text = '-' $'СкруглённыйПрямоугольникБелый/Label4'.text = '-'
$"СкруглённыйПрямоугольникБелый/Label5".text = '-' $'СкруглённыйПрямоугольникБелый/Label5'.text = '-'
$"СкруглённыйПрямоугольникБелый/Label6".text = '-' $'СкруглённыйПрямоугольникБелый/Label6'.text = '-'
$"СкруглённыйПрямоугольникБелый/Label7".text = '-' $'СкруглённыйПрямоугольникБелый/Label7'.text = '-'
$"СкруглённыйПрямоугольникБелый/Label8".text = '-' $'СкруглённыйПрямоугольникБелый/Label8'.text = '-'
$"СкруглённыйПрямоугольникБелый/Label9".text = '-' $'СкруглённыйПрямоугольникБелый/Label9'.text = '-'
$"СкруглённыйПрямоугольникБелый/Label10".text = '-' $'СкруглённыйПрямоугольникБелый/Label10'.text = '-'
func on_sector_klaster(_data, unit_trassa): func on_sector_klaster(data, unit_trassa):
$"СкруглённыйПрямоугольникБелый/Label6".text = str(unit_trassa.dap) $'СкруглённыйПрямоугольникБелый/Label6'.text = str(unit_trassa.dap)
$"СкруглённыйПрямоугольникБелый/Label7".text = str(unit_trassa.daa) $'СкруглённыйПрямоугольникБелый/Label7'.text = str(unit_trassa.daa)
$"СкруглённыйПрямоугольникБелый/Label8".text = '1' $'СкруглённыйПрямоугольникБелый/Label8'.text = '1'
$"СкруглённыйПрямоугольникБелый/Label9".text = str(unit_trassa.lfb) $'СкруглённыйПрямоугольникБелый/Label9'.text = str(unit_trassa.lfb)
$"СкруглённыйПрямоугольникБелый/Label10".text = str(unit_trassa.hfb) $'СкруглённыйПрямоугольникБелый/Label10'.text = str(unit_trassa.hfb)

View File

@@ -93,6 +93,7 @@ const ID_INTERFERS_LEN = 63 ## Размер пула номеров целе
const INTERFER_OFF = 'off' const INTERFER_OFF = 'off'
const INTERFER_IQFILE = 'IQ-файл' const INTERFER_IQFILE = 'IQ-файл'
const POW_DEFAULT: float = 50.0 const POW_DEFAULT: float = 50.0
const PERIOD_DEFAULT = 7.5
var msg6_num: int = 0 ## Счётчик сообщений "тип 6" var msg6_num: int = 0 ## Счётчик сообщений "тип 6"
var msg8_num: int = 0 ## Счётчик сообщений "тип 8" var msg8_num: int = 0 ## Счётчик сообщений "тип 8"
var id_array: Array ## Массив id воздействий. var id_array: Array ## Массив id воздействий.
@@ -215,7 +216,7 @@ func _ready() -> void:
threats.connect('threats_resized', Callable(self, 'on_threats_resized')) threats.connect('threats_resized', Callable(self, 'on_threats_resized'))
threats.connect('threat_update', Callable(self, 'on_threats_update').bind(ecms, unit_caps)) threats.connect('threat_update', Callable(self, 'on_threats_update').bind(ecms, unit_caps))
ProjectSettings.connect('settings_changed', on_settings_changed) ProjectSettings.connect('settings_changed', on_settings_changed)
var unit_nav = network.get_unit_instance('навигация') var unit_nav: = network.get_unit_instance('навигация')
unit_nav.connect('data_received', on_nav_data_received.bind(unit_caps)) unit_nav.connect('data_received', on_nav_data_received.bind(unit_caps))
@@ -389,10 +390,7 @@ func on_interfer_create(interfer_name, sel_threats, fs_arr, power, u, ecms) -> v
if krp != '': if krp != '':
interfer_name = krp interfer_name = krp
set_rparams(item, param) set_rparams(item, param)
if (param['width'] < settings.WIDTH_MIN): check_width(param)
param['width'] = settings.WIDTH_MIN
elif (param['width'] > settings.WIDTH_MAX):
param['width'] = settings.WIDTH_MAX
interfer_create(u, interfer_name, ecms, param, kni, id, thrs, SOURCE_INTERFER[0], power) interfer_create(u, interfer_name, ecms, param, kni, id, thrs, SOURCE_INTERFER[0], power)
for item in fs_arr: for item in fs_arr:
@@ -401,10 +399,7 @@ func on_interfer_create(interfer_name, sel_threats, fs_arr, power, u, ecms) -> v
var id = item[3] var id = item[3]
param['freq'] = item[1] param['freq'] = item[1]
param['width'] = item[2] param['width'] = item[2]
if (param['width'] < settings.WIDTH_MIN): check_width(param)
param['width'] = settings.WIDTH_MIN
elif (param['width'] > settings.WIDTH_MAX):
param['width'] = settings.WIDTH_MAX
interfer_create(u, interfer_name, ecms, param, kni, id, fs, SOURCE_INTERFER[1], power) interfer_create(u, interfer_name, ecms, param, kni, id, fs, SOURCE_INTERFER[1], power)
@@ -444,7 +439,7 @@ func interfer_create(u, interfer_name, ecms, param, kni, id, dict, source_interf
var sz = ecms.size() var sz = ecms.size()
var ispp: int = 0 var ispp: int = 0
param['dur'] = 1.0 # Необходимо добавить параметры управления param['dur'] = 1.0 # Необходимо добавить параметры управления
param['period'] = 1.0 # Необходимо добавить параметры управления param['period'] = param.get('period', PERIOD_DEFAULT)
var key = dict.find_key(id) var key = dict.find_key(id)
if source_interfer != SOURCE_INTERFER[2]: if source_interfer != SOURCE_INTERFER[2]:
if key != null: if key != null:
@@ -580,9 +575,8 @@ func on_threats_update(threat, ecms, unit_caps):
ecm.priority = threat.priority ecm.priority = threat.priority
ecm.params['freq'] = threat.freq ecm.params['freq'] = threat.freq
var width = threat.width * 1.5 var width = threat.width * 1.5
if width < settings.WIDTH_MIN:
width = settings.WIDTH_MIN
ecm.params['width'] = width ecm.params['width'] = width
check_width(ecm.params)
if (threat.rkrp != '') and threat.fflags.rkrp and auto_enabled: if (threat.rkrp != '') and threat.fflags.rkrp and auto_enabled:
var krp = get_krp(threat) var krp = get_krp(threat)
if krp != '': if krp != '':
@@ -619,12 +613,11 @@ func set_rparams(threat: threats.Threat, params: Dictionary):
params['freq'] = threat.rparams['freq'] params['freq'] = threat.rparams['freq']
else: else:
params['freq'] = threat.freq params['freq'] = threat.freq
if threat.rparams.has('period'):
params['period'] = threat.rparams['period']
if threat.rparams.has('width'): if threat.rparams.has('width'):
params['width'] = threat.rparams['width'] params['width'] = threat.rparams['width'] * 1.5
else: else:
params['width'] = threat.width * 1.5 params['width'] = threat.width * 1.5
check_width(params)
if threat.rparams.has('filename'): if threat.rparams.has('filename'):
params['filename'] = threat.rparams['filename'] params['filename'] = threat.rparams['filename']
@@ -695,3 +688,8 @@ func set_th_emit(th: threats.Threat, ecm: Interfer):
return return
else: else:
th.emit_state = 1 th.emit_state = 1
func check_width(param: Dictionary):
if (param['width'] < settings.WIDTH_MIN): param['width'] = settings.WIDTH_MIN
elif (param['width'] > settings.WIDTH_MAX): param['width'] = settings.WIDTH_MAX

View File

@@ -153,7 +153,6 @@ class Fs:
class PRD: class PRD:
var prd_name: String ## Имя прибора var prd_name: String ## Имя прибора
var unit_yau07 ## Юнит эмс var unit_yau07 ## Юнит эмс
var unit_control: Object ## Класс проверки прибора ПРД
var fs_dic: Dictionary ## Массив блоков ФС var fs_dic: Dictionary ## Массив блоков ФС
var yemsg_board: yemsboards.EmsBoard ## Плата ЭМС-Г var yemsg_board: yemsboards.EmsBoard ## Плата ЭМС-Г
var state = PrdState.WORK var state = PrdState.WORK
@@ -168,7 +167,6 @@ class PRD:
unit_yau07 = u_yau07 unit_yau07 = u_yau07
init_ems_g() init_ems_g()
func init_ems_g(): func init_ems_g():
var in_tbl: Array = [] var in_tbl: Array = []
var out_tbl: Array = [] var out_tbl: Array = []
@@ -285,9 +283,6 @@ func _ready() -> void:
var unit_prd = network.get_unit_instance(prd_name) var unit_prd = network.get_unit_instance(prd_name)
var new_prd = PRD.new(prd_name, unit_prd) var new_prd = PRD.new(prd_name, unit_prd)
prd_dict[prd_name] = new_prd prd_dict[prd_name] = new_prd
var unit_control = TestPRD.new({'unit_prd': unit_prd}, new_prd.cmd_array)
add_child(unit_control)
new_prd.unit_control = unit_control
for key in FS_PRD.keys(): for key in FS_PRD.keys():
var fs = Fs.new(key, FS_PRD[key][0]) var fs = Fs.new(key, FS_PRD[key][0])
fs_dict[key] = fs fs_dict[key] = fs

File diff suppressed because it is too large Load Diff

View File

@@ -182,11 +182,6 @@ signal kb_pressed(state)
signal ems2_hide_pressed(state) signal ems2_hide_pressed(state)
## Вызывается при нажатии на кнопку отладки контроля
## [param state] - состояние показа отладки контроля
signal debag_control_pressed(state)
## Вызывается при нажатии на кнопку экранной клавиатуры ## Вызывается при нажатии на кнопку экранной клавиатуры
## [param state] - состояние скрытия кнопки ЭМС2 ## [param state] - состояние скрытия кнопки ЭМС2
signal emit_changed(state) signal emit_changed(state)
@@ -221,10 +216,6 @@ signal sector_klaster (new_sector_data)
signal clear_klaster () signal clear_klaster ()
## Вызывается при нажатии на кнопку "Запуск контроля".[br]
signal start_contol_device()
## Вызывается при программном отключении помехи.[br] ## Вызывается при программном отключении помехи.[br]
## [param ecm] - выключаемая помеха ([b]true[/b] ## [param ecm] - выключаемая помеха ([b]true[/b]
signal on_prog_ecm_off(ecm: interfer.Interfer) signal on_prog_ecm_off(ecm: interfer.Interfer)

View File

@@ -4,6 +4,7 @@
"Адрес БПО левого борта": "http://172.22.246.13:8081/selftest?presetType=bpo&400000000", "Адрес БПО левого борта": "http://172.22.246.13:8081/selftest?presetType=bpo&400000000",
"Адрес БПО правого борта": "http://172.22.246.11:8082/selftest?presetType=bpo&400000000", "Адрес БПО правого борта": "http://172.22.246.11:8082/selftest?presetType=bpo&400000000",
"Виртуальная клавиатура": false, "Виртуальная клавиатура": false,
"Включить работу по своим целям": true,
"Внешнее указание Трасса": false, "Внешнее указание Трасса": false,
"Внешнее управление": false, "Внешнее управление": false,
"Кнопка «JTIDS»": false, "Кнопка «JTIDS»": false,
@@ -26,29 +27,31 @@
"Период опроса состояния АФСП, секунды": "30", "Период опроса состояния АФСП, секунды": "30",
"Период опроса состояния БПО, секунды": "30", "Период опроса состояния БПО, секунды": "30",
"Скрыть вкладку ЭМС 2": true, "Скрыть вкладку ЭМС 2": true,
"Список своих протоколов": "j11",
"Схема прибора. Белый цвет": [1.0, 1.0, 1.0],
"Схема прибора. Чёрный цвет": [0.0, 0.0, 0.0],
"Текущая версия ПО УАРЭП": "master b2633d8 Thu Sep 11 16:26:39 2025 +0300", "Текущая версия ПО УАРЭП": "master b2633d8 Thu Sep 11 16:26:39 2025 +0300",
"Шаблон адреса сервера карт": "http://10.1.1.2:8001/osm_tiles/{z}/{x}/{y}.png", "Шаблон адреса сервера карт": "http://169.254.27.71:8001/osm_tiles/{z}/{x}/{y}.png",
"навигация": [ "навигация": [
"*", "*",
60000, 60000,
true, true,
true true
], ],
"уареп-трасса": "127.0.0.1,127.0.0.1,50200,10004",
"уарэп-5п28": [ "уарэп-5п28": [
"127.0.0.1", "127.0.0.1",
50777 50777
], ],
"уарэп-капсрпб": [ "уарэп-капсрпб": [
"192.168.11.102", "127.0.0.1",
"192.168.11.105", "127.0.0.1",
42023, 42023,
42022, 42022,
false, false,
true true
], ],
"уарэп-спт25-1": [ "уарэп-спт25-1": [
"/home/user/tty0", "/home/sasha/dev/tty0",
0, 0,
19200, 19200,
"N", "N",
@@ -56,15 +59,23 @@
1 1
], ],
"уарэп-спт25-2": [ "уарэп-спт25-2": [
"/home/user/tty1", "/home/sasha/dev/tty4",
0, 0,
19200, 19200,
"N", "N",
8, 8,
1 1
], ],
"уарэп-трасса": [
"127.0.0.1",
"127.0.0.1",
50200,
10004,
false,
true
],
"уарэп-щ3": [ "уарэп-щ3": [
"/home/user/tty3", "/home/sasha/dev/tty2",
7, 7,
19200, 19200,
"N", "N",

View File

@@ -7,6 +7,9 @@ code = "shader_type canvas_item;
#define RADIUS_INNER_0 200.0 /* Радиус внутренний для режима приоритет РТО */ #define RADIUS_INNER_0 200.0 /* Радиус внутренний для режима приоритет РТО */
#define RADIUS_INNER_1 480.0 /* Радиус внутренний для режима приоритет РЛС */ #define RADIUS_INNER_1 480.0 /* Радиус внутренний для режима приоритет РЛС */
#define ANTENAS_COUNT 28 /* Количество антенн */
#define ANT_BAND_READY 1U /* Антенна (модуль ФС) готова или исправна */
#define ANT_BAND_FAILED 0U /* Антенна (модуль ФС) не исправно */
uniform vec2 pc0 = vec2(560, 560); /* Центр сетки антенн */ uniform vec2 pc0 = vec2(560, 560); /* Центр сетки антенн */
uniform float rotation: hint_range(0.0, 360.0) = 0.0; /* */ uniform float rotation: hint_range(0.0, 360.0) = 0.0; /* */
@@ -14,9 +17,13 @@ uniform vec4 color0: source_color = vec4(0.38, 0.47, 0.51, 0.4);
uniform vec4 color1: source_color = vec4(0.39, 0.44, 0.50, 0.4); uniform vec4 color1: source_color = vec4(0.39, 0.44, 0.50, 0.4);
uniform float radius_inner_0 = RADIUS_INNER_0; uniform float radius_inner_0 = RADIUS_INNER_0;
uniform float radius_inner_1 = RADIUS_INNER_1; uniform float radius_inner_1 = RADIUS_INNER_1;
uniform float radius_outter = 550.0; /* Радиус внешний. Должно быть равно ant_band_r1_6 */ uniform float radius_outter = 550.0; /* Радиус внешний. Должно быть равно ant_band_r1_6 */
uniform float alpha: hint_range(0.0, 1.0) = 0.5; uniform float alpha: hint_range(0.0, 1.0) = 0.5;
uniform int mode = 0; /* Режим отображения. Приоритет РТО - 0, приоритет РЛС - 1 */ uniform int mode = 0; /* Режим отображения. Приоритет РТО - 0, приоритет РЛС - 1 */
uniform float ffr: hint_range(0.0, 1.0) = 0.2; /* Индикация неисправности модулей ФС. Заметность штриховки. */
uniform float sfr: hint_range(0.0, 10.0) = 0.0; /* Индикация неисправности модулей ФС. Скорость движения штрховки */
uniform float afr: hint_range(0.0, 180.0) = 0.0; /* Индикация неисправности модулей ФС. Наклон штрховки */
uniform float pfr: hint_range(1.0, 20.0) = 10.0; /* Индикация неисправности модулей ФС. Частота штриховки */
const int ant_band_count_0 = 2; const int ant_band_count_0 = 2;
const int ant_band_count_1 = 2; const int ant_band_count_1 = 2;
@@ -42,7 +49,8 @@ const float ant_band_r1_4[] = {450.0, 530.0};
const float ant_band_r1_5[] = {500.0, 540.0}; const float ant_band_r1_5[] = {500.0, 540.0};
const float ant_band_r1_6[] = {550.0, 550.0}; const float ant_band_r1_6[] = {550.0, 550.0};
uniform vec4 ant_band_c[28]; uniform vec4 ant_band_c[ANTENAS_COUNT];
uniform uint ant_band_m[ANTENAS_COUNT];
const float d4 = 90.0; const float d4 = 90.0;
const float ds = 1.0; const float ds = 1.0;
@@ -79,6 +87,12 @@ void antenas(inout vec4 c, vec2 uv, vec2 p0, int cnt, float r0, float r1, inout
col.rgb = ant_band_c[j].rgb; col.rgb = ant_band_c[j].rgb;
index++; index++;
col.a = alpha + (random_timed(uv) - 0.5f) * ant_band_c[j].a; col.a = alpha + (random_timed(uv) - 0.5f) * ant_band_c[j].a;
if (ant_band_m[j] == ANT_BAND_FAILED)
{
vec2 uvr = uv;
rotate_vec2(uvr, radians(afr), pc0);
col.a *= (1.0 - ffr) + tanh(10.0 * sin(TIME * sfr + 2.0 * PI * uvr.x / pfr)) * ffr;
}
float v = float(i & 1); float v = float(i & 1);
vec4 color = v * col + (1.0f - v) * col; vec4 color = v * col + (1.0f - v) * col;
sector(c, uv, p0, float(i) * da, da, r0, r1, color); sector(c, uv, p0, float(i) * da, da, r0, r1, color);
@@ -120,4 +134,9 @@ shader_parameter/radius_inner_1 = 480.0
shader_parameter/radius_outter = 550.0 shader_parameter/radius_outter = 550.0
shader_parameter/alpha = 0.5 shader_parameter/alpha = 0.5
shader_parameter/mode = 0 shader_parameter/mode = 0
shader_parameter/ffr = 0.2
shader_parameter/sfr = 0.0
shader_parameter/afr = 0.0
shader_parameter/pfr = 10.0
shader_parameter/ant_band_c = PackedVector4Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) shader_parameter/ant_band_c = PackedVector4Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
shader_parameter/ant_band_m = PackedInt32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)

View File

@@ -325,9 +325,10 @@ func _set_row_selected(i_row: int, selected: bool = true) -> void:
var node = nodes[node_key] var node = nodes[node_key]
var selector = nodes[selector_key] var selector = nodes[selector_key]
nodes.erase(selector_key) nodes.erase(selector_key)
if is_instance_valid(node) and is_instance_valid(selector): if is_instance_valid(selector):
if selector.get_parent() == node: var prnt = selector.get_parent_control()
node.remove_child(selector) if prnt:
prnt.remove_child(selector)
selector.queue_free() selector.queue_free()
else: else:
push_warning('обращение к удалённому элементу \"%s\"' % selector_key) push_warning('обращение к удалённому элементу \"%s\"' % selector_key)
@@ -449,7 +450,6 @@ func remove_row(i_row: int):
if nodes.has(sel_key): if nodes.has(sel_key):
var selector = nodes[sel_key] var selector = nodes[sel_key]
if selector == null: return
var prnt = selector.get_parent() var prnt = selector.get_parent()
prnt.remove_child(selector) prnt.remove_child(selector)
selector.queue_free() selector.queue_free()
@@ -486,11 +486,8 @@ func next_index(indexes: Array) -> void:
func swap_nodes(nodes_copy, node_key_format, i0, i1) -> void: func swap_nodes(nodes_copy, node_key_format, i0, i1) -> void:
var key0 = node_key_format % [i0.y, i0.x] var key0 = node_key_format % [i0.y, i0.x]
var key1 = node_key_format % [i1.y, i1.x] var key1 = node_key_format % [i1.y, i1.x]
if is_instance_valid(nodes[key0]): nodes_copy[key1] = nodes[key0]
nodes_copy[key1] = nodes[key0] nodes_copy[key1].name = key1
nodes_copy[key1].name = key1
else:
print_debug("Ошибка: нод ", key0, " был освобожден")
## Переназначает ключи в соответствии с размерами таблицы. ## Переназначает ключи в соответствии с размерами таблицы.