Skip to content
Merged
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
16 changes: 16 additions & 0 deletions docs/supported_instruments.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,22 @@ the same SCPI command set.

---

## GENERIC (Universal Fallback)

| Driver | Purpose | Auto-Detect IDN Keywords |
|:---|:---|:---|
| `GenericDriver` | Catch-all driver for unidentified instruments; accepts any model | none (explicit `"GENERIC"` request or unrecognized `*IDN?`) |

`"GENERIC"` is a first-class, always-registered key in
`DriverRegistry` — `get_drivers_by_type("GENERIC")` always returns
`GenericDriver` (real mode) and `SimulatedGeneric` (SIM mode). It is used
when `connect_instrument()` cannot identify an instrument, or when you
explicitly pass `driver_type="GENERIC"` to `get_instrument()`. It exposes
only generic SCPI passthrough (no typed measurement API), so it is a safe
default, never a silent DMM/SA misread — see issue #148.

---

## Summary

| Category | Drivers | Validated Models |
Expand Down
14 changes: 13 additions & 1 deletion src/instrumation/drivers/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@
logger = logging.getLogger(__name__)

class DriverRegistry:
"""Registry to keep track of available instrument drivers."""
"""Registry to keep track of available instrument drivers.

Drivers register themselves against a canonical instrument *type* key
(e.g. ``"DMM"``, ``"SA"``, ``"SCOPE"``). The full set of known keys is
defined in :data:`instrumation.factory.KNOWN_DRIVER_TYPES`.

``"GENERIC"`` is a special, always-registered key: both
:class:`instrumation.drivers.generic.GenericDriver` and
:class:`instrumation.drivers.simulated.SimulatedGeneric` register
against it, so ``get_drivers_by_type("GENERIC")`` never returns an
empty list in a normal import. It is the universal fallback used when
an instrument cannot be identified (see issue #148).
"""

# Map of type -> list of driver classes
_drivers: Dict[str, List[Type[InstrumentDriver]]] = {}
Expand Down
Loading