Skip to content

Commit

Permalink
Removed Conditioning window and added it's informations to Loop's gro…
Browse files Browse the repository at this point in the history
…up box
  • Loading branch information
João Augusto Rosa Feltran committed Oct 31, 2024
1 parent d3d34b0 commit f25cb63
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 155 deletions.
9 changes: 3 additions & 6 deletions pyqt-apps/scripts/sirius-hla-bo-rf-control.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
import argparse as _argparse
import sys

from siriuspy.envars import VACA_PREFIX

from siriushla.as_rf_control.advanced_details import ADCDACDetails, \
AutoStartDetails, CalEqDetails, CalSysDetails, ConditioningDetails, \
HardwareDetails, LoopsDetails, RampsDetails, RFInputsDetails, \
TuningDetails
AutoStartDetails, CalEqDetails, CalSysDetails, HardwareDetails, \
LoopsDetails, RampsDetails, RFInputsDetails, TuningDetails
from siriushla.as_rf_control.control import RFMainControl
from siriushla.as_rf_control.details import CavityStatusDetails, FDLDetails, \
LLRFInterlockDetails, SlowLoopErrorDetails, SlowLoopParametersDetails, \
SSADetailsBO, TempMonitor, TransmLineStatusDetails
from siriushla.sirius_application import SiriusApplication
from siriuspy.envars import VACA_PREFIX

parser = _argparse.ArgumentParser(
description="Run RF Control Interface.")
Expand All @@ -31,7 +29,6 @@
'auto-start': AutoStartDetails,
'cal-eq': CalEqDetails,
'cal-sys': CalSysDetails,
'conditioning': ConditioningDetails,
'hardware': HardwareDetails,
'loops': LoopsDetails,
'ramps': RampsDetails,
Expand Down
9 changes: 3 additions & 6 deletions pyqt-apps/scripts/sirius-hla-si-rf-control.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
import argparse as _argparse
import sys

from siriuspy.envars import VACA_PREFIX

from siriushla.as_rf_control.advanced_details import ADCDACDetails, \
AutoStartDetails, CalEqDetails, CalSysDetails, ConditioningDetails, \
HardwareDetails, LoopsDetails, RampsDetails, RFInputsDetails, \
TuningDetails
AutoStartDetails, CalEqDetails, CalSysDetails, HardwareDetails, \
LoopsDetails, RampsDetails, RFInputsDetails, TuningDetails
from siriushla.as_rf_control.control import RFMainControl
from siriushla.as_rf_control.details import CavityStatusDetails, FDLDetails, \
LLRFInterlockDetails, SlowLoopErrorDetails, SlowLoopParametersDetails, \
SSADetailsSI, TempMonitor, TransmLineStatusDetails
from siriushla.sirius_application import SiriusApplication
from siriuspy.envars import VACA_PREFIX

parser = _argparse.ArgumentParser(
description="Run RF Control Interface.")
Expand All @@ -35,7 +33,6 @@
'auto-start': AutoStartDetails,
'cal-eq': CalEqDetails,
'cal-sys': CalSysDetails,
'conditioning': ConditioningDetails,
'hardware': HardwareDetails,
'loops': LoopsDetails,
'ramps': RampsDetails,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from .auto_start import AutoStartDetails
from .cal_eq import CalEqDetails
from .cal_sys import CalSysDetails
from .conditioning import ConditioningDetails
from .hardware import HardwareDetails
from .loops import LoopsDetails
from .ramps import RampsDetails
Expand Down
99 changes: 0 additions & 99 deletions pyqt-apps/siriushla/as_rf_control/advanced_details/conditioning.py

This file was deleted.

99 changes: 86 additions & 13 deletions pyqt-apps/siriushla/as_rf_control/advanced_details/loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def _setupUi(self):
" border-right: 2px solid gray;}")

wid_controls = QWidget(self)
wid_controls.setLayout(
self._loopsControlLayout(self.syst_dict['Control']))
wid_controls.setLayout(self._loopsControlLayout())
dtls.addTab(wid_controls, 'Loops Control')

wid_iq = QWidget(self)
Expand All @@ -63,11 +62,26 @@ def _setupUi(self):
f'<h4>{self.title}</h4>', alignment=Qt.AlignCenter))
lay.addWidget(dtls)

def _loopsControlLayout(self, chs_dict):
lay = QGridLayout()
def _loopsControlLayout(self):
lay = QVBoxLayout()
lay.setAlignment(Qt.AlignTop)
lay.setSpacing(9)

gbox_gen = QGroupBox('General Controls')
gbox_gen.setLayout(self._setupGeneralControlsLayout(self.syst_dict['Control']))

gbox_cond = QGroupBox('Conditioning')
gbox_cond.setLayout(self._setupConditioningLayout(self.syst_dict['Conditioning']))

lay.addWidget(gbox_gen)
lay.addWidget(gbox_cond)

return lay

def _setupGeneralControlsLayout(self, chs_dict):
lay = QGridLayout()
lay.setSpacing(9)

# Amp Loop Ref
self._setupLabelEdit(lay, chs_dict, '24 mV', 0, 0)
self._setupLabelEdit(lay, chs_dict, '24 VGap', 1, 0)
Expand All @@ -79,7 +93,7 @@ def _loopsControlLayout(self, chs_dict):
lb_vinc = SiriusLabel(self, self.prefix+chs_dict['29'][1]+'-RB',
alignment=Qt.AlignCenter)
lb_vinc.showUnits = True
lay.addWidget(QLabel('29'), 3, 0)
lay.addWidget(QLabel('29', alignment=Qt.AlignCenter), 3, 0)
lay.addWidget(QLabel(chs_dict['29'][0]), 3, 1)
lay.addWidget(SiriusEnumComboBox(
self, self.prefix+chs_dict['29'][1]+'-SP'),
Expand All @@ -90,15 +104,15 @@ def _loopsControlLayout(self, chs_dict):
lb_pinc = SiriusLabel(self, self.prefix+chs_dict['28'][1]+'-RB',
alignment=Qt.AlignCenter)
lb_pinc.showUnits = True
lay.addWidget(QLabel('28'), 4, 0)
lay.addWidget(QLabel('28', alignment=Qt.AlignCenter), 4, 0)
lay.addWidget(QLabel(chs_dict['28'][0]), 4, 1)
lay.addWidget(SiriusEnumComboBox(
self, self.prefix+chs_dict['28'][1]+'-SP'),
4, 2, alignment=Qt.AlignRight)
lay.addWidget(lb_pinc, 4, 3)

# Look Reference
lay.addWidget(QLabel('106'), 5, 0)
lay.addWidget(QLabel('106', alignment=Qt.AlignCenter), 5, 0)
lay.addWidget(QLabel(chs_dict['106'][0]), 5, 1)
lay.addWidget(SiriusPushButton(
self, self.prefix+chs_dict['106'][1],
Expand All @@ -109,7 +123,7 @@ def _loopsControlLayout(self, chs_dict):
5, 3, alignment=Qt.AlignCenter)

# # Rect/Polar Mode Select
lay.addWidget(QLabel('114'), 6, 0)
lay.addWidget(QLabel('114', alignment=Qt.AlignCenter), 6, 0)
lay.addWidget(QLabel(chs_dict['114'][0]), 6, 1)
lay.addWidget(SiriusEnumComboBox(
self, self.prefix+chs_dict['114'][1]+'-Sel'),
Expand All @@ -118,7 +132,7 @@ def _loopsControlLayout(self, chs_dict):
alignment=Qt.AlignCenter), 6, 3)

# Quadrant Selection
lay.addWidget(QLabel('107'), 7, 0)
lay.addWidget(QLabel('107', alignment=Qt.AlignCenter), 7, 0)
lay.addWidget(QLabel(chs_dict['107'][0]), 7, 1)
lay.addWidget(SiriusEnumComboBox(
self, self.prefix+chs_dict['107'][1]+'-Sel'),
Expand Down Expand Up @@ -149,7 +163,7 @@ def _loopsControlLayout(self, chs_dict):
self._setupLabelEdit(lay, chs_dict, '30', 3, 5)

# Phase Correction Control
lay.addWidget(QLabel('31'), 4, 5)
lay.addWidget(QLabel('31', alignment=Qt.AlignCenter), 4, 5)
lay.addWidget(QLabel(chs_dict['31'][0]), 4, 6)
lay.addWidget(PyDMStateButton(
self, self.prefix+chs_dict['31'][1]+'-Sel'), 4, 7)
Expand All @@ -161,15 +175,15 @@ def _loopsControlLayout(self, chs_dict):
lb_80 = SiriusLabel(self, self.prefix+chs_dict['80'][1],
alignment=Qt.AlignCenter)
lb_80.showUnits = True
lay.addWidget(QLabel('80'), 5, 5)
lay.addWidget(QLabel('80', alignment=Qt.AlignCenter), 5, 5)
lay.addWidget(QLabel(chs_dict['80'][0]), 5, 6)
lay.addWidget(lb_80, 5, 8)

# Phase Correct Control
lb_81 = SiriusLabel(self, self.prefix+chs_dict['81'][1],
alignment=Qt.AlignCenter)
lb_81.showUnits = True
lay.addWidget(QLabel('81'), 6, 5)
lay.addWidget(QLabel('81', alignment=Qt.AlignCenter), 6, 5)
lay.addWidget(QLabel(chs_dict['81'][0]), 6, 6)
lay.addWidget(lb_81, 6, 8)

Expand All @@ -178,16 +192,75 @@ def _loopsControlLayout(self, chs_dict):

return lay

def _setupConditioningLayout(self, chs_dict):
lay = QGridLayout(self)
lay.setAlignment(Qt.AlignTop)
lay.setSpacing(9)

# Pulse Enable
self._setupLedState(lay, chs_dict, '200', 0, True)

# Auto Cond Enable
self._setupLedState(lay, chs_dict, '201', 1, True)

# Vacuum
self._setupLedState(lay, chs_dict, '79', 2, False)

# Duty Cycle
self._setupLabelEdit(lay, chs_dict, '202', 0, 4)

# Duty Cycle RB
lb_condfreq = SiriusLabel(self, self.prefix+chs_dict['530'][1])
lb_condfreq.showUnits = True
lay.addWidget(QLabel('530', alignment=Qt.AlignCenter), 1, 4)
lay.addWidget(QLabel(chs_dict['530'][0]), 1, 5)
lay.addWidget(lb_condfreq, 1, 7, alignment=Qt.AlignCenter)

row = 2
if self.section == 'BO':
relay_keys = [
'CGC Fast Relay', 'Relay Setpoint RB', 'Relay Hysteria RB']
for key in relay_keys:
lb_relay = SiriusLabel(
self, self.prefix+chs_dict['Relay'][key]+'-RB')
lb_relay.showUnits = True

lay.addWidget(QLabel(key), row, 5)
if key.split()[-1] != 'RB':
lay.addWidget(SiriusSpinbox(
self, self.prefix+chs_dict['Relay'][key]+'-SP'),
row, 6)
lay.addWidget(lb_relay, row, 7)
row += 1

return lay

def _setupLabelEdit(self, lay, chs_dict, key, row, column):
label = SiriusLabel(self, self.prefix+chs_dict[key][1]+'-RB')
label.showUnits = True

lay.addWidget(QLabel(key.split()[0]), row, column)
lay.addWidget(QLabel(
key.split()[0], alignment=Qt.AlignCenter), row, column)
lay.addWidget(QLabel(chs_dict[key][0]), row, column+1)
lay.addWidget(SiriusSpinbox(
self, self.prefix+chs_dict[key][1]+'-SP'), row, column+2)
lay.addWidget(label, row, column+3, alignment=Qt.AlignCenter)

def _setupLedState(self, lay, chs_dict, key, row, has_button):
lay.addWidget(QLabel(key, alignment=Qt.AlignCenter), row, 0)
lay.addWidget(QLabel(chs_dict[key][0]), row, 1)

ending = ''
if has_button:
lay.addWidget(PyDMStateButton(
self, self.prefix+chs_dict[key][1]+'-Sel'),
row, 2, alignment=Qt.AlignCenter)
ending = '-Sts'

lay.addWidget(SiriusLedState(
self, self.prefix+chs_dict[key][1]+ending),
row, 3, alignment=Qt.AlignCenter)

def _specificLoopsLayout(self, rect_or_polar):
lay = QVBoxLayout()
lay.setAlignment(Qt.AlignTop)
Expand Down
2 changes: 0 additions & 2 deletions pyqt-apps/siriushla/as_rf_control/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,6 @@ def _advancedDetailsLayout(self):
'Cavity Ramps', 'ramps', systems[i], buttons)
self._addDetailButton(
'Auto Start', 'auto-start', systems[i], buttons)
self._addDetailButton(
'Conditioning', 'conditioning', systems[i], buttons)
self._addDetailButton(
'Tuning', 'tuning', systems[i], buttons)
self._addDetailButton(
Expand Down
Loading

0 comments on commit f25cb63

Please sign in to comment.