def _set_source(self, value): if value is None: return dict() # BUG: I noticed that differently from the EVR and EVE IOCs, # the AMCFPGAEVR do not have a 'Dsbl' as first option of the enums # list. So I have to create this offset to fix this... offset = int(self.channel.dev.startswith('AMCFPGAEVR')) if value >= (len(self._source_enums)-1): return dict() pname = self._source_enums[value] n = _cstime.Const.TrigSrcLL._fields.index('Trigger') if pname.startswith('Dsbl'): dic_ = {'Src': n, 'Evt': _cstime.Const.EvtLL.Evt00} if pname.startswith('Clock'): n = _cstime.Const.TrigSrcLL._fields.index(pname) n -= offset dic_ = {'Src': n} else: n -= offset evt = int(_cstime.Const.EvtHL2LLMap[pname][-2:]) dic_ = {'Src': n, 'Evt': evt} if 'SrcTrig' in self._dict_convert_prop2pv.keys(): intrg = _LLTimeSearch.get_channel_internal_trigger_pvname( self.channel) intrg = int(intrg[-2:]) # get internal trigger number for EVR dic_['SrcTrig'] = intrg return dic_
def __init__(self, channel, source_enums): fout_chan = _LLTimeSearch.get_fout_channel(channel) self._fout_out = int(fout_chan.propty[3:]) evg_chan = _LLTimeSearch.get_evg_channel(channel) self._evg_out = int(evg_chan.propty[3:]) self._source_enums = source_enums self._duration = None # I keep this for avoid rounding errors prefix = LL_PREFIX + _PVName(channel).device_name + ':' super().__init__(channel, prefix) # self._config_ok_values['DevEnbl'] = 1 # self._config_ok_values['FoutDevEnbl'] = 1 # self._config_ok_values['EVGDevEnbl'] = 1 if self.channel.propty.startswith('OUT'): intrg = _LLTimeSearch.get_channel_internal_trigger_pvname( self.channel) intrg = int(intrg.propty[-2:]) # get internal trigger number self._config_ok_values['SrcTrig'] = intrg # Stop using FineDelay and RF Delay to ease consistency: self._config_ok_values['FineDelay'] = 0 self._config_ok_values['RFDelay'] = 0
def _define_convertion_prop2pv(self): intlb = _LLTimeSearch.get_channel_internal_trigger_pvname(self.channel) outlb = _LLTimeSearch.get_channel_output_port_pvname(self.channel) intlb = intlb.propty outlb = outlb.propty evg_chan = _LLTimeSearch.get_evg_channel(self.channel) _evg_prefix = LL_PREFIX + evg_chan.device_name + ':' fout_chan = _LLTimeSearch.get_fout_channel(self.channel) _fout_prefix = LL_PREFIX + fout_chan.device_name + ':' map_ = { 'State': self.prefix + intlb + 'State-Sts', 'Evt': self.prefix + intlb + 'Evt-RB', 'Width': self.prefix + intlb + 'WidthRaw-RB', 'Polarity': self.prefix + intlb + 'Polarity-Sts', 'NrPulses': self.prefix + intlb + 'NrPulses-RB', 'Delay': self.prefix + intlb + 'DelayRaw-RB', 'Src': self.prefix + outlb + 'Src-Sts', 'SrcTrig': self.prefix + outlb + 'SrcTrig-RB', 'RFDelay': self.prefix + outlb + 'RFDelayRaw-RB', 'FineDelay': self.prefix + outlb + 'FineDelayRaw-RB', 'RFDelayType': self.prefix + outlb + 'RFDelayType-Sts', # connection status PVs 'DevEnbl': self.prefix + 'DevEnbl-Sts', 'Network': self.prefix + 'Network-Mon', 'Link': self.prefix + 'LinkStatus-Mon', 'Intlk': self.prefix + 'IntlkStatus-Mon', 'Los': self.prefix + 'Los-Mon', 'EVGLos': _evg_prefix + 'Los-Mon', 'FoutLos': _fout_prefix + 'Los-Mon', 'FoutDevEnbl': _fout_prefix + 'DevEnbl-Sts', 'EVGDevEnbl': _evg_prefix + 'DevEnbl-Sts', } for prop in self._REMOVE_PROPS: map_.pop(prop) return map_
def _process_src_trig(self, src_trig, is_sp): invalid = len(self._source_enums)-1 # Invalid option intrg = _LLTimeSearch.get_channel_internal_trigger_pvname(self.channel) intrg = int(intrg.propty[-2:]) # get internal trigger number for EVR if src_trig != intrg: return {'Src': invalid}