Skip to content

Commit

Permalink
spi D5a driver: validator has to be updated on span change (#871)
Browse files Browse the repository at this point in the history
* validator has to be updated on span change

* fix merge mistake

* add docs for D5a
  • Loading branch information
dpfranke authored and jenshnielsen committed Nov 20, 2017
1 parent 66bf8bf commit 7f47183
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion qcodes/instrument_drivers/QuTech/D5a.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3,
The D5a module works with volts as units. For backward compatibility
there is the option to allow mV for the dacX parameters.
The output span of the DAC module can be changed with the spanX
command. Be carefull when executing this command with a sample
connected as voltage jumps can occur.
Args:
name (str): name of the instrument.
Expand Down Expand Up @@ -87,7 +91,8 @@ def __init__(self, name, spi_rack, module, inter_delay=0.1, dac_step=10e-3,
self.add_parameter('span{}'.format(i + 1),
get_cmd=partial(self._get_span, i),
set_cmd=partial(self._set_span, i),
vals=Enum(*self._span_set_map.keys()))
vals=Enum(*self._span_set_map.keys()),
docstring='Change the output span of the DAC. This command also updates the validator.')

def _set_dacs_zero(self):
for i in range(16):
Expand All @@ -104,6 +109,8 @@ def _get_span(self, dac):

def _set_span(self, dac, span_str):
self.d5a.change_span_update(dac, self._span_set_map[span_str])
self.parameters['dac{}'.format(
dac + 1)].vals = self._get_validator(dac)

def _get_validator(self, dac):
span = self.d5a.span[dac]
Expand Down

0 comments on commit 7f47183

Please sign in to comment.