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

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

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=3 uid="uid://dnuexoef2nnv5"]
[gd_scene load_steps=13 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="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_is25t"]
@@ -7,6 +7,30 @@
[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://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"]
layout_mode = 3
@@ -350,3 +374,33 @@ offset_right = 649.0
offset_bottom = 1003.0
horizontal_alignment = 1
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")