Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quadtrim idff #687

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions pyqt-apps/siriushla/si_ap_idff/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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;}')
Expand All @@ -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
Expand All @@ -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
Expand Down