[docs]classmoduleBase(InstrumentChannel):""" Base class for all M81 SSM modules"""def__init__(self,parent:Instrument,name:str,Channel:str,**kwargs)->None:super().__init__(parent,name,**kwargs)self.module_name=Channelself.command_prefix=self._get_prefix()self.add_parameter(name='model',label='model',get_cmd=self._param_getter('MODel?'),get_parser=lambdaresp:resp.strip('"'))self.add_parameter(name='serial',label='serial',get_cmd=self._param_getter('SERial?'),get_parser=lambdaresp:resp.strip('"'))def_get_prefix(self)->str:matchself.module_name:case'S1':return"SOURce1"case'S2':return"SOURCe2"case'S3':return"SOURCe3"case'M1':return"SENSe1"case'M2':return"SENSe2"case'M3':return"SENSe3"case_:raiseValueError('Channel must be either S[1-3] or M[1-3]')def_param_getter(self,get_cmd:str)->str:returnf"{self.command_prefix}:{get_cmd}"def_param_setter(self,set_cmd:str,value:str)->str:returnf"{self.command_prefix}:{set_cmd}{value}"