Releases: Scaxlibur/WaveBench
Release list
WaveBench v0.8.0
WaveBench v0.8.0 发布说明
WaveBench v0.8.0 把仪器接入从“主包内固定驱动”扩展为“长期预装基线 + 可选外置发行版”的双层架构,并补齐可执行 Instrument API V2、本地受管插件生命周期、长波形可靠性和现场诊断能力。
主包仍永久预装 RTM2000/RTM2032、DS1104Z/DS1000Z、DG4000/DG4202、DP800 和 DM3000/DM3058 五个仪器族;首次使用不需要额外插件。外置包用于独立升级、特定 transport 或扩展,通过严格白名单接管 canonical ID,短 alias 始终保留在内建实现,卸载后自动回退。
主要变化
可执行仪器插件与本地生命周期
- 新增 Instrument API V2、统一 descriptor、capability、权限、配置字段和 resource scheme 契约。
- 新增本地 wheel/source package 检查,以及
plugin install/installed/upgrade/downgrade/remove/recover受管生命周期。 - 安装事务带账本、文件摘要、漂移检测、回滚和保守恢复;外置插件只能声明 canonical ID,不能覆盖短 alias。
- DG4000、DM3000、DP800 和 RTM2000 支持受限 canonical 覆盖;DS1000Z 使用独立外置 canonical ID。
- 插件仍是可信 Python 扩展,不是安全沙箱;安装器只接受用户明确指定的本地包,不下载插件、不自动获取依赖、不修改仪器配置。
仪器与采集
- 新增 RIGOL DS1104Z/DS1000Z 四通道示波器支持,包括 BYTE 波形换算、RAW 分块读取、截图、autoscale 和错误队列处理。
- 多通道示波器采集改为一次 acquisition 后统一读取,避免逐通道重新触发造成时间不一致。
- 强化长波形读取:安全二进制查询、长度与 telemetry 校验、不可安全重放错误语义,以及调用级长传输超时。
- RTM2000 可按插件声明优先使用 RsInstrument SocketIO,并保留 RsVisa、VXI-11/pyvisa-py 等显式兼容路径。
- DM3000/DM3058 增加经校验的 RS-232 transport 配置;外置 DM3000 发行版严格限制为 TCPIP/LAN。
- 新增 sweep analyzer 公共数据契约,为 query-only 扫频分析仪驱动保留安全、硬件无关的接入面。
Run plan、诊断与报告
- Run plan 在一次执行中复用仪器 session,减少重复连接和状态漂移。
- 新增保守的 run plan 模板、参数化模板和 source/scope 离散扫频模板。
wavebench doctor可检查已配置仪器的 resource、IDN 和型号匹配,并在显式网段内只读发现候选设备。- 报告新增多点 sweep 摘要;scope capture 支持显式 autoscale 前置步骤和更完整的质量/一致性信息。
TUI
- Textual TUI 继续作为
wavebench[tui]optional extra。 - 产品范围冻结在电源、万用表和信号源三个快速控制面板;CLI、run plan 和 Service 仍是核心接口。
- 修复退出时遗漏关闭信号源 session 的生命周期问题。
兼容性说明
- Instrument API V2 和受管插件生命周期从 v0.8.0 起正式提供,不属于 v0.7.0。
- 当前六个外置插件包统一要求
wavebench>=0.8,<0.9;它们不能与 v0.7.0 配套运行,也不自动声明兼容未来 0.9。 - 五个内建仪器族继续随主包发布,原有短 driver alias 保持可用。
安装
python -m pip install wavebench-0.8.0-py3-none-any.whl需要终端 TUI 时安装 optional extra:
python -m pip install "wavebench[tui]==0.8.0"外置仪器插件独立发布;安装前请同时固定 WaveBench 与插件版本,并先运行本地 package check。
WaveBench v0.7.0
WaveBench v0.7.0 发布说明
WaveBench v0.7.0 是一次面向自动化、远程集成和插件生态的主线版本。这个版本把 v0.6.0 的 TUI 收口之后继续推进:新增只读 HTTP MCP 接口、局域网仪器发现、RunService/CLI 内部拆分,以及第一版插件注册表和声明式 SCPI 插件元数据能力。
这个版本仍然保持安全边界:HTTP MCP 只暴露只读工具,插件系统默认只处理 metadata,不自动安装、不下载、不导入市场条目、不执行任意 SCPI,也不改变现有 service/driver 控制路径。声明式 SCPI probe/doctor 只允许显式资源参数下的只读 IDN 查询,用于确认设备身份。
新增与改进
- 新增只读 HTTP MCP 服务:
wavebench mcp serve。 - HTTP MCP 默认只绑定
127.0.0.1,拒绝0.0.0.0,并对/mcp、/tools、/call强制 Bearer token。 - HTTP MCP 提供只读工具:
run.schema、run.check、capture.inspect。 run.check和capture.inspect增加路径边界,限制在预期目录内,避免通过 MCP 读取任意路径。- 新增网络发现命令:
wavebench net discover,支持扫描网段、探测常见仪器端口,并对 SCPI socket 执行只读*IDN?。 - CLI 内部拆分出
cli_parser.py和cli_output.py,降低cli.py复杂度。 - RunService 拆分出
run_analysis.py、run_artifacts.py、run_safety.py、run_restore.py,让分析、产物写出、安全检查、source restore 边界更清楚。 - 新增插件 metadata 注册表:
wavebench plugin list/info,内置 RTM2032、DG4202、DP800、DM3000 四类驱动 metadata。 - 新增插件诊断:
wavebench plugin doctor,检查 API 版本、仪器类型、capability 命名和 entry point 加载问题。 - 支持显式 entry point 发现:
--include-entry-points会加载wavebench.drivers,默认不导入第三方包。 - 新增本地只读插件市场索引:
wavebench plugin market search/info,仅读取包内 JSON index,不联网、不安装。 - 新增声明式 SCPI 插件 metadata:
wavebench plugin scpi check/info,用于校验和展示本地 TOML 插件描述。 - 新增声明式 SCPI 只读 probe:
wavebench plugin scpi probe,只发送 TOML 中通过校验的 IDN query。 - 新增声明式 SCPI doctor:
wavebench plugin scpi doctor,默认只检查 metadata;显式--probe --resource时才执行只读 IDN 匹配。 - 新增 SCPI 插件示例:
doc/project/scpi-plugin.example.toml和doc/project/scpi-dp800.example.toml。 - 新增插件注册表、插件市场索引、声明式 SCPI 插件、HTTP MCP 只读接口等项目文档。
- 删除不再维护的英文文档副本
doc/README_EN.md,当前公开文档以中文为准。
安全与边界
- HTTP MCP 不暴露 raw SCPI、不提供 output on/off、不执行真实仪器写操作。
- HTTP MCP token 必须通过
--token或--token-env提供,示例只展示环境变量名,不记录 token 值。 wavebench net discover和 SCPI plugin probe 只做只读 IDN 查询。- 插件系统不自动下载插件,不自动安装插件,不导入 market index 条目中的 Python 包。
- 声明式 SCPI 插件不注册为可执行 driver,不让 service 层按声明式插件执行控制命令。
plugin scpi doctor --probe必须显式提供--resource,不会自己扫描或碰未指定仪器。
验证
本地门禁已通过:
ruff check src tests: OK- full test suite:
373 passed, 16 subtests passed git diff --check: OK- wheel build:
wavebench-0.7.0-py3-none-any.whl - wheel metadata:
Version: 0.7.0 - wheel 内容检查:HTTP MCP、network discovery、plugin market JSON、SCPI plugin、CLI parser/output 都已入包
- 插件 smoke:
plugin doctor、plugin market search rigol、plugin scpi doctor ... --probe ...均通过 - 现场验证:仅对已开机的 RIGOL DP832A 执行只读
*IDN?probe,返回RIGOL TECHNOLOGIES,DP832A,...且 IDN 匹配声明片段
WaveBench v0.6.0
WaveBench v0.6.0 Release Notes / 发布说明
中文
WaveBench v0.6.0 是实验性 TUI 控制面板的第一个完整收口版本。这个版本把 WaveBench 从“主要靠 CLI/run plan 驱动”的工具,推进到可以在终端里直接查看和控制实验台状态:DP800/DP832A 电源、DM3058/DM3000 系列万用表、DG4202 信号源都已有对应 TUI 面板。
这个版本仍然保持 WaveBench 的边界:不做 LabVIEW 式平台重构,不隐藏仪器写操作,不绕过已有 service/driver 安全层。TUI 只是新增前端,底层仍复用 CLI 已验证过的 SourceService、PowerService、DmmService 与现有配置。
新增与改进
- 新增实验性
wavebench tui终端控制面板,基于 Textual,可用wavebench tui --fake离线查看界面。 - TUI 新增 DG4202 信号源面板,显示 output、function、frequency、Vpp、offset,并支持显式 set function、set frequency、set Vpp、toggle output。
- TUI 电源面板继续打磨:DP800/DP832A 三通道状态压缩为更紧凑的三行显示,输出 ON、CC 模式和不同通道用颜色高亮。
- TUI 电源 protection 面板支持 OVP/OCP 状态显示与受约束写入;写操作仍复用
PowerService.set_protection()的安全校验。 - TUI DMM 面板改为中英双语功能按钮,覆盖 DCV、ACV、DCI、ACI、RES、FRES、FREQ、PERIOD、CONT、DIODE、CAP。
- DMM function 切换后新增可配置等待:
[dmm].settle_ms_after_function_change,默认 500 ms,避免切挡后立即读数不稳定。 - DMM TUI 自动读数不再每轮查询
:FUNCtion?,改用本地 active function 缓存,减少 DM3058 LAN/PyVISA 偶发RPCUnpackError对自动刷新链路的影响。 - DM3058 function 状态解析兼容更多真实回读简写:
CONT、FREQ、CAP、2WR、4WR。 - 重复点击当前 DMM 挡位时不再重复发送 set-function,只做读数刷新,避免仪器控制卡住。
- TUI 持久化日志默认写入
data/tui/wavebench-tui.log,并记录 session start/stop、界面日志与 adapter command log lines。 - TUI 退出收尾硬化:
q退出时停止 refresh timer,避免继续调度后台 I/O;仪器阻塞 I/O 改为自管 daemon thread 路径,避免 asyncio 默认 executor 300 秒 join warning。 - Source 不参与全局自动轮询;启动时读一次,手动 Refresh 可读,写操作后回读,避免把非 telemetry 的信号源状态当作高频刷新对象。
- 本地 agent 元数据
.agents/、.codex/已加入.gitignore。 - 公开 README 与文档总览补充当前 TUI 用法、日志路径、退出说明和配置项。
安全与边界
- TUI 不直接散写 SCPI;信号源、电源、万用表操作继续走现有 service/driver 层。
- 电源写操作仍受
[safety_limits]约束。 - Source 输出打开前仍检查配置中的 source amplitude 上限。
- DP800 手册复查确认没有一次返回三通道明细的 status/measurement/OVP/OCP 查询;后续若要优化刷新性能,优先考虑 round-robin 分片刷新或降低 protection 刷新频率。
English
WaveBench v0.6.0 is the first closeout release for the experimental terminal TUI control panel. It moves WaveBench beyond CLI/run-plan-only workflows toward a terminal lab-bench panel where DP800/DP832A power supplies, DM3058/DM3000-family DMMs, and DG4202 source controls can be viewed and operated directly.
The project boundary stays the same: this is not a LabVIEW-style platform rewrite, it does not hide instrument writes, and it does not bypass the existing service/driver safety layers. The TUI is only a new frontend over the already-tested SourceService, PowerService, DmmService, and configuration model.
Added and Improved
- Added the experimental
wavebench tuiterminal control panel, built with Textual. Usewavebench tui --faketo inspect the UI offline. - Added the DG4202 source TUI panel, showing output, function, frequency, Vpp, and offset, with explicit set function, set frequency, set Vpp, and output toggle operations.
- Polished the power TUI: DP800/DP832A three-channel status is now displayed in a compact three-row layout, with visual highlighting for ON output, CC mode, and channel rows.
- Added/continued the power protection TUI panel for OVP/OCP status and constrained writes. Writes still go through
PowerService.set_protection()safety checks. - Reworked the DMM TUI into bilingual function buttons covering DCV, ACV, DCI, ACI, RES, FRES, FREQ, PERIOD, CONT, DIODE, and CAP.
- Added configurable DMM settle time after function changes:
[dmm].settle_ms_after_function_change, defaulting to 500 ms. - DMM TUI auto-read no longer queries
:FUNCtion?on every refresh. It uses a local active-function cache to reduce DM3058 LAN/PyVISA intermittentRPCUnpackErrorimpact. - DM3058 function status parsing now accepts real shorthand responses such as
CONT,FREQ,CAP,2WR, and4WR. - Clicking the current DMM function again is now a no-op for set-function and only refreshes the reading, avoiding a repeated set command that could stall the instrument control path.
- TUI persistent logs now default to
data/tui/wavebench-tui.log, recording session start/stop, UI logs, and adapter command log lines. - Hardened TUI shutdown: pressing
qstops the refresh timer and prevents new background I/O scheduling. Blocking instrument I/O now uses managed daemon threads instead of the asyncio default executor path, avoiding the 300-second executor join warning. - Source status is no longer part of the global auto-refresh loop. It is read once on startup, can be refreshed manually, and is read back after writes.
- Local agent metadata directories
.agents/and.codex/are now ignored. - Public README and docs now describe the current TUI usage, log path, quit behavior, and configuration options.
Safety and Boundaries
- The TUI does not scatter raw SCPI; source, power, and DMM operations still go through the existing service/driver layers.
- Power writes remain guarded by
[safety_limits]. - Source output enable still checks the configured source amplitude limit first.
- A DP800 manual review confirmed there is no single query returning detailed status/measurement/OVP/OCP data for all three channels. Future refresh-performance work should prefer round-robin split refreshes or lower protection refresh frequency.
WaveBench v0.5.0
WaveBench v0.5.0 Release Notes / 发布说明
中文
WaveBench v0.5.0 是 report evidence polish 收口版本。这个版本没有扩大仪器控制边界,重点是让真实 run report 更适合作为实验交付证据:摘要更清楚、产物更容易追溯、步骤时间线更完整,同时补上 DMM 读数的独立稳定等待配置。
新增与改进
- HTML report 新增并打磨
实验证据摘要 / Run evidence summary,让 run 状态、步骤、验收结果和关键产物一眼可扫读。 - HTML report 新增
产物链接 / Artifact links,集中链接run.json、summary.csv、采集包、截图和相关离线产物。 - HTML report 新增
证据时间线 / Evidence timeline,按步骤展示 source / scope / DMM / sleep 等执行证据。 - report layout 进一步收紧,保持单文件静态 HTML 和现有视觉方向,在真实内容变多时更紧凑、更适合阅读和打印。
- DMM 读数卡片与 report 中的 DMM 信息展示继续完善,DMM ACV/DCV 读数可以和 scope 验收信息一起出现在同一份 run report 中。
- 新增
[dmm].settle_ms_before_read,DMM 正式读取前的稳定等待由 DMM 自己的配置控制,不再复用 source 设频等待语义。
实机验证
已完成一次真实 source/scope + DMM report smoke:
- run:
data/runs/20260506_185453_source_scope_dmm_report_check/ - report:
data/runs/20260506_185453_source_scope_dmm_report_check/report.html - 接线:DG4202 CH1 -> RTM2032 CH1;DG4202 CH2 -> DM3058。
- scope CH1:约
1000.500 Hz、1.000 Vpp,expect与expect_fft均通过。 - DMM ACV:
0.3530127 V,expect 通过。
English
WaveBench v0.5.0 is a report evidence polish closeout. It does not expand the instrument-control boundary; the focus is making real run reports more useful as experiment evidence, with clearer summaries, easier artifact tracing, a fuller step timeline, and an independent DMM read-settling configuration.
Added and Improved
- HTML reports now include and polish
Run evidence summary / 实验证据摘要, making run status, steps, expectation results, and key artifacts easier to scan. - HTML reports now include
Artifact links / 产物链接, collecting links torun.json,summary.csv, capture packages, screenshots, and related offline artifacts. - HTML reports now include
Evidence timeline / 证据时间线, showing source / scope / DMM / sleep execution evidence by step. - Report layout is more compact while keeping the single-file static HTML format and the existing visual direction, so larger real reports remain readable and printer-friendly.
- DMM reading cards and report-side DMM presentation were improved, allowing DMM ACV/DCV readings to sit alongside scope expectation evidence in the same run report.
- Added
[dmm].settle_ms_before_read, so DMM settling before formal reads is controlled by DMM-specific configuration instead of reusing source frequency-settle semantics.
Real-Instrument Verification
A real source/scope + DMM report smoke passed:
- run:
data/runs/20260506_185453_source_scope_dmm_report_check/ - report:
data/runs/20260506_185453_source_scope_dmm_report_check/report.html - Wiring: DG4202 CH1 -> RTM2032 CH1; DG4202 CH2 -> DM3058.
- Scope CH1: about
1000.500 Hz,1.000 Vpp; bothexpectandexpect_fftpassed. - DMM ACV:
0.3530127 V; expectation passed.
WaveBench v0.4.4
WaveBench v0.4.4 Release Notes / 发布说明
中文
WaveBench v0.4.4 是 DMM + report 小版本收口。这个版本把 DM3058 LAN/VISA 读取、run plan 中的 dmm.read、DMM 读数 expect 门禁,以及 HTML 报告里的 DMM 读数卡片整理成一个可发布的增量。
新增与改进
- 新增 DM3058 LAN/VISA 万用表读取路径,并保留 DM3000 RS232 方向的 driver / transport skeleton。
- 新增
dmm idn与dmm read dcv|acv|dci|aci|res|fres|freq|period|continuity|diode|cap。 - 新增
scripts/dmm_dcv_staircase_smoke.py,用于保守执行DP800 -> DMMDCV 阶梯 smoke,并在结束时恢复电源输出。 - 新增
scripts/dmm_acv_source_smoke.py与plans/example_dmm_acv_source_smoke.toml,用于保守执行DG4202 -> DMMACV/RMS smoke,并恢复信号源状态。 - run plan 新增
dmm.read步骤;默认读取 DCV,也可通过function指定测量函数。 dmm.read支持[steps.expect],可对 DMM 读数 payload 中的数值字段做 min/max 门禁;常用字段为value。run report新增 DMM 读数卡片,并在 expect 表中展示 DMM 读数的预期、实测与状态。
文档
- 更新公开 README 的版本号到
0.4.4。 - 英文 README 补充 DM3000 / DM3058 DMM 能力、smoke 脚本和 run plan DMM 步骤说明。
验证
- 单元测试覆盖 DMM CLI 参数、DM3058 兼容读取、DMM 配置解析、
dmm.readrun-plan schema、run service 执行与 expect 失败路径,以及 HTML report DMM 卡片渲染。
English
WaveBench v0.4.4 is a small DMM + report consolidation release. It packages the DM3058 LAN/VISA read path, dmm.read run-plan step, DMM expectation checks, and DMM reading cards in HTML reports into one release-ready increment.
Added and Improved
- Added the DM3058 LAN/VISA DMM read path, while keeping the DM3000 RS232 driver / transport skeleton separated for the next stage.
- Added
dmm idnanddmm read dcv|acv|dci|aci|res|fres|freq|period|continuity|diode|cap. - Added
scripts/dmm_dcv_staircase_smoke.pyfor a conservativeDP800 -> DMMDCV staircase smoke with power-output restoration. - Added
scripts/dmm_acv_source_smoke.pyandplans/example_dmm_acv_source_smoke.tomlfor a conservativeDG4202 -> DMMACV/RMS smoke with source-state restoration. - Added the
dmm.readrun-plan step. It defaults to DCV and can select a measurement function withfunction. dmm.readnow supports[steps.expect]min/max checks over numeric fields in the DMM reading payload. The common field isvalue.run reportnow renders DMM reading cards and includes DMM expected/measured/status rows in the expectation table.
Documentation
- Updated the public README version to
0.4.4. - Updated the English README with DM3000 / DM3058 DMM capabilities, smoke scripts, and run-plan DMM step wording.
Verification
- Unit coverage includes DMM CLI arguments, DM3058-compatible reads, DMM config parsing,
dmm.readrun-plan schema, run-service execution and expect failure handling, plus HTML report DMM card rendering.
WaveBench v0.3.0
WaveBench v0.3.0 - visual evidence reports / 可视化证据报告
中文
WaveBench v0.3.0 把报告从“可读日志”推进到“小型可视化证据包”。它继续保持离线优先边界:报告和 inspect 命令只读取已有 artifact,不连接仪器。
主要变化
run report顶部新增 Summary card,显示状态、实验标签、步骤数、失败步骤、采集包、warning、expect 失败、截图、恢复状态和主要信号指标。- 新增
Expected vs measured表格,直接展示[steps.expect]的目标值与实测值。 - 从保存的
ch*.npy生成内联 SVG 波形预览。 - 新增
report-assets/manifest.json,记录报告引用的 artifact 和缺失 artifact warning。 - 新增可选离线 FFT 文本摘要:
python -m wavebench capture inspect data/raw/<capture_dir> --fft报告改进
python -m wavebench run report data/runs/<run_dir> 现在会写出:
report.html
report-assets/manifest.json
HTML 报告包含:
- Summary card
- 带截图缩略图的 Steps 表格
- Expected vs measured 检查表
- Signal analysis 表格
- 波形预览
- 截图库
FFT inspect
capture inspect --fft 会对保存的 NPY 波形输出轻量频域摘要:
- Hann 窗
- 采样率
- 频率分辨率
- 主峰频率和幅度
- 噪声底估计
- 2 到 5 次谐波 bin
- 粗略 THD 估计
- 非均匀采样或异常时间轴 warning
它故意只是文本 inspect 工具,不是默认 report 区块。
保持的边界
v0.3.0 不做:
- GUI / SPA
- 交互式图表
- 新工作流语言
- 条件分支或矩阵 run plan
- 默认频谱报告
- zip export
- 新仪器型号
验证
124 passed
备注
报告可以生成派生预览和 manifest 文件,但不会修改原始采集数据、metadata 或 run records。
English
WaveBench v0.3.0 turns reports from plain readable logs into small visual evidence packets. It keeps the offline-first boundary: reports and inspect commands read existing artifacts only and do not connect to instruments.
Highlights
- Added a run-report Summary card for status, experiment label, steps, failed steps, captures, warnings, failed expectations, screenshots, restore status, and primary signal metrics.
- Added an
Expected vs measuredtable for[steps.expect]checks. - Added inline SVG waveform previews generated from saved
ch*.npydata. - Added
report-assets/manifest.jsonfor report artifact references and missing-artifact warnings. - Added optional offline FFT text summaries:
python -m wavebench capture inspect data/raw/<capture_dir> --fftReport improvements
python -m wavebench run report data/runs/<run_dir> now writes:
report.html
report-assets/manifest.json
The HTML report includes:
- Summary card
- Steps table with screenshot thumbnails
- Expected vs measured checks
- Signal analysis table
- Waveform previews
- Screenshot gallery
FFT inspect
capture inspect --fft prints a lightweight frequency-domain summary for saved NPY waveforms:
- Hann window
- sample rate
- frequency resolution
- peak frequency and amplitude
- noise floor estimate
- 2nd to 5th harmonic bins
- rough THD estimate
- warnings for non-uniform or problematic time axes
This is intentionally a text inspect tool, not a default report section.
Boundaries kept
v0.3.0 does not add:
- GUI / SPA
- interactive charts
- new workflow language
- conditional or matrix run plans
- default spectrum reports
- zip export
- new instrument models
Validation
124 passed
Notes
The report can generate derived preview and manifest files, but it does not modify original capture data, metadata, or run records.
WaveBench v0.4.2
WaveBench v0.4.2 Release Notes / 发布说明
中文
WaveBench v0.4.2 是一个保守的小版本,重点是给已经接入的信号源、电源和 run plan 增加第一层软件安全上限,并改善 PyVISA 通信失败时的命令行错误呈现。
新增
- 新增
[safety_limits]配置区:max_source_vpp:限制信号源 Vpp 写操作。max_power_voltage_v:限制电源设定电压。max_power_current_limit_a:限制电源限流值。
source set-vpp、source arb-load、power set会在写仪器前检查安全上限。run plan会在创建 run 目录和连接仪器前静态检查 run plan 中的 source/power 超限步骤。run check与run verify也会结合当前配置检查安全上限;通过时run check输出safety_limits=ok / 安全上限=通过。source output on与power output on会先读取当前设定值;如果当前幅度、电压或限流超出配置上限,则拒绝打开输出。
修复
- PyVISA 的 query/write/binary query/
*OPC?失败现在会包装为 WaveBench 的用户可读错误,不再泄露 Python traceback。
验证
- 本地测试:
171 passed。 - GitHub CI:Python 3.11 / 3.12 均通过。
- 保守验证:
- 使用不存在的 VISA resource 验证超限路径先返回安全错误,没有进入连接仪器。
- 使用实际 DG4202 CH2 验证:当当前 CH2 为 5 Vpp,而
max_source_vpp = 2.0时,source output on会在写输出前拒绝,并保持设备状态不变。 - 验证低于安全上限时不会被误拦截;后续 I/O timeout 会被包装成
wavebench:用户错误。
English
WaveBench v0.4.2 is a conservative patch release focused on adding first-layer software safety limits for the existing source, power, and run-plan paths, plus cleaner CLI errors for PyVISA communication failures.
Added
- Added the
[safety_limits]config table:max_source_vpp: caps signal-generator Vpp write operations.max_power_voltage_v: caps power-supply voltage setpoints.max_power_current_limit_a: caps power-supply current-limit setpoints.
source set-vpp,source arb-load, andpower setnow check safety limits before instrument writes.run plannow statically checks source/power limit violations before creating a run directory or connecting to instruments.run checkandrun verifyalso apply the configured safety limits; successfulrun checkprintssafety_limits=ok / 安全上限=通过.source output onandpower output onread current setpoints first; if the current amplitude, voltage, or current limit exceeds the configured limits, WaveBench refuses to enable output.
Fixed
- PyVISA query/write/binary-query/
*OPC?failures are now wrapped as user-readable WaveBench errors instead of leaking Python tracebacks.
Validation
- Local tests:
171 passed. - GitHub CI: Python 3.11 / 3.12 passed.
- Conservative validation:
- Verified with intentionally nonexistent VISA resources that over-limit paths return safety errors before instrument connection.
- Verified against a real DG4202 CH2: with CH2 currently at 5 Vpp and
max_source_vpp = 2.0,source output onis rejected before writing output state, leaving the instrument unchanged. - Verified that under-limit paths are not falsely blocked; subsequent I/O timeouts are wrapped as
wavebench:user errors.
WaveBench v0.4.1
English
WaveBench v0.4.1 is a small hardening release after v0.4.0.
Added
- Added
wavebench run verify --plan <plan.toml>for read-only run-plan preflight checks.- It parses the plan, finds referenced instruments, and queries
*IDN?for scope/source/power as needed. - It does not change output state or front-panel settings.
- It parses the plan, finds referenced instruments, and queries
- Added PyVISA transport support for
query_float_list,query_bin_block, andquery_opcso the transport abstraction is more complete. - Hardened socket query handling for instruments that leave an empty line before the real response, verified on DG4202 status reads.
- Added tests for:
- all-zero arbitrary waveform normalization,
- malformed DP800 response parsing,
- PyVISA transport capability helpers,
- empty socket-response recovery,
- run-plan preflight instrument selection.
Changed
wavebench.__version__now reads package metadata instead of carrying a stale hard-coded value.- Project version bumped to
0.4.1. - README / English README now mention
run verify.
Validation
158 passedwithpython -m pytest -q.- Live Excalibur-wsl check passed against RTM2032 + DG4202:
run verifysucceeded, DG4202 CH2 status parsed correctly, and RTM2032 CH1 captured an existing ~1 kHz / 2.04 Vpp signal with quality statusok. git diff --checkpassed.
中文
WaveBench v0.4.1 是 v0.4.0 之后的小型加固版本。
新增
- 新增
wavebench run verify --plan <plan.toml>,用于 run plan 执行前的只读预检。- 它会解析 plan,找出涉及的 scope/source/power,并按需查询
*IDN?。 - 它不会修改输出状态,也不会改前面板设置。
- 它会解析 plan,找出涉及的 scope/source/power,并按需查询
- 补齐 PyVISA 传输层的
query_float_list、query_bin_block、query_opc,让传输抽象更完整。 - 加固 socket 查询处理,兼容仪器在真实响应前残留空行的情况;已用 DG4202 状态读取验证。
- 补充测试:
- 任意波形全零输入归一化;
- DP800 异常响应解析;
- PyVISA 传输能力辅助方法;
- socket 空响应恢复;
- run plan 预检的仪器选择逻辑。
变更
wavebench.__version__改为读取 package metadata,避免继续携带过时硬编码版本。- 项目版本升至
0.4.1。 - README / 英文 README 增加
run verify说明。
验证
python -m pytest -q:158 passed。- Excalibur-wsl 实物检查通过:RTM2032 + DG4202 的
run verify成功,DG4202 CH2 状态解析正确,RTM2032 CH1 对现有约 1 kHz / 2.04 Vpp 信号的采集质量为ok。 git diff --check通过。
WaveBench v0.4.0
WaveBench v0.4.0 - arbitrary waveform closure / 任意波形闭环
WaveBench v0.4.0 closes the first real arbitrary-waveform loop for the RIGOL DG4202 and R&S RTM2032 lab pair.
WaveBench v0.4.0 为 RIGOL DG4202 与 R&S RTM2032 这套实验仪器组合打通了第一条真实的任意波形闭环。
The scope of this release is deliberately small: take a CSV/NPY waveform, validate and map it into DG4000/DG4202 14-bit DAC data, upload it through DATA:DAC VOLATILE, capture the result with RTM2032, and preserve enough evidence to decide whether the loop actually worked.
本次发布的范围刻意收窄:读取 CSV/NPY 波形,校验并映射为 DG4000/DG4202 14-bit DAC 数据,通过 DATA:DAC VOLATILE 上传,用 RTM2032 采集结果,并保留足够证据来判断这条回路是否真正跑通了。
Highlights / 亮点
- Added DG4202 arbitrary waveform upload through
DATA:DAC VOLATILE. - 新增 DG4202 任意波形上传功能,通过
DATA:DAC VOLATILE实现。 - Added raw byte transport support with
InstrumentTransport.write_bytes()and PyVISAwrite_raw. - 新增原始字节传输支持,通过
InstrumentTransport.write_bytes()和 PyVISAwrite_raw实现。 - Added DG4000/DG4202 14-bit DAC binary block generation from validated CSV / NPY waveforms.
- 新增从校验后的 CSV / NPY 波形生成 DG4000/DG4202 14-bit DAC 二进制块的功能。
- Promoted
source arb-loadfrom dry-run-only payload validation to a minimal upload command. - 将
source arb-load从仅 dry-run 的负载校验提升为可实际上传的最小命令。 - Added
source.arb_loadrun-plan step so upload, output enablement, capture, and[steps.expect]checks can live in one explicit plan. - 新增
source.arb_loadrun-plan 步骤,使上传、输出使能、采集和[steps.expect]检查能共存于一个显式计划中。 - Recorded the first real closure evidence: DG4202 triangle arbitrary waveform -> RTM2032 capture -> FFT peak at 1 kHz -> static report.
- 记录了首条真实闭环证据:DG4202 三角任意波形 → RTM2032 采集 → 1 kHz FFT 峰值 → 静态报告。
CLI example / 命令行示例
Dry-run validation remains available:
Dry-run 校验仍然可用:
python -m wavebench source arb-load \
--channel 1 \
--file waveform.npy \
--name REI_ARB \
--amplitude 1.0 \
--offset 0.0 \
--export-payload data/arb/REI_ARB.json \
--dry-runUpload requires an explicit playback frequency:
上传需指定回放频率:
python -m wavebench source arb-load \
--config wavebench.toml \
--channel 1 \
--file waveform.npy \
--name REI_TRI \
--amplitude 1.0 \
--frequency 1000 \
--offset 0.0 \
--output-onRun-plan example / Run-plan 示例
[[steps]]
kind = "source.arb_load"
channel = 1
file = "data/arb/triangle_1024.npy"
frequency_hz = 1000
amplitude_vpp = 1.0
offset_v = 0.0
output_on = true
[[steps]]
kind = "scope.capture"
channel = 1
label = "arb_triangle_1k"
window_frequency_hz = 1000
target_cycles = 10
target_vpp = 1.0
screenshot = true
[steps.expect]
voltage_vpp_v = { min = 0.8, max = 1.2 }
frequency_estimate_hz = { min = 950, max = 1050 }Validation / 验证
python -m pytest -q->150 passedgit diff --check-> OK- Lab closure record / 实验室闭环记录:
doc/project/WaveBench_v0.4_闭环验证记录.md
Not included / 未包含
v0.4.0 is not an arbitrary-waveform editor. It does not add GUI editing, cross-vendor waveform abstraction, non-volatile waveform library management, RAF / Ultra Station workflows, or automatic waveform synthesis.
v0.4.0 不是一个任意波形编辑器。它不包含 GUI 编辑、跨厂商波形抽象、非易失波形库管理、RAF / Ultra Station 工作流,也不包含自动波形合成。
Those can come later. This release is about proving the first small loop.
这些可以以后再做。本次发布的意义在于证明第一条小回路是可行的。
WaveBench v0.2.0
WaveBench v0.2.0 - readable evidence reports / 可读的测量证据报告
中文说明
WaveBench v0.2.0 的重点是把已经采集到的测量数据变成更容易阅读、复盘和分享的证据报告。
这一版没有扩展更多仪器型号,也没有引入 GUI。目标很明确:让 data/raw/... 和 data/runs/... 里已经存在的数据更有用。
新增功能
-
新增离线 capture / run package 读取能力,支持读取
data/raw/...和data/runs/...。 -
新增:
wavebench capture inspect <capture_dir>
用于查看采集包摘要。
-
新增:
wavebench run report <run_dir>
用于从已有 run package 生成静态 HTML 报告。
-
新增:
wavebench scope capture --screenshot
支持 RTM2032 保存 PNG 截图 artifact。
-
run plan 的
scope.capture现在支持:[[steps]] kind = "scope.capture" screenshot = true
-
HTML 报告现在会在存在截图时自动嵌入截图缩略图,并生成 Screenshots 区块。
-
HTML 报告新增 Signal analysis 区块,展示:
- 频率
- Vpp
- RMS
- 均值
- duty cycle
- rise/fall time
- quality warnings
-
新增
plans/demo_dg4202_10k_screenshot_report.toml,作为 v0.2 的最小实机 demo plan。 -
WSL 环境下新增
pyvisa-pyfallback:当 native RS VISA 不可用时,可以通过pyvisa-py继续连接仪器。
安全模型
-
run report和capture inspect都是离线命令,不会连接仪器。 -
截图是 capture artifact,不是 report 的副作用。
-
run plan 继续保持显式语义:
- 不隐藏 reset
- 不在 capture 前隐式 autoscale
- 不偷偷修改电源输出
- 不自动修正硬件状态
-
source restore 仍然需要显式启用:
[restore] source_state = true
验证情况
- 单元测试:118 tests passing。
- WSL 实机 demo 已通过:
- DG4202 输出
- RTM2032 采集
- 10 kHz 波形
- screenshot artifact
- HTML report generation
- Demo report 中已确认包含 Signal analysis 和 Screenshots 区块。
已知边界
- 没有 GUI。
- 没有 YAML workflow layer。
- run plan 仍不支持条件分支、循环、矩阵实验或表达式语言。
- report 里的 Signal analysis 目前汇总已有 capture metadata,不重新读取 NPY 做二次分析。
- 仪器支持仍然保持窄范围,只针对当前文档中验证过的 RTM2032 / DG4202 / DP800 路径。
English Notes
WaveBench v0.2.0 focuses on turning captured measurement data into readable evidence.
This release does not expand the instrument matrix or introduce a GUI. The goal is simple: make existing data/raw/... and data/runs/... artifacts easier to inspect, review, and share.
New features
-
Added offline capture/run package readers for
data/raw/...anddata/runs/.... -
Added:
wavebench capture inspect <capture_dir>
for human-readable capture summaries.
-
Added:
wavebench run report <run_dir>
for static offline HTML reports.
-
Added:
wavebench scope capture --screenshot
for RTM2032 PNG screenshot artifacts.
-
Run-plan
scope.capturenow supports:[[steps]] kind = "scope.capture" screenshot = true
-
HTML reports now embed screenshot thumbnails and include a Screenshots section when captures provide
screenshot.png. -
HTML reports now include a Signal analysis section with:
- frequency
- Vpp
- RMS
- mean
- duty cycle
- rise/fall time
- quality warnings
-
Added
plans/demo_dg4202_10k_screenshot_report.tomlas a minimal v0.2 hardware demo plan. -
Added WSL-friendly VISA fallback through
pyvisa-pywhen native RS VISA is unavailable.
Safety model
-
run reportandcapture inspectare offline-only commands and never connect to instruments. -
Screenshots are capture artifacts, not report side effects.
-
Run plans remain explicit:
- no hidden reset
- no implicit autoscale before capture
- no hidden power output changes
- no automatic hardware correction
-
Source restore remains opt-in:
[restore] source_state = true
Validation
- Unit test suite: 118 tests passing.
- Real WSL hardware demo passed:
- DG4202 output
- RTM2032 capture
- 10 kHz waveform
- screenshot artifact
- HTML report generation
- Demo reports include both Signal analysis and Screenshots sections.
Known limits
- No GUI.
- No YAML workflow layer.
- No conditionals, loops, matrix experiments, or expression language in run plans.
- Signal analysis in reports summarizes existing capture metadata; it does not reprocess NPY waveforms yet.
- Instrument support remains intentionally narrow and verified only for the documented RTM2032 / DG4202 / DP800 paths.