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)}", "环境");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user