This commit is contained in:
CortexCore 2023-07-17 09:59:27 +08:00
parent e27cce2ac3
commit 453754890b
3 changed files with 52 additions and 2 deletions

View File

@ -0,0 +1,21 @@
using Godot;
using System;
namespace BITFactory;
public partial class 湿 : Node
{
[Export] private string handle;
[Export] private int count;
[Export] private LineEdit _lineEdit;
private void Excute()
{
var myHandle = handle;
if (_lineEdit is not null) myHandle = _lineEdit.Text;
for (var i = 0; i < count; i++)
{
IDIS_Service.Singleton.Register(myHandle, "温度", "float", $"{new Random().Next(10, 60)}", "环境");
IDIS_Service.Singleton.Register(myHandle, "湿度", "float", $"{new Random().Next(0, 100)}", "环境");
}
}
}

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=56 format=3 uid="uid://cngf2h2a5ne4a"]
[gd_scene load_steps=57 format=3 uid="uid://cngf2h2a5ne4a"]
[ext_resource type="Script" path="res://BITKit/Scripts/UX/UXPanel.cs" id="1_c78kh"]
[ext_resource type="PackedScene" uid="uid://d1po2qljd0jh2" path="res://Mods/教育平台/教程header.tscn" id="2_mn1rn"]
@ -44,6 +44,7 @@
[ext_resource type="Resource" uid="uid://cgk1wmiqqedmi" path="res://Mods/工业数据采集与分析应用分享/Resource/自动标识模板/温湿度传感器/温湿度传感器.tres" id="42_xvnkp"]
[ext_resource type="Resource" uid="uid://b38onsp3c3jem" path="res://Mods/工业数据采集与分析应用分享/Resource/自动标识模板/温湿度/温度.tres" id="43_qidfp"]
[ext_resource type="Resource" uid="uid://d3xam2no2uaas" path="res://Mods/工业数据采集与分析应用分享/Resource/自动标识模板/温湿度/湿度.tres" id="44_0hai5"]
[ext_resource type="Script" path="res://Mods/工业数据采集与分析应用分享/Scripts/Temp/生成温湿度.cs" id="45_pngx2"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nfm72"]
bg_color = Color(1, 1, 1, 0.0313726)
@ -1044,7 +1045,6 @@ theme_override_constants/v_separation = 16
columns = 2
[node name="温湿度传感器" type="MarginContainer" parent="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer"]
visible = false
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/温湿度传感器"]
@ -1169,6 +1169,14 @@ popup/item_0/id = 0
popup/item_1/text = "添加记录"
popup/item_1/id = 1
[node name="Control" type="Control" parent="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/温湿度传感器/VBoxContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="生成数据-button" type="Button" parent="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/温湿度传感器/VBoxContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "生成256条数据"
[node name="更新温湿度-button" type="Button" parent="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/温湿度传感器/VBoxContainer/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
@ -1413,6 +1421,7 @@ layout_mode = 2
text = "保存"
[node name="标识模板注册器" type="VBoxContainer" parent="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer"]
visible = false
layout_mode = 2
[node name="标题栏Template" parent="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/标识模板注册器" instance=ExtResource("13_7vm0l")]
@ -1819,8 +1828,14 @@ regResources = Array[Object]([ExtResource("42_xvnkp"), ExtResource("43_qidfp"),
progressBars = [NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/GridContainer/ProgressBar"), NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/GridContainer/ProgressBar2"), NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/GridContainer/ProgressBar3"), NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/GridContainer/ProgressBar4"), NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/GridContainer/ProgressBar5"), NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/GridContainer/ProgressBar6"), NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/GridContainer/ProgressBar7"), NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/GridContainer/ProgressBar8"), NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/GridContainer/ProgressBar9"), NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/GridContainer/ProgressBar10")]
logLabel = NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/PanelContainer/MarginContainer/logLabel")
[node name="温湿度数据生成" type="Node" parent="." node_paths=PackedStringArray("_lineEdit")]
script = ExtResource("45_pngx2")
count = 256
_lineEdit = NodePath("../Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/温湿度传感器/VBoxContainer/VBoxContainer/GridContainer2/LineEdit-0")
[connection signal="pressed" from="Layout/UX Window Service/Horizontal Layout/导航栏/MarginContainer/Layout/Button5" to="Layout/UX Window Service/Horizontal Layout/导航栏/MarginContainer/Layout/Button5" method="Return"]
[connection signal="pressed" from="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/标识解析/Search/SearchEdit/HBoxContainer/refresh-button" to="标识搜索服务" method="Search"]
[connection signal="pressed" from="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/温湿度传感器/VBoxContainer/VBoxContainer/HBoxContainer/生成数据-button" to="温湿度数据生成" method="Excute"]
[connection signal="pressed" from="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/标识模板注册器/HBoxContainer/VBoxContainer3/Button" to="标识模板注册器" method="Rebuild"]
[connection signal="pressed" from="Layout/UX Window Service/Horizontal Layout/内容/MarginContainer/自动注册标识/HFlowContainer/VBoxContainer/start-button" to="自动注册标识" method="Register"]

View File

@ -1,8 +1,22 @@
# 工业互联网标识解析与注册
## 主要流程
- 注册标识模板
- 用户需要填写的信息有
- 1.标识模板名称
- 2.标识值属性
- 2.1 标识值的类型
- 2.2 标识值的名称
- 2.3 标识值的默认值
- 2.4 标识值的分类(可不填)
- 根据生产步骤,一步一步手动注册需要标识
- 用户需要填写的信息有
- 1.标识码
- 2.所有需要的标识值
- 3.标识码的引用
- 在这一步中有自动注册的按钮,点击后会自动注册需要的标识
- 对温湿度传感器进行手动引发异常
- 用户可以对温湿度传感器引发异常,例如吹口气或者把传感器放在冰箱里
- 用户可以手动提交新的温湿度值
- 检测软件在屏幕上给出明显的异常提示
- 通过标识解析,一步一步找到异常的原因
## 数据结构