Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WaveBench 仪器插件的独立源码仓库。仓库计划按“一台仪器或

## 当前状态

正式源码包已进入独立维护:`wavebench-rigol-ds1000z`、`wavebench-rigol-dg4000`、LAN-only 的 `wavebench-rigol-dm3000`、`wavebench-rigol-dp800` 与 `wavebench-rohde-schwarz-rtm2000` 已完成离线、受管生命周期和受控实机验收;`wavebench-shengpu-sp3000a` 已进入 SP30120 M3.5,保留最小 query-only descriptor 并提供五项经认证的厂商专用 RF-OFF 控制。前五个包是 WaveBench 预装驱动的可选外置发行版,用于独立升级、特定 transport 或后续扩展,并不替代或淘汰主包的开箱即用基线。WaveBench v0.8.0 已提供本地 package check、受管安装、状态查询、升级/降级、卸载和保守事务恢复;本仓库只维护插件源码,不重复实现安装器或远程 catalog。
正式源码包已进入独立维护:`wavebench-rigol-ds1000z`、`wavebench-rigol-dg4000`、LAN-only 的 `wavebench-rigol-dm3000`、`wavebench-rigol-dp800` 与 `wavebench-rohde-schwarz-rtm2000` 已完成离线、受管生命周期和受控实机验收;`wavebench-rigol-dg1000` 当前完成离线与受管生命周期验证,并保持 basic source 控制面;`wavebench-shengpu-sp3000a` 已进入 SP30120 M3.5,保留最小 query-only descriptor 并提供五项经认证的厂商专用 RF-OFF 控制。这些包是 WaveBench 预装驱动或新增仪器族的可选外置发行版,用于独立升级、特定 transport 或后续扩展,并不替代或淘汰主包的开箱即用基线。WaveBench v0.8.0 已提供本地 package check、受管安装、状态查询、升级/降级、卸载和保守事务恢复;本仓库只维护插件源码,不重复实现安装器或远程 catalog。

> [!IMPORTANT]
> WaveBench `v0.7.0` 尚不包含 Instrument API V2、受管插件生命周期或覆盖槽位。本仓库当前包面向 WaveBench `v0.8.0` release,并统一要求 `wavebench>=0.8,<0.9`;它们不能与 `v0.7.0` 配套运行,也不能自动假定兼容未来 `0.9`。
Expand All @@ -15,6 +15,7 @@ WaveBench 仪器插件的独立源码仓库。仓库计划按“一台仪器或

```text
packages/
├── wavebench-rigol-dg1000/
├── wavebench-rigol-dg4000/
├── wavebench-rigol-dm3000/
├── wavebench-rigol-dp800/
Expand All @@ -37,6 +38,7 @@ WaveBench 主包长期预装 RTM2000、DS1000Z、DG4000、DP800 和 DM3000 五
## 当前插件

- [`wavebench-rigol-ds1000z`](packages/wavebench-rigol-ds1000z/README.md):四通道 RIGOL DS1104Z / DS1000Z 系列,canonical ID `rigol.ds1000z`。
- [`wavebench-rigol-dg1000`](packages/wavebench-rigol-dg1000/README.md):双通道 RIGOL DG1000/DG1000Z 系列,canonical ID `rigol.dg1000`,basic source 控制面。
- [`wavebench-rigol-dg4000`](packages/wavebench-rigol-dg4000/README.md):双通道 RIGOL DG4202 / DG4000 系列,canonical ID `rigol.dg4202`。
- [`wavebench-rigol-dm3000`](packages/wavebench-rigol-dm3000/README.md):LAN-only RIGOL DM3000 / DM3058 数字万用表,canonical ID `rigol.dm3000`;短 alias 保留内建双 backend fallback。
- [`wavebench-rigol-dp800`](packages/wavebench-rigol-dp800/README.md):RIGOL DP800 / DP832 / DP832A 可编程直流电源,canonical ID `rigol.dp800`;短 alias 保留内建 fallback。
Expand Down
4 changes: 3 additions & 1 deletion doc/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repository is reserved for independently packaged WaveBench instrument plug

## Current status

The source packages are maintained independently: `wavebench-rigol-ds1000z`, `wavebench-rigol-dg4000`, the LAN-only `wavebench-rigol-dm3000`, `wavebench-rigol-dp800`, and `wavebench-rohde-schwarz-rtm2000` have completed offline, managed-lifecycle, and controlled hardware acceptance; `wavebench-shengpu-sp3000a` is at SP30120 M3.5 with a minimal query-only descriptor and five certified vendor-specific RF-OFF controls. The first five are optional external editions of drivers that remain bundled with WaveBench for first-use operation; they provide an independent upgrade, transport, and extension path rather than replacing or deprecating the bundled baseline. WaveBench v0.8.0 provides local package inspection and managed install, status, upgrade, downgrade, removal, and conservative transaction recovery. This repository owns plugin source packages and does not duplicate the installer or a remote catalog.
The source packages are maintained independently: `wavebench-rigol-ds1000z`, `wavebench-rigol-dg4000`, the LAN-only `wavebench-rigol-dm3000`, `wavebench-rigol-dp800`, and `wavebench-rohde-schwarz-rtm2000` have completed offline, managed-lifecycle, and controlled hardware acceptance; `wavebench-rigol-dg1000` currently has offline and managed-lifecycle coverage and keeps a basic source control surface; `wavebench-shengpu-sp3000a` is at SP30120 M3.5 with a minimal query-only descriptor and five certified vendor-specific RF-OFF controls. These packages are optional external editions of bundled drivers or new instrument families; they provide an independent upgrade, transport, and extension path rather than replacing or deprecating the bundled baseline. WaveBench v0.8.0 provides local package inspection and managed install, status, upgrade, downgrade, removal, and conservative transaction recovery. This repository owns plugin source packages and does not duplicate the installer or a remote catalog.

> [!IMPORTANT]
> The WaveBench `v0.7.0` release does not contain Instrument API V2, the managed plugin lifecycle, or canonical override slots. These packages target the WaveBench `v0.8.0` release and uniformly require `wavebench>=0.8,<0.9`; they do not run with `v0.7.0` and do not assume compatibility with a future `0.9` core.
Expand All @@ -15,6 +15,7 @@ The source packages are maintained independently: `wavebench-rigol-ds1000z`, `wa

```text
packages/
├── wavebench-rigol-dg1000/
├── wavebench-rigol-dg4000/
├── wavebench-rigol-dm3000/
├── wavebench-rigol-dp800/
Expand All @@ -37,6 +38,7 @@ WaveBench permanently bundles the RTM2000, DS1000Z, DG4000, DP800, and DM3000 fa
## Current plugin

- [`wavebench-rigol-ds1000z`](../packages/wavebench-rigol-ds1000z/README_EN.md): four-channel RIGOL DS1104Z / DS1000Z series, canonical ID `rigol.ds1000z`.
- [`wavebench-rigol-dg1000`](../packages/wavebench-rigol-dg1000/README_EN.md): dual-channel RIGOL DG1000/DG1000Z series, canonical ID `rigol.dg1000`, basic source control surface.
- [`wavebench-rigol-dg4000`](../packages/wavebench-rigol-dg4000/README_EN.md): dual-channel RIGOL DG4202 / DG4000 series, canonical ID `rigol.dg4202`.
- [`wavebench-rigol-dm3000`](../packages/wavebench-rigol-dm3000/README_EN.md): LAN-only RIGOL DM3000 / DM3058 multimeter, canonical ID `rigol.dm3000`; short aliases retain the built-in dual-backend fallback.
- [`wavebench-rigol-dp800`](../packages/wavebench-rigol-dp800/README_EN.md): RIGOL DP800 / DP832 / DP832A programmable DC power supply, canonical ID `rigol.dp800`; its short alias remains on the built-in fallback.
Expand Down
2 changes: 1 addition & 1 deletion packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[English](README_EN.md)

该目录用于放置独立的 WaveBench 仪器插件源码包。当前正式包为 `wavebench-rigol-ds1000z`、`wavebench-rigol-dg4000`、LAN-only 的 `wavebench-rigol-dm3000`、`wavebench-rigol-dp800`、已完成 SocketIO 数据路径实机验收的 `wavebench-rohde-schwarz-rtm2000` 和 M3 query-only 的 `wavebench-shengpu-sp3000a`。前五个包是主包预装驱动的可选外置发行版;后续也按仪器或紧密相关系列逐包维护,但不以移除预装驱动为目标,也不在这里冻结第二套 manifest、安装器或 catalog 协议。
该目录用于放置独立的 WaveBench 仪器插件源码包。当前正式包为 `wavebench-rigol-ds1000z`、`wavebench-rigol-dg1000`、`wavebench-rigol-dg4000`、LAN-only 的 `wavebench-rigol-dm3000`、`wavebench-rigol-dp800`、已完成 SocketIO 数据路径实机验收的 `wavebench-rohde-schwarz-rtm2000` 和 M3 query-only 的 `wavebench-shengpu-sp3000a`。这些包是主包预装驱动或新增仪器族的可选外置发行版;后续也按仪器或紧密相关系列逐包维护,但不以移除预装驱动为目标,也不在这里冻结第二套 manifest、安装器或 catalog 协议。

这些包当前对齐 WaveBench `v0.8.0` release,并统一声明 `wavebench>=0.8,<0.9`。它们不能与 `v0.7.0` 配套运行,也不会把未来 `0.9` 自动视为兼容版本。

Expand Down
2 changes: 1 addition & 1 deletion packages/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[中文](README.md)

This directory contains independently packaged WaveBench instrument plugins. The current maintained packages are `wavebench-rigol-ds1000z`, `wavebench-rigol-dg4000`, the LAN-only `wavebench-rigol-dm3000`, `wavebench-rigol-dp800`, the SocketIO-data-path hardware-accepted `wavebench-rohde-schwarz-rtm2000`, and the M3 query-only `wavebench-shengpu-sp3000a`. The first five are optional external editions of drivers bundled with the main package. Future packages should continue the one-instrument-or-family layout without treating bundled-driver removal as a goal or defining a second manifest, installer, or catalog protocol here.
This directory contains independently packaged WaveBench instrument plugins. The current maintained packages are `wavebench-rigol-ds1000z`, `wavebench-rigol-dg1000`, `wavebench-rigol-dg4000`, the LAN-only `wavebench-rigol-dm3000`, `wavebench-rigol-dp800`, the SocketIO-data-path hardware-accepted `wavebench-rohde-schwarz-rtm2000`, and the M3 query-only `wavebench-shengpu-sp3000a`. These packages are optional external editions of bundled drivers or new instrument families. Future packages should continue the one-instrument-or-family layout without treating bundled-driver removal as a goal or defining a second manifest, installer, or catalog protocol here.

These packages target the WaveBench `v0.8.0` release and uniformly declare `wavebench>=0.8,<0.9`. They do not run with `v0.7.0` release and do not automatically assume compatibility with a future `0.9` core.

Expand Down
21 changes: 21 additions & 0 deletions packages/wavebench-rigol-dg1000/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Scaxlibur

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
91 changes: 91 additions & 0 deletions packages/wavebench-rigol-dg1000/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# WaveBench RIGOL DG1000 插件

[English](README_EN.md)

面向双通道 RIGOL DG1022、DG1022A、DG1022Z、DG1032Z 和 DG1062Z
函数/任意波形发生器的 WaveBench 可执行仪器插件。

## 身份与兼容范围

- distribution:`wavebench-rigol-dg1000`
- canonical driver ID:`rigol.dg1000`
- WaveBench:`>=0.8,<0.9`
- Python:`>=3.11`
- transport backend:`pyvisa`

该插件声明 canonical ID `rigol.dg1000`,不声明短 alias。安装后,需要在配置中显式使用
`driver = "rigol.dg1000"` 才会选择此外置实现。

## 能力

- `*IDN?` 与错误队列;
- CH1/CH2 输出、函数、频率、VPP 幅度、offset、phase、sweep 状态和方波占空比读取;
- 固定频率、函数、VPP 幅度和方波占空比设置;
- 显式输出开关;
- 设置固定频率前可按 WaveBench source 配置显式关闭 sweep。

当前公开能力只覆盖 basic source 控制面。插件不声明 DG4000/DG4202 专用的任意波上传、harmonic
mode、modulation、burst、counter profile 或完整 sweep profile。DG1000 前面板或厂商协议中的
加法/谐波叠加功能不在本插件的受支持能力内;启用该功能时,基波与谐波的实际输出很可能与设置值
不一致,不能把 basic status 回读视为准确的谐波验收依据。WaveBench core 继续负责安全上限、
Service、run plan、状态恢复和 artifact;插件只负责 DG1000 系列 SCPI、解析和回读。

驱动同时覆盖两种已知命令布局:DG1022/DG1022A 的 legacy `:CH2` 后缀布局,以及
DG1022Z/DG1032Z/DG1062Z 的 `:SOUR<n>:` 前缀布局。未识别型号会 fail closed。

## 安全边界

descriptor 导入不连接仪器。factory 只通过 WaveBench `DriverContext` 打开当前配置的 transport。
默认离线测试使用 FakeTransport,不扫描资源、不连接仪器,也不发送真实 SCPI。写命令失败后,
当前 driver 实例会锁停后续配置写入,要求调用方重新打开会话并独立验证设备状态。输出启用
后的回读或错误队列检查失败时,driver 会强制关闭对应输出并回读确认;若 OFF 无法确认,配置
写入同样锁停。legacy DG1022/DG1022A 的 sweep 只属于 CH1,CH2 状态固定规范化为 FIX/OFF,
设置 CH2 频率不会查询或关闭 CH1 sweep。

配置示例使用 RFC 5737 文档保留地址:

```toml
[source]
driver = "rigol.dg1000"
resource = "TCPIP::192.0.2.30::INSTR"
default_channel = 1
check_errors = true
ensure_fix_mode_on_set_frequency = true
settle_ms_after_set_frequency = 500
```

真实仪器地址、序列号、波形、截图和命令日志不得提交。

## 许可证

本插件采用 [MIT License](LICENSE)。

## 开发验证

在已安装匹配的 WaveBench `v0.8.0` release 环境中:

```bash
python -m pytest -q packages/wavebench-rigol-dg1000/tests
python -m ruff check packages/wavebench-rigol-dg1000
python -m wavebench plugin package check packages/wavebench-rigol-dg1000
python -m wavebench plugin install packages/wavebench-rigol-dg1000 --dry-run
```

日常源码开发可使用仓库级 [editable 开发环境](../../doc/DEVELOPMENT.md);正式验收仍使用真实
wheel 和一次性虚拟环境。
型号覆盖和能力边界见 [DG1000 覆盖矩阵](doc/DG1000_COVERAGE_MATRIX.md)。

## 实机验收边界

`0.1.0` 的公开门禁目前覆盖离线 FakeTransport、受管安装生命周期和 wheel 检查。DG1032Z
直连示波器的闭环实验台可用于后续实机门禁;在形成可复现、已脱敏的实机记录前,本包不把
DG1032Z 行为外推到 DG1022Z/DG1062Z 或 legacy DG1022/DG1022A 命令布局。

实机验收记录不得提交真实资源、序列号、原始波形、截图或命令日志。当前 capability 仍只代表
basic source 控制面,不覆盖任意波上传、offset/symmetry setter、modulation、burst、counter 或
完整 sweep profile。

## 来源

`0.1.0`:从 WaveBench 主仓 DG1000 草案实现迁移为独立插件包,保留 vendor driver、descriptor、
entry point 和 FakeTransport 测试;当前只声明 basic source 能力。
102 changes: 102 additions & 0 deletions packages/wavebench-rigol-dg1000/README_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# WaveBench RIGOL DG1000 Plugin

[中文](README.md)

An executable WaveBench instrument plugin for dual-channel RIGOL DG1022, DG1022A, DG1022Z,
DG1032Z, and DG1062Z function/arbitrary waveform generators.

## Identity and compatibility

- Distribution: `wavebench-rigol-dg1000`
- Canonical driver ID: `rigol.dg1000`
- WaveBench: `>=0.8,<0.9`
- Python: `>=3.11`
- Transport backend: `pyvisa`

The plugin declares the canonical ID `rigol.dg1000` and no short aliases. After installation,
select it explicitly with `driver = "rigol.dg1000"` in the WaveBench configuration.

## Capabilities

- `*IDN?` and error queue;
- CH1/CH2 output, function, frequency, VPP amplitude, offset, phase, sweep state, and square duty
cycle status;
- fixed frequency, function, VPP amplitude, and square duty-cycle settings;
- explicit output control;
- optional explicit sweep disable before setting a fixed frequency through WaveBench source config.

The public surface is intentionally limited to basic source control. The plugin does not claim the
DG4000/DG4202 arbitrary-waveform upload path, harmonic mode, modulation, burst, counter profile,
or a complete sweep profile. The DG1000 front-panel/vendor add or harmonic-superposition feature
is outside this plugin's supported surface; when it is enabled, the actual fundamental and harmonic
outputs are likely to differ from the configured values, so basic status readback must not be used
as accurate harmonic acceptance evidence. WaveBench core retains safety limits, services, run
plans, state restoration, and artifacts; this package owns only DG1000-family SCPI, parsing, and
readback.

The driver covers two known command layouts: the legacy `:CH2` suffix layout used by DG1022/DG1022A
and the `:SOUR<n>:` prefixed layout used by DG1022Z/DG1032Z/DG1062Z. Unknown models fail closed.

## Safety boundary

Descriptor import performs no instrument I/O. The factory opens only the configured transport
through WaveBench `DriverContext`. Default offline tests use FakeTransport only; they do not scan
resources, connect to instruments, or send real SCPI. After an ambiguous write, the driver instance
latches later configuration writes off and requires the caller to reopen the session and verify
instrument state independently. If readback or error-queue checks fail after output enable, the
driver forces that output OFF and verifies the readback; an unverified OFF recovery also latches
configuration writes. Sweep is CH1-only on legacy DG1022/DG1022A models, so CH2 status is normalized
to FIX/OFF and CH2 frequency writes never query or disable the CH1 sweep.

The example uses an RFC 5737 documentation address:

```toml
[source]
driver = "rigol.dg1000"
resource = "TCPIP::192.0.2.30::INSTR"
default_channel = 1
check_errors = true
ensure_fix_mode_on_set_frequency = true
settle_ms_after_set_frequency = 500
```

Do not commit real addresses, serial numbers, waveforms, screenshots, or command logs.

## License

This plugin is licensed under the [MIT License](LICENSE).

## Development checks

Run the package tests, Ruff, WaveBench package inspection, and a managed-install dry run from an
environment containing the matching WaveBench `v0.8.0` release.

```bash
python -m pytest -q packages/wavebench-rigol-dg1000/tests
python -m ruff check packages/wavebench-rigol-dg1000
python -m wavebench plugin package check packages/wavebench-rigol-dg1000
python -m wavebench plugin install packages/wavebench-rigol-dg1000 --dry-run
```

Use the repository-level [editable development environment](../../doc/DEVELOPMENT_EN.md) for daily
source work. Formal acceptance still uses a real wheel and a disposable virtual environment.
See the [DG1000 coverage matrix](doc/DG1000_COVERAGE_MATRIX_EN.md) for model coverage and
capability boundaries.

## Hardware acceptance boundary

The public `0.1.0` gate currently covers offline FakeTransport tests, managed-install lifecycle
checks, and wheel checks. A DG1032Z-to-oscilloscope closed-loop bench can serve as a future
hardware gate. Until a reproducible, sanitized hardware record exists, this package does not
extrapolate DG1032Z behavior to DG1022Z/DG1062Z or to the legacy DG1022/DG1022A command layout.

Hardware records must not commit real resources, serial numbers, raw waveforms, screenshots, or
command logs. The current capability surface still means basic source control only; it does not
cover arbitrary-waveform upload, offset/symmetry setters, modulation, burst, counter, or a complete
sweep profile.

## Provenance

- `0.1.0` migrated the WaveBench core DG1000 draft into an independent plugin package, preserving
the vendor driver, descriptor, entry point, and FakeTransport tests. The package currently
declares only basic source capabilities.
Loading