更新2025
This commit is contained in:
@@ -18,7 +18,7 @@ namespace TabletTester2025.Services
|
||||
float value = startAddress switch
|
||||
{
|
||||
100 => 40 + (float)_rand.NextDouble() * 20, // 硬度 40~60N
|
||||
410 => 4.0f, // 脆碎试验时间(min)
|
||||
410 => 100f, // 脆碎圈数
|
||||
412 => 5.0f + (float)_rand.NextDouble() * 2, // 脆碎度前重
|
||||
414 => 4.9f + (float)_rand.NextDouble() * 2, // 后重
|
||||
300 => 37.0f, // 温度
|
||||
@@ -34,8 +34,12 @@ namespace TabletTester2025.Services
|
||||
// 👇 新增 ReadIntAsync 的模拟实现
|
||||
public Task<int> ReadIntAsync(ushort startAddress)
|
||||
{
|
||||
// 模拟整数返回,比如返回0-1000之间的随机数
|
||||
return Task.FromResult(_rand.Next(0, 1000));
|
||||
int value = startAddress switch
|
||||
{
|
||||
410 => 100, // 脆碎圈数
|
||||
_ => _rand.Next(0, 1000)
|
||||
};
|
||||
return Task.FromResult(value);
|
||||
}
|
||||
|
||||
public Task WriteCoilAsync(ushort coilAddress, bool value) => Task.CompletedTask;
|
||||
|
||||
Reference in New Issue
Block a user