<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki2.lessokaji.com/index.php?action=history&amp;feed=atom&amp;title=%E6%8F%92%E4%BB%B6%E6%B5%8B%E8%AF%95%E4%B8%8E%E5%8F%91%E5%B8%83</id>
	<title>插件测试与发布 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki2.lessokaji.com/index.php?action=history&amp;feed=atom&amp;title=%E6%8F%92%E4%BB%B6%E6%B5%8B%E8%AF%95%E4%B8%8E%E5%8F%91%E5%B8%83"/>
	<link rel="alternate" type="text/html" href="https://wiki2.lessokaji.com/index.php?title=%E6%8F%92%E4%BB%B6%E6%B5%8B%E8%AF%95%E4%B8%8E%E5%8F%91%E5%B8%83&amp;action=history"/>
	<updated>2026-05-16T17:04:28Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki2.lessokaji.com/index.php?title=%E6%8F%92%E4%BB%B6%E6%B5%8B%E8%AF%95%E4%B8%8E%E5%8F%91%E5%B8%83&amp;diff=1049&amp;oldid=prev</id>
		<title>Artheru：​Initial bilingual draft (auto-published)</title>
		<link rel="alternate" type="text/html" href="https://wiki2.lessokaji.com/index.php?title=%E6%8F%92%E4%BB%B6%E6%B5%8B%E8%AF%95%E4%B8%8E%E5%8F%91%E5%B8%83&amp;diff=1049&amp;oldid=prev"/>
		<updated>2026-05-16T14:00:50Z</updated>

		<summary type="html">&lt;p&gt;Initial bilingual draft (auto-published)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 概述 / Overview ==&lt;br /&gt;
本页讲 MDCS 插件的 ''测试 + 打包 + 发布''流程 —— 从 bench-test 单个插件，到把插件做成可分发的版本。&lt;br /&gt;
&lt;br /&gt;
This page covers MDCS plugin ''testing + packaging + release'' — from bench-testing a single plugin to packaging a deliverable version.&lt;br /&gt;
&lt;br /&gt;
== 1. Bench-test Medulla 插件 ==&lt;br /&gt;
=== 控制台测试 / Console testing ===&lt;br /&gt;
启动 Medulla 控制台后，可以直接 [[Special:MyLanguage/startup.iocmd脚本语法|startup.iocmd]] 命令：&lt;br /&gt;
After starting the Medulla console, use script commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
io load plugins/yourname.dll&lt;br /&gt;
your = io init &amp;lt;TypeName&amp;gt; &amp;lt;args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# 读字段 / read field&lt;br /&gt;
your.&amp;lt;field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# 写字段 / write field&lt;br /&gt;
your.&amp;lt;field&amp;gt; = 100&lt;br /&gt;
&lt;br /&gt;
# 调方法 / invoke a [IOObjectUtility]&lt;br /&gt;
your &amp;lt;UtilityMethod&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 雷达插件可视化 / Lidar visualisation ===&lt;br /&gt;
Medulla 的 `LidarTypes/MainIOObject` 暴露一个 `[IOObjectUtility]` 用于显示 2D 点云。加载完雷达后点这个按钮 ：&lt;br /&gt;
* 确认 `frame` 单调递增。&lt;br /&gt;
* 点云形状符合预期（前方、左右、距离合理）。&lt;br /&gt;
* 反光强度归一化后（`ReflexRange`）反光板明显偏红。&lt;br /&gt;
&lt;br /&gt;
Lidar plugin: confirm `frame` increments monotonically, geometry matches expectation, reflectors visibly red after `ReflexRange` normalisation.&lt;br /&gt;
&lt;br /&gt;
=== Cart 插件验证 / Cart plugin validation ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! 检查 / Check !! 方法 / Method&lt;br /&gt;
|-&lt;br /&gt;
| `Init()` 不抛 || 看 `Hedingben` 是否有红色 toast&lt;br /&gt;
|-&lt;br /&gt;
| LadderLogic 启动 || `[IOObjectMonitor]` 看一个 ''iteration 计数器''&lt;br /&gt;
|-&lt;br /&gt;
| `[AsUpperIO]` 设置生效 || `your.vCmd = 100`，观察硬件电机&lt;br /&gt;
|-&lt;br /&gt;
| `[AsLowerIO]` 读取正常 || `your.batteryPercent` 应给真实值&lt;br /&gt;
|-&lt;br /&gt;
| `[UseLadderLogic(resume=true)]` 验证 || 故意制造异常，看是否自动重启循环 + Hedingben toast&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 2. Bench-test Movement ==&lt;br /&gt;
`[MovementTest]` 属性在 Clumsy 测试 UI 自动注册一个按钮。要求 ：&lt;br /&gt;
* 车在静止 / 仿真环境中&lt;br /&gt;
* 没有 ''任何''其它 Movement 在跑&lt;br /&gt;
&lt;br /&gt;
`[MovementTest]` registers a button automatically. Requires the vehicle to be still / simulated, with no other Movement running.&lt;br /&gt;
&lt;br /&gt;
按下按钮 → Movement 开始；UI 实时显示驱动指令；异常时显示 stack trace。&lt;br /&gt;
Pressing the button starts the Movement; UI shows live drive commands; exception → stack trace surfaced.&lt;br /&gt;
&lt;br /&gt;
== 3. Bench-test SimpleComposer 插件 ==&lt;br /&gt;
=== 仿真车 / Virtual vehicle ===&lt;br /&gt;
SimpleComposer 内置 ''仿真车''类型（不需要真硬件） ：&lt;br /&gt;
* 添加 `DummyCar`，配置你的 `[CarType]` 关联。&lt;br /&gt;
* 发派任务从 UI 派；运动学按理想模型计算。&lt;br /&gt;
&lt;br /&gt;
A built-in virtual car type lets you test without real hardware. Configure a `DummyCar` bound to your `[CarType]`; missions dispatched from the UI; kinematics calculated ideally.&lt;br /&gt;
&lt;br /&gt;
=== Trace 面板 / Trace panel ===&lt;br /&gt;
观察 ：&lt;br /&gt;
* 每辆车的 `Queue` 行执行时间线&lt;br /&gt;
* 锁的获取 / 释放序列&lt;br /&gt;
* 任务 status 状态转换（`Programming → Forecasted → Queued → Running → Finished`）&lt;br /&gt;
* 异常路径&lt;br /&gt;
&lt;br /&gt;
Inspect: per-car Queue row timeline, lock acquire/release sequence, status transitions, exception paths.&lt;br /&gt;
&lt;br /&gt;
=== HTTP API 测试 / API testing ===&lt;br /&gt;
SimpleComposer 的 Nancy API 可以用 curl / Postman 测试 ：&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
curl -X POST http://localhost:9050/api/dispatch \&lt;br /&gt;
  -H &amp;quot;Content-Type: application/json&amp;quot; \&lt;br /&gt;
  -d '{&amp;quot;car&amp;quot;: &amp;quot;TestCar&amp;quot;, &amp;quot;target&amp;quot;: &amp;quot;siteA&amp;quot;, &amp;quot;mission_type&amp;quot;: &amp;quot;Go&amp;quot;}'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 4. 录制与回放 / Recording &amp;amp; replay ==&lt;br /&gt;
DObject 自动 ''录制''（每槽可独立开关 `dobj.Recording = true`）写 `.dorec` 文件到 `medulla/recordings/`。&lt;br /&gt;
&lt;br /&gt;
DObject auto-recording (per-slot `Recording = true` flag) writes `.dorec` files into `medulla/recordings/`.&lt;br /&gt;
&lt;br /&gt;
回放工具用于：&lt;br /&gt;
* 重现现场 bug（同一序列输入 → 相同输出）&lt;br /&gt;
* 离线对比 SLAM 算法（同一传感器流跑多个版本）&lt;br /&gt;
* 培训（不用真车）&lt;br /&gt;
&lt;br /&gt;
Replay flows are documented at [[Special:MyLanguage/使用手册 - 数据录制与回放手册|使用手册 - 数据录制与回放手册]]。&lt;br /&gt;
&lt;br /&gt;
== 5. 版本与助记词 / Version + mnemonic ==&lt;br /&gt;
按项目惯例 ：&lt;br /&gt;
Project convention:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;AssemblyInformationalVersion&amp;gt;1.4.0+kindling&amp;lt;/AssemblyInformationalVersion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Major.Minor.Patch + ''单词''助记词。每次改动换助记词。&lt;br /&gt;
Bump a fresh single-word mnemonic on each modification.&lt;br /&gt;
&lt;br /&gt;
或用 `[ReplaceWithCompileInfo]` —— LessokajiWeaver 注入时间戳 + git hash 到 static string 字段（[[Special:MyLanguage/LessokajiWeaver编译后处理工具|详情]]）。&lt;br /&gt;
Alternative: `[ReplaceWithCompileInfo]` injects compile timestamp + git hash automatically.&lt;br /&gt;
&lt;br /&gt;
== 6. 打包 / Packaging ==&lt;br /&gt;
=== Release 构建 / Release build ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dotnet publish -c Release -f net6.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
输出在 `bin/Release/net6.0/publish/`。Costura.Fody 已经把依赖打到单 DLL，所以只需要 ``&amp;lt;plugin&amp;gt;.dll`。&lt;br /&gt;
Output at `bin/Release/net6.0/publish/`. Costura.Fody has embedded deps; only one DLL needed.&lt;br /&gt;
&lt;br /&gt;
=== 测试加载 / Test load ===&lt;br /&gt;
'''关键''' ：在一个 ''干净''的 Medulla 控制台（没有其它插件）加载新 DLL：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
io load plugins/yourname.dll&lt;br /&gt;
your = io init ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
如果你 ''忘了 Costura''，其它插件可能 ''碰巧''加载了你需要的 DLL，但生产环境干净启动时会出错。这个测试能立刻发现。&lt;br /&gt;
&lt;br /&gt;
If you forgot Costura, other plugins may incidentally provide the dep, but a clean production install will fail. This test surfaces it instantly.&lt;br /&gt;
&lt;br /&gt;
=== Release artefact / Release zip ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
your-plugin-1.4.0+kindling.zip&lt;br /&gt;
├── your-plugin.dll&lt;br /&gt;
├── README.md            # 简短说明&lt;br /&gt;
├── CHANGELOG.md         # 本版本变更&lt;br /&gt;
├── INSTALL.txt          # 部署 startup.iocmd 片段&lt;br /&gt;
└── (optional) docs/     # 详细使用文档&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 7. 发布 / Release ==&lt;br /&gt;
* '''内部分发''' / Internal: 上传到 `https://dl.lessokaji.com`（按客户分目录）。&lt;br /&gt;
* '''授权门''' / Auth gate: 通过 `auth.lessokaji.com` 控制谁能下载。&lt;br /&gt;
* '''Wiki 发布说明''' / Wiki release notes: 更新对应 wiki 页（如 `Detour版本发布记录`）。&lt;br /&gt;
* '''DEV_LOG''': 在仓库 `DEV_LOG.md` 加一条记录，含 ''助记词''与变更摘要。&lt;br /&gt;
&lt;br /&gt;
== 8. 兼容性矩阵 / Compatibility matrix ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! 你的插件目标 / Your plugin's target !! 兼容 / Compatible with&lt;br /&gt;
|-&lt;br /&gt;
| RefMedullaCore 1.x || Medulla 1.x runtime&lt;br /&gt;
|-&lt;br /&gt;
| RefMedullaCore 2.x || Medulla 2.x runtime（即当前 M2，默认）&lt;br /&gt;
|-&lt;br /&gt;
| RefClumsyCore 1.x || Clumsy 1.x&lt;br /&gt;
|-&lt;br /&gt;
| RefClumsyCore 2.x || Clumsy 2.x（当前）&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
在 csproj 里 pin 一个主版本，在 CHANGELOG 里写清次版本要求。&lt;br /&gt;
Pin a major version in csproj; document minor-version requirements in CHANGELOG.&lt;br /&gt;
&lt;br /&gt;
== 9. 持续集成 / CI ==&lt;br /&gt;
推荐流水线 ：&lt;br /&gt;
Recommended pipeline:&lt;br /&gt;
&lt;br /&gt;
# 拉源 → 单元测试（如果有）→ 构建 Debug 与 Release。&lt;br /&gt;
# Lint csproj：检查 ''都引用了 `Ref&amp;lt;Name&amp;gt;.dll`'' 而不是 impl DLL，避免误打包。&lt;br /&gt;
# 自动版本号注入（git tag → AssemblyInformationalVersion）。&lt;br /&gt;
# Release zip 自动生成 + 上传到内部仓库。&lt;br /&gt;
&lt;br /&gt;
== 10. 常见错误清单 / Pre-release checklist ==&lt;br /&gt;
* [ ] 测试加载 (干净环境)&lt;br /&gt;
* [ ] `[AsUpperIO]` / `[AsLowerIO]` 字段不是 readonly&lt;br /&gt;
* [ ] `Init()` 不抛异常&lt;br /&gt;
* [ ] LadderLogic `resume = true` 时也手动捕异常 + 写 Lower IO `eStop = true`&lt;br /&gt;
* [ ] Costura.Fody 在 FodyWeavers.xml&lt;br /&gt;
* [ ] AssemblyInformationalVersion 含助记词&lt;br /&gt;
* [ ] CHANGELOG.md 写了本版变更&lt;br /&gt;
* [ ] startup.iocmd 示例片段在 INSTALL.txt&lt;br /&gt;
* [ ] 在仿真车里跑过完整任务&lt;br /&gt;
&lt;br /&gt;
== 相关页面 / See also ==&lt;br /&gt;
* [[Special:MyLanguage/插件契约与打包约定|插件契约与打包约定]]&lt;br /&gt;
* [[Special:MyLanguage/插件开发清单|插件开发清单]]&lt;br /&gt;
* [[Special:MyLanguage/startup.iocmd脚本语法|startup.iocmd脚本语法]]&lt;br /&gt;
* [[Special:MyLanguage/使用手册 - 数据录制与回放手册|数据录制与回放手册]]&lt;br /&gt;
* [[Special:MyLanguage/LessokajiWeaver编译后处理工具|LessokajiWeaver编译后处理工具]]&lt;br /&gt;
&lt;br /&gt;
[[Category:二次开发相关说明]]&lt;br /&gt;
[[Category:开发手册]]&lt;/div&gt;</summary>
		<author><name>Artheru</name></author>
	</entry>
</feed>