Compare commits

...

2 Commits

12 changed files with 161 additions and 150 deletions

View File

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

View File

@@ -37,15 +37,15 @@ func set_frame(node_frame: Node, val: int): node_frame.set_frame(val)
func start_control() -> void:
set_default_state()
set_default_state(get_tree().get_nodes_in_group('default_reset'), get_tree().get_nodes_in_group('power_amplifier'))
find_labels(self)
func set_default_state() -> void:
for group in get_tree().get_nodes_in_group('default_reset'):
static func set_default_state(default_reset_array_node: Array, power_amplifier_arr_node: Array) -> void:
for group in default_reset_array_node:
group.state = STATE_VAL.NONE
for group in get_tree().get_nodes_in_group('power_amplifier'):
for group in power_amplifier_arr_node:
group.state = STATE_VAL.NONE
@@ -83,10 +83,16 @@ static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifi
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_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]
for i_p in pow_dic[powamp_meta]:
if i_p < POWER_THRESHOLD:
if powamp_meta == 'um_8':
i_powapm.value0 = [pow_dic[powamp_meta][5]]
if pow_dic[powamp_meta][5] < POWER_THRESHOLD:
status = STATE_VAL.ERROR
else:
i_powapm.value0 = pow_dic[powamp_meta]
for i_p in pow_dic[powamp_meta]:
if i_p < POWER_THRESHOLD:
status = STATE_VAL.ERROR
i_powapm.state = status
@@ -121,7 +127,7 @@ func on_press_device() -> void:
on_control_result(for_control_result)
func on_control_result(for_result_dic: Dictionary) -> void:
static func on_control_result(for_result_dic: Dictionary) -> void:
temperature_fill(for_result_dic.power_amplifier, for_result_dic.temperature_um)
var block_kasseta_y5_prd_config_k: Dictionary = for_result_dic.block_kasseta_y5_config
@@ -134,14 +140,15 @@ func on_control_result(for_result_dic: Dictionary) -> void:
break
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_k[meta_y5] else STATE_VAL.ERROR
var block_ip_config_k: Dictionary = unit_prd_k.block_ip_config
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
for power_supply in node_ip_power_arr:
var block_ip_config_k: Dictionary = for_result_dic.block_ip_config
for power_supply in for_result_dic.node_ip_power_arr:
var meta_ip = power_supply.get_meta('ip')
if block_ip_config_k.has(meta_ip) and block_kasseta_y5_prd_config_k.ug:
power_supply.state = STATE_VAL.GOOD if block_ip_config_k[meta_ip][1] else STATE_VAL.ERROR
## If control is end
if not for_result_dic.control_is_over:
set_default_state(for_result_dic.default_reset_array_node, for_result_dic.power_amplifier)
return
var result_dic: Dictionary = for_result_dic.result_dic
for f in for_result_dic.fs_nodes:
var fs_meta: String = f.get_meta('fs')

View File

@@ -51,7 +51,7 @@ offset_top = 242.0
offset_right = 485.0
offset_bottom = 432.0
[node name="maa2000_A22" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("1_8dmgr")]
[node name="maa2000_A22" parent="." groups=["power_supply"] instance=ExtResource("1_8dmgr")]
layout_mode = 0
offset_left = 485.0
offset_top = 907.0
@@ -70,7 +70,7 @@ offset_bottom = 907.0
fname = "ДОУ-6"
rname = "A7"
[node name="maa2000_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("1_8dmgr")]
[node name="maa2000_A23" parent="." groups=["power_supply"] instance=ExtResource("1_8dmgr")]
layout_mode = 0
offset_left = 8.0
offset_top = 907.0
@@ -122,7 +122,7 @@ offset_bottom = 337.0
value0 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
fname = "УМ1535Б"
rname = "A10"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_1"
@@ -134,7 +134,7 @@ offset_right = 652.0
offset_bottom = 432.0
fname = "УМ1535Б"
rname = "A11"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_2"
@@ -146,7 +146,7 @@ offset_right = 652.0
offset_bottom = 527.0
fname = "УМ1535Б"
rname = "A12"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_3"
@@ -158,7 +158,7 @@ offset_right = 652.0
offset_bottom = 622.0
fname = "УМ1535Б"
rname = "A13"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_4"
@@ -170,7 +170,7 @@ offset_right = 652.0
offset_bottom = 717.0
fname = "УМ1535Б"
rname = "A14"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_5"
@@ -182,7 +182,7 @@ offset_right = 652.0
offset_bottom = 812.0
fname = "УМ1535Б"
rname = "A15"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_6"
@@ -194,6 +194,8 @@ offset_right = 652.0
offset_bottom = 907.0
fname = "УТМ80"
rname = "A9"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_8"
[node name="rm1620m_A16" parent="." groups=["power_amplifier"] instance=ExtResource("5_c7lv8")]
@@ -204,7 +206,7 @@ offset_right = 175.0
offset_bottom = 337.0
fname = "РМ16-20М"
rname = "A16"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_9"
@@ -216,7 +218,7 @@ offset_right = 173.0
offset_bottom = 432.0
fname = "РМ16-20М"
rname = "A17"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_10"
@@ -228,7 +230,7 @@ offset_right = 175.0
offset_bottom = 527.0
fname = "РМ16-20М"
rname = "A18"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_11"
@@ -240,7 +242,7 @@ offset_right = 175.0
offset_bottom = 622.0
fname = "РМ16-20М"
rname = "A19"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_12"
@@ -252,7 +254,7 @@ offset_right = 175.0
offset_bottom = 717.0
fname = "РМ16-20М"
rname = "A20"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_13"
@@ -264,7 +266,7 @@ offset_right = 175.0
offset_bottom = 812.0
fname = "РМ16-20М"
rname = "A21"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_14"
@@ -290,7 +292,7 @@ patch_margin_bottom = 16
script = ExtResource("7_xpa2n")
fname = "Кассета П-1"
[node name="ref_A26" parent="kasseta_p_1" groups=["default_reset", "power_supply"] instance=ExtResource("8_la5yt")]
[node name="ref_A26" parent="kasseta_p_1" groups=["power_supply"] instance=ExtResource("8_la5yt")]
offset_left = 9.0
offset_top = 33.0
offset_right = 59.0
@@ -299,7 +301,7 @@ fname = "ИП9-50"
rname = "A23"
metadata/ip = "ip9_50_1"
[node name="ref_A23" parent="kasseta_p_1" groups=["default_reset", "power_supply"] instance=ExtResource("8_la5yt")]
[node name="ref_A23" parent="kasseta_p_1" groups=["power_supply"] instance=ExtResource("8_la5yt")]
offset_left = 59.0
offset_top = 33.0
offset_right = 109.0
@@ -308,7 +310,7 @@ fname = "ИП9-50"
rname = "A24"
metadata/ip = "ip9_50_2"
[node name="ref_A24" parent="kasseta_p_1" groups=["default_reset", "power_supply"] instance=ExtResource("8_la5yt")]
[node name="ref_A24" parent="kasseta_p_1" groups=["power_supply"] instance=ExtResource("8_la5yt")]
offset_left = 109.0
offset_top = 33.0
offset_right = 159.0
@@ -347,40 +349,25 @@ horizontal_alignment = 1
metadata/_edit_lock_ = true
[node name="input_0" type="AnimatedSprite2D" parent="."]
position = Vector2(234, 177)
position = Vector2(353, 618)
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)
position = Vector2(405, 618)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="input_2" type="AnimatedSprite2D" parent="."]
position = Vector2(188, 177)
position = Vector2(255, 619)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="output_0" type="AnimatedSprite2D" parent="."]
position = Vector2(421, 177)
position = Vector2(355, 464)
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)
position = Vector2(405, 464)
sprite_frames = SubResource("SpriteFrames_di0aa")
[node name="output_2" type="AnimatedSprite2D" parent="."]
position = Vector2(383, 177)
position = Vector2(255, 464)
sprite_frames = SubResource("SpriteFrames_di0aa")

View File

@@ -37,15 +37,15 @@ func set_frame(node_frame: Node, val: int): node_frame.set_frame(val)
func start_control() -> void:
set_default_state()
set_default_state(get_tree().get_nodes_in_group('default_reset'), get_tree().get_nodes_in_group('power_amplifier'))
find_labels(self)
func set_default_state() -> void:
for group in get_tree().get_nodes_in_group('default_reset'):
static func set_default_state(default_reset_array_node: Array, power_amplifier_arr_node: Array) -> void:
for group in default_reset_array_node:
group.state = STATE_VAL.NONE
for group in get_tree().get_nodes_in_group('power_amplifier'):
for group in power_amplifier_arr_node:
group.state = STATE_VAL.NONE
@@ -88,11 +88,13 @@ func on_press_device() -> void:
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
var power_amplifier_arr_node: Array = get_tree().get_nodes_in_group('power_amplifier')
var default_reset_array_node = get_tree().get_nodes_in_group('default_reset')
var module_fs_2: Node = $kasseta_FS_ND/ref_A4
var dou_2: Node = $dou2_A5
var module_fs_3: Node = $kasseta_FS_ND/ref_A3
var dou_3: Node = $dou3_A6
var for_control_result: Dictionary = {
'control_is_over': unit_prd_n.flag_control_is_over,
'result_dic': unit_prd_n.control_results,
'power_dic': unit_prd_n.power_result,
'block_kasseta_y5_config': unit_prd_n.block_kasseta_y5_config,
@@ -102,6 +104,7 @@ func on_press_device() -> void:
'node_ip_power_arr': node_ip_power_arr,
'fs_nodes': fs_nodes,
'power_amplifier': power_amplifier_arr_node,
'default_reset_array_node': default_reset_array_node,
'POWER_THRESHOLD': unit_prd_n.constants.POWER_THRESHOLD,
'name_prd': unit_prd_n.self_name,
'module_fs_2': module_fs_2,
@@ -112,7 +115,7 @@ func on_press_device() -> void:
on_control_result(for_control_result)
func on_control_result(for_result_dic: Dictionary) -> void:
static func on_control_result(for_result_dic: Dictionary) -> void:
temperature_fill(for_result_dic.power_amplifier, for_result_dic.temperature_um)
var block_kasseta_y5_prd_config_n: Dictionary = for_result_dic.block_kasseta_y5_config
@@ -125,14 +128,15 @@ func on_control_result(for_result_dic: Dictionary) -> void:
break
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_n[meta_y5] else STATE_VAL.ERROR
var block_ip_config_n: Dictionary = unit_prd_n.block_ip_config
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
for power_supply in node_ip_power_arr:
var block_ip_config_n: Dictionary = for_result_dic.block_ip_config
for power_supply in for_result_dic.node_ip_power_arr:
var meta_ip = power_supply.get_meta('ip')
if block_ip_config_n.has(meta_ip) and block_kasseta_y5_prd_config_n.ug:
power_supply.state = STATE_VAL.GOOD if block_ip_config_n[meta_ip][1] else STATE_VAL.ERROR
## If control is end
if not for_result_dic.control_is_over:
set_default_state(for_result_dic.default_reset_array_node, for_result_dic.power_amplifier)
return
var result_dic: Dictionary = for_result_dic.result_dic
for f in for_result_dic.fs_nodes:
var fs_meta: String = f.get_meta('fs')

View File

@@ -40,7 +40,7 @@ offset_right = 15.0
offset_bottom = 30.0
script = ExtResource("1_bnnv3")
[node name="maa2000_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_is25t")]
[node name="maa2000_A23" parent="." groups=["power_supply"] instance=ExtResource("2_is25t")]
layout_mode = 2
offset_left = 8.0
offset_top = 877.0
@@ -50,7 +50,7 @@ fname = "MAA2000"
rname = "A23"
metadata/ip = "maa2000_2"
[node name="maa2000_A22" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_is25t")]
[node name="maa2000_A22" parent="." groups=["power_supply"] instance=ExtResource("2_is25t")]
layout_mode = 2
offset_left = 485.0
offset_top = 877.0
@@ -254,7 +254,7 @@ patch_margin_bottom = 16
script = ExtResource("6_b5wvk")
fname = "Кассета П-1"
[node name="ref_A21" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_eoqf2")]
[node name="ref_A21" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_eoqf2")]
offset_left = 9.0
offset_top = 33.0
offset_right = 59.0
@@ -263,7 +263,7 @@ fname = "ИП12-50"
rname = "A21"
metadata/ip = "ip12_50_1"
[node name="ref_A20" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_eoqf2")]
[node name="ref_A20" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_eoqf2")]
offset_left = 59.0
offset_top = 33.0
offset_right = 109.0
@@ -272,7 +272,7 @@ fname = "ИП9-50"
rname = "A20"
metadata/ip = "ip9_50_1"
[node name="ref_A19" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_eoqf2")]
[node name="ref_A19" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_eoqf2")]
offset_left = 109.0
offset_top = 33.0
offset_right = 159.0
@@ -300,7 +300,7 @@ offset_right = 652.0
offset_bottom = 337.0
fname = "УМ1535А"
rname = "A7"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_1"
@@ -312,7 +312,7 @@ offset_right = 652.0
offset_bottom = 432.0
fname = "УМ1535А"
rname = "A8"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_2"
@@ -324,7 +324,7 @@ offset_right = 652.0
offset_bottom = 527.0
fname = "УМ1535А"
rname = "A9"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_3"
@@ -336,7 +336,7 @@ offset_right = 652.0
offset_bottom = 622.0
fname = "УМ1535А"
rname = "A10"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_4"
@@ -348,7 +348,7 @@ offset_right = 652.0
offset_bottom = 717.0
fname = "УМ1535А"
rname = "A11"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_5"
@@ -360,7 +360,7 @@ offset_right = 652.0
offset_bottom = 812.0
fname = "УМ1535А"
rname = "A12"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_6"
@@ -372,7 +372,7 @@ offset_right = 175.0
offset_bottom = 337.0
fname = "УМ1535А"
rname = "A13"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_9"
@@ -384,7 +384,7 @@ offset_right = 175.0
offset_bottom = 432.0
fname = "УМ1535А"
rname = "A14"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_10"
@@ -396,7 +396,7 @@ offset_right = 175.0
offset_bottom = 527.0
fname = "УМ1535А"
rname = "A15"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_11"
@@ -408,7 +408,7 @@ offset_right = 175.0
offset_bottom = 622.0
fname = "УМ1535А"
rname = "A16"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_12"
@@ -420,7 +420,7 @@ offset_right = 175.0
offset_bottom = 717.0
fname = "УМ1535А"
rname = "A17"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_13"
@@ -432,7 +432,7 @@ offset_right = 175.0
offset_bottom = 812.0
fname = "УМ1535А"
rname = "A18"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_14"
@@ -446,31 +446,17 @@ horizontal_alignment = 1
metadata/_edit_lock_ = true
[node name="input_0" type="AnimatedSprite2D" parent="."]
position = Vector2(234, 177)
position = Vector2(456, 589)
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)
position = Vector2(207, 586)
sprite_frames = SubResource("SpriteFrames_1wf07")
[node name="output_0" type="AnimatedSprite2D" parent="."]
position = Vector2(381, 177)
position = Vector2(458, 476)
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)
position = Vector2(210, 477)
sprite_frames = SubResource("SpriteFrames_1wf07")

View File

@@ -34,15 +34,15 @@ func set_frame(node_frame: Node, val: int): node_frame.set_frame(val)
func start_control() -> void:
set_default_state()
set_default_state(get_tree().get_nodes_in_group('default_reset'), get_tree().get_nodes_in_group('power_amplifier'))
find_labels(self)
func set_default_state() -> void:
for group in get_tree().get_nodes_in_group('default_reset'):
static func set_default_state(default_reset_array_node: Array, power_amplifier_arr_node: Array) -> void:
for group in default_reset_array_node:
group.state = STATE_VAL.NONE
for group in get_tree().get_nodes_in_group('power_amplifier'):
for group in power_amplifier_arr_node:
group.state = STATE_VAL.NONE
@@ -135,11 +135,13 @@ func on_press_device() -> void:
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')
var fs_nodes: Array = get_tree().get_nodes_in_group('fs_group')
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
var default_reset_array_node: Array = get_tree().get_nodes_in_group('default_reset')
var module_fs_4: Node = $kasseta_FS_VD/ref_A6
var dou_4: Node = $dou4_A5
var module_fs_5: Node = $kasseta_FS_VD/ref_A2
var dou_5: Node = $dou5_A6
var for_control_result: Dictionary = {
'control_is_over': unit_prd_v.flag_control_is_over,
'result_dic': unit_prd_v.control_results,
'power_dic': unit_prd_v.power_result,
'block_kasseta_y5_config': unit_prd_v.block_kasseta_y5_config,
@@ -149,6 +151,7 @@ func on_press_device() -> void:
'node_ip_power_arr': node_ip_power_arr,
'fs_nodes': fs_nodes,
'power_amplifier': power_amplifier,
'default_reset_array_node': default_reset_array_node,
'POWER_THRESHOLD': unit_prd_v.constants.POWER_THRESHOLD,
'name_prd': unit_prd_v.self_name,
'module_fs_4': module_fs_4,
@@ -178,7 +181,9 @@ 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:
power_supply.state = STATE_VAL.GOOD if block_ip_config_v[meta_ip][1] else STATE_VAL.ERROR
## If control is end
if not for_result_dic.control_is_over:
set_default_state(for_result_dic.default_reset_array_node, for_result_dic.power_amplifier)
return
var result_dic: Dictionary = for_result_dic.result_dic
for f in for_result_dic.fs_nodes:
var fs_meta: String = f.get_meta('fs')

View File

@@ -41,7 +41,7 @@ offset_right = 15.0
offset_bottom = 30.0
script = ExtResource("1_c20s6")
[node name="maa2000_A22" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_xpo4b")]
[node name="maa2000_A22" parent="." groups=["power_supply"] instance=ExtResource("2_xpo4b")]
layout_mode = 2
offset_left = 485.0
offset_top = 877.0
@@ -60,7 +60,7 @@ offset_bottom = 877.0
fname = "ДОУ-4"
rname = "A5"
[node name="maa2000_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("2_xpo4b")]
[node name="maa2000_A23" parent="." groups=["power_supply"] instance=ExtResource("2_xpo4b")]
layout_mode = 2
offset_left = 8.0
offset_top = 877.0
@@ -203,7 +203,7 @@ patch_margin_bottom = 16
script = ExtResource("6_os4mt")
fname = "Кассета П-1В"
[node name="ref_A19" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_38u2b")]
[node name="ref_A19" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_38u2b")]
offset_left = 9.0
offset_top = 33.0
offset_right = 59.0
@@ -212,7 +212,7 @@ fname = "ИП9-50"
rname = "A19"
metadata/ip = "ip9_50_1"
[node name="ref_A20" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_38u2b")]
[node name="ref_A20" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_38u2b")]
offset_left = 59.0
offset_top = 33.0
offset_right = 109.0
@@ -221,7 +221,7 @@ fname = "ИП9-50"
rname = "A20"
metadata/ip = "ip9_50_2"
[node name="ref_A21" parent="kasseta_P_1" groups=["default_reset", "power_supply"] instance=ExtResource("7_38u2b")]
[node name="ref_A21" parent="kasseta_P_1" groups=["power_supply"] instance=ExtResource("7_38u2b")]
offset_left = 109.0
offset_top = 33.0
offset_right = 159.0
@@ -249,7 +249,7 @@ offset_right = 652.0
offset_bottom = 337.0
fname = "УМ1535А"
rname = "A7"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_1"
@@ -261,7 +261,7 @@ offset_right = 652.0
offset_bottom = 432.0
fname = "УМ1535А"
rname = "A8"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_2"
@@ -273,7 +273,7 @@ offset_right = 652.0
offset_bottom = 527.0
fname = "УМ1535А"
rname = "A9"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_3"
@@ -285,7 +285,7 @@ offset_right = 652.0
offset_bottom = 622.0
fname = "УМ1535А"
rname = "A10"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_4"
@@ -297,7 +297,7 @@ offset_right = 652.0
offset_bottom = 717.0
fname = "УМ1535А"
rname = "A11"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_5"
@@ -309,7 +309,7 @@ offset_right = 652.0
offset_bottom = 812.0
fname = "УМ1535А"
rname = "A12"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_6"
@@ -321,7 +321,7 @@ offset_right = 175.0
offset_bottom = 337.0
fname = "УМ1535А"
rname = "A13"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_9"
@@ -333,7 +333,7 @@ offset_right = 175.0
offset_bottom = 432.0
fname = "УМ1535А"
rname = "A14"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_10"
@@ -345,7 +345,7 @@ offset_right = 175.0
offset_bottom = 527.0
fname = "УМ1535А"
rname = "A15"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_11"
@@ -357,7 +357,7 @@ offset_right = 175.0
offset_bottom = 622.0
fname = "УМ1535А"
rname = "A16"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_12"
@@ -369,7 +369,7 @@ offset_right = 175.0
offset_bottom = 717.0
fname = "УМ1535А"
rname = "A17"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_13"
@@ -381,7 +381,7 @@ offset_right = 175.0
offset_bottom = 812.0
fname = "УМ1535А"
rname = "A18"
value0_info = "Мощность, Вт"
value0_info = "Мощность"
value1_info = "Температура,°C"
metadata/um = "um_14"
@@ -395,31 +395,17 @@ horizontal_alignment = 1
metadata/_edit_lock_ = true
[node name="input_0" type="AnimatedSprite2D" parent="."]
position = Vector2(234, 177)
position = Vector2(457, 586)
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)
position = Vector2(209, 586)
sprite_frames = SubResource("SpriteFrames_s5gcy")
[node name="output_0" type="AnimatedSprite2D" parent="."]
position = Vector2(381, 177)
position = Vector2(457, 482)
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)
position = Vector2(209, 482)
sprite_frames = SubResource("SpriteFrames_s5gcy")

View File

@@ -273,6 +273,7 @@ theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u")
script = SubResource("GDScript_oj3k3")
textures = [ExtResource("1_n1aqt"), ExtResource("2_rim3u"), ExtResource("3_3w8fg")]
value0 = [20.0, 30.0, 40.0, 50.0, 60.0, 70.0]
min_value1 = -40.0
max_value0 = 1400.0
max_value1 = 70.0
step0 = 1.0
@@ -475,8 +476,9 @@ size_flags_horizontal = 3
size_flags_vertical = 3
tooltip_text = "
Текущее: 0.00
Диапазон: 0.00…70.00"
Диапазон: -40.00…70.00"
mouse_filter = 0
min_value = -40.0
max_value = 70.0
fill_mode = 3
nine_patch_stretch = true

View File

@@ -259,6 +259,8 @@ theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u")
script = SubResource("GDScript_oj3k3")
textures = [ExtResource("1_uojqc"), ExtResource("2_a8ar3"), ExtResource("3_xwd13")]
value0 = [20.0, 30.0, 40.0, 50.0, 60.0, 70.0]
value1 = -40.0
min_value1 = -40.0
max_value0 = 1400.0
max_value1 = 70.0
step0 = 1.0
@@ -363,10 +365,12 @@ layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
tooltip_text = "
Текущее: 0.00
Диапазон: 0.00…70.00"
Текущее: -40.00
Диапазон: -40.00…70.00"
mouse_filter = 0
min_value = -40.0
max_value = 70.0
value = -40.0
fill_mode = 3
nine_patch_stretch = true
stretch_margin_left = 8

View File

@@ -14,7 +14,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
script = ExtResource("2_mdnod")
[node name="ref_A26" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("3_4a27g")]
[node name="ref_A26" parent="." groups=["power_supply"] instance=ExtResource("3_4a27g")]
offset_left = 10.0
offset_top = 30.0
offset_right = 60.0
@@ -23,7 +23,7 @@ fname = "ИП9-50"
rname = "A22"
metadata/ip = "ip9_50_3"
[node name="ref_A23" parent="." groups=["default_reset", "power_supply"] instance=ExtResource("3_4a27g")]
[node name="ref_A23" parent="." groups=["power_supply"] instance=ExtResource("3_4a27g")]
offset_left = 60.0
offset_top = 30.0
offset_right = 110.0

View File

@@ -2,6 +2,7 @@ class_name TestPRD
extends Node
# Константы
const CONFIG_PATH = "user://config/setting_prd_control.json"
const DEFAULT_CONFIG_PATH = "res://config/setting_prd_control.json"
const RAY_m5: String = "RAY_m5"
const RAY_5: String = "RAY_5"
@@ -61,6 +62,7 @@ var flag_fs_status_ok: bool = false
var flag_si_fs_input: bool = false
var flag_si_fs_output: bool = false
var flag_in_control: bool = false
var flag_control_is_over: bool = false
var unit_prd: Object
var control_timer: Timer = Timer.new()
var ems_6666_timer: Timer = Timer.new()
@@ -109,7 +111,24 @@ func _get_ray_key(machine_state: int) -> String:
return _ray_state_mapping.get(machine_state, "")
func _ensure_config_exists() -> bool:
DirAccess.make_dir_recursive_absolute("user://config")
if FileAccess.file_exists(CONFIG_PATH):
return true
if not FileAccess.file_exists(DEFAULT_CONFIG_PATH):
return false
var src := FileAccess.open(DEFAULT_CONFIG_PATH, FileAccess.READ)
var dst := FileAccess.open(CONFIG_PATH, FileAccess.WRITE)
if src == null or dst == null:
return false
dst.store_string(src.get_as_text())
src.close()
dst.close()
return true
func _load_configuration() -> void:
if not _ensure_config_exists(): return
var config_file = FileAccess.open(CONFIG_PATH, FileAccess.READ)
if config_file:
var json_text = config_file.get_as_text()
@@ -184,13 +203,14 @@ func on_data_received(unit_pribor: Object) -> void:
return
_process_dkm_status(status)
if current_litera != 0:
if current_litera != 0: # Формирование мощностей в литерах
var tek_litera: Dictionary = power_for_litera[current_litera]
var interes = _get_ray_key(state)
if interes != '':
tek_litera[_get_ray_key(state)] = power_um_ukp(status, current_litera, tek_litera[_get_ray_key(state)])
power_for_litera[current_litera] = tek_litera
var ems_input_1: int
var ems_input_2: int
var ems_input_lit_1: int
@@ -202,17 +222,18 @@ var ems_output_lit_1: int
func _get_data_index(key: String) -> int:
return data_indices.get(key, -1)
func socket_status_ems_g(packet_form_yau_07: PackedByteArray) -> void:
if self_name in ['', '', '', '']:
ems_input_1 = (packet_form_yau_07.decode_u16(_get_data_index('IN_BLANK_PRD')) & (1 << 9)) != 0
ems_input_2 = (packet_form_yau_07.decode_u16(_get_data_index('IN_BLANK_PRD')) & (1 << 10)) != 0
if self_name in ['', '', '', '']:
ems_input_1 = (packet_form_yau_07.decode_u16(_get_data_index('IN_BLANK_PRD')) & (1 << 11)) != 0
ems_input_1 = (packet_form_yau_07.decode_u16(_get_data_index('IN_BLANK_PRD')) & (1 << 12)) != 0
ems_input_2 = (packet_form_yau_07.decode_u16(_get_data_index('IN_BLANK_PRD')) & (1 << 12)) != 0
if self_name in ['', '', '', '']:
ems_input_1 = (packet_form_yau_07.decode_u16(_get_data_index('IN_BLANK_PRD')) & (1 << 13)) != 0
ems_input_1 = (packet_form_yau_07.decode_u16(_get_data_index('IN_BLANK_PRD')) & (1 << 14)) != 0
ems_input_lit_1 = (packet_form_yau_07.decode_u16(_get_data_index('IN_BLANK_PRD')) & (1 << 8)) != 0
ems_input_1 = (packet_form_yau_07.decode_u16(_get_data_index('IN_BLANK_PRD')) & (1 << 13)) != 0
ems_input_2 = (packet_form_yau_07.decode_u16(_get_data_index('IN_BLANK_PRD')) & (1 << 14)) != 0
ems_output_1 = (packet_form_yau_07.decode_u16(_get_data_index('OUT_BLANK_PRD')) & (1 << 4)) != 0
ems_output_2 = (packet_form_yau_07.decode_u16(_get_data_index('OUT_BLANK_PRD')) & (1 << 5)) != 0
@@ -247,7 +268,6 @@ func on_fs_update_state(packet_type_7: Dictionary, fs_mapping: Dictionary) -> vo
func state_control_machine() -> void:
match state:
STATE_MACHINE.INIT:
print("Start control for %s device %s litera" % [self_name, current_litera])
_handle_init_state()
STATE_MACHINE.FS_TURN_ON:
_handle_fs_turn_on_state()
@@ -335,18 +355,27 @@ func state_control_machine() -> void:
STATE_MACHINE.STOP_CONTROL:
_handle_stop_control_state()
## В машине состояний вызов изменения состояния прогресс бара контроля
progressbar_status()
if block_kasseta_y5_config['yau07']:
progressbar_status()
## 'Выполняется инициализация ФС-%s' % current_litera
func _handle_init_state() -> void:
if current_litera in [1, 2, 3, 4, 5, 6, 7]:
if not ecms.size():
var flag_ecm: bool = false
for key in ecms:
var params = ecms[key].params.freq
if fs_parameters[current_litera].freq == params:
var kni = ecms[key].kni
if pribor_config[self_name].angle == kni:
flag_ecm = true
if not flag_ecm:
state = STATE_MACHINE.FS_TURN_ON
else:
control_results = on_control_result(block_ip_config, control_results)
power_result = prep_power(power_for_litera, self_name)
emit_signal('control_is_over')
flag_control_is_over = true
machine_timer.stop()
@@ -524,12 +553,12 @@ func setup_timer() -> void:
func on_mode_changed(in_tree: bool) -> void:
flag_in_control = in_tree
if not in_tree: ## TODO: Дополнительная проверка если контроль идет, если нет, то смысла вызывать нет
flag_control_is_over = false
progress_value = 0
machine_timer.stop()
state = STATE_MACHINE.INIT
_handle_fs_turn_off_state()
#prd_v_module.cmd_array.append([unit_prd_v.CmdCode.WRITE_ISA, [constants_v.ADDR_UG_LITERA_1, ug_work_1, constants_v.ADDR_UG_LITERA_2, ug_work_2]])
func _process_dkm_status(status: PackedByteArray) -> void:

View File

@@ -325,8 +325,9 @@ func _set_row_selected(i_row: int, selected: bool = true) -> void:
var node = nodes[node_key]
var selector = nodes[selector_key]
nodes.erase(selector_key)
if is_instance_valid(selector):
node.remove_child(selector)
if is_instance_valid(node) and is_instance_valid(selector):
if selector.get_parent() == node:
node.remove_child(selector)
selector.queue_free()
else:
push_warning('обращение к удалённому элементу \"%s\"' % selector_key)