From d602fd9eab4af3ebe64ac294623e45b73778b05b Mon Sep 17 00:00:00 2001 From: ximenes Date: Mon, 8 Jan 2024 17:08:55 -0300 Subject: [PATCH] Add trim corrs in IDFF --- pyqt-apps/siriushla/si_ap_idff/main.py | 30 +++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/pyqt-apps/siriushla/si_ap_idff/main.py b/pyqt-apps/siriushla/si_ap_idff/main.py index 36fcd0b50..517750b6e 100644 --- a/pyqt-apps/siriushla/si_ap_idff/main.py +++ b/pyqt-apps/siriushla/si_ap_idff/main.py @@ -80,11 +80,21 @@ def _basicSettingsWidget(self): self.lb_loopfreq = SiriusLabel( self, self.dev_pref.substitute(propty='LoopFreq-RB')) + qd_1 = IDSearch.conv_idname_2_idff_qd_1names(self.idname) + qd_2 = IDSearch.conv_idname_2_idff_qd_1names(self.idname) + qf = IDSearch.conv_idname_2_idff_qfnames(self.idname) + ld_calccorr = QLabel( 'Calc. values:', self, alignment=Qt.AlignRight) glay_calccorr = QGridLayout() glay_calccorr.addWidget(ld_calccorr, 0, 0) - for ridx, corr in enumerate(['CH', 'CV', 'QS']): + for ridx, corr in enumerate(['CH', 'CV', 'QS', 'QD_1', 'QF', 'QD_2']): + if corr == 'QD_1' and not qd_1: + continue + if corr == 'QF' and not qf: + continue + if corr == 'QD_2' and not qd_2: + continue row = ridx + 1 hheader = QLabel(f'{corr}', alignment=Qt.AlignCenter) hheader.setStyleSheet('.QLabel{font-weight: bold;}') @@ -95,7 +105,11 @@ def _basicSettingsWidget(self): vheader = QLabel(f'{col}', alignment=Qt.AlignCenter) vheader.setStyleSheet('.QLabel{font-weight: bold;}') glay_calccorr.addWidget(vheader, 0, col) - propty = f'Corr{corr}{col}Current-Mon' + if corr in ['CH', 'CV', 'QS', 'QF']: + propty = f'Corr{corr}{col}Current-Mon' + else: + qn, fidx = corr.split('_') + propty = f'Corr{qn}{col}_{fidx}Current-Mon' pvname = self.dev_pref.substitute(propty=propty) lbl = SiriusLabel(self, pvname, keep_unit=True) lbl.showUnits = True @@ -122,11 +136,21 @@ def _basicSettingsWidget(self): self, self.dev_pref.substitute(propty='ControlQS-Sel')) self.lb_controlqs = SiriusLedState( self, self.dev_pref.substitute(propty='ControlQS-Sts')) - lay.addWidget(ld_controlqs, 5, 0) lay.addWidget(self.sb_controlqs, 5, 1) lay.addWidget(self.lb_controlqs, 5, 2) + if qd_1 or qd_2 or qf: + ld_controlqn = QLabel( + 'Control QN: ', self, alignment=Qt.AlignRight) + self.sb_controlqn = PyDMStateButton( + self, self.dev_pref.substitute(propty='ControlQN-Sel')) + self.lb_controlqn = SiriusLedState( + self, self.dev_pref.substitute(propty='ControlQN-Sts')) + lay.addWidget(ld_controlqn, 6, 0) + lay.addWidget(self.sb_controlqn, 6, 1) + lay.addWidget(self.lb_controlqn, 6, 2) + lay.addLayout(glay_calccorr, 7, 0, 1, 3) return gbox