readme
This commit is contained in:
21
Mods/工业数据采集与分析应用分享/Scripts/Temp/生成温湿度.cs
Normal file
21
Mods/工业数据采集与分析应用分享/Scripts/Temp/生成温湿度.cs
Normal 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)}", "环境");
|
||||
}
|
||||
}
|
||||
}
|
@@ -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"]
|
||||
|
||||
|
Reference in New Issue
Block a user