iFactory.Godot/Mods/工业数据采集与分析应用分享/Scripts/Temp/生成温湿度.cs

24 lines
587 B
C#

#if Deprecated
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)}", "环境");
}
}
}
#endif