lightlab.equipment.abstract_drivers.multimodule_configurable module¶
Summary¶
Classes:
ConfigModule |
A module that has an associated channel and keeps track of parameters within that channel. |
MultiModuleConfigurable |
Keeps track of a list of Configurable objects, each associated with a channel number. |
Reference¶
-
class
ConfigModule(channel, bank, **kwargs)[source]¶ Bases:
lightlab.equipment.abstract_drivers.configurable.ConfigurableA module that has an associated channel and keeps track of parameters within that channel. Updates only when changed or with
forceHardware. It communicates with a bank instrument of which it is a part. When it writes to hardware, it selects itself by first sending'CH 2'(if it were initialized with channel 2)Parameters: - channel (int) – its channel that will be written before writing/querying
- bank (MultiModuleConfigurable) – enclosing bank
-
selectPrefix= 'CH'¶
-
class
MultiModuleConfigurable(useChans=None, configModule_klass=<class 'lightlab.equipment.abstract_drivers.configurable.Configurable'>, **kwargs)[source]¶ Bases:
lightlab.equipment.abstract_drivers.AbstractDriverKeeps track of a list of
Configurableobjects, each associated with a channel number. Provides array and dict setting/getting.Parameter values are cached just like in
Configurable. That means hardware access is lazy: No write/queries are performed unless a parameter is not yet known, or if the value changes.When the module classes are
ConfigModule, then this supports multi-channel instruments where channels are selectable. This is used in cases where, for example, querying the wavelength of channel 2 would take these messages:self.write('CH 2') wl = self.query('WAVE')
Parameters: - useChans (list(int)) – integers that indicate channel number.
- to key dictionaries and write select messages. (Used) –
- configModule_klass (type) – class that members will be initialized as.
- Configurable, this object is basically a container; however, (When) –
- ConfigModule, there is special behavior for multi-channel instruments. (when) –
-
maxChannel= None¶
-
getConfigArray(cStr)[source]¶ Iterate over modules getting the parameter at each
Parameters: cStr (str) – parameter name Returns: values for all modules, ordered based on the ordering of useChansReturn type: (np.ndarray)
-
setConfigArray(cStr, newValArr, forceHardware=False)[source]¶ Iterate over modules setting the parameter to the corresponding array value.
Values for ALL channels must be specified. To only change some, use the dictionary-based setter:
setConfigDictParameters: Returns: did any require hardware write?
Return type: (bool)
-
getConfigDict(cStr)[source]¶ Parameters: cStr (str) – parameter name Returns: parameter on all the channels, keyed by channel number Return type: (dict)
-
setConfigDict(cStr, newValDict, forceHardware=False)[source]¶ Parameters: Returns: did any require hardware write?
Return type: (bool)
-
moduleIds¶ list of module ID strings