第 0 阶段:教材项目 2 任务 1 在网页中原样运行

- 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>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-22 10:15:14 +08:00
commit 98be8331bc
71 files changed
+7919

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
using System;
using System.IO;
using Sim.Runner;
// 两种模式,都通过标准输入输出与 Bun 服务器交换 JSON 消息(每行一条):
// dotnet Sim.Runner.dll compile-server 常驻编译服务,全服务器共用一个,编译学生工程并把程序集写回工程目录
// dotnet Sim.Runner.dll run <工程目录> 运行已编译的学生程序,每次运行一个进程
// 运行模式不加载 Roslyn,单个学生程序的内存占用因此小得多。
return args switch
{
["compile-server"] => CompileServer.Run(),
["run", var dir] when Directory.Exists(dir) => StudentProgramHost.Run(dir),
_ => Usage(),
};
static int Usage()
{
Console.Error.WriteLine("用法:Sim.Runner compile-server | Sim.Runner run <工程目录>");
return 2;
}