class DiodeIO(SndDevice): """ Peak information for a Wave8 input Parameters ---------- prefix : str Base name of device channel : int Channel number of device name : str Name of Wave8 device """ peakA = FC(EpicsSignalRO, '{self.prefix}:_peakA_{self.channel}') peakT = FC(EpicsSignalRO, '{self.prefix}:_peakT_{self.channel}') def __init__(self, prefix, channel, name, *, read_attrs=None, **kwargs): #Store the channel self.channel = channel #Default read attributes if read_attrs is None: read_attrs = ['peakT'] #Initialize device super().__init__(prefix, name=name, read_attrs=read_attrs, **kwargs)
class CalcoutRecordChannel(Device): """ channel of a calcout record: A-L .. autosummary:: ~reset """ input_value = FC(EpicsSignal, '{self.prefix}.{self._ch_letter}') last_value = FC(EpicsSignalRO, '{self.prefix}.L{self._ch_letter}') input_pv = FC(EpicsSignal, '{self.prefix}.INP{self._ch_letter}') input_pv_valid = FC(EpicsSignalRO, '{self.prefix}.IN{self._ch_letter}V') read_attrs = [ 'input_value', ] hints = {"fields": read_attrs} def __init__(self, prefix, letter, **kwargs): self._ch_letter = letter super().__init__(prefix, **kwargs) def reset(self): """set all fields to default values""" self.input_pv.put("") self.input_value.put(0)
class sscanTrigger(Device): """ detector trigger of an EPICS sscan record .. autosummary:: ~reset """ trigger_pv = FC(EpicsSignal, '{self.prefix}.T{self._ch_num}PV', kind=Kind.config) trigger_value = FC(EpicsSignal, '{self.prefix}.T{self._ch_num}CD') def __init__(self, prefix, num, **kwargs): self._ch_num = num super().__init__(prefix, **kwargs) def reset(self): """set all fields to default values""" self.trigger_pv.put("") self.trigger_value.put(1) @property def defined_in_EPICS(self): """True if defined in EPICS""" return len(self.trigger_pv.value.strip()) > 0
class sscanDetector(Device): """ detector of an EPICS sscan record .. autosummary:: ~defined_in_EPICS ~reset """ input_pv = FC(EpicsSignal, '{self.prefix}.D{self._ch_num}PV', kind=Kind.config) current_value = FC(EpicsSignal, '{self.prefix}.D{self._ch_num}CV') array = FC(EpicsSignal, '{self.prefix}.D{self._ch_num}CA', kind=Kind.omitted) def __init__(self, prefix, num, **kwargs): self._ch_num = num super().__init__(prefix, **kwargs) def reset(self): """set all fields to default values""" self.input_pv.put("") @property def defined_in_EPICS(self): """True if defined in EPICS""" return len(self.input_pv.value.strip()) > 0
class swaitRecordChannel(Device): """channel of a synApps swait record: A-L""" value = FC(EpicsSignal, '{self.prefix}.{self._ch_letter}') input_pv = FC(EpicsSignal, '{self.prefix}.IN{self._ch_letter}N') input_trigger = FC(EpicsSignal, '{self.prefix}.IN{self._ch_letter}P') def __init__(self, prefix, letter, **kwargs): self._ch_letter = letter super().__init__(prefix, **kwargs)
class transformRecordChannel(Device): """ channel of a synApps transform record: A-P .. autosummary:: ~reset """ current_value = FC(EpicsSignal, '{self.prefix}.{self._ch_letter}') last_value = FC(EpicsSignalRO, '{self.prefix}.L{self._ch_letter}') input_pv = FC(EpicsSignal, '{self.prefix}.INP{self._ch_letter}') input_pv_valid = FC(EpicsSignalRO, '{self.prefix}.I{self._ch_letter}V') expression_invalid = FC(EpicsSignalRO, '{self.prefix}.C{self._ch_letter}V') comment = FC(EpicsSignal, '{self.prefix}.CMT{self._ch_letter}') expression = FC(EpicsSignal, '{self.prefix}.CLC{self._ch_letter}') output_pv = FC(EpicsSignal, '{self.prefix}.OUT{self._ch_letter}') output_pv_valid = FC(EpicsSignalRO, '{self.prefix}.O{self._ch_letter}V') read_attrs = ["current_value"] def __init__(self, prefix, letter, **kwargs): self._ch_letter = letter super().__init__(prefix, **kwargs) def reset(self): """set all fields to default values""" self.comment.put(self._ch_letter.lower()) self.input_pv.put("") self.expression.put("") self.current_value.put(0) self.output_pv.put("")
class EpicsSscanDetector(Device): """detector of an EPICS sscan record""" input_pv = FC(EpicsSignal, '{self.prefix}.D{self._ch_num}PV') current_value = FC(EpicsSignal, '{self.prefix}.D{self._ch_num}CV') def __init__(self, prefix, num, **kwargs): self._ch_num = num super().__init__(prefix, **kwargs) def reset(self): """set all fields to default values""" self.input_pv.put("")
class EpicsSscanTrigger(Device): """detector trigger of an EPICS sscan record""" trigger_pv = FC(EpicsSignal, '{self.prefix}.T{self._ch_num}PV') trigger_value = FC(EpicsSignal, '{self.prefix}.T{self._ch_num}CD') def __init__(self, prefix, num, **kwargs): self._ch_num = num super().__init__(prefix, **kwargs) def reset(self): """set all fields to default values""" self.trigger_pv.put("") self.trigger_value.put(1)
class EpicsSwaitRecordChannel(Device): """channel of a synApps swait record: A-L""" value = FC(EpicsSignal, '{self.prefix}.{self._ch_letter}') input_pv = FC(EpicsSignal, '{self.prefix}.IN{self._ch_letter}N') input_trigger = FC(EpicsSignal, '{self.prefix}.IN{self._ch_letter}P') def __init__(self, prefix, letter, **kwargs): self._ch_letter = letter super().__init__(prefix, **kwargs) def reset(self): """set all fields to default values""" self.value.put(0) self.input_pv.put("") self.input_trigger.put("Yes")
class ScalerChannel(Device): _default_configuration_attrs = ('chname', 'preset', 'gate') _default_read_attrs = ('s', ) # TODO set up monitor on this to automatically change the name chname = FC(EpicsSignal, '{self.prefix}.NM{self._ch_num}') s = FC(EpicsSignalRO, '{self.prefix}.S{self._ch_num}') preset = FC(EpicsSignal, '{self.prefix}.PR{self._ch_num}') gate = FC(EpicsSignal, '{self.prefix}.G{self._ch_num}', string=True) def __init__(self, prefix, ch_num, **kwargs): self._ch_num = ch_num super().__init__(prefix, **kwargs) self.match_name() def match_name(self): self.s.name = self.chname.get()
class EpicsSscanPositioner(Device): """positioner of an EPICS sscan record""" readback_pv = FC(EpicsSignal, '{self.prefix}.R{self._ch_num}PV') readback_value = FC(EpicsSignalRO, '{self.prefix}.R{self._ch_num}CV') setpoint_pv = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}PV') setpoint_value = FC(EpicsSignalRO, '{self.prefix}.P{self._ch_num}DV') start = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}SP') center = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}CP') end = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}EP') step_size = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}SI') width = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}WD') abs_rel = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}AR') mode = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}SM') units = FC(EpicsSignalRO, '{self.prefix}.P{self._ch_num}EU') def __init__(self, prefix, num, **kwargs): self._ch_num = num super().__init__(prefix, **kwargs) def reset(self): """set all fields to default values""" self.readback_pv.put("") self.setpoint_pv.put("") self.start.put(0) self.center.put(0) self.end.put(0) self.step_size.put(0) self.width.put(0) self.abs_rel.put("ABSOLUTE") self.mode.put("LINEAR")
class sscanPositioner(Device): """ positioner of an EPICS sscan record .. autosummary:: ~defined_in_EPICS ~reset """ readback_pv = FC(EpicsSignal, '{self.prefix}.R{self._ch_num}PV', kind=Kind.config) readback_value = FC(EpicsSignalRO, '{self.prefix}.R{self._ch_num}CV') array = FC(EpicsSignalRO, '{self.prefix}.P{self._ch_num}CA', kind=Kind.omitted) setpoint_pv = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}PV', kind=Kind.config) setpoint_value = FC(EpicsSignalRO, '{self.prefix}.P{self._ch_num}DV') start = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}SP', kind=Kind.config) center = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}CP', kind=Kind.config) end = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}EP', kind=Kind.config) step_size = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}SI', kind=Kind.config) width = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}WD', kind=Kind.config) abs_rel = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}AR', kind=Kind.config) mode = FC(EpicsSignal, '{self.prefix}.P{self._ch_num}SM', kind=Kind.config) units = FC(EpicsSignalRO, '{self.prefix}.P{self._ch_num}EU', kind=Kind.config) def __init__(self, prefix, num, **kwargs): self._ch_num = num super().__init__(prefix, **kwargs) def reset(self): """set all fields to default values""" self.readback_pv.put("") self.setpoint_pv.put("") self.start.put(0) self.center.put(0) self.end.put(0) self.step_size.put(0) self.width.put(0) self.abs_rel.put("ABSOLUTE") self.mode.put("LINEAR") @property def defined_in_EPICS(self): """True if defined in EPICS""" return len(self.setpoint_pv.value.strip()) > 0