Доработка. У приборов АФСП и РТР один общий скрипт для загрузки результатов контроля

This commit is contained in:
sasha80
2025-05-26 11:33:31 +03:00
parent 0865e1902d
commit 8de4188419
10 changed files with 30 additions and 37 deletions

View File

@@ -122,7 +122,6 @@ folder_colors={
"res://scenes/pribor-prd-k/": "purple",
"res://scenes/pribor-prd-n/": "purple",
"res://scenes/pribor-prd-v/": "purple",
"res://scenes/pribor-rtr/": "purple",
"res://scenes/pribor-uf/": "purple",
"res://scenes/pribor-uyep/": "purple",
"res://scenes/tabs-switch/": "blue",

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://8ll27id5ajq1"]
[ext_resource type="Script" uid="uid://d0jwv5opi3mrl" path="res://scenes/pribor-afsp/pribor-afsp.gd" id="1_151rh"]
[ext_resource type="Script" uid="uid://bux47vkw71w1t" path="res://scenes/контроль/request.gd" id="2_4vyhj"]
[ext_resource type="Script" uid="uid://bux47vkw71w1t" path="res://scenes/pribor-afsp/request.gd" id="2_4vyhj"]
[ext_resource type="PackedScene" uid="uid://dnxq870xf6pkh" path="res://scenes/pribor-afsp/bort-afsp.tscn" id="3_d7iti"]
[sub_resource type="GDScript" id="GDScript_yhnwg"]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://5uv1idl3lqet"]
[ext_resource type="Script" uid="uid://d0jwv5opi3mrl" path="res://scenes/pribor-afsp/pribor-afsp.gd" id="1_tfses"]
[ext_resource type="Script" uid="uid://bux47vkw71w1t" path="res://scenes/контроль/request.gd" id="2_miwrd"]
[ext_resource type="Script" uid="uid://bux47vkw71w1t" path="res://scenes/pribor-afsp/request.gd" id="2_miwrd"]
[ext_resource type="PackedScene" uid="uid://dnxq870xf6pkh" path="res://scenes/pribor-afsp/bort-afsp.tscn" id="3_xpxb5"]
[sub_resource type="GDScript" id="GDScript_yhnwg"]

View File

@@ -49,7 +49,6 @@ func _on_request_rtr_request_completed(result, _response_code, headers, body: Pa
push_error('разбор json прерван - \"%s\" (%s)' % [err, headers])
return
var pp = ['DeviceDescripton', 'DeviceName']
var ppp = []
map_solid_to_array(prefix_path, ppp)
@@ -60,13 +59,8 @@ func _on_request_rtr_request_completed(result, _response_code, headers, body: Pa
push_error('путь %s не найден (%s)' % [pp_copy, ret_val[2]])
return
var bort_rtr_name_left: StringName = $left.get_meta('DeviceName', '')
var bort_rtr_name_right: StringName = $right.get_meta('DeviceName', '')
var bb = {bort_rtr_name_left: $left, bort_rtr_name_right: $right}
if not bb.has(ret_val[0]):
return
var bort_rtr = bb[ret_val[0]]
var bort_rtr_name: StringName = get_meta('DeviceName', '')
var bort_rtr = self
for child in bort_rtr.get_node('konverter/grid').get_children():
map_value_to_item(json_conv.data, child, 'value0')
map_value_to_item(json_conv.data, child, 'value1')

View File

@@ -1,8 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://5uv1idl3lqea"]
[ext_resource type="Script" uid="uid://d0jwv5opi3mrk" path="res://scenes/pribor-rtr/pribor-rtr.gd" id="1_sqyma"]
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="2_yb5ym"]
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="3_xqaxm"]
[ext_resource type="Script" uid="uid://d0jwv5opi3mrk" path="res://scenes/pribor-afsp/pribor-rtr.gd" id="1_soedq"]
[ext_resource type="PackedScene" uid="uid://d3iqb5e4g81m5" path="res://scenes/контроль/элемент-г.tscn" id="2_pspup"]
[ext_resource type="PackedScene" uid="uid://p2suppildvq0" path="res://scenes/контроль/элемент-в.tscn" id="3_gh777"]
[node name="pribor_rtr" type="Control"]
layout_mode = 3
@@ -11,9 +11,9 @@ offset_left = 115.0
offset_top = 150.0
offset_right = 115.0
offset_bottom = 150.0
script = ExtResource("1_sqyma")
script = ExtResource("1_soedq")
[node name="yach_svyzi" parent="." instance=ExtResource("3_xqaxm")]
[node name="yach_svyzi" parent="." instance=ExtResource("2_pspup")]
layout_mode = 2
offset_left = 40.0
offset_top = 535.0
@@ -24,7 +24,7 @@ size_flags_vertical = 7
fname = "Модуль электропитания"
rname = "G1"
[node name="blok_bpo_a1" parent="." instance=ExtResource("3_xqaxm")]
[node name="blok_bpo_a1" parent="." instance=ExtResource("2_pspup")]
layout_mode = 0
offset_left = 40.0
offset_top = 135.0
@@ -42,55 +42,55 @@ offset_right = 498.0
offset_bottom = 320.0
columns = 4
[node name="a1_kanal1" parent="grid_bpo_a1" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal1" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 1"
[node name="a1_kanal2" parent="grid_bpo_a1" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal2" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 2"
[node name="a1_kanal3" parent="grid_bpo_a1" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal3" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 3"
[node name="a1_kanal4" parent="grid_bpo_a1" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal4" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 4"
[node name="a1_kanal5" parent="grid_bpo_a1" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal5" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 5"
[node name="a1_kanal6" parent="grid_bpo_a1" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal6" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 6"
[node name="a1_kanal7" parent="grid_bpo_a1" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal7" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 7"
[node name="a1_kanal8" parent="grid_bpo_a1" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal8" parent="grid_bpo_a1" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 8"
[node name="yas_bpo_a1" parent="." instance=ExtResource("2_yb5ym")]
[node name="yas_bpo_a1" parent="." instance=ExtResource("3_gh777")]
offset_left = 500.0
offset_top = 175.0
offset_right = 550.0
@@ -99,7 +99,7 @@ show_rname = false
self_size = Vector2i(50, 145)
fname = "Яч. связи"
[node name="blok_bpo_a2" parent="." instance=ExtResource("3_xqaxm")]
[node name="blok_bpo_a2" parent="." instance=ExtResource("2_pspup")]
layout_mode = 0
offset_left = 40.0
offset_top = 335.0
@@ -117,55 +117,55 @@ offset_right = 498.0
offset_bottom = 520.0
columns = 4
[node name="a1_kanal1" parent="grid_bpo_a2" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal1" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 1"
[node name="a1_kanal2" parent="grid_bpo_a2" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal2" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 2"
[node name="a1_kanal3" parent="grid_bpo_a2" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal3" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 3"
[node name="a1_kanal4" parent="grid_bpo_a2" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal4" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 4"
[node name="a1_kanal5" parent="grid_bpo_a2" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal5" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 5"
[node name="a1_kanal6" parent="grid_bpo_a2" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal6" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 6"
[node name="a1_kanal7" parent="grid_bpo_a2" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal7" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 7"
[node name="a1_kanal8" parent="grid_bpo_a2" instance=ExtResource("3_xqaxm")]
[node name="a1_kanal8" parent="grid_bpo_a2" instance=ExtResource("2_pspup")]
layout_mode = 2
size_flags_horizontal = 7
size_flags_vertical = 7
fname = "Канал 8"
[node name="yas_bpo_a2" parent="." instance=ExtResource("2_yb5ym")]
[node name="yas_bpo_a2" parent="." instance=ExtResource("3_gh777")]
offset_left = 500.0
offset_top = 375.0
offset_right = 550.0

View File

@@ -18,7 +18,7 @@ const PRIBORS_RES = \
'pribor_prd_v_2': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 2'],
'pribor_prd_v_3': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 3'],
'pribor_prd_v_4': ['res://scenes/pribor-prd-v/pribor-prd-v.tscn', 'Контроль исправности прибора ПРД-В 4'],
'pribor_rtr': ['res://scenes/pribor-rtr/pribor-rtr.tscn', 'Контроль исправности прибора РТР'],
'pribor_rtr': ['res://scenes/pribor-afsp/pribor-rtr.tscn', 'Контроль исправности прибора РТР'],
'pribor_afsp_1': ['res://scenes/pribor-afsp/pribor-afsp-1.tscn', 'Контроль исправности прибора АФСП 1'],
'pribor_afsp_2': ['res://scenes/pribor-afsp/pribor-afsp-2.tscn', 'Контроль исправности прибора АФСП 2'],
'pribor_uf': ['res://scenes/pribor-uf/pribor-uf.tscn', 'Контроль исправности прибора УФ'],