mpylab.device.amplifier_virtual module¶
Virtual amplifier driver for UI and API tests.
- class mpylab.device.amplifier_virtual.AMPLIFIER(**kw)
Bases:
AMPLIFIERVirtual amplifier with interpolated data and state tracking.
- Parameters:
kw (mapping) – Keyword arguments forwarded to the base amplifier, including
SearchPaths.
- GetState()
Return the virtual amplifier state.
- Returns:
(0, state).- Return type:
tuple
- GetVirtual()
Return the fixed virtual-mode flag.
- Returns:
(0, True).- Return type:
tuple
- Init(ini=None, channel=None, ignore_bus=None)
Initialize data and force virtual mode on.
- Parameters:
ini (path-like or file-like, optional) – Amplifier configuration source.
channel (int or str, optional) – Initial data channel.
ignore_bus (bool, optional) – Accepted for API compatibility; the virtual driver always ignores the hardware bus.
- Returns:
Device status; zero indicates success.
- Return type:
int
- Operate()
Switch to operate mode.
- Returns:
Device status.
- Return type:
int
- POff()
Switch amplifier power off.
- Returns:
Device status.
- Return type:
int
- POn()
Switch amplifier power on.
- Returns:
Device status.
- Return type:
int
- Quit()
Power off the virtual amplifier.
- Returns:
Device status.
- Return type:
int
- SetState(state)
Set amplifier state using common aliases.
- Parameters:
state (str) – State or alias for
POn,Operate,Standby, orPOff.- Returns:
Device status; zero indicates success.
- Return type:
int
- Standby()
Switch to standby mode.
- Returns:
Device status.
- Return type:
int