Merge remote-tracking branch 'refs/remotes/kotik/prd-control'

# Conflicts:
#	scenes/tabs-switch/lbl_ready.gd
#	scenes/tabs-switch/tab-switch.tscn
#	scenes/tilemap/tilemap.gd
#	scenes/контроль/control_prd.gd
#	scenes/контроль/control_prd.gd.uid
#	scenes/контроль/контроль.tscn
This commit is contained in:
kira-a-k
2025-11-16 22:44:28 +03:00
22 changed files with 2049 additions and 1150 deletions

View File

@@ -0,0 +1,219 @@
{
"device_constants": {
"PRD_N": {
"constants": {
"POWER_UKP_1": 31,
"POWER_UKP_2": 63,
"DKM_BIT_2": 1,
"DKM_BIT_3": 2,
"BASE_ADDR_EMS_G": 288,
"ADDR_UG_LITERA_1": 262,
"ADDR_UG_LITERA_2": 264,
"ADDR_UG_LITERA_3": 266,
"TEMP_THRESHOLD": 70,
"POWER_THRESHOLD": 40,
"RAY_DOU_NUM": 3,
"ATT_UM_2": 2,
"ATT_UM_3": 3,
"POWER_UM": 100,
"TIMER_DELAY": 10.0,
"STATE_MASHINE_TIMER": 0.3
},
"pribor_config": {
"1н": {"angle": 0.0, "sectors": [4, 8]},
"2н": {"angle": 90.0, "sectors": [7, 11]},
"3н": {"angle": 180.0, "sectors": [6, 10]},
"4н": {"angle": 270.0, "sectors": [5, 9]}
},
"fs_params": {
"2": {"freq": 932.0, "width": 100.0},
"3": {"freq": 1157.0, "width": 100.0}
},
"start_litera": 2,
"progress_max": 20
},
"PRD_V": {
"constants": {
"POWER_UKP_1": 31,
"POWER_UKP_2": 63,
"DKM_BIT_4": 3,
"DKM_BIT_5": 4,
"BASE_ADDR_EMS_G": 288,
"ADDR_UG_LITERA_1": 262,
"ADDR_UG_LITERA_2": 264,
"ADDR_UG_LITERA_3": 266,
"TEMP_THRESHOLD": 70,
"POWER_THRESHOLD": 40,
"RAY_DOU_NUM": 3,
"ATT_UM_4": 2,
"ATT_UM_5": 3,
"POWER_UM": 100,
"TIMER_DELAY": 10.0,
"STATE_MASHINE_TIMER": 0.3
},
"pribor_config": {
"1в": {"angle": 0.0, "sectors": [12, 16]},
"2в": {"angle": 90.0, "sectors": [15, 19]},
"3в": {"angle": 180.0, "sectors": [14, 18]},
"4в": {"angle": 270.0, "sectors": [13, 17]}
},
"fs_params": {
"4": {"freq": 1227.0, "width": 100.0},
"5": {"freq": 1575.0, "width": 110.0}
},
"start_litera": 4,
"progress_max": 20
},
"PRD_K": {
"constants": {
"POWER_UKP_1": 31,
"POWER_UKP_2": 63,
"DKM_BIT_1": 0,
"DKM_BIT_6": 5,
"DKM_BIT_7": 6,
"BASE_ADDR_EMS_G": 288,
"ADDR_UG_LITERA_1": 262,
"ADDR_UG_LITERA_2": 264,
"ADDR_UG_LITERA_3": 266,
"TEMP_THRESHOLD": 40,
"POWER_THRESHOLD": 40,
"RAY_DOU_NUM": 3,
"ATT_UM_1": 0,
"ATT_UM_6": 3,
"ATT_UM_7": 2,
"POWER_UM": 100,
"TIMER_DELAY": 10.0,
"STATE_MASHINE_TIMER": 0.3
},
"pribor_config": {
"1к": {"angle": 0.0, "sectors": [0, 20, 24]},
"2к": {"angle": 90.0, "sectors": [3, 23, 27]},
"3к": {"angle": 180.0, "sectors": [2, 22, 26]},
"4к": {"angle": 270.0, "sectors": [1, 21, 25]}
},
"fs_params": {
"1": {"freq": 450.0, "width": 80.0},
"6": {"freq": 2450.0, "width": 110.0},
"7": {"freq": 4750.0, "width": 110.0}
},
"start_litera": 1,
"progress_max": 30
}
},
"base_configs": {
"block_ip": {
"maa2000_1": [0, false],
"maa2000_2": [1, false],
"ip9_50_1": [2, false],
"ip9_50_2": [3, false],
"ip12_50_1": [4, false],
"ip5_25": [7, false]
},
"block_kasseta": {
"yau07": false,
"ems": false,
"ug": false,
"ukp1": false,
"ukp2": false
}
},
"device_configs": {
"PRD_N": {
"block_ip": "base",
"block_kasseta": "base",
"control_results": {
"block_ip": false,
"temperature": true,
"dkm_2": false,
"dkm_3": false,
"dou_2": false,
"dou_3": false,
"fs_2": 0,
"fs_3": 0
}
},
"PRD_V": {
"block_ip": "base",
"block_kasseta": "base",
"control_results": {
"block_ip": false,
"temperature": true,
"dkm_4": false,
"dkm_5": false,
"dou_4": false,
"dou_5": false,
"fs_4": 0,
"fs_5": 0
}
},
"PRD_K": {
"block_ip": {
"maa2000_1": [0, false],
"maa2000_2": [1, false],
"ip9_50_1": [2, false],
"ip9_50_2": [3, false],
"ip12_50_1": [4, false],
"ip9_50_3": [5, false],
"ip12_50_2": [6, false],
"ip5_25": [7, false]
},
"block_kasseta": "base",
"control_results": {
"block_ip": false,
"temperature": true,
"dkm_1": false,
"dkm_6": false,
"dkm_7": false,
"dou_6": false,
"dou_7": false,
"fs_1": 0,
"fs_6": 0,
"fs_7": 0
}
}
},
"ray_types": ["RAY_m5", "RAY_5", "RAY_15", "RAY_25", "RAY_35", "RAY_45"],
"data_indices": {
"STATUS_BOARD": 0,
"IN_BLANK_PRD": 1,
"IN_IMPULS_PRD": 7,
"OUT_BLANK_PRD": 13,
"OUT_IMPULS_PRD": 19,
"DRY_CONTACT": 27,
"DKM": 28,
"POWER_UKP_1": 31,
"TEMPERATURE_UKP_1": 47,
"POWER_UKP_2": 63,
"TEMPERATURE_UKP_2": 79
},
"fs_keys": {
"1": "fs_1",
"2": "fs_2",
"3": "fs_3",
"4": "fs_4",
"5": "fs_5",
"6": "fs_6",
"7": "fs_7"
},
"temperature_constants": {
"CONST_MIN_TEMP": -25,
"MAXIMUM_CODE_ADC": 3796,
"MINIMUM_CODE_AD": 2660,
"TEMPERATURE_UKP_1": 47,
"TEMPERATURE_UKP_2": 79
},
"ems_input_bits_config": {
"PRD_N": {"bit1": 9, "bit2": 10},
"PRD_V": {"bit1": 11, "bit2": 12},
"PRD_K": {"bit1": 13, "bit2": 14, "bit_lit": 8}
},
"fs_rules":[
{"key": "fs_1", "min": 0, "max": 4},
{"key": "fs_2", "min": 4, "max": 8},
{"key": "fs_3", "min": 8, "max": 12},
{"key": "fs_4", "min": 12, "max": 16},
{"key": "fs_5", "min": 16, "max": 20},
{"key": "fs_6", "min": 20, "max": 24},
{"key": "fs_7", "min": 24, "max": 27}
]
}

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 = "A2" rname = "A6"
[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 = "A5" rname = "A3"
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 = "A3" rname = "A2"
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 = "A6" rname = "A5"

View File

@@ -18,9 +18,24 @@ func _ready() -> void:
for temp in power_amplifier: for temp in power_amplifier:
temp.value1 = -70 temp.value1 = -70
unit_prd_k.connect('control_is_over', Callable(self, 'on_press_device')) unit_prd_k.connect('control_is_over', Callable(self, 'on_press_device'))
#unit_prd_k.power_amplify = power_amplifier
on_press_device() on_press_device()
func _process(_delta: float) -> void:
if Engine.is_editor_hint():
return
set_frame($input_0, unit_prd_k.ems_input_1)
set_frame($input_1, unit_prd_k.ems_input_2)
set_frame($input_2, unit_prd_k.ems_input_lit_1)
set_frame($output_0, unit_prd_k.ems_output_1)
set_frame($output_1, unit_prd_k.ems_output_2)
set_frame($output_2, unit_prd_k.ems_output_lit_1)
func set_frame(node_frame: Node, val: int): node_frame.set_frame(val)
func start_control() -> void: func start_control() -> void:
set_default_state() set_default_state()
find_labels(self) find_labels(self)
@@ -47,6 +62,13 @@ func _exit_tree() -> void:
#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:
for i_node_temperature in temperature_arr_node:
var temperature_meta: String = i_node_temperature.get_meta('um')
if not temperature_dic.has(temperature_meta): return
i_node_temperature.value1 = temperature_dic[temperature_meta]
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier: Array, POWER_THRESHOLD: int) -> void: static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier: Array, POWER_THRESHOLD: int) -> void:
for i_powapm in power_amplifier: for i_powapm in power_amplifier:
var powamp_meta: String = i_powapm.get_meta('um') var powamp_meta: String = i_powapm.get_meta('um')
@@ -58,9 +80,9 @@ static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifi
if pow_dic[powamp_meta].size() < 6: if pow_dic[powamp_meta].size() < 6:
status = STATE_VAL.ERROR status = STATE_VAL.ERROR
else: else:
if powamp_meta == 'um_7' and not fs_result.fs_1: return if powamp_meta == 'um_8' and not fs_result.fs_1: return
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_6: return if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_6: return
if powamp_meta in ['um_8', 'um_9', 'um_10', 'um_11', 'um_12', 'um_13'] and not fs_result.fs_7: return if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_7: return
i_powapm.value0 = pow_dic[powamp_meta] i_powapm.value0 = pow_dic[powamp_meta]
for i_p in pow_dic[powamp_meta]: for i_p in pow_dic[powamp_meta]:
if i_p < POWER_THRESHOLD: if i_p < POWER_THRESHOLD:
@@ -83,6 +105,7 @@ func on_press_device() -> void:
'power_dic': unit_prd_k.power_result, 'power_dic': unit_prd_k.power_result,
'block_kasseta_y5_config': unit_prd_k.block_kasseta_y5_config, 'block_kasseta_y5_config': unit_prd_k.block_kasseta_y5_config,
'block_ip_config': unit_prd_k.block_ip_config, 'block_ip_config': unit_prd_k.block_ip_config,
'temperature_um' : unit_prd_k.temperature_um,
'nodes_y5': nodes_y5, 'nodes_y5': nodes_y5,
'node_ip_power_arr': node_ip_power_arr, 'node_ip_power_arr': node_ip_power_arr,
'fs_nodes': fs_nodes, 'fs_nodes': fs_nodes,
@@ -99,13 +122,14 @@ func on_press_device() -> void:
func on_control_result(for_result_dic: Dictionary) -> void: func on_control_result(for_result_dic: Dictionary) -> void:
## If control is end temperature_fill(for_result_dic.power_amplifier, for_result_dic.temperature_um)
var block_kasseta_y5_prd_config_k: Dictionary = for_result_dic.block_kasseta_y5_config var block_kasseta_y5_prd_config_k: Dictionary = for_result_dic.block_kasseta_y5_config
var nodes_y5: Array = for_result_dic.nodes_y5 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 block_kasseta_y5_prd_config_k['yau07'] == false: if not block_kasseta_y5_prd_config_k['yau07']:
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
break 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
@@ -117,30 +141,26 @@ func on_control_result(for_result_dic: Dictionary) -> void:
if block_ip_config_k.has(meta_ip) and block_kasseta_y5_prd_config_k.ug: 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
## If control is end
var result_dic: Dictionary = for_result_dic.result_dic var result_dic: Dictionary = for_result_dic.result_dic
for f in for_result_dic.fs_nodes: 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):
var new_state = result_dic[fs_meta] f.state = result_dic[fs_meta]
f.state = new_state
result_dic[fs_meta] = new_state
if result_dic.fs_1 == 1: if result_dic.fs_1 == 1 and block_kasseta_y5_prd_config_k['yau07']:
for_result_dic.module_fs_1.state = STATE_VAL.GOOD if result_dic.dkm_1 else STATE_VAL.ERROR for_result_dic.module_fs_1.state = STATE_VAL.GOOD if result_dic.dkm_1 else STATE_VAL.ERROR
else:
result_dic.fs_1 = 0 if result_dic.fs_6 == 1 and block_kasseta_y5_prd_config_k['yau07']:
if result_dic.fs_6 == 1:
for_result_dic.module_fs_6.state = STATE_VAL.GOOD if result_dic.dkm_6 else STATE_VAL.ERROR 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 for_result_dic.dou_6.state = STATE_VAL.GOOD if result_dic.dou_6 else STATE_VAL.ERROR
else:
result_dic.fs_6 = 0 if result_dic.fs_7 == 1 and block_kasseta_y5_prd_config_k['yau07']:
if result_dic.fs_7 == 1:
for_result_dic.module_fs_7.state = STATE_VAL.GOOD if result_dic.dkm_7 else STATE_VAL.ERROR for_result_dic.module_fs_7.state = STATE_VAL.GOOD if result_dic.dkm_7 else STATE_VAL.ERROR
for_result_dic.dou_7.state = STATE_VAL.GOOD if result_dic.dou_7 else STATE_VAL.ERROR for_result_dic.dou_7.state = STATE_VAL.GOOD if result_dic.dou_7 else STATE_VAL.ERROR
else:
result_dic.fs_7 = 0
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD) 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 result: bool = true var result: bool = true
for device in result_dic.values(): for device in result_dic.values():

View File

@@ -1,14 +1,39 @@
[gd_scene load_steps=10 format=3 uid="uid://m5s87q7m66lj"] [gd_scene load_steps=16 format=3 uid="uid://m5s87q7m66lj"]
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="1_8dmgr"] [ext_resource type="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
@@ -161,7 +186,7 @@ value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_6" metadata/um = "um_6"
[node name="utm80_A9" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")] [node name="блок-к" parent="." groups=["power_amplifier"] instance=ExtResource("6_wd1vi")]
layout_mode = 0 layout_mode = 0
offset_left = 485.0 offset_left = 485.0
offset_top = 812.0 offset_top = 812.0
@@ -169,9 +194,7 @@ offset_right = 652.0
offset_bottom = 907.0 offset_bottom = 907.0
fname = "УТМ80" fname = "УТМ80"
rname = "A9" rname = "A9"
value0_info = "Мощность, Вт" metadata/um = "um_8"
value1_info = "Температура,°C"
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
@@ -179,11 +202,11 @@ offset_left = 8.0
offset_top = 242.0 offset_top = 242.0
offset_right = 175.0 offset_right = 175.0
offset_bottom = 337.0 offset_bottom = 337.0
fname = "УМ1535Б" fname = "РМ16-20М"
rname = "A16" rname = "A16"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_8" metadata/um = "um_9"
[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
@@ -191,11 +214,11 @@ offset_left = 8.0
offset_top = 337.0 offset_top = 337.0
offset_right = 173.0 offset_right = 173.0
offset_bottom = 432.0 offset_bottom = 432.0
fname = "УМ1535Б" fname = "РМ16-20М"
rname = "A17" rname = "A17"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_9" metadata/um = "um_10"
[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
@@ -203,11 +226,11 @@ offset_left = 8.0
offset_top = 432.0 offset_top = 432.0
offset_right = 175.0 offset_right = 175.0
offset_bottom = 527.0 offset_bottom = 527.0
fname = "УМ1535Б" fname = "РМ16-20М"
rname = "A18" rname = "A18"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_10" metadata/um = "um_11"
[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
@@ -215,11 +238,11 @@ offset_left = 8.0
offset_top = 527.0 offset_top = 527.0
offset_right = 175.0 offset_right = 175.0
offset_bottom = 622.0 offset_bottom = 622.0
fname = "УМ1535Б" fname = "РМ16-20М"
rname = "A19" rname = "A19"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_11" metadata/um = "um_12"
[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
@@ -227,11 +250,11 @@ offset_left = 8.0
offset_top = 622.0 offset_top = 622.0
offset_right = 175.0 offset_right = 175.0
offset_bottom = 717.0 offset_bottom = 717.0
fname = "УМ1535Б" fname = "РМ16-20М"
rname = "A20" rname = "A20"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_12" metadata/um = "um_13"
[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
@@ -239,11 +262,11 @@ offset_left = 8.0
offset_top = 717.0 offset_top = 717.0
offset_right = 175.0 offset_right = 175.0
offset_bottom = 812.0 offset_bottom = 812.0
fname = "УМ1535Б" fname = "РМ16-20М"
rname = "A21" rname = "A21"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_13" metadata/um = "um_14"
[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
@@ -297,9 +320,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 = 7.0 offset_left = 2.0
offset_top = 8.0 offset_top = 8.0
offset_right = 159.0 offset_right = 162.0
offset_bottom = 33.0 offset_bottom = 33.0
text = "Кассета П-1" text = "Кассета П-1"
horizontal_alignment = 1 horizontal_alignment = 1
@@ -322,3 +345,42 @@ offset_bottom = 1003.0
text = "Прибор ПРД- неисправен" text = "Прибор ПРД- неисправен"
horizontal_alignment = 1 horizontal_alignment = 1
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="input_0" type="AnimatedSprite2D" parent="."]
position = Vector2(234, 177)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="Label" type="Label" parent="input_0"]
offset_left = -38.0
offset_top = 16.0
offset_right = 30.0
offset_bottom = 35.0
text = "Вход ЕМС"
[node name="input_1" type="AnimatedSprite2D" parent="."]
position = Vector2(277, 177)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="input_2" type="AnimatedSprite2D" parent="."]
position = Vector2(188, 177)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="output_0" type="AnimatedSprite2D" parent="."]
position = Vector2(421, 177)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="Label" type="Label" parent="output_0"]
offset_left = -40.0
offset_top = 14.0
offset_right = 36.0
offset_bottom = 33.0
text = "Модуляция"
metadata/_edit_use_anchors_ = true
[node name="output_1" type="AnimatedSprite2D" parent="."]
position = Vector2(462, 177)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="output_2" type="AnimatedSprite2D" parent="."]
position = Vector2(383, 177)
sprite_frames = SubResource("SpriteFrames_di0aa")

View File

@@ -17,10 +17,25 @@ func _ready() -> void:
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier') var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
for temp in power_amplifier: for temp in power_amplifier:
temp.value1 = -70 temp.value1 = -70
temp.max_value1 = 70
temp.min_value1 = -40
unit_prd_n.connect('control_is_over', Callable(self, 'on_press_device')) unit_prd_n.connect('control_is_over', Callable(self, 'on_press_device'))
#unit_prd_n.power_amplify = power_amplifier
on_press_device() on_press_device()
func _process(_delta: float) -> void:
if Engine.is_editor_hint():
return
set_frame($input_0, unit_prd_n.ems_input_1)
set_frame($input_1, unit_prd_n.ems_input_2)
set_frame($output_0, unit_prd_n.ems_output_1)
set_frame($output_1, unit_prd_n.ems_output_2)
func set_frame(node_frame: Node, val: int): node_frame.set_frame(val)
func start_control() -> void: func start_control() -> void:
set_default_state() set_default_state()
find_labels(self) find_labels(self)
@@ -47,28 +62,32 @@ func _exit_tree() -> void:
#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 power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier: Array, POWER_THRESHOLD: int) -> void: static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dictionary)->void:
for i_powapm in power_amplifier: for i_node_temperature in temperature_arr_node:
var powamp_meta: String = i_powapm.get_meta('um') var temperature_meta: String = i_node_temperature.get_meta('um')
if not temperature_dic.has(temperature_meta): return
i_node_temperature.value1 = temperature_dic[temperature_meta]
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void:
for i_node_powapm in power_amplifier_arr_node:
var powamp_meta: String = i_node_powapm.get_meta('um')
var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE
if not pow_dic.has(powamp_meta): return 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 for i_p in pow_dic[powamp_meta]:
if powamp_meta in ['um_7', 'um_8', 'um_9', 'um_10', 'um_11', 'um_12'] and not fs_result.fs_3: return if i_p < POWER_THRESHOLD:
i_powapm.value0 = pow_dic[powamp_meta] status = STATE_VAL.ERROR
for i_p in pow_dic[powamp_meta]: i_node_powapm.state = status
if i_p < POWER_THRESHOLD:
status = STATE_VAL.ERROR
i_powapm.state = status
func on_press_device() -> void: func on_press_device() -> void:
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 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 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_arr_node: Array = get_tree().get_nodes_in_group('power_amplifier')
var module_fs_2: Node = $kasseta_FS_ND/ref_A4 var module_fs_2: Node = $kasseta_FS_ND/ref_A4
var dou_2: Node = $dou2_A5 var dou_2: Node = $dou2_A5
var module_fs_3: Node = $kasseta_FS_ND/ref_A3 var module_fs_3: Node = $kasseta_FS_ND/ref_A3
@@ -78,10 +97,11 @@ func on_press_device() -> void:
'power_dic': unit_prd_n.power_result, 'power_dic': unit_prd_n.power_result,
'block_kasseta_y5_config': unit_prd_n.block_kasseta_y5_config, 'block_kasseta_y5_config': unit_prd_n.block_kasseta_y5_config,
'block_ip_config': unit_prd_n.block_ip_config, 'block_ip_config': unit_prd_n.block_ip_config,
'temperature_um' : unit_prd_n.temperature_um,
'nodes_y5': nodes_y5, 'nodes_y5': nodes_y5,
'node_ip_power_arr': node_ip_power_arr, 'node_ip_power_arr': node_ip_power_arr,
'fs_nodes': fs_nodes, 'fs_nodes': fs_nodes,
'power_amplifier': power_amplifier, 'power_amplifier': power_amplifier_arr_node,
'POWER_THRESHOLD': unit_prd_n.constants.POWER_THRESHOLD, 'POWER_THRESHOLD': unit_prd_n.constants.POWER_THRESHOLD,
'name_prd': unit_prd_n.self_name, 'name_prd': unit_prd_n.self_name,
'module_fs_2': module_fs_2, 'module_fs_2': module_fs_2,
@@ -93,13 +113,14 @@ func on_press_device() -> void:
func on_control_result(for_result_dic: Dictionary) -> void: func on_control_result(for_result_dic: Dictionary) -> void:
## If control is end 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 block_kasseta_y5_prd_config_n: Dictionary = for_result_dic.block_kasseta_y5_config
var nodes_y5: Array = for_result_dic.nodes_y5 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 block_kasseta_y5_prd_config_n['yau07'] == false: if not block_kasseta_y5_prd_config_n['yau07']:
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
break 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
@@ -111,27 +132,23 @@ func on_control_result(for_result_dic: Dictionary) -> void:
if block_ip_config_n.has(meta_ip) and block_kasseta_y5_prd_config_n.ug: 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
## If control is end
var result_dic: Dictionary = for_result_dic.result_dic var result_dic: Dictionary = for_result_dic.result_dic
for f in for_result_dic.fs_nodes: 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):
var new_state = result_dic[fs_meta] f.state = result_dic[fs_meta]
f.state = new_state
result_dic[fs_meta] = new_state
if result_dic.fs_2 == 1: if result_dic.fs_2 == 1 and block_kasseta_y5_prd_config_n['yau07']:
for_result_dic.module_fs_2.state = STATE_VAL.GOOD if result_dic.dkm_2 else STATE_VAL.ERROR for_result_dic.module_fs_2.state = STATE_VAL.GOOD if result_dic.dkm_2 else STATE_VAL.ERROR
for_result_dic.dou_2.state = STATE_VAL.GOOD if result_dic.dou_2 else STATE_VAL.ERROR for_result_dic.dou_2.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 and block_kasseta_y5_prd_config_n['yau07']:
if result_dic.fs_3 == 1:
for_result_dic.module_fs_3.state = STATE_VAL.GOOD if result_dic.dkm_3 else STATE_VAL.ERROR 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 for_result_dic.dou_3.state = STATE_VAL.GOOD if result_dic.dou_3 else STATE_VAL.ERROR
else:
result_dic.fs_3 = 0
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD) if block_kasseta_y5_prd_config_n['yau07']:
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD)
var result: bool = true var result: bool = true
for device in result_dic.values(): for device in result_dic.values():
if not device: if not device:

View File

@@ -1,12 +1,35 @@
[gd_scene load_steps=8 format=3 uid="uid://dnuexoef2nnv5"] [gd_scene load_steps=12 format=3 uid="uid://dnuexoef2nnv5"]
[ext_resource type="Script" uid="uid://cto2r4ipew65m" path="res://scenes/pribor-prd-n/pribor-prd-n.gd" id="1_bnnv3"] [ext_resource type="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
@@ -79,12 +102,83 @@ text = "Панель
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="kasseta_U5" parent="." instance=ExtResource("4_xkifg")] [node name="kasseta_U5" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 175.0 offset_left = 175.0
offset_top = 242.0 offset_top = 242.0
offset_right = 485.0 offset_right = 485.0
offset_bottom = 432.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
@@ -118,7 +212,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 = "A3" rname = "A4"
[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
@@ -126,7 +220,7 @@ offset_top = 32.0
offset_right = 155.0 offset_right = 155.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "Модуль ФС" fname = "Модуль ФС"
rname = "A1" rname = "A2"
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")]
@@ -135,7 +229,7 @@ offset_top = 32.0
offset_right = 205.0 offset_right = 205.0
offset_bottom = 182.0 offset_bottom = 182.0
fname = "Модуль ФС" fname = "Модуль ФС"
rname = "A2" rname = "A1"
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")]
@@ -144,7 +238,7 @@ 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 = "A4" rname = "A3"
[node name="kasseta_P_1" type="NinePatchRect" parent="."] [node name="kasseta_P_1" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
@@ -204,7 +298,7 @@ offset_left = 485.0
offset_top = 242.0 offset_top = 242.0
offset_right = 652.0 offset_right = 652.0
offset_bottom = 337.0 offset_bottom = 337.0
fname = "УМ1535Б" fname = "УМ1535А"
rname = "A7" rname = "A7"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
@@ -280,7 +374,7 @@ fname = "УМ1535А"
rname = "A13" rname = "A13"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_7" metadata/um = "um_9"
[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
@@ -292,7 +386,7 @@ fname = "УМ1535А"
rname = "A14" rname = "A14"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_8" metadata/um = "um_10"
[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
@@ -304,7 +398,7 @@ fname = "УМ1535А"
rname = "A15" rname = "A15"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_9" metadata/um = "um_11"
[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
@@ -316,7 +410,7 @@ fname = "УМ1535А"
rname = "A16" rname = "A16"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_10" metadata/um = "um_12"
[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
@@ -328,7 +422,7 @@ fname = "УМ1535А"
rname = "A17" rname = "A17"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_11" metadata/um = "um_13"
[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
@@ -340,7 +434,7 @@ fname = "УМ1535А"
rname = "A18" rname = "A18"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_12" metadata/um = "um_14"
[node name="control_result" type="Label" parent="."] [node name="control_result" type="Label" parent="."]
layout_mode = 0 layout_mode = 0
@@ -350,3 +444,33 @@ offset_right = 649.0
offset_bottom = 1003.0 offset_bottom = 1003.0
horizontal_alignment = 1 horizontal_alignment = 1
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="input_0" type="AnimatedSprite2D" parent="."]
position = Vector2(234, 177)
sprite_frames = SubResource("SpriteFrames_1wf07")
[node name="Label" type="Label" parent="input_0"]
offset_left = -15.0
offset_top = 15.0
offset_right = 53.0
offset_bottom = 34.0
text = "Вход ЕМС"
[node name="input_1" type="AnimatedSprite2D" parent="."]
position = Vector2(277, 177)
sprite_frames = SubResource("SpriteFrames_1wf07")
[node name="output_0" type="AnimatedSprite2D" parent="."]
position = Vector2(381, 177)
sprite_frames = SubResource("SpriteFrames_1wf07")
[node name="Label" type="Label" parent="output_0"]
offset_left = -19.0
offset_top = 14.0
offset_right = 57.0
offset_bottom = 33.0
text = "Модуляция"
[node name="output_1" type="AnimatedSprite2D" parent="."]
position = Vector2(422, 177)
sprite_frames = SubResource("SpriteFrames_1wf07")

View File

@@ -21,6 +21,18 @@ func _ready() -> void:
on_press_device() on_press_device()
func _process(_delta: float) -> void:
if Engine.is_editor_hint():
return
set_frame($input_0, unit_prd_v.ems_input_1)
set_frame($input_1, unit_prd_v.ems_input_2)
set_frame($output_0, unit_prd_v.ems_output_1)
set_frame($output_1, unit_prd_v.ems_output_2)
func set_frame(node_frame: Node, val: int): node_frame.set_frame(val)
func start_control() -> void: func start_control() -> void:
set_default_state() set_default_state()
find_labels(self) find_labels(self)
@@ -47,6 +59,13 @@ func _exit_tree() -> void:
#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:
for i_node_temperature in temperature_arr_node:
var temperature_meta: String = i_node_temperature.get_meta('um')
if not temperature_dic.has(temperature_meta): return
i_node_temperature.value1 = temperature_dic[temperature_meta]
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier: Array, POWER_THRESHOLD: int) -> void: static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier: Array, POWER_THRESHOLD: int) -> void:
for i_powapm in power_amplifier: for i_powapm in power_amplifier:
var powamp_meta: String = i_powapm.get_meta('um') var powamp_meta: String = i_powapm.get_meta('um')
@@ -56,7 +75,7 @@ static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifi
status = STATE_VAL.ERROR status = STATE_VAL.ERROR
else: else:
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_4: return if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_4: return
if powamp_meta in ['um_7', 'um_8', 'um_9', 'um_10', 'um_11', 'um_12'] and not fs_result.fs_5: return if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_5: return
i_powapm.value0 = pow_dic[powamp_meta] i_powapm.value0 = pow_dic[powamp_meta]
for i_p in pow_dic[powamp_meta]: for i_p in pow_dic[powamp_meta]:
if i_p < POWER_THRESHOLD: if i_p < POWER_THRESHOLD:
@@ -64,6 +83,53 @@ static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifi
i_powapm.state = status i_powapm.state = status
## Проверка температур УМ от УКП
static func check_temperature_um(status_prd: PackedByteArray, power_amplifier: Array) -> bool:
if power_amplifier.size() < 1: return false
const Constants: Dictionary = {
'CONST_MIN_TEMP': -25,
'MAXIMUM_CODE_ADC': 3796,
'MINIMUM_CODE_AD': 2660,
'TEMPERATURE_UKP_1': 47,
'TEMPERATURE_UKP_2': 79,
}
const TEMP: float = 115.0 / (Constants.MAXIMUM_CODE_ADC - Constants.MINIMUM_CODE_AD)
var ukp1_online: int = (status_prd[0] >> 2) & 1
var ukp2_online = (status_prd[0] >> 3) & 1
var all_temp_is_ok: bool = true
if ukp1_online:
var tmp_1: int
var temperature_ukp_1: int
for i_temp in 6:
temperature_ukp_1 = status_prd.decode_u16(Constants.TEMPERATURE_UKP_1 + 2 * i_temp)
tmp_1 = round(Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_ukp_1) * TEMP + 3)
power_amplifier[i_temp].value1 = tmp_1
if tmp_1>70:
all_temp_is_ok = false
if power_amplifier.size() > 12: # Темпуратура от УМ литеры 1
temperature_ukp_1 = status_prd.decode_u16(Constants.TEMPERATURE_UKP_1 + 2 * 7)
tmp_1 = round(Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_ukp_1) * TEMP + 3)
power_amplifier[6].value1 = tmp_1
if tmp_1>70:
all_temp_is_ok = false
if ukp2_online:
for i_temp in 6:
var temperature_ukp_2: int = status_prd.decode_u16(Constants.TEMPERATURE_UKP_2 + 2 * i_temp)
var tmp_2: int = round(Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_ukp_2) * TEMP + 3)
if power_amplifier.size() > 12:
power_amplifier[i_temp+7].value1 = tmp_2
if tmp_2>70:
all_temp_is_ok = false
else:
power_amplifier[i_temp+6].value1 = tmp_2
if tmp_2>70:
all_temp_is_ok = false
return all_temp_is_ok
func on_press_device() -> void: func on_press_device() -> void:
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 node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
@@ -78,6 +144,7 @@ func on_press_device() -> void:
'power_dic': unit_prd_v.power_result, 'power_dic': unit_prd_v.power_result,
'block_kasseta_y5_config': unit_prd_v.block_kasseta_y5_config, 'block_kasseta_y5_config': unit_prd_v.block_kasseta_y5_config,
'block_ip_config': unit_prd_v.block_ip_config, 'block_ip_config': unit_prd_v.block_ip_config,
'temperature_um' : unit_prd_v.temperature_um,
'nodes_y5': nodes_y5, 'nodes_y5': nodes_y5,
'node_ip_power_arr': node_ip_power_arr, 'node_ip_power_arr': node_ip_power_arr,
'fs_nodes': fs_nodes, 'fs_nodes': fs_nodes,
@@ -93,7 +160,8 @@ func on_press_device() -> void:
static func on_control_result(for_result_dic: Dictionary) -> void: static func on_control_result(for_result_dic: Dictionary) -> void:
## If control is end temperature_fill(for_result_dic.power_amplifier, for_result_dic.temperature_um)
var block_kasseta_y5_prd_config_v: Dictionary = for_result_dic.block_kasseta_y5_config var block_kasseta_y5_prd_config_v: Dictionary = for_result_dic.block_kasseta_y5_config
var nodes_y5: Array = for_result_dic.nodes_y5 var nodes_y5: Array = for_result_dic.nodes_y5
for node_y5 in nodes_y5: for node_y5 in nodes_y5:
@@ -110,26 +178,23 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
if block_ip_config_v.has(meta_ip) and block_kasseta_y5_prd_config_v.ug: if block_ip_config_v.has(meta_ip) and block_kasseta_y5_prd_config_v.ug:
power_supply.state = STATE_VAL.GOOD if block_ip_config_v[meta_ip][1] else STATE_VAL.ERROR power_supply.state = STATE_VAL.GOOD if block_ip_config_v[meta_ip][1] else STATE_VAL.ERROR
## If control is end
var result_dic: Dictionary = for_result_dic.result_dic var result_dic: Dictionary = for_result_dic.result_dic
for f in for_result_dic.fs_nodes: 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):
var new_state = result_dic[fs_meta] f.state = result_dic[fs_meta]
f.state = new_state
result_dic[fs_meta] = new_state
if result_dic.fs_5 == 1: if result_dic.fs_5 == 1 and block_kasseta_y5_prd_config_v['yau07']:
for_result_dic.module_fs_5.state = STATE_VAL.GOOD if result_dic.dkm_5 else STATE_VAL.ERROR for_result_dic.module_fs_5.state = STATE_VAL.GOOD if result_dic.dkm_5 else STATE_VAL.ERROR
for_result_dic.dou_5.state = STATE_VAL.GOOD if result_dic.dou_5 else STATE_VAL.ERROR for_result_dic.dou_5.state = STATE_VAL.GOOD if result_dic.dou_5 else STATE_VAL.ERROR
else:
result_dic.fs_5 = 0 if result_dic.fs_4 == 1 and block_kasseta_y5_prd_config_v['yau07']:
if result_dic.fs_4 == 1:
for_result_dic.module_fs_4.state = STATE_VAL.GOOD if result_dic.dkm_4 else STATE_VAL.ERROR for_result_dic.module_fs_4.state = STATE_VAL.GOOD if result_dic.dkm_4 else STATE_VAL.ERROR
for_result_dic.dou_4.state = STATE_VAL.GOOD if result_dic.dou_4 else STATE_VAL.ERROR for_result_dic.dou_4.state = STATE_VAL.GOOD if result_dic.dou_4 else STATE_VAL.ERROR
else:
result_dic.fs_4 = 0 if block_kasseta_y5_prd_config_v['yau07']:
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD)
power_fill(for_result_dic.power_dic, for_result_dic.result_dic, for_result_dic.power_amplifier, for_result_dic.POWER_THRESHOLD)
var result: bool = true var result: bool = true
for device in result_dic.values(): for device in result_dic.values():

View File

@@ -1,13 +1,36 @@
[gd_scene load_steps=9 format=3 uid="uid://cvskpe1ti3p45"] [gd_scene load_steps=13 format=3 uid="uid://cvskpe1ti3p45"]
[ext_resource type="Script" uid="uid://cvuosuvjaci1h" path="res://scenes/pribor-prd-v/pribor-prd-v.gd" id="1_c20s6"] [ext_resource type="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
@@ -80,12 +103,83 @@ text = "Панель
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="kasseta_U5" parent="." instance=ExtResource("4_gl2bl")] [node name="kasseta_U5" type="NinePatchRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 175.0 offset_left = 175.0
offset_top = 242.0 offset_top = 242.0
offset_right = 485.0 offset_right = 485.0
offset_bottom = 432.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
@@ -153,7 +247,7 @@ offset_left = 485.0
offset_top = 242.0 offset_top = 242.0
offset_right = 652.0 offset_right = 652.0
offset_bottom = 337.0 offset_bottom = 337.0
fname = "УМ1535Б" fname = "УМ1535А"
rname = "A7" rname = "A7"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
@@ -229,7 +323,7 @@ fname = "УМ1535А"
rname = "A13" rname = "A13"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_7" metadata/um = "um_9"
[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
@@ -241,7 +335,7 @@ fname = "УМ1535А"
rname = "A14" rname = "A14"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_8" metadata/um = "um_10"
[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
@@ -253,7 +347,7 @@ fname = "УМ1535А"
rname = "A15" rname = "A15"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_9" metadata/um = "um_11"
[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
@@ -265,7 +359,7 @@ fname = "УМ1535А"
rname = "A16" rname = "A16"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_10" metadata/um = "um_12"
[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
@@ -277,7 +371,7 @@ fname = "УМ1535А"
rname = "A17" rname = "A17"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_11" metadata/um = "um_13"
[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
@@ -289,7 +383,7 @@ fname = "УМ1535А"
rname = "A18" rname = "A18"
value0_info = "Мощность, Вт" value0_info = "Мощность, Вт"
value1_info = "Температура,°C" value1_info = "Температура,°C"
metadata/um = "um_12" metadata/um = "um_14"
[node name="control_result" type="Label" parent="."] [node name="control_result" type="Label" parent="."]
layout_mode = 0 layout_mode = 0
@@ -299,3 +393,33 @@ offset_right = 649.0
offset_bottom = 1003.0 offset_bottom = 1003.0
horizontal_alignment = 1 horizontal_alignment = 1
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="input_0" type="AnimatedSprite2D" parent="."]
position = Vector2(234, 177)
sprite_frames = SubResource("SpriteFrames_s5gcy")
[node name="Label" type="Label" parent="input_0"]
offset_left = -15.0
offset_top = 15.0
offset_right = 53.0
offset_bottom = 34.0
text = "Вход ЕМС"
[node name="input_1" type="AnimatedSprite2D" parent="."]
position = Vector2(277, 177)
sprite_frames = SubResource("SpriteFrames_s5gcy")
[node name="output_0" type="AnimatedSprite2D" parent="."]
position = Vector2(381, 177)
sprite_frames = SubResource("SpriteFrames_s5gcy")
[node name="Label" type="Label" parent="output_0"]
offset_left = -19.0
offset_top = 14.0
offset_right = 57.0
offset_bottom = 33.0
text = "Модуляция"
[node name="output_1" type="AnimatedSprite2D" parent="."]
position = Vector2(422, 177)
sprite_frames = SubResource("SpriteFrames_s5gcy")

View File

@@ -3,53 +3,32 @@ extends Label
const STATUS_GOOD := {"text": "Исправно", "color": Color.GREEN, "font_color": Color.BLACK} const STATUS_GOOD := {"text": "Исправно", "color": Color.GREEN, "font_color": Color.BLACK}
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 = false # true var is_prd_operational: bool = true
var is_uf_operational: bool = false var is_uf_operational: bool = true
func _ready() -> void: func _ready() -> void:
tooltip_text = 'Нет связи с приборами комплекса' tooltip_text = 'Нет связи с приборами комплекса'
for prd_module in prd.prd_dict.values(): for prd_module in prd.prd_dict.values():
prd_module.connect('update_serviceability', Callable(self, 'on_serviceability_changed').bind(prd_module)) prd_module.connect('update_serviceability', Callable(self, 'on_serviceability_changed').bind(prd_module))
var unit_uf = network.get_unit_instance('уарэп-эмс') var unit_uf: = network.get_unit_instance('уарэп-эмс')
unit_uf.connect('data_received', Callable(self, 'on_uf_status_receive')) unit_uf.connect('data_received', Callable(self, 'on_uf_status_receive'))
add_theme_color_override("font_color", Color.BLACK) add_theme_color_override("font_color", Color.BLACK)
#func on_serviceability_changed(unit_prd_module: Object) -> void:
func on_serviceability_changed() -> void: func on_serviceability_changed(unit_prd_module: Object) -> void:
var check_service: bool = true var check_service: bool = true
for prd_module in prd.prd_dict.values(): for prd_module in prd.prd_dict.values():
if prd_module.unit_yau07.online: if prd_module.unit_yau07.online:
#if not unit_prd_module.serviceability: if not unit_prd_module.serviceability:
if not prd_module.serviceability:
check_service = false check_service = false
if check_service != is_prd_operational: if check_service != is_prd_operational:
is_prd_operational = check_service is_prd_operational = check_service
_update_serviceability_display() _update_serviceability_display()
## Обработчики кнопок
#func _on_button_test_on() -> void:
#print("[TEST] Оба исправны")
#is_prd_operational = true
#is_uf_operational = true
#_update_serviceability_display()
#
#func _on_button_test_off() -> void:
#print("[TEST] Оба неисправны")
#is_prd_operational = false
#is_uf_operational = false
#_update_serviceability_display()
#
#func _on_button_test_mix() -> void:
#is_prd_operational = !is_prd_operational
#is_uf_operational = !is_uf_operational
#print("[TEST] Смешанный режим → UF:", is_uf_operational, "PRD:", is_prd_operational)
#_update_serviceability_display()
func _update_serviceability_display() -> void: func _update_serviceability_display() -> void:
var status = STATUS_GOOD if (is_uf_operational and is_prd_operational) else STATUS_BAD var status := STATUS_GOOD if (is_uf_operational and is_prd_operational) else STATUS_BAD
text = status.text text = status.text
modulate = status.color modulate = status.color
tooltip_text = 'Результаты обобщенного признака работоспособности изделия' tooltip_text = 'Результаты обобщенного признака работоспособности изделия'
@@ -57,9 +36,9 @@ func _update_serviceability_display() -> void:
func on_uf_status_receive(unit_uf: Object) -> void: func on_uf_status_receive(unit_uf: Object) -> void:
var KEMS_B = ((unit_uf.status[0] >> 0) & 1) & ((unit_uf.status[0] >> 3) & 1) var KEMS_B = ((unit_uf.status[0] >> 0) & 1) and ((unit_uf.status[0] >> 3) & 1)
var EMS_B_1 = ((unit_uf.status[0] >> 1) & 1) & ((unit_uf.status[0] >> 4) & 1) var EMS_B_1 = ((unit_uf.status[0] >> 1) & 1) and ((unit_uf.status[0] >> 4) & 1)
var EMS_B_2 = ((unit_uf.status[0] >> 2) & 1) & ((unit_uf.status[0] >> 5) & 1) var EMS_B_2 = ((unit_uf.status[0] >> 2) & 1) and ((unit_uf.status[0] >> 5) & 1)
var IP27B = ((unit_uf.status[2] >> 6) & 1) var IP27B = ((unit_uf.status[2] >> 6) & 1)
var check_service: bool = KEMS_B and EMS_B_1 and EMS_B_2 and IP27B var check_service: bool = KEMS_B and EMS_B_1 and EMS_B_2 and IP27B
if not _is_uf_status_initialized or check_service != is_uf_operational: if not _is_uf_status_initialized or check_service != is_uf_operational:

View File

@@ -79,21 +79,6 @@ 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 = 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
[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 = 1242.0
@@ -125,35 +110,20 @@ toggle_mode = true
text = "Тренаж" text = "Тренаж"
script = ExtResource("9_41d34") script = ExtResource("9_41d34")
[node name="buttontest" type="Button" parent="."] [node name="lbl_ready" type="Label" parent="."]
visible = false
layout_mode = 0 layout_mode = 0
offset_left = 1408.0 offset_left = 1504.0
offset_top = 64.0 offset_right = 1600.0
offset_right = 1456.0 offset_bottom = 27.0
offset_bottom = 88.0 tooltip_text = "Готовность аппаратуры к работе"
text = "mix" mouse_filter = 0
theme_override_font_sizes/font_size = 14
[node name="buttonteston" type="Button" parent="."] theme_override_styles/normal = SubResource("StyleBoxFlat_o1r22")
visible = false text = "Нет связи"
layout_mode = 0 horizontal_alignment = 1
offset_left = 1472.0 vertical_alignment = 1
offset_top = 64.0 script = ExtResource("8_tidwt")
offset_right = 1520.0 metadata/_edit_lock_ = true
offset_bottom = 88.0
text = "on"
[node name="buttontestoff" type="Button" parent="."]
visible = false
layout_mode = 0
offset_left = 1536.0
offset_top = 64.0
offset_right = 1584.0
offset_bottom = 88.0
text = "off"
[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_trenaj_toggled"] [connection signal="toggled" from="тренаж_режим" to="tab_switch" method="_on_button_trenazh_toggled"]
[connection signal="pressed" from="buttontest" to="lbl_ready" method="_on_button_test_mix"]
[connection signal="pressed" from="buttonteston" to="lbl_ready" method="_on_button_test_on"]
[connection signal="pressed" from="buttontestoff" to="lbl_ready" method="_on_button_test_off"]

View File

@@ -367,13 +367,13 @@ func _process(delta) -> void:
_queue.erase(tile.i) _queue.erase(tile.i)
req.request_completed.connect(_response.bind(req, tile)) req.request_completed.connect(_response.bind(req, tile))
if req.request(tile.url) != OK: if req.request(tile.url) != OK:
tile.t = now tile.t = now
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
if _queue.is_empty(): if _queue.is_empty():
emit_signal('load_completed') emit_signal('load_completed')
@@ -717,7 +717,7 @@ func set_coordinates(lon: float, lat: float, course: float) -> void:
add_mark_from_lon_lat(ship_id, lon, lat, ship_instance, 0.0) add_mark_from_lon_lat(ship_id, lon, lat, ship_instance, 0.0)
else: else:
_marks[ship_id].position = lonlat_to_world(lon, lat) _marks[ship_id].position = lonlat_to_world(lon, lat)
ship_instance.rotation_degrees = fmod(course, 360.0) ship_instance.rotation_degrees = fmod(270.0 + course, 360.0)
queue_redraw() queue_redraw()

View File

@@ -3,10 +3,16 @@ extends Button
var base_style: StyleBoxFlat var base_style: StyleBoxFlat
var tween var tween
var pulsing: bool = false var pulsing: bool = false
@onready var progress_bars := get_tree().get_nodes_in_group("control_progress") var original_text: String
func _ready(): func _ready():
original_text = text
_setup_styles()
_setup_signals()
func _setup_styles() -> void:
if get("theme_override_styles/disabled") == null: if get("theme_override_styles/disabled") == null:
base_style = StyleBoxFlat.new() base_style = StyleBoxFlat.new()
base_style.border_color = Color(1.0, 0.5, 0.0) base_style.border_color = Color(1.0, 0.5, 0.0)
@@ -14,19 +20,28 @@ func _ready():
base_style.border_width_bottom = 4 base_style.border_width_bottom = 4
base_style.border_width_left = 4 base_style.border_width_left = 4
base_style.border_width_right = 4 base_style.border_width_right = 4
base_style.bg_color = Color(0.2, 0.2, 0.2)
set("theme_override_styles/disabled", base_style) set("theme_override_styles/disabled", base_style)
else: else:
base_style = get("theme_override_styles/disabled") base_style = get("theme_override_styles/disabled")
set("theme_override_colors/font_disabled_color", Color(1.0, 1.0, 1.0))
func _setup_signals() -> void:
connect("pressed", Callable(self, "_on_pressed")) connect("pressed", Callable(self, "_on_pressed"))
if not signaller:
return
var signals_to_connect := ["режим_работа", "режим_журнал", "режим_эмс", "режим_настройки", "режим_контроль"]
for signal_name in signals_to_connect:
if signaller.has_signal(signal_name):
signaller.connect(signal_name, Callable(self, "_on_status_change"))
func _on_pressed(): func _on_pressed():
disabled = true disabled = true
text = "Идет выполнение контроля"
_start_pulse() _start_pulse()
var callback = Callable(self, "_check_progress_end")
for pb in progress_bars:
if not pb.is_connected("value_changed", callback):
pb.connect("value_changed", callback)
func _start_pulse(): func _start_pulse():
@@ -52,14 +67,13 @@ func _stop_pulse():
base_style.border_color = Color(1.0, 0.5, 0.0) base_style.border_color = Color(1.0, 0.5, 0.0)
pulsing = false pulsing = false
disabled = false disabled = false
var callback = Callable(self, "_check_progress_end") text = original_text
for pb in progress_bars:
if pb.is_connected("value_changed", callback):
pb.disconnect("value_changed", callback)
func _check_progress_end(value): func _on_status_change():
for pb in progress_bars:
if pb.value < pb.max_value:
return
_stop_pulse() _stop_pulse()
func _exit_tree() -> void:
if tween:
tween.kill()

View File

@@ -1 +1 @@
uid://cjj7pbbhk8q7c uid://xjs7owe2iexn

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 > 70 else Color.WHITE $margin/vbox/grid1/level7.tint_progress = Color.RED if v >= 70 else Color.GOLD if v >= 60 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) #push_warning('обращение к %s вне дерева' % self) TODO: пишеться только когда заходишь в проект а дальше не используется
func get_level_nodes() -> Array: func get_level_nodes() -> Array:
@@ -273,10 +273,8 @@ 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]
value1 = 56.0 max_value0 = 1400.0
min_value1 = -50.0 max_value1 = 70.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,%"
@@ -476,12 +474,10 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = " tooltip_text = "
Текущее: 56.00 Текущее: 0.00
Диапазон: -50.00…120.00" Диапазон: 0.00…70.00"
mouse_filter = 0 mouse_filter = 0
min_value = -50.0 max_value = 70.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

@@ -0,0 +1,406 @@
[gd_scene load_steps=15 format=3 uid="uid://ffi1njkjceb5"]
[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="1_uojqc"]
[ext_resource type="Texture2D" uid="uid://dnreyfh3cd1k2" path="res://data/состояние-исправности-1.png" id="2_a8ar3"]
[ext_resource type="Texture2D" uid="uid://c6booa8753u5t" path="res://data/состояние-исправности-2.png" id="3_xwd13"]
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="4_eobkx"]
[ext_resource type="Texture2D" uid="uid://00871pb6moln" path="res://data/прогресс-фон-1.png" id="5_mg57e"]
[ext_resource type="Texture2D" uid="uid://c1k856fxhrjnh" path="res://data/прогресс-заполнение-1.png" id="6_of7rd"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3nd2u"]
[sub_resource type="GDScript" id="GDScript_oj3k3"]
script/source = "@tool
class_name blok_v extends PanelContainer
@export var textures: Array
@export var animation_duration: float = 1.5
signal pressed(control: PanelContainer)
## Значения уровней
@export var value0: Array:
set(v):
value0.assign(v)
var items: Array = get_level_nodes()
var count: int = min(items.size(), v.size())
for i in count:
set_value0_animated(items[i], v[i])
## Значение уровня
@export var value1: float:
set(v):
value1 = v
if not is_inside_tree():
return
$margin/vbox/grid1/level7.value = v
$margin/vbox/grid1/level7.tint_progress = Color.RED if v >= 70 else Color.GOLD if v >= 60 else Color.WHITE
@export var min_value0: float:
set(v):
min_value0 = v
var items: = get_level_nodes()
set_group_param(items, 'min_value', v)
@export var min_value1: float:
set(v):
min_value1 = v
if not is_inside_tree():
return
$margin/vbox/grid1/level7.min_value = v
@export var max_value0: float:
set(v):
max_value0 = v
var items: = get_level_nodes()
set_group_param(items, 'max_value', v)
@export var max_value1: float:
set(v):
max_value1 = v
if not is_inside_tree():
return
$margin/vbox/grid1/level7.max_value = v
@export var step0: float:
set(v):
step0 = v
var items: = get_level_nodes()
set_group_param(items, 'step', v)
@export var step1: float:
set(v):
step1 = v
if not is_inside_tree():
return
$margin/vbox/grid1/level7.step = v
@export var value_name0: String:
set(v):
value_name0 = v
var items: Array = get_name_nodes()
set_group_param(items, 'text', v)
@export var value_name1: String:
set(v):
value_name1 = v
if not is_inside_tree():
return
$margin/vbox/grid2/lbl7.text = v
@export var fname: String:
set(v):
fname = v
if not is_inside_tree():
return
$margin/vbox/grid0/fname.text = v
@export var rname: String:
set(v):
rname = v
if not is_inside_tree():
return
$margin/vbox/grid0/rname.text = v
@export var state: int:
set(v):
state = tools.clip_value(v, 0, textures.size() - 1)
if not is_inside_tree():
return
$margin/vbox/grid0/state.texture = textures[state]
@export var alignment: int:
set(v):
alignment = v
if is_inside_tree():
$margin/vbox.alignment = v
@export var value0_info: String:
set(v):
value0_info = v
@export var value1_info: String:
set(v):
value1_info = v
func _on_button_pressed(): emit_signal('pressed', self)
func set_value0(value: Array): value0.assign(value)
func _enter_tree() -> void: call_deferred('_enter_tree_defered')
func _ready():
var items: Array = get_level_nodes()
for item in items:
item.connect('value_changed', on_level_changed.bind(item, value0_info))
on_level_changed(item.value, item, value0_info)
var level7: = $margin/vbox/grid1/level7
level7.connect('value_changed', on_level_changed.bind(level7, value1_info))
on_level_changed(level7.value, level7, value1_info)
func on_level_changed(_val: float, item: TextureProgressBar, info: String):
item.tooltip_text = '%s\\nТекущее: %0.2f\\nДиапазон: %0.2f…%0.2f' % [info, item.value, item.min_value, item.max_value]
func set_group_param(items: Array, param: StringName, v) -> void:
if not is_inside_tree():
return
if not get_tree():
return
for i in items.size():
items[i].set(param, v)
func set_value0_by_index(index: int, value: float) -> void:
var items: Array = get_level_nodes()
items[index].value = value
func _enter_tree_defered():
var items: Array = get_level_nodes()
var count: int = min(items.size(), value0.size())
for i in count:
items[i].min_value = min_value0
items[i].max_value = 1400 # max_value0: TODO для отладки
items[i].step = step0
items = get_name_nodes()
set_group_param(items, 'text', value_name0)
if is_inside_tree():
$margin/vbox/grid1/level7.value = value1
$margin/vbox/grid1/level7.min_value = min_value1
$margin/vbox/grid1/level7.max_value = max_value1
$margin/vbox/grid1/level7.step = step1
$margin/vbox/grid2/lbl7.text = value_name1
$margin/vbox.alignment = alignment
$margin/vbox/grid0/rname.text = rname
$margin/vbox/grid0/fname.text = fname
$margin/vbox/grid0/state.texture = textures[state]
func get_level_nodes() -> Array:
if not is_inside_tree():
return []
if not get_tree():
return []
return [$margin/vbox/grid1/level1]
func get_name_nodes() -> Array:
if not is_inside_tree():
return []
if not get_tree():
return []
return [$margin/vbox/grid2/lbl1]
func set_value0_animated(target_node, target_value: float) -> void:
var tween: Tween = create_tween()
tween.set_ease(Tween.EASE_OUT)
tween.set_trans(Tween.TRANS_QUINT)
tween.tween_property(target_node, 'value', target_value, animation_duration)
"
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_rceim"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8yvwo"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6qu57"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_mlxje"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3dspb"]
[sub_resource type="GDScript" id="GDScript_45hqb"]
script/source = "@tool
extends MarginContainer
func _enter_tree() -> void:
margins = [8, 8, 8, 8]
@export var margins: Array:
set(vals):
add_theme_constant_override('margin_top', vals[0])
add_theme_constant_override('margin_left', vals[1])
add_theme_constant_override('margin_bottom', vals[2])
add_theme_constant_override('margin_right', vals[3])
get:
var vals = [0, 0, 0, 0]
vals[0] = get_theme_constant('margin_top')
vals[1] = get_theme_constant('margin_left')
vals[2] = get_theme_constant('margin_bottom')
vals[3] = get_theme_constant('margin_right')
return vals
"
[node name="блок-к" type="PanelContainer"]
editor_description = "Элемент замены из ЗИП"
offset_right = 160.0
offset_bottom = 88.0
theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u")
script = SubResource("GDScript_oj3k3")
textures = [ExtResource("1_uojqc"), ExtResource("2_a8ar3"), ExtResource("3_xwd13")]
value0 = [20.0, 30.0, 40.0, 50.0, 60.0, 70.0]
max_value0 = 1400.0
max_value1 = 70.0
step0 = 1.0
step1 = 1.0
value_name0 = "P,%"
value_name1 = "°C"
fname = "Блок В"
rname = "A1"
[node name="button" type="Button" parent="."]
layout_mode = 2
theme_override_styles/focus = SubResource("StyleBoxEmpty_rceim")
theme_override_styles/disabled = SubResource("StyleBoxEmpty_8yvwo")
theme_override_styles/hover = SubResource("StyleBoxEmpty_6qu57")
theme_override_styles/pressed = SubResource("StyleBoxEmpty_mlxje")
theme_override_styles/normal = SubResource("StyleBoxEmpty_3dspb")
[node name="rect" type="NinePatchRect" parent="."]
layout_mode = 2
texture = ExtResource("4_eobkx")
draw_center = false
region_rect = Rect2(0, 0, 63, 63)
patch_margin_left = 17
patch_margin_top = 17
patch_margin_right = 17
patch_margin_bottom = 15
[node name="margin" type="MarginContainer" parent="."]
layout_mode = 2
theme_override_constants/margin_left = 8
theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 8
theme_override_constants/margin_bottom = 8
script = SubResource("GDScript_45hqb")
margins = [8, 8, 8, 8]
[node name="vbox" type="VBoxContainer" parent="margin"]
layout_mode = 2
[node name="grid0" type="GridContainer" parent="margin/vbox"]
layout_mode = 2
columns = 3
[node name="state" type="TextureRect" parent="margin/vbox/grid0"]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
size_flags_horizontal = 2
size_flags_vertical = 6
texture = ExtResource("1_uojqc")
expand_mode = 1
[node name="fname" type="Label" parent="margin/vbox/grid0"]
self_modulate = Color(1, 1, 1, 0.627451)
custom_minimum_size = Vector2(0, 20)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_font_sizes/font_size = 17
text = "Блок В"
horizontal_alignment = 1
vertical_alignment = 1
[node name="rname" type="Label" parent="margin/vbox/grid0"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 6
theme_override_font_sizes/font_size = 18
text = "A1"
horizontal_alignment = 2
vertical_alignment = 1
[node name="grid1" type="GridContainer" parent="margin/vbox"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 3
columns = 7
[node name="level1" type="TextureProgressBar" parent="margin/vbox/grid1" groups=["уровни"]]
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
tooltip_text = "
Текущее: 0.00
Диапазон: 0.00…1400.00"
mouse_filter = 0
max_value = 1400.0
fill_mode = 3
nine_patch_stretch = true
stretch_margin_left = 8
stretch_margin_top = 8
stretch_margin_right = 8
stretch_margin_bottom = 8
texture_under = ExtResource("5_mg57e")
texture_progress = ExtResource("6_of7rd")
tint_under = Color(1, 1, 1, 0.419608)
tint_progress = Color(0.890196, 0.486275, 0.196078, 1)
[node name="level7" type="TextureProgressBar" parent="margin/vbox/grid1"]
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
tooltip_text = "
Текущее: 0.00
Диапазон: 0.00…70.00"
mouse_filter = 0
max_value = 70.0
fill_mode = 3
nine_patch_stretch = true
stretch_margin_left = 8
stretch_margin_top = 8
stretch_margin_right = 8
stretch_margin_bottom = 8
texture_under = ExtResource("5_mg57e")
texture_progress = ExtResource("6_of7rd")
tint_under = Color(0.890196, 0.486275, 0.196078, 1)
tint_over = Color(0.890196, 0.486275, 0.196078, 1)
[node name="grid2" type="GridContainer" parent="margin/vbox"]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
columns = 7
[node name="lbl1" type="Label" parent="margin/vbox/grid2" groups=["названия"]]
clip_contents = true
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 8
text = "P,%"
horizontal_alignment = 1
[node name="lbl7" type="Label" parent="margin/vbox/grid2"]
clip_contents = true
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 8
text = "°C"
horizontal_alignment = 1
[connection signal="pressed" from="button" to="." method="_on_button_pressed"]

View File

@@ -35,9 +35,10 @@ 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 = 5.0 offset_left = 8.0
offset_top = 5.0 offset_top = 5.0
offset_right = 105.0 offset_right = 112.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 = "A24" rname = "A31"
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 = "A30" rname = "A37"
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 = "A26" rname = "A33"
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 = "A27" rname = "A34"
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 = "A28" rname = "A36"
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 = "A29" rname = "A35"
metadata/y5 = "ukp2" metadata/y5 = "ukp2"

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=22 format=3 uid="uid://lwmw4egynmd1"] [gd_scene load_steps=21 format=3 uid="uid://lwmw4egynmd1"]
[ext_resource type="Texture2D" uid="uid://bar8k5qef7kch" path="res://data/УФ.png" id="2_0nvm1"] [ext_resource type="Texture2D" uid="uid://bar8k5qef7kch" path="res://data/УФ.png" id="2_0nvm1"]
[ext_resource type="Script" uid="uid://q3gmpsqspjfp" path="res://scenes/контроль/внешний.gd" id="2_8r80x"] [ext_resource type="Script" uid="uid://q3gmpsqspjfp" path="res://scenes/контроль/внешний.gd" id="2_8r80x"]
@@ -17,7 +17,7 @@
[ext_resource type="Texture2D" uid="uid://00871pb6moln" path="res://data/прогресс-фон-1.png" id="9_w6m6a"] [ext_resource type="Texture2D" uid="uid://00871pb6moln" path="res://data/прогресс-фон-1.png" id="9_w6m6a"]
[ext_resource type="Texture2D" uid="uid://c1k856fxhrjnh" path="res://data/прогресс-заполнение-1.png" id="10_lbx5w"] [ext_resource type="Texture2D" uid="uid://c1k856fxhrjnh" path="res://data/прогресс-заполнение-1.png" id="10_lbx5w"]
[ext_resource type="Script" uid="uid://bncy1x53jp73d" path="res://scenes/контроль/connect_pribor.gd" id="11_u7tym"] [ext_resource type="Script" uid="uid://bncy1x53jp73d" path="res://scenes/контроль/connect_pribor.gd" id="11_u7tym"]
[ext_resource type="Script" uid="uid://cjj7pbbhk8q7c" path="res://scenes/контроль/control_prd.gd" id="18_lbx5w"] [ext_resource type="Script" uid="uid://xjs7owe2iexn" path="res://scenes/контроль/control_prd.gd" id="18_lbx5w"]
[sub_resource type="GDScript" id="GDScript_iqgf5"] [sub_resource type="GDScript" id="GDScript_iqgf5"]
script/source = "extends Panel script/source = "extends Panel
@@ -178,15 +178,6 @@ animations = [{
"speed": 5.0 "speed": 5.0
}] }]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lbx5w"]
bg_color = Color(0.6, 0.6, 0.6, 0)
border_width_left = 10
border_width_top = 10
border_width_right = 10
border_width_bottom = 10
border_color = Color(0.833286, 0.436556, 0.229611, 1)
border_blend = true
[node name="Контроль" type="Panel"] [node name="Контроль" type="Panel"]
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@@ -422,7 +413,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_n_1" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_n_1"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -4.0 offset_left = -4.0
@@ -465,6 +456,7 @@ metadata/unit_name = ["уарэп-эмс"]
metadata/online_proc = "on_line_changed" metadata/online_proc = "on_line_changed"
[node name="label" type="Label" parent="pribor_uf"] [node name="label" type="Label" parent="pribor_uf"]
self_modulate = Color(0, 1, 0, 1)
layout_mode = 0 layout_mode = 0
offset_left = 15.0 offset_left = 15.0
offset_top = -44.0 offset_top = -44.0
@@ -541,6 +533,16 @@ patch_margin_top = 16
patch_margin_right = 16 patch_margin_right = 16
patch_margin_bottom = 16 patch_margin_bottom = 16
[node name="label2" type="Label" parent="pribor_rtr"]
layout_mode = 0
offset_left = 11.0
offset_top = -49.0
offset_right = 94.0
offset_bottom = -30.0
text = "РТР"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_rtr"] [node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_rtr"]
light_mask = 3 light_mask = 3
position = Vector2(53, -15) position = Vector2(53, -15)
@@ -596,6 +598,17 @@ patch_margin_top = 16
patch_margin_right = 16 patch_margin_right = 16
patch_margin_bottom = 16 patch_margin_bottom = 16
[node name="label2" type="Label" parent="pribor_afsp_1"]
layout_mode = 0
offset_left = 175.0
offset_top = -245.0
offset_right = 272.0
offset_bottom = -225.0
scale = Vector2(5, 5)
text = "АФСП 1"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_afsp_1"] [node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_afsp_1"]
light_mask = 3 light_mask = 3
position = Vector2(415, -40) position = Vector2(415, -40)
@@ -652,6 +665,17 @@ patch_margin_top = 16
patch_margin_right = 16 patch_margin_right = 16
patch_margin_bottom = 16 patch_margin_bottom = 16
[node name="label2" type="Label" parent="pribor_afsp_2"]
layout_mode = 0
offset_left = 175.0
offset_top = -240.0
offset_right = 272.0
offset_bottom = -220.0
scale = Vector2(5, 5)
text = "АФСП 2"
horizontal_alignment = 1
vertical_alignment = 1
[node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_afsp_2"] [node name="connect_pribor" type="AnimatedSprite2D" parent="pribor_afsp_2"]
light_mask = 3 light_mask = 3
position = Vector2(415, -40) position = Vector2(415, -40)
@@ -763,7 +787,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_v_2" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_v_2"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -4.0 offset_left = -4.0
@@ -840,7 +864,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_n_2" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_n_2"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -4.0 offset_left = -4.0
@@ -915,7 +939,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_k_2" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_k_2"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -4.0 offset_left = -4.0
@@ -990,7 +1014,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_v_3" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_v_3"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -8.0 offset_left = -8.0
@@ -1065,7 +1089,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_n_3" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_n_3"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -7.0 offset_left = -7.0
@@ -1140,7 +1164,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_k_3" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_k_3"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -8.0 offset_left = -8.0
@@ -1215,7 +1239,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_v_1" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_v_1"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -4.0 offset_left = -4.0
@@ -1290,7 +1314,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_k_1" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_k_1"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -4.0 offset_left = -4.0
@@ -1364,7 +1388,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_v_4" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_v_4"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -6.0 offset_left = -6.0
@@ -1438,7 +1462,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_n_4" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_n_4"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -8.0 offset_left = -8.0
@@ -1512,7 +1536,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
frame_progress = 0.72355 frame_progress = 0.72355
script = ExtResource("11_u7tym") script = ExtResource("11_u7tym")
[node name="control_progress" type="TextureProgressBar" parent="pribor_prd_k_4" groups=["control_progress"]] [node name="control_progress" type="TextureProgressBar" parent="pribor_prd_k_4"]
visible = false visible = false
layout_mode = 0 layout_mode = 0
offset_left = -8.0 offset_left = -8.0
@@ -1656,16 +1680,16 @@ points = PackedVector2Array(-8, 0, 608, 0)
width = 2.0 width = 2.0
default_color = Color(1, 1, 1, 0.352941) default_color = Color(1, 1, 1, 0.352941)
[node name="control_prd" type="Button" parent="." groups=["control_progress"]] [node name="control_prd" type="Button" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 1106.0 offset_left = 1101.0
offset_top = 64.0 offset_top = 64.0
offset_right = 1331.0 offset_right = 1326.0
offset_bottom = 104.0 offset_bottom = 104.0
focus_mode = 0 focus_mode = 0
theme_override_styles/disabled = SubResource("StyleBoxFlat_lbx5w")
text = "Запуск контроля" text = "Запуск контроля"
script = ExtResource("18_lbx5w") script = ExtResource("18_lbx5w")
metadata/_edit_lock_ = true
[connection signal="toggled" from="pribor_prd_n_1" to="pribor_prd_n_1" method="_on_toggled"] [connection signal="toggled" from="pribor_prd_n_1" to="pribor_prd_n_1" method="_on_toggled"]
[connection signal="toggled" from="pribor_uf" to="pribor_uf" method="_on_toggled"] [connection signal="toggled" from="pribor_uf" to="pribor_uf" method="_on_toggled"]

View File

@@ -98,7 +98,7 @@ func on_settings_changed():
color_closed = ProjectSettings.get_setting('application/interfer/closed_sectors', Color(0.0, 0.0, 0.0, 1.0)) color_closed = ProjectSettings.get_setting('application/interfer/closed_sectors', Color(0.0, 0.0, 0.0, 1.0))
color_emit_sel = color_select color_emit_sel = color_select
color_closed_emit = color_closed color_closed_emit = color_closed
color_select *= Color(1.0, 1.0, 1.0, 0.0) color_select *= Color(1.0, 1.0, 1.0, 0.0)
color_ecm *= Color(1.0, 1.0, 1.0, 0.0) color_ecm *= Color(1.0, 1.0, 1.0, 0.0)
color_emit_sel *= Color(1.0, 1.0, 1.0, 0.2) color_emit_sel *= Color(1.0, 1.0, 1.0, 0.2)
@@ -529,7 +529,7 @@ func update_fs_colors():
$btn_activate.self_modulate = Color.WHITE $btn_activate.self_modulate = Color.WHITE
else: else:
$btn_activate.self_modulate = Color.WHITE $btn_activate.self_modulate = Color.WHITE
func unsel_fs_all(need_btns_off: bool): func unsel_fs_all(need_btns_off: bool):
@@ -565,7 +565,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]:

View File

@@ -266,7 +266,7 @@ func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> v
thr.nmfs = nmfs thr.nmfs = nmfs
if (thr.proto in gos_protocols) and thr.fflags.proto and (not gos_flag): if (thr.proto in gos_protocols) and thr.fflags.proto and (not gos_flag):
gos_nmfs.append(nmfs) gos_nmfs.append(nmfs)
thr.emit_state = 0 thr.emit_state = 0
for ecm in ecms.values(): for ecm in ecms.values():
if thr.nmfs == ecm.nmfs: if thr.nmfs == ecm.nmfs:
@@ -278,7 +278,7 @@ func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> v
ecm_active = false ecm_active = false
if ecm_active and (prd.fs_caps_id[ecm.nmfs] in fs_closed): if ecm_active and (prd.fs_caps_id[ecm.nmfs] in fs_closed):
interfer_off(ecm, unit_instance) interfer_off(ecm, unit_instance)
var th_id = thr.id var th_id = thr.id
for ecm_i in thrs.keys(): for ecm_i in thrs.keys():
if thrs[ecm_i] == th_id: if thrs[ecm_i] == th_id:
@@ -675,4 +675,3 @@ func set_th_emit(th: threats.Threat, ecm: Interfer):
return return
else: else:
th.emit_state = 1 th.emit_state = 1

View File

@@ -285,8 +285,7 @@ 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 control_pribor_prd = preload('res://scripts/pribor-prd.gd') var unit_control = TestPRD.new({'unit_prd': unit_prd}, new_prd.cmd_array)
var unit_control = control_pribor_prd.TestPRD.new({'unit_prd': unit_prd}, new_prd.cmd_array)
add_child(unit_control) add_child(unit_control)
new_prd.unit_control = unit_control new_prd.unit_control = unit_control
for key in FS_PRD.keys(): for key in FS_PRD.keys():

File diff suppressed because it is too large Load Diff