Skip to content

Commit

Permalink
Merge pull request #459 from jenshnielsen/fix/CurrentVoltageParameter
Browse files Browse the repository at this point in the history
Fix/current voltage parameter
  • Loading branch information
jenshnielsen authored Jan 23, 2017
2 parents 72185ea + de6236b commit f1e98e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
8 changes: 4 additions & 4 deletions qcodes/instrument_drivers/ithaco/Ithaco_1211.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from qcodes import Instrument
from qcodes.instrument.parameter import Parameter
from qcodes.instrument.parameter import MultiParameter
from qcodes.instrument.parameter import ManualParameter
from qcodes.utils.validators import Enum, Bool


class CurrentParameter(Parameter):
class CurrentParameter(MultiParameter):
"""
Current measurement via an Ithaco preamp and a measured voltage.
Expand All @@ -31,13 +31,13 @@ class CurrentParameter(Parameter):
def __init__(self, measured_param, c_amp_ins, name='curr'):
p_name = measured_param.name

super().__init__(name=name, names=(p_name+'_raw', name))
super().__init__(name=name, names=(p_name+'_raw', name), shapes=((), ()))

self._measured_param = measured_param
self._instrument = c_amp_ins

p_label = getattr(measured_param, 'label', None)
p_unit = getattr(measured_param, 'units', None)
p_unit = getattr(measured_param, 'unit', None)

self.labels = (p_label, 'Current')
self.units = (p_unit, 'A')
Expand Down
19 changes: 10 additions & 9 deletions qcodes/instrument_drivers/stanford_research/SR560.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from qcodes import Instrument
from qcodes.instrument.parameter import ManualParameter
from qcodes.instrument.parameter import MultiParameter
from qcodes.utils.validators import Bool, Enum

from qcodes.instrument.parameter import Parameter


class VoltageParameter(Parameter):

class VoltageParameter(MultiParameter):
"""
Amplified voltage measurement via an SR560 preamp and a measured voltage.
Expand All @@ -32,13 +33,13 @@ class VoltageParameter(Parameter):
def __init__(self, measured_param, v_amp_ins, name='volt'):
p_name = measured_param.name

super().__init__(name=name, names=(p_name+'_raw', name))
super().__init__(name=name, names=(p_name+'_raw', name), shapes=((), ()))

self._measured_param = measured_param
self._instrument = v_amp_ins

p_label = getattr(measured_param, 'label', None)
p_unit = getattr(measured_param, 'units', None)
p_unit = getattr(measured_param, 'unit', None)

self.labels = (p_label, 'Voltage')
self.units = (p_unit, 'V')
Expand Down Expand Up @@ -75,7 +76,7 @@ class SR560(Instrument):
def __init__(self, name, **kwargs):
super().__init__(name, **kwargs)

cutoffs = [0.03, 0.1, 0.3, 1, 3, 10, 30, 100, 300, 1000,
cutoffs = ['DC', 0.03, 0.1, 0.3, 1, 3, 10, 30, 100, 300, 1000,
3000, 10000, 30000, 100000, 300000, 1000000]

gains = [1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000,
Expand All @@ -85,14 +86,14 @@ def __init__(self, name, **kwargs):
parameter_class=ManualParameter,
initial_value='DC',
label='High pass',
units='Hz',
unit='Hz',
vals=Enum(*cutoffs))

self.add_parameter('cutoff_hi',
parameter_class=ManualParameter,
initial_value='1e6',
initial_value=1e6,
label='Low pass',
units='Hz',
unit='Hz',
vals=Enum(*cutoffs))

self.add_parameter('invert',
Expand All @@ -105,7 +106,7 @@ def __init__(self, name, **kwargs):
parameter_class=ManualParameter,
initial_value=10,
label='Gain',
units=None,
unit=None,
vals=Enum(*gains))

def get_idn(self):
Expand Down

0 comments on commit f1e98e9

Please sign in to comment.