From 0d1cf5b71bfd3b25238782e292d17a120da4d907 Mon Sep 17 00:00:00 2001 From: layeoh Date: Tue, 28 Nov 2017 16:45:15 +0100 Subject: [PATCH 1/2] add update for D5mux --- qcodes/instrument_drivers/QuTech/D5a.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qcodes/instrument_drivers/QuTech/D5a.py b/qcodes/instrument_drivers/QuTech/D5a.py index b12af6eec45..7624cad6a10 100644 --- a/qcodes/instrument_drivers/QuTech/D5a.py +++ b/qcodes/instrument_drivers/QuTech/D5a.py @@ -27,7 +27,7 @@ class D5a(Instrument): """ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3, - reset_voltages=False, mV=False, **kwargs): + reset_voltages=False, mV=False, number_dacs=16, **kwargs): """ Create instrument for the D5a module. The D5a module works with volts as units. For backward compatibility @@ -45,12 +45,14 @@ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3, dac_step (float): max step size (V or mV), passed to dac parameters of the object reset_voltages (bool): passed to D5a_module constructor mV (bool): if True, then use mV as units in the dac parameters + number_dacs (int): number of DACs available. This is 8 for the D5mux """ super().__init__(name, **kwargs) self.d5a = D5a_module(spi_rack, module, reset_voltages=reset_voltages) self._mV = mV - + self._number_dacs = number_dacs + self._span_set_map = { '4v uni': 0, '4v bi': 2, @@ -68,7 +70,7 @@ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3, self._gain = 1 unit = 'V' - for i in range(16): + for i in range(self._number_dacs): validator = self._get_validator(i) self.add_parameter('dac{}'.format(i + 1), @@ -90,7 +92,7 @@ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3, vals=Enum(*self._span_set_map.keys())) def _set_dacs_zero(self): - for i in range(16): + for i in range(self._number_dacs): self._set_dac(i, 0.0) def _set_dac(self, dac, value): From 679e52b4ac26d10ef23f355cb9f367589725ab4d Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Tue, 28 Nov 2017 23:10:29 +0100 Subject: [PATCH 2/2] autopep --- qcodes/instrument_drivers/QuTech/D5a.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcodes/instrument_drivers/QuTech/D5a.py b/qcodes/instrument_drivers/QuTech/D5a.py index 7624cad6a10..9055aa3a395 100644 --- a/qcodes/instrument_drivers/QuTech/D5a.py +++ b/qcodes/instrument_drivers/QuTech/D5a.py @@ -52,7 +52,7 @@ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3, self.d5a = D5a_module(spi_rack, module, reset_voltages=reset_voltages) self._mV = mV self._number_dacs = number_dacs - + self._span_set_map = { '4v uni': 0, '4v bi': 2,