- runtime:仿真 WinForms 子集(Form、Button、Label、TextBox、ComboBox、 GroupBox、Timer、MessageBox、界面线程消息循环、跨线程检查)、 教材设备类库(DeviceCtrlHelper、LED 控件)、运行器(常驻编译服务 + 运行模式) - server:Bun + Hono,WebSocket 会话,每次运行一个进程,消息转发 - web:Vue + Naive UI,WinForms 风格窗体渲染、MessageBox、实训台 LED 屏 - 端到端测试与 100 个程序并发的压力测试 - 教材逐任务摘要(docs/教材摘要) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
1015 B
C#
26 lines
1015 B
C#
using System.Collections.Concurrent;
|
|
|
|
namespace DeviceCtrlLibrary;
|
|
|
|
/// <summary>
|
|
/// 虚拟实训台的设备状态。第 0 阶段先放在运行器进程里、用固定的默认值;
|
|
/// 第 1 阶段改为向 Bun 服务器上的实训台查询,数值由网页上的滑块和开关控制。
|
|
/// </summary>
|
|
internal static class TrainingBoard
|
|
{
|
|
/// <summary>ADAM-4017 各通道的读数(Vin0 温度、Vin1 湿度、Vin2 光照……),按教材格式保存为整数</summary>
|
|
public static readonly ConcurrentDictionary<int, int> AnalogInputs = new()
|
|
{
|
|
[0] = 25, // 温度 ℃
|
|
[1] = 60, // 湿度 %
|
|
[2] = 500, // 光照 lx
|
|
[3] = 101, // 气压 kPa
|
|
[4] = 60, // 空气质量
|
|
[5] = 600, // CO2 ppm
|
|
[6] = 20, // 风速
|
|
};
|
|
|
|
/// <summary>ADAM-4150 数字量输入(DI0 人体红外、DI1 火焰、DI2 烟雾、DI3 红外对射)</summary>
|
|
public static readonly ConcurrentDictionary<int, bool> DigitalInputs = new();
|
|
}
|