Qblox qmi driver - #215
Qblox qmi driver#215heevasti wants to merge 7 commits into
Conversation
…rted editing unit-tests.
| EXT_TRIGGERS_IN_CLUSTER = 15 | ||
| # Module configuration constants: | ||
| # AO_IN_MODULE: Analog output channels in modules with value range -1V...+1V. | ||
| # AI_IN_MODULE: Analog output channels in modules with value range -1V...+1V. |
There was a problem hiding this comment.
input channels presumeably
| # Add type handles as callables | ||
| for type_handle, value in self.cluster._type_handle.__dict__.items(): | ||
| if type_handle.startswith("_is"): | ||
| # As 'value' gets overridden in memory for the lambda function, do like this: |
| idn = self.cluster._get_idn() | ||
| _, model, _, _ = idn.split(",") | ||
| self._modules = {"0": _QbloxModule(model, self.cluster_funcs)} | ||
| for k, v in self.cluster._mod_handles.items(): |
There was a problem hiding this comment.
code would be a bit more readable if these keys and values have a bit more descriptive names
There was a problem hiding this comment.
I guess the v's are modules?
| if str(module) == module_type: | ||
| # Just double check module type before returning | ||
| if ( | ||
| module_type == "QCM" |
There was a problem hiding this comment.
if these two are on the same line it looks much better
| self.cluster._slot_reset() | ||
|
|
||
| @rpc_method | ||
| def get_module(self, module_type: str, slot_no: int | None = None) -> NativeCluster | _QbloxModule: |
There was a problem hiding this comment.
I guess it might be fair enough, but if you have multiple of the same module and you specify the module name, it's not clear which one you're gonna get. Maybe ideally you warn the user (or refuse) when you know there are duplicate modules and they didn't specify the slot.
| for sequencer in range(SEQUENCERS_IN_MODULE[module_type]): | ||
| try: | ||
| sequencer_config = module_func_refs["_get_sequencer_config"](sequencer) | ||
| if channel_type in [0, 1] and AI_IN_MODULE[module_type] > 0: |
There was a problem hiding this comment.
magical constants, ideally we replace
| for channel in sequencer_channel_map[1]: | ||
| channels[f"adc{channel}_acq_Q{sequencer}"] = sequencer_config["awg"] | ||
|
|
||
| if channel_type in [0, 2] and AO_IN_MODULE[module_type] > 0: |
| for channel in sequencer_channel_map[1]: | ||
| channels[f"dac{channel}_Q{sequencer}"] = sequencer_config["awg"] # TODO: Is this always valid? | ||
|
|
||
| if channel_type in [0, 3] and DIGITAL_MARKERS_IN_MODULE[module_type] > 0: |
| invert: Any | ||
|
|
||
|
|
||
| class Qblox_QcodesCluster(Qblox_ClusterBase): |
There was a problem hiding this comment.
what is the difference between this class and Qblox_NativeCluster?
Add a QMI driver for Qblox Cluster series device.
The driver contains only base functions to control the cluster, and trigger channels, and receive system info and module | function reference objects.