Доработка. Режим Контроль. Прибор РТР. Отображение данных о состоянии

This commit is contained in:
sasha80
2024-05-28 16:41:25 +03:00
parent 93f25b4e18
commit 0cd7464969
6 changed files with 40 additions and 40 deletions

View File

@@ -39,6 +39,9 @@ config/mod_bus_serial_baud="9600"
config/mod_bus_serial_port="/dev/pts/3"
interfer/resend_timeout=1000.0
config/external_cu=false
config/unit_rr_left_bort="http://localhost:8080/reports/left_SelfTestReport.json"
config/unit_rr_right_bort="http://localhost:8080/reports/right_SelfTestReport.json"
config/unit_rr_request_period=1.0
[autoload]

View File

@@ -1,15 +1,16 @@
[gd_scene load_steps=6 format=3 uid="uid://5uv1idl3lqet"]
[gd_scene load_steps=7 format=3 uid="uid://5uv1idl3lqet"]
[ext_resource type="Script" path="res://scenes/контроль/прибор.gd" id="1_ab82m"]
[ext_resource type="Script" path="res://scenes/pribor-rtr/pribor-rtr.gd" id="1_sqyma"]
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="2_02opt"]
[ext_resource type="PackedScene" uid="uid://7ps8s0jd2bdr" path="res://scenes/контроль/блок-б.tscn" id="2_v25ql"]
[ext_resource type="PackedScene" uid="uid://bkxblfoj7ejv0" path="res://scenes/контроль/блок-а.tscn" id="4_2tw5p"]
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="5_mxmk0"]
[ext_resource type="Script" path="res://scenes/pribor-rtr/request-rtr.gd" id="6_iwtoo"]
[node name="pribor_rtr" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_ab82m")
script = ExtResource("1_sqyma")
[node name="lbl_header" type="Label" parent="."]
layout_mode = 0
@@ -582,3 +583,14 @@ offset_top = 30.0
offset_right = 305.0
offset_bottom = 80.0
fname = "Плата АЦП"
[node name="request_rtr" type="HTTPRequest" parent="."]
script = ExtResource("6_iwtoo")
[node name="timer" type="Timer" parent="request_rtr"]
wait_time = 4.168
autostart = true
[connection signal="child_entered_tree" from="request_rtr" to="request_rtr" method="_on_child_entered_tree"]
[connection signal="request_completed" from="request_rtr" to="." method="_on_request_rtr_request_completed"]
[connection signal="timeout" from="request_rtr/timer" to="request_rtr" method="_on_request_timer"]

View File

@@ -11,5 +11,3 @@ func _on_toggled(toggled_on): $frame.visible = toggled_on
v = 0 if v < 0 else v % state_colors.size()
state = v
$label.self_modulate = state_colors[v]
get:
return state

View File

@@ -22,6 +22,7 @@ script = ExtResource("1_x5d6w")
metadata/_edit_lock_ = true
[node name="pribor_uf" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1194.0
offset_top = 500.0
@@ -34,8 +35,7 @@ action_mode = 0
texture_normal = ExtResource("2_0nvm1")
stretch_mode = 0
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.854902, 0.0705882, 0.0705882, 1)]
state = 2
state_colors = [Color(1, 1, 1, 1), Color(0, 0.74, 0.37, 1), Color(0.854902, 0.0705882, 0.0705882, 1)]
[node name="label" type="Label" parent="pribor_uf"]
layout_mode = 0
@@ -63,6 +63,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_rtr" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1197.0
offset_top = 289.0
@@ -76,7 +77,6 @@ texture_normal = ExtResource("3_hhadv")
stretch_mode = 0
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_rtr"]
layout_mode = 0
@@ -103,6 +103,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_afsp_l" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 996.0
offset_top = 301.0
@@ -117,7 +118,6 @@ texture_normal = ExtResource("4_l0nc7")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_afsp_l"]
layout_mode = 0
@@ -147,6 +147,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_afsp_r" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1342.0
offset_top = 301.0
@@ -161,7 +162,6 @@ texture_normal = ExtResource("4_l0nc7")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_afsp_r"]
layout_mode = 0
@@ -191,6 +191,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_uyep" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1194.0
offset_top = 739.0
@@ -204,7 +205,6 @@ texture_normal = ExtResource("5_kvnex")
stretch_mode = 0
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_uyep"]
layout_mode = 0
@@ -232,6 +232,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_v_2" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 960.0
offset_top = 480.0
@@ -245,7 +246,6 @@ texture_normal = ExtResource("6_i1yfn")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_v_2"]
layout_mode = 0
@@ -272,6 +272,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_n_2" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 960.0
offset_top = 635.0
@@ -285,7 +286,6 @@ texture_normal = ExtResource("6_i1yfn")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_n_2"]
layout_mode = 0
@@ -314,6 +314,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_k_2" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1077.0
offset_top = 479.0
@@ -327,7 +328,6 @@ texture_normal = ExtResource("6_i1yfn")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_k_2"]
layout_mode = 0
@@ -354,6 +354,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_v_3" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1344.0
offset_top = 797.0
@@ -368,7 +369,6 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_v_3"]
layout_mode = 0
@@ -396,6 +396,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_n_3" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1458.0
offset_top = 798.0
@@ -410,7 +411,6 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_n_3"]
layout_mode = 0
@@ -437,6 +437,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_k_3" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1343.0
offset_top = 635.0
@@ -451,7 +452,6 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_k_3"]
layout_mode = 0
@@ -479,6 +479,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_v_1" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1457.0
offset_top = 480.0
@@ -493,7 +494,6 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_v_1"]
layout_mode = 0
@@ -520,6 +520,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_n_1" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1455.0
offset_top = 634.0
@@ -534,7 +535,6 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_n_1"]
layout_mode = 0
@@ -561,6 +561,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_k_1" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1344.0
offset_top = 478.0
@@ -575,7 +576,6 @@ stretch_mode = 4
flip_h = true
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_k_1"]
layout_mode = 0
@@ -602,6 +602,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_v_4" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1077.0
offset_top = 796.0
@@ -615,7 +616,6 @@ texture_normal = ExtResource("6_i1yfn")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_v_4"]
layout_mode = 0
@@ -643,6 +643,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_n_4" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 961.0
offset_top = 794.0
@@ -656,7 +657,6 @@ texture_normal = ExtResource("6_i1yfn")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_n_4"]
layout_mode = 0
@@ -683,6 +683,7 @@ patch_margin_right = 16
patch_margin_bottom = 16
[node name="pribor_prd_k_4" type="TextureButton" parent="."]
editor_description = "Кнопка для выбора прибора."
layout_mode = 0
offset_left = 1077.0
offset_top = 635.0
@@ -696,7 +697,6 @@ texture_normal = ExtResource("6_i1yfn")
stretch_mode = 4
script = ExtResource("3_4pt7j")
state_colors = [Color(1, 1, 1, 1), Color(0, 0.87, 0, 1), Color(0.65, 0.0715, 0.0715, 1)]
state = 2
[node name="label" type="Label" parent="pribor_prd_k_4"]
layout_mode = 0

View File

@@ -13,24 +13,18 @@ extends GridContainer
set(v):
min_value = v
$indicator_h.min_value = v
get:
return min_value
@export var max_value: float:
set(v):
max_value = v
$indicator_h.max_value = v
get:
return max_value
@export var step: float:
set(v):
step = v
$indicator_h.step = v
get:
return step
@export var value: float:
@@ -38,25 +32,18 @@ extends GridContainer
value = v
$indicator_h.value = v
$lbl_val.text = '%02d' % int(v)
get:
return value
@export var value_name: String:
set(v):
value_name = v
$lbl_name.text = v
get:
return value_name
@export var name_min_size: Vector2i:
set(v):
name_min_size = v
var l = $lbl_name
$lbl_name.custom_minimum_size = v
get:
return name_min_size
"
[node name="grid" type="GridContainer"]

View File

@@ -9,8 +9,8 @@ func _ready(): _on_value_changed(3)
func _on_value_changed(val):
val = int(val)
for nm in VAL_TO_LABEL.values():
var lbl = get_node(nm)
lbl.self_modulate.a = 0.45
var lbl = get_node(VAL_TO_LABEL[val])
lbl.self_modulate.a = 1.0
var lbl0 = get_node(nm)
lbl0.self_modulate.a = 0.45
var lbl1 = get_node(VAL_TO_LABEL[val])
lbl1.self_modulate.a = 1.0
signaller.emit_signal(VAL_TO_EVENT[val])