AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證High-level Rust/C# control for VISA instruments: auto-discovery, IVI-inspired typed classes (DMM, PSU, function generator, oscilloscope, switch, counter), and mock fixtures for CI
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
High-level Rust and C# control for VISA instruments: auto-discovery, IVI-inspired typed classes, and mock fixtures for CI. Shared SCPI, dialect, and classifier tables keep the two native implementations aligned.
Rust: cargo add instrument-components then use instrument::prelude::* (the library name stays instrument).
C#: project-reference InstrumentComponents (and InstrumentComponents.Visa for hardware) — see dotnet/.檢視完整 README ↗High-level Rust and C# control for VISA instruments: auto-discovery, IVI-inspired typed classes, and mock fixtures for CI. Shared SCPI, dialect, and classifier tables keep the two native implementations aligned.
Rust: cargo add instrument-components then use instrument::prelude::* (the library name stays instrument).
C#: project-reference InstrumentComponents (and InstrumentComponents.Visa for hardware) — see dotnet/.
DeviceId for instrument replacement workflows| I want to… | Start here |
|---|---|
| Test in CI without hardware | Mock quick start · C# mock |
| Talk to real USB/GPIB gear | Hardware quick start · C# hardware |
| Build an app with device pickers | docs/discovery.md |
| Use async VISA I/O (opt-in) | docs/async.md · C# async |
No VISA installation required. Rust:
[dependencies]
instrument-components = { version = "0.1", default-features = false }
use instrument::prelude::*;
let fixture = ScriptedFixture::builder()
.idn("Acme Corp", "SMU2602", "SN001", "1.0")
.kinds([InstrumentKind::Dmm, InstrumentKind::DcPowerSupply])
.on_query(":MEAS:VOLT:DC?", "3.300")
.build();
let catalog = DeviceCatalog::from_fixture("mock://smu-1", fixture)?;
let dmm = catalog.open_dmm("mock://smu-1")?;
let volts = dmm.measure_voltage_dc(None)?;
println!("{volts} V");
C# (same fixture, no VISA):
dotnet run --project dotnet/examples/MockFixtureCi
[dependencies]
instrument-components = "0.1"
use instrument::prelude::*;
let catalog = Discovery::visa()?.scan()?;
catalog.print_summary();
let dmm = catalog.open_dmm(&catalog.devices_by_kind(InstrumentKind::Dmm)[0].address.raw)?;
let volts = dmm.measure_voltage_dc(None)?;
println!("{volts} V");
TCPIP/LXI devices usually need a manual address:
let catalog = Discovery::visa()?
.manual_address("TCPIP0::192.168.0.42::INSTR")
.scan()?;
See docs/getting-started.md for the full walkthrough.
| Feature | Default | Description |
|---|---|---|
visa | yes | VISA backend via instrument-visa |
record | no | Record real I/O into mock scripts |
tokio | no | Full async API: AsyncScpiSession, AsyncDiscovery, typed classes |
cross-compile | no | Cross-compile enum repr for visa-rs |
default-features = false | — | Mock/CI only; no native VISA link |
# CI / mock only
instrument-components = { version = "0.1", default-features = false }
# Async VISA (opt-in; use git/`latest` until 0.2.0 is published)
instrument-components = { version = "0.1", features = ["visa", "tokio"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
Same mock path as above, with .await and AsyncDeviceCatalog:
[dependencies]
instrument-components = { version = "0.1", default-features = false, features = ["tokio"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
use instrument::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
let fixture = ScriptedFixture::builder()
.idn("Acme", "DMM1", "SN1", "1.0")
.kinds([InstrumentKind::Dmm])
.on_query(":MEAS:VOLT:DC?", "1.0")
.build();
let catalog = AsyncDeviceCatalog::from_fixture("mock://dmm", fixture).await?;
let mut dmm = catalog.open_dmm("mock://dmm").await?;
println!("{} V", dmm.measure_voltage_dc(None).await?);
Ok(())
}
crates.io 0.1.0 predates the async API and later instrument classes. Until 0.2.0 is published, take those features from git/latest.
Published site (MkDocs): https://josh-hemphill.github.io/instrument-components/
API reference on docs.rs (after first publish). Local docs site: docs-site/ (pip install -r requirements.txt && mkdocs serve).
Native C# packages live under dotnet/ — first-class, same contracts as Rust. Install from NuGet:
dotnet add package InstrumentComponents # mock/CI — no VISA
dotnet add package InstrumentComponents.Visa # Windows + IviFoundation.Visa
See dotnet/README.md for mock and hardware quick starts.
| Crate | crates.io | Role |
|---|---|---|
instrument-components | facade | Discovery, typed classes, re-exports |
instrument-core | backend | Transport, SCPI, mocks — no VISA |
instrument-visa | backend | NI-VISA / Keysight VISA via visa-rs |
# Mock path (no VISA) — runs in CI
cargo test --workspace --no-default-features
# Async mock path
cargo test -p instrument-core --features async
cargo test -p instrument-components --features tokio --no-default-features
# Hardware (local or self-hosted, requires VISA + a DMM)
cargo test -p instrument-components --features visa -- --ignored
# One-resource DMM smoke (used by .github/workflows/hardware.yml)
INSTRUMENT_RESOURCE='USB0::0x0957::0x0607::SN::INSTR' \
cargo test -p instrument-components --features visa --test hardware dmm_measure_voltage_dc_smoke -- --ignored --nocapture --exact
Licensed under either of Apache License, Version 2.0 or MIT License at your option.