24 lines
587 B
C#
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
|