diff --git a/qcodes_contrib_drivers/drivers/Keysight/Keysight_E8267D.py b/qcodes_contrib_drivers/drivers/Keysight/Keysight_E8267D.py index 41441f8a0..63b7c676d 100644 --- a/qcodes_contrib_drivers/drivers/Keysight/Keysight_E8267D.py +++ b/qcodes_contrib_drivers/drivers/Keysight/Keysight_E8267D.py @@ -2,6 +2,7 @@ from qcodes import VisaInstrument, validators as vals from qcodes.utils.validators import Numbers from qcodes.utils.helpers import create_on_off_val_mapping +from qcodes.instrument.parameter import DelegateParameter def parse_on_off(stat): @@ -74,7 +75,7 @@ def __init__(self, name, address, step_attenuator=False, **kwargs): set_parser=float, vals=vals.Numbers(1e5, 20e9), docstring='Adjust the RF output frequency') - self.add_parameter(name='frequency_offset', + self.add_parameter(name='freq_offset', label='Frequency offset', unit='Hz', get_cmd='FREQ:OFFS?', @@ -82,12 +83,28 @@ def __init__(self, name, address, step_attenuator=False, **kwargs): get_parser=float, vals=Numbers(min_value=-200e9, max_value=200e9)) - self.add_parameter('frequency_mode', + self.add_parameter(name='frequency_offset', + source=self.freq_offset, + parameter_class=DelegateParameter, + docstring="'frequency_offset' delegate parameter " + "for 'freq_offset' is deprecated to " + "make the parameter name consistent with " + "that of one present in Agilent (Keysight)" + " E8267C driver in Qcodes") + self.add_parameter('freq_mode', label='Frequency mode', set_cmd='FREQ:MODE {}', get_cmd='FREQ:MODE?', get_parser=lambda s: s.strip(), vals=vals.Enum('FIX', 'CW', 'SWE', 'LIST')) + self.add_parameter(name='frequency_mode', + source=self.freq_mode, + parameter_class=DelegateParameter, + docstring="'frequency_mode' delegate parameter for " + "'freq_mode' is deprecated to make the " + "parameter name consistent with that of " + "one present in Agilent (Keysight) E8267C " + "driver in Qcodes") self.add_parameter(name='phase', label='Phase', unit='deg', @@ -104,15 +121,32 @@ def __init__(self, name, address, step_attenuator=False, **kwargs): get_parser=float, set_parser=float, vals=vals.Numbers(-130, 25)) - self.add_parameter('status', + self.add_parameter('output_rf', get_cmd=':OUTP?', set_cmd='OUTP {}', get_parser=parse_on_off, vals=on_off_validator) - self.add_parameter(name='modulation_rf_enabled', + self.add_parameter(name='status', + source=self.output_rf, + parameter_class=DelegateParameter, + docstring="'status' delegate parameter for " + "'output_rf' is deprecated to make the " + "parameter name consistent with that of " + "one present in Agilent (Keysight) E8267C " + "driver in Qcodes") + self.add_parameter(name='modulation_rf', get_cmd='OUTP:MOD?', set_cmd='OUTP:MOD {}', val_mapping=on_off_mapping) + self.add_parameter(name='modulation_rf_enabled', + source=self.modulation_rf, + parameter_class=DelegateParameter, + docstring="'modulation_rf_enabled' delegate " + "parameter for 'modulation_rf' is " + "deprecated to make the parameter name " + "consistent with that of one present in " + "Agilent (Keysight) E8267C driver in " + "Qcodes") self.add_parameter('IQmodulator_enabled', get_cmd='DM:STATe?', set_cmd='DM:STATe {}', @@ -142,10 +176,10 @@ def __init__(self, name, address, step_attenuator=False, **kwargs): self.connect_message() def on(self): - self.set('status', 'on') + self.output_rf('on') def off(self): - self.set('status', 'off') + self.output_rf('off') @staticmethod def deg_to_rad(angle_deg):