После отладки, добавление индикации состояний эмс ячеек

This commit is contained in:
TotMaxim
2025-11-12 20:47:35 +03:00
parent 2980aa9f15
commit 87e360e1a9
10 changed files with 323 additions and 90 deletions

View File

@@ -18,9 +18,23 @@ func _ready() -> void:
for temp in power_amplifier:
temp.value1 = -70
unit_prd_k.connect('control_is_over', Callable(self, 'on_press_device'))
#unit_prd_k.power_amplify = power_amplifier
on_press_device()
func _process(delta: float) -> void:
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:
set_default_state()
find_labels(self)
@@ -139,7 +153,7 @@ func on_control_result(for_result_dic: Dictionary) -> void:
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)
var result: bool = true

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://m5s87q7m66lj"]
[gd_scene load_steps=15 format=3 uid="uid://m5s87q7m66lj"]
[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"]
@@ -9,6 +9,30 @@
[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://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"]
layout_mode = 3
@@ -322,3 +346,42 @@ offset_bottom = 1003.0
text = "Прибор ПРД- неисправен"
horizontal_alignment = 1
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")