Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 97cdd17881 |
10
guiheader.py
10
guiheader.py
@@ -121,6 +121,16 @@ class GUIHeader(QWidget):
|
||||
grid_layout.setHorizontalSpacing(0)
|
||||
grid_layout.setContentsMargins(2, 9, 2, 0)
|
||||
|
||||
|
||||
if header == "UCN":
|
||||
beam_req_status = CAQLabel(
|
||||
self, pv_name="UCNQ:BEAMREQ:STATUS", prefix="BEAMREQ: ")
|
||||
beam_req_status.setFixedHeight(self.widget_height)
|
||||
beam_req_status.setFixedWidth(146)
|
||||
grid_layout.addWidget(beam_req_status, 1, 0, 1, 1, Qt.AlignCenter)
|
||||
self.extra_height += 25
|
||||
self.beam_current_wgt_dict["UCNQ"] = beam_req_status
|
||||
|
||||
station.setLayout(grid_layout)
|
||||
station.setFixedHeight(beam_current.height() + self.extra_height)
|
||||
station.setFixedWidth(beam_current.width() + 15)
|
||||
|
||||
@@ -9,25 +9,16 @@ from qtpy.QtWidgets import (QComboBox, QDialog, QFileDialog, QHBoxLayout,
|
||||
QVBoxLayout)
|
||||
|
||||
import elog # https://github.com/paulscherrerinstitute/py_elog
|
||||
from pyqtacc.bdbase.enumkind import MsgSeverity
|
||||
from apps4ops.bdbase.enumkind import MsgSeverity
|
||||
from apps4ops.bdbase.sendelogframe import QSendToELOGFrame
|
||||
from apps4ops.bdbase.utils import _line
|
||||
|
||||
from pyqtacc.bdbase.sendelogframe import QSendToELOGFrame
|
||||
|
||||
_version = "1.0.0"
|
||||
_pymodule = os.path.basename(__file__)
|
||||
_appname, _appext = _pymodule.split(".")
|
||||
_hostname = socket.gethostname().split(".")[0]
|
||||
|
||||
def _line():
|
||||
"""Macro to return the current line number.
|
||||
|
||||
The current line number within the file is used when
|
||||
reporting messages to the message logging window.
|
||||
|
||||
Returns:
|
||||
int: Current line number.
|
||||
"""
|
||||
return inspect.currentframe().f_back.f_lineno
|
||||
|
||||
class QSendToELOG(QSendToELOGFrame):
|
||||
""" Graphical interface to elog
|
||||
@@ -50,7 +41,7 @@ class QSendToELOG(QSendToELOGFrame):
|
||||
self.ort_idx = ortIdx
|
||||
self.effekt_idx = effektIdx
|
||||
|
||||
#print("indices", self.projekt_idx, self.eintrag_idx, self.system_idx, self.ort_idx, flush=True)
|
||||
|
||||
self.projekt = None
|
||||
self.eintrag = None
|
||||
self.system = None
|
||||
@@ -59,8 +50,6 @@ class QSendToELOG(QSendToELOGFrame):
|
||||
self.ort = None
|
||||
self.konsole = None
|
||||
|
||||
#print("LAYOUT ITEMS: ", self.layout_items)
|
||||
|
||||
self.sim_list = ["Sand", "test"]
|
||||
|
||||
self.initialize_layout(self.logbook)
|
||||
@@ -151,8 +140,6 @@ class QSendToELOG(QSendToELOGFrame):
|
||||
|
||||
def initialize_layout(self, logbook):
|
||||
|
||||
print("initialize_layout", self.layout_items, flush=True)
|
||||
|
||||
#Decide on layout
|
||||
self.create_layout_widgets()
|
||||
|
||||
@@ -254,10 +241,6 @@ class QSendToELOG(QSendToELOGFrame):
|
||||
#https://riverbankcomputing.com/pipermail/pyqt/2009-November/025214.html
|
||||
def on_elog_change(self, idx):
|
||||
|
||||
#print(self.elog_items.currentText(), "new=", idx)
|
||||
#print(self.elog_items.itemText(idx))
|
||||
#print(self.logbook)
|
||||
|
||||
new_logbook = self.elog_items.itemText(idx)
|
||||
|
||||
#Meet the new logbook. Same as the old logbook
|
||||
@@ -267,25 +250,6 @@ class QSendToELOG(QSendToELOGFrame):
|
||||
self.layout_items = self.get_logbook_specific_items(new_logbook)
|
||||
print("self.layout_items", self.layout_items)
|
||||
|
||||
'''
|
||||
#Acquire New Layout List
|
||||
new_items = self.get_logbook_specific_items(new_logbook)
|
||||
#Acquire Current Layout List
|
||||
old_items = self.get_logbook_specific_items(self.logbook)
|
||||
#Compare lists and remove Layouts that do not belong
|
||||
common_items = list(set(new_items) & set(old_items))
|
||||
print("common items", common_items)
|
||||
#remove common_items from old_items
|
||||
|
||||
#unwanted_items = [ele for ele in old_items if ele not in common_items]
|
||||
#print("unwamted items", unwanted_items)
|
||||
unwanted_items = [ele for ele in old_items if ele not in new_items]
|
||||
print("unwamted items", unwanted_items)
|
||||
|
||||
#Add Layouts that are new
|
||||
wanted_items = [ele for ele in new_items if ele not in old_items]
|
||||
print("wanted items", wanted_items)
|
||||
'''
|
||||
|
||||
if any(substring.upper() in new_logbook.upper() \
|
||||
for substring in self.sim_list):
|
||||
|
||||
Reference in New Issue
Block a user