После отладки, добавление индикации состояний эмс ячеек
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -21,6 +21,18 @@ func _ready() -> void:
|
||||
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:
|
||||
set_default_state()
|
||||
find_labels(self)
|
||||
@@ -64,6 +76,53 @@ static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifi
|
||||
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:
|
||||
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')
|
||||
@@ -128,7 +187,7 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
for_result_dic.dou_4.state = STATE_VAL.GOOD if result_dic.dou_4 else STATE_VAL.ERROR
|
||||
else:
|
||||
result_dic.fs_4 = 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://cvskpe1ti3p45"]
|
||||
[gd_scene load_steps=14 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="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_xpo4b"]
|
||||
@@ -8,6 +8,30 @@
|
||||
[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://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"]
|
||||
layout_mode = 3
|
||||
@@ -299,3 +323,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_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")
|
||||
|
||||
@@ -368,12 +368,12 @@ func _process(delta) -> void:
|
||||
_queue.erase(tile.i)
|
||||
req.request_completed.connect(_response.bind(req, tile))
|
||||
|
||||
#if req.request(tile.url) != OK:
|
||||
#tile.t = now
|
||||
#remove_child(req)
|
||||
#req.queue_free()
|
||||
#_req_count -= 1
|
||||
# push_error('запрос \"%s\" не отправлен' % tile.url) TODO: For Deugs
|
||||
if req.request(tile.url) != OK:
|
||||
tile.t = now
|
||||
remove_child(req)
|
||||
req.queue_free()
|
||||
_req_count -= 1
|
||||
push_error('запрос \"%s\" не отправлен' % tile.url) #TODO: For Deugs
|
||||
if _queue.is_empty():
|
||||
emit_signal('load_completed')
|
||||
|
||||
|
||||
@@ -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_emit_sel = color_select
|
||||
color_closed_emit = color_closed
|
||||
|
||||
|
||||
color_select *= 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)
|
||||
@@ -529,7 +529,7 @@ func update_fs_colors():
|
||||
$btn_activate.self_modulate = Color.WHITE
|
||||
else:
|
||||
$btn_activate.self_modulate = Color.WHITE
|
||||
|
||||
|
||||
|
||||
|
||||
func unsel_fs_all(need_btns_off: bool):
|
||||
@@ -565,7 +565,7 @@ func set_btns_disabled(value: bool, btn):
|
||||
btn.set_disabled(value)
|
||||
|
||||
|
||||
func on_interfer_prinuditelno (prenuditelno_sectors, btns):
|
||||
func on_interfer_prinuditelno(prenuditelno_sectors, btns):
|
||||
for key in prenuditelno_sectors:
|
||||
var sectors = []
|
||||
for sector in prenuditelno_sectors[key]:
|
||||
|
||||
Reference in New Issue
Block a user