更新2025

This commit is contained in:
GukSang.Jin
2026-05-19 18:44:56 +08:00
parent 2f4388723c
commit 8ed011f91e
8 changed files with 93 additions and 74 deletions

View File

@@ -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;