mirror of
https://gitlab.psi.ch/pyqtacc/proscan.git
synced 2025-12-30 22:48:45 +01:00
added cometOverlap for header
This commit is contained in:
24
guiheader.py
24
guiheader.py
@@ -117,6 +117,7 @@ class GUIHeader(QWidget):
|
||||
self.hor_layout.setContentsMargins(5, 0, 5, 0)
|
||||
else:
|
||||
j = 0
|
||||
_align = Qt.AlignCenter
|
||||
for (sector, pv, color) in (
|
||||
zip(self.header_groups, pvlist, header_colors)):
|
||||
if sector == "MASTER":
|
||||
@@ -128,7 +129,7 @@ class GUIHeader(QWidget):
|
||||
self.grid_layout.addWidget(self.beam_current_widget(
|
||||
header=sector, pv= pv, color_obj=color), self.header_row[sector], j, 2, 1)
|
||||
j += 1
|
||||
_align = Qt.AlignCenter
|
||||
|
||||
if sector in ["PIF"]:
|
||||
qw = draw_box(nheight=10, nwidth=8, area="PRE-G3")
|
||||
self.grid_layout.addWidget(qw, 0, j, 2, 1, _align)
|
||||
@@ -148,7 +149,7 @@ class GUIHeader(QWidget):
|
||||
self.grid_layout.addWidget(qw, 0, j, 3, 1, _align)
|
||||
j += 1
|
||||
elif sector in ["G1"]:
|
||||
qw = draw_box(nheight=5,nwidth=16, area="G1")
|
||||
qw = draw_box(nheight=5, nwidth=16, area="G1")
|
||||
self.grid_layout.addWidget(qw, 1, j-1, 1, 1, _align)
|
||||
qw = draw_box(nheight=10, nwidth=8, area="PRE-SH")
|
||||
self.grid_layout.addWidget(qw, 1, j, 2, 1, _align)
|
||||
@@ -163,6 +164,9 @@ class GUIHeader(QWidget):
|
||||
qw = draw_box()
|
||||
self.grid_layout.addWidget(qw, 0, j, 2, 1, _align)
|
||||
j += 1
|
||||
|
||||
shift_type = CAQLabel(self, pv_name="PRO-HUSH:SHIFT-TYPE")
|
||||
self.grid_layout.addWidget(shift_type, 0, 0, 1, 2, Qt.AlignLeft)
|
||||
|
||||
if has_hbox_layout:
|
||||
self.grid_layout.setSpacing(6)
|
||||
@@ -242,7 +246,14 @@ class GUIHeader(QWidget):
|
||||
pf.setStyleSheet("background-color:{0};".format(_color))
|
||||
for key, pf in self.pframe_matrix["PRE-SH"][3].items():
|
||||
pf.setStyleSheet("background-color:{0};".format(_color))
|
||||
|
||||
|
||||
def toCometOverlap(self, on_off: str = "ON"):
|
||||
_color = "green" if on_off=="ON" else self.pf_bgcolor()
|
||||
pf = self.pframe_matrix["POST-COMET"][3][0]
|
||||
pf.setStyleSheet("background-color:{0};".format(_color))
|
||||
pf = self.pframe_matrix["POST-COMET"][3][1]
|
||||
pf.setStyleSheet("background-color:{0};".format(_color))
|
||||
|
||||
def toSHOverlap(self, on_off: str = "ON"):
|
||||
_color = "green" if on_off=="ON" else self.pf_bgcolor()
|
||||
pf = self.pframe_matrix["POST-COMET"][3][0]
|
||||
@@ -391,7 +402,12 @@ class GUIHeader(QWidget):
|
||||
station.setObjectName(color_obj.upper())
|
||||
station.setAlignment(Qt.AlignHCenter | Qt.AlignTop)
|
||||
station.setFlat(False)
|
||||
station.setTitle(header)
|
||||
if header == "SH":
|
||||
|
||||
station.setTitle("BMA1 SH")
|
||||
else:
|
||||
station.setTitle(header)
|
||||
|
||||
beam_current = CAQLabel(self, pv_name=pv, show_units=True)
|
||||
beam_current.setFixedHeight(self.widget_height)
|
||||
if header == "MASTER":
|
||||
|
||||
Reference in New Issue
Block a user