def _create_objects(section): """.""" dipnames = DIPNAMES[section] psnames = _PSSearch.get_psnames({'sec': section}) kckrs = [ _SiriusPVName('BO-01D:PU-InjKckr'), _SiriusPVName('BO-48D:PU-EjeKckr'), _SiriusPVName('SI-01SA:PU-InjDpKckr'), _SiriusPVName('SI-01SA:PU-InjNLKckr') ] # Add Kickers to TLs: if section == 'TS': psnames.extend(kckrs[1:]) psnames = sorted(psnames) elif section == 'TB': psnames.append(kckrs[0]) psnames = sorted(psnames) else: psnames = sorted(set(psnames) - set(kckrs)) magnets = [] dipoles = [] for psname in psnames: if psname.dev.startswith('FC'): continue mfunc = _PSSearch.conv_psname_2_magfunc(psname) if mfunc == 'dipole': dipoles.append({'psname': psname, 'mafunc': mfunc}) continue magnets.append({'psname': psname, 'mafunc': mfunc}) return dipoles, magnets
def __init__(self, parent, psnames): super().__init__(parent) self._psnames = psnames self._choose_sec = ['TB', 'BO', 'TS', 'SI'] self._choose_sub = ['All', ] self._choose_sub.extend(['{0:02d}.*'.format(i+1) for i in range(20)]) self._choose_sub.extend(['.*M1', '.*M2', '.*C1', '.*C2', '.*C3', '.*C4', '.*SA', '.*SB', '.*SP']) self._choose_dev = { sec: ['CH', 'CV', 'C(H|V)'] for sec in self._choose_sec} self._choose_dev['SI'].extend( ['QS', 'QFA', 'QFB', 'QFP', 'QF.*', 'QDA', 'QDB1', 'QDB2', 'QDP1', 'QDP2', 'QD.*', 'Q1', 'Q2', 'Q3', 'Q4', 'Q[1-4]', 'Q(D|F).*', 'Q(F|D|[1-4]).*', 'FCH', 'FCV', 'FC(H|V)']) self.magfunc = _PSSearch.conv_psname_2_magfunc(self._psnames[0]) self.pytype = _PSSearch.conv_psname_2_pstype(self._psnames[0]) self._setupUi()
def __init__(self, parent=None, prefix=_vaca_prefix, filters=''): super().__init__(parent) self.setWindowTitle('Power Supplies Graph Monitor') self._prefix = prefix self._filters = filters if not filters: self.setObjectName('ASApp') filters = {'sec': 'SI', 'dis': 'PS', 'dev': 'CH'} else: self.setObjectName(filters['sec']+'App') self._psnames = _PSSearch.get_psnames(filters) self._magfunc = _PSSearch.conv_psname_2_magfunc(self._psnames[0]) self._pstype = _PSSearch.conv_psname_2_pstype(self._psnames[0]) self._setupUi()
def _set_psnames(self): sec = self.cb_sec.currentText() if sec == 'SI': sub = self.cb_sub.currentText() sub = sub if sub != 'All' else '.*' else: sub = '.*' dev = self.cb_dev[sec].currentText() self._psnames = _PSSearch.get_psnames( {'sec': sec, 'sub': '(?!Fam)'+sub, 'dis': 'PS', 'dev': dev}) if self._psnames and self.sender() == self.cb_dev[sec]: self.magfunc = _PSSearch.conv_psname_2_magfunc(self._psnames[0]) self.pytype = _PSSearch.conv_psname_2_pstype(self._psnames[0]) self.matype_changed.emit(self.magfunc, self.pytype) self.psnames_changed.emit(self._psnames)