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 BPMs Equalization Window #672

Merged
merged 9 commits into from
Nov 10, 2023
18 changes: 18 additions & 0 deletions pyqt-apps/scripts/sirius-hla-si-di-equalize_bpms_switching.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env python-sirius

"""Window to equalize switching semicycles of BPM antennas."""

import sys
import argparse as _argparse

from siriushla.sirius_application import SiriusApplication
from siriushla.si_di_equalize_bpms import BPMsEqualizeSwitching


parser = _argparse.ArgumentParser(
description="Run BPMs Equalization Interface.")
args = parser.parse_args()

app = SiriusApplication()
app.open_window(BPMsEqualizeSwitching, parent=None)
sys.exit(app.exec_())
1 change: 1 addition & 0 deletions pyqt-apps/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def my_test_suite():
'scripts/sirius-hla-si-ap-tunecorr.py',
'scripts/sirius-hla-si-bs-fofbsysid.py',
'scripts/sirius-hla-si-di-bbb.py',
'scripts/sirius-hla-si-di-equalize_bpms_switching.py',
'scripts/sirius-hla-si-di-scraps.py',
'scripts/sirius-hla-si-di-tune.py',
'scripts/sirius-hla-si-di-vlight.py',
Expand Down
7 changes: 6 additions & 1 deletion pyqt-apps/siriushla/as_ap_configdb/configdialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class _BaseConfigManipulation(SiriusDialog):
def __init__(self, config_type, parent=None):
"""Constructor."""
super().__init__(parent)
self._client = ConfigDBClient()
self._client = ConfigDBClient(config_type=config_type)
self._config_type = config_type
self._logger = logging.getLogger(__name__)
self._logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -68,6 +68,11 @@ def _setupui(self):
# Connect database error to slot that show messages
self.editor.connectionError.connect(self._database_error)

@property
def client(self):
"""."""
return self._client

@property
def config_name(self):
return self.editor.config_name
Expand Down
2 changes: 1 addition & 1 deletion pyqt-apps/siriushla/as_ap_injcontrol/tbts.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def keyPressEvent(self, event):
# show_label=True)
# self.centralwidget = QWidget()
# self.centralwidget.setLayout(QVBoxLayout())
# self.canvas = MatplotlibWidget(self._fig)
# self.canvas = MatplotlibWidget(figure=self._fig)
# self.canvas.setParent(self.centralwidget)
# self.centralwidget.layout().addWidget(self.canvas)
# self.centralwidget.layout().setContentsMargins(0, 0, 0, 0)
Expand Down
5 changes: 5 additions & 0 deletions pyqt-apps/siriushla/as_ap_launcher/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,11 @@ def _set_bpm_menu(self, sec):
menu = QMenu('BPMs', self)
menu.setObjectName(sec.upper()+'App')
menu.setIcon(qta.icon('mdi.currency-sign'))
if sec == 'si':
action = menu.addAction('Equalize Switching')
action.setIcon(qta.icon('mdi.approximately-equal-box'))
self.connect_newprocess(
action, 'sirius-hla-si-di-equalize_bpms_switching.py')
action = menu.addAction('Monitor')
action.setIcon(util.get_monitor_icon('mdi.currency-sign'))
self.connect_newprocess(action, cmd + ['-w', 'Monitor', ])
Expand Down
4 changes: 2 additions & 2 deletions pyqt-apps/siriushla/as_ap_macreport/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def _show_raw_data(self):
str(self._macreport.time_stop) + ')')
dialog.setWindowIcon(self.windowIcon())
fig = self._macreport.plot_raw_data()
wid = MatplotlibWidget(fig)
wid = MatplotlibWidget(figure=fig)
lay = QGridLayout(dialog)
lay.addWidget(wid)
dialog.exec_()
Expand All @@ -566,7 +566,7 @@ def _show_progmd_vs_delivd(self):
str(self._macreport.time_start) + ' -> ' +
str(self._macreport.time_stop) + ')')
fig = self._macreport.plot_progmd_vs_delivd_hours()
wid = MatplotlibWidget(fig)
wid = MatplotlibWidget(figure=fig)
lay = QGridLayout(dialog)
lay.addWidget(wid)
dialog.exec_()
Expand Down
2 changes: 1 addition & 1 deletion pyqt-apps/siriushla/as_ap_measure/emittance_meas.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def _get_trans_mat(self, K1):
def _setupUi(self):
gl = QGridLayout(self)
fig = mplt.figure()
wid = MatplotlibWidget(fig, parent=self)
wid = MatplotlibWidget(parent=self, figure=fig)
wid.setObjectName('fig_result')
wid.setStyleSheet('#fig_result{min-width: 25em;}')
self.fig_res = wid
Expand Down
1 change: 1 addition & 0 deletions pyqt-apps/siriushla/si_di_equalize_bpms/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .main import BPMsEqualizeSwitching
Loading