Add high-level interface for separating out individual PSU or measurement channels
Providing a high-level interface for a single "channel" (for source or measurement) and migration of InstrumentCluster
and similar structures to use these would hopefully help remove instrument-class dependencies and standardise features for high-level objects whilst still providing the robustness of ICICLE's low-level interfaces. Please comment with opinions or suggestions!
Suggested implementation:
- high-level interfaces defined at the level of
Instrument
-PowerChannel
andMeasureChannel
- channel implementations defined in each instrument for that specific instrument (as a subclass)
- channel objects initialised on-demand if requested from instrument
- channel objects can be initialised directly via
instrument_type, resource, channel_number
- in this case, instrument is automatically initialised or existing instrument in multiton forinstrument_type
- Instrument classes registered in some top-level dictionary that allows lookup of appropriate class from string (
instrument_type
); removes this requirement fromInstrumentCluster
, etc.
Suggested interfaces:
Example pseudocode:
class Instrument:
class PSUChannel:
@property
def status(self, channel):
throw NotImplementedError()
@status.setter
def status(self, channel, value):
throw NotImplementedError()
...
class HMP4040(...Instrument):
class HMP4040PSUChannel(Instrument.PSUChannel):
@property
def status(self):
return self._instrument.status(self._channel)
@status.setter
def status(self, value):
if value:
return self._instrument.on(self._channel)
else:
return self._instrument.off(self._channel)
def sweep(...arg_list....):
self._instrument.sweep(self._channel, ...arg_list...)
...
Edited by Simon Florian Koch