def __get_display_commands(window='[:WINDow1]'): r = {} for k, v in _display_commands.items(): k = k.format(window=window) r[k] = v return r __get_mXb_commands = partial(__get_commands, _mXb_commands) __get_offset_commands = partial(__get_commands, _offset_commands) __get_limits_commands = partial(__get_commands, _limits_commands) __get_buffer_config_commands = partial(__get_commands, _buffer_config_commands) __get_ratio_commands = partial(__get_commands, _ratio_commands) __get_sens_commands = partial(__get_commands, _sens_commands) _6482_commands = Commands() _6482_commands.update(__get_mXb_commands('CALCulate[1]:')) _6482_commands.update(__get_mXb_commands('CALCulate2:')) _6482_commands.update(__get_offset_commands('CALCulate3:')) _6482_commands.update(__get_offset_commands('CALCulate4:')) _6482_commands.update(__get_ratio_commands('CALCulate5:')) _6482_commands.update(__get_ratio_commands('CALCulate6:')) _6482_commands.update(__get_limits_commands('CALCulate7:')) # TODO missing LIMitX, CLIMITs _6482_commands.update(__get_buffer_config_commands('CALCulate8:')) _6482_commands.update(__get_display_commands('[:WINDow1]')) _6482_commands.update(__get_display_commands('[:WINDow2]')) _6482_commands.update(__get_sens_commands('[SENSe[1]:]')) _6482_commands.update(__get_sens_commands('SENSe2:')) _6485_commands = Commands() _6485_commands.update(__get_mXb_commands('CALCulate[1]:')) _6485_commands.update(__get_offset_commands('CALCulate2:'))
def __init__(self, *args, **kwargs): commands = SCPICommands(SCPI_COMMANDS) model = str(kwargs.pop('model')) commands.update(SCPI_MODEL_COMMANDS.get(model, {})) kwargs['commands'] = commands super(KeithleySCPI, self).__init__(*args, **kwargs)
r = {} for k, v in _display_commands.items(): k = k.format(window=window) r[k] = v return r __get_mXb_commands = partial(__get_commands, _mXb_commands) __get_offset_commands = partial(__get_commands, _offset_commands) __get_limits_commands = partial(__get_commands, _limits_commands) __get_buffer_config_commands = partial(__get_commands, _buffer_config_commands) __get_ratio_commands = partial(__get_commands, _ratio_commands) __get_sens_commands = partial(__get_commands, _sens_commands) _6482_commands = Commands() _6482_commands.update(__get_mXb_commands('CALCulate[1]:')) _6482_commands.update(__get_mXb_commands('CALCulate2:')) _6482_commands.update(__get_offset_commands('CALCulate3:')) _6482_commands.update(__get_offset_commands('CALCulate4:')) _6482_commands.update(__get_ratio_commands('CALCulate5:')) _6482_commands.update(__get_ratio_commands('CALCulate6:')) _6482_commands.update( __get_limits_commands('CALCulate7:')) # TODO missing LIMitX, CLIMITs _6482_commands.update(__get_buffer_config_commands('CALCulate8:')) _6482_commands.update(__get_display_commands('[:WINDow1]')) _6482_commands.update(__get_display_commands('[:WINDow2]')) _6482_commands.update(__get_sens_commands('[SENSe[1]:]')) _6482_commands.update(__get_sens_commands('SENSe2:')) _6485_commands = Commands() _6485_commands.update(__get_mXb_commands('CALCulate[1]:'))