45 Commits

Author SHA1 Message Date
c0dd0c6038 QEventLoop has int argument not flopat 2024-02-29 17:01:07 +01:00
0f62863828 expt with font size 2024-02-29 16:05:08 +01:00
ab8534c62a expt with font size 2024-02-29 16:03:29 +01:00
9852226d3b expt with font size 2024-02-29 16:01:36 +01:00
434679d9ce expt with font size 2024-02-29 15:58:28 +01:00
f229ba2059 expt with font size 2024-02-29 15:51:16 +01:00
c06bc4f58e expt with font size 2024-02-29 15:48:27 +01:00
3e5255c55e expt with font size 2024-02-29 15:39:20 +01:00
8ae83b2ea6 expt with font size 2024-02-29 15:32:45 +01:00
49be032511 expt with font size 2024-02-29 15:29:56 +01:00
4b5f911c10 expt with font size 2024-02-29 15:19:42 +01:00
727b48e1c6 expt with font size 2024-02-29 15:08:16 +01:00
d997517dc1 expt with font size 2024-02-29 15:04:38 +01:00
68e8da943e expt with font size 2024-02-29 15:01:38 +01:00
bf08fbe488 expt with font size 2024-02-29 14:35:07 +01:00
f335663b55 expt with font size 2024-02-29 14:32:56 +01:00
9829be0bcd expt with font size 2024-02-29 14:30:24 +01:00
14400488a3 Font size to 8 CAQTextEntry 2024-02-29 14:13:32 +01:00
76528ed3c0 Font size to 8 CAQTextEntry 2024-02-29 14:12:03 +01:00
9beed3ff90 Font size to 12 CAQTextEntry 2024-02-29 13:13:11 +01:00
53a0f6495d Font size to 12 CAQTextEntry 2024-02-29 13:11:41 +01:00
fee2e64bb3 Font size to 16 CAQTextEntry 2024-02-29 13:10:22 +01:00
15394066ed Font size to 8 pixels for CAQTextEntry 2024-02-29 13:03:35 +01:00
0441a79305 Font size to 8 pixels for CAQTextEntry 2024-02-29 13:01:39 +01:00
2f0e9aefee Font size to 8 pixels for CAQTextEntry 2024-02-29 12:58:23 +01:00
d148f6777f Font size to 8 pixels for CAQTextEntry 2024-02-29 12:57:20 +01:00
c95afc03b5 Font size to 10 pixels for CAQTextEntry 2024-02-29 12:55:05 +01:00
a830a1a44b Font size to 10 pixels for CAQTextEntry 2024-02-29 12:53:23 +01:00
952cff5002 Font size from 11 to 10 for CAQTextEntry as for CAQLabel 2024-02-29 12:43:19 +01:00
681761ca40 cast to Qt.AlignmentFlag when setAlignment includeds an OR 2024-02-27 15:54:14 +01:00
20b6749ed4 added scale-factot to update_widget in CAQTableWidget 2024-01-30 10:11:46 +01:00
fa33a4479d Added precision to and modified CAQTextEdit 2023-08-21 15:40:32 +02:00
54b332f69d Reconnect btn to 11px 2023-07-27 09:51:46 +02:00
0ff5ca7b49 rm unwanted backup files 2023-07-17 14:37:52 +02:00
76a6f28136 update to caqtable 2023-07-17 14:31:01 +02:00
3c408ebcbd add standby functionality to table wgt 2023-06-01 12:14:26 +02:00
420f82563f fixed widget_update in CAQTableWidget as used in Configure Table PVs 2023-04-06 14:17:43 +02:00
b2ad43abb0 fixed widget_update in CAQTableWidget as used in Configure Table PVs 2023-04-06 14:11:50 +02:00
75dc1e5e51 removed prtint statements 2022-10-28 10:58:03 +02:00
d9167d044f Merge branch 'master' of gitlab.psi.ch:cafe/caqtwidgets 2022-10-14 13:48:47 +02:00
4c151a8cd0 sync git 2022-10-14 13:48:13 +02:00
7f1981aac7 fixed alarm colors in QTableWidget 2022-10-14 13:32:15 +02:00
d9f098582f Delete pvwidgets.py- 2022-09-15 08:15:54 +00:00
d865b9eba7 Delete pvgateway.py- 2022-09-15 08:15:46 +00:00
9b53c2d618 v1.3.0 2022-09-15 10:09:44 +02:00
5 changed files with 775 additions and 342 deletions

10
.gitignore vendored
View File

@@ -1,5 +1,7 @@
# Temporary editor files #
##########################
*~
*.-*
*.*:*
*.*-
*.*-*
*.-*
__pycache__
__pycache__/*.*

Binary file not shown.

Binary file not shown.

View File

@@ -96,6 +96,7 @@ class PVGateway(QWidget):
notify_unison: bool = False, precision: int = 0,
monitor_dbr_time: bool = False):
super().__init__()
if parent is None:
@@ -112,7 +113,7 @@ class PVGateway(QWidget):
1000 / self.notify_freq_hz
self.notify_unison = bool(notify_unison) and bool(self.notify_freq_hz)
self.parent = parent
self.settings = self.parent.settings
@@ -120,6 +121,8 @@ class PVGateway(QWidget):
self.color_mode = None
self.check_rtyp = False
if color_mode is not None:
if color_mode in (self.ACT_ON_BEAM,
self.NOT_ACT_ON_BEAM,
@@ -129,6 +132,10 @@ class PVGateway(QWidget):
self.color_mode_requested = self.color_mode
#if 'READ' in self.pv_name:
#print('color mode',self.pv_name, self.color_mode,
#self.color_mode_requested )
if monitor_callback is not None:
self.monitor_callback = monitor_callback
else:
@@ -143,9 +150,13 @@ class PVGateway(QWidget):
self.cafe = self.parent.cafe
self.cyca = self.parent.cyca
self.url_archiver = None
self.url_databuffer = None
if self.parent.settings is not None:
self.url_archiver = self.parent.settings.data["url"]["archiver"]
self.url_databuffer = self.parent.settings.data["url"]["databuffer"]
if "databuffer" in self.parent.settings.data["url"]:
self.url_databuffer = self.parent.settings.data["url"]["databuffer"]
self.bg_readback = self.parent.settings.data["StyleGuide"][
"bgReadback"]
self.fg_alarm_major = self.parent.settings.data["StyleGuide"][
@@ -158,10 +169,10 @@ class PVGateway(QWidget):
"fgAlarmNoAlarm"]
else:
#self.settings = ReadJSON(self.parent.appname)
self.url_archiver = ("https://ui-data-api.psi.ch/prepare?channel=" +
self.url_archiver = ("https://data-ui.psi.ch/preselect?c1=" +
"sf-archiverappliance/")
self.url_databuffer \
= "https://ui-data-api.psi.ch/prepare?channel=sf-databuffer/"
= "https://data-ui.psi.ch/preselect?c1=sf-databuffer/"
self.daq_group_name = self._DAQ_CAFE_SG_NAME
self.desc = None
@@ -176,6 +187,7 @@ class PVGateway(QWidget):
self.monitor_id = None
self.monitor_dbr_time = monitor_dbr_time
self.mutex_post_display = QMutex()
self.mutex = QMutex()
self.precision_user = precision
self.has_precision_user = bool(precision)
@@ -266,23 +278,20 @@ class PVGateway(QWidget):
action1 = QAction("Text Info", self)
action1.triggered.connect(self.pv_status_text)
self.context_menu.addAction(action1)
action2 = QAction("Lookup in Archiver", self)
action2.triggered.connect(self.lookup_archiver)
action3 = QAction("Lookup in Databuffer", self)
action3.triggered.connect(self.lookup_databuffer)
self.context_menu.addAction(action2)
if self.url_databuffer is not None:
action3 = QAction("Lookup in Databuffer", self)
action3.triggered.connect(self.lookup_databuffer)
self.context_menu.addAction(action3)
action4 = QAction("Strip Chart (PShell)", self)
action4.triggered.connect(self.strip_chart)
self.context_menu.addAction(action4)
action6 = QAction("Configure Display Parameters", self)
action6.triggered.connect(self.display_parameters)
self.context_menu.addAction(action1)
self.context_menu.addAction(action2)
self.context_menu.addAction(action3)
self.context_menu.addAction(action4)
action5 = QAction("Reconnect: {0}".format(self.pv_name), self)
action5.triggered.connect(self.reconnect_channel)
@@ -307,8 +316,11 @@ class PVGateway(QWidget):
self.pv_message_in_a_box.setDefaultButton(QMessageBox.Close)
self.initialize()
#return self - previously used by pvgateway
#The __init__ method of a class is used to initialize new objects,
#not create them. As such, it should not return any value.
return #self # used by pvgateway in CAQStripChart
def initialize(self):
@@ -376,7 +388,7 @@ class PVGateway(QWidget):
if self.pv_info is None:
self.pv_info = self.cafe.getChannelInfo(self.pv_name)
if "Not Supported" in self.pv_info.className:
if "Not Supported" in self.pv_info.className and self.check_rtyp:
_rtype = self.cafe.get(self.pv_name.split(".")[0] + ".RTYP")
self.record_type = _rtype if _rtype is not None else \
self.pv_info.className
@@ -409,8 +421,9 @@ class PVGateway(QWidget):
_max_control_abs = 0
if self.pv_ctrl is not None:
_lower_control_abs = abs(int(self.pv_ctrl.lowerControlLimit))
_upper_control_abs = abs(int(self.pv_ctrl.upperControlLimit))
#DisplayLimit preferred over ControlLimit as latter n/a for ao
_lower_control_abs = abs(int(self.pv_ctrl.lowerDisplayLimit))
_upper_control_abs = abs(int(self.pv_ctrl.upperDisplayLimit))
_max_control_abs = max(_lower_control_abs, _upper_control_abs)
if _max_control_abs is None:
_max_control_abs = 0
@@ -485,7 +498,7 @@ class PVGateway(QWidget):
time.sleep(0.01)
self.initialize_meta_data()
icount += 1
if icount > 50:
if icount > 5: #50
return False
return True
@@ -574,7 +587,7 @@ class PVGateway(QWidget):
self.pv_ctrl = self.cafe.getCtrlCache(self.handle)
self.pv_info = self.cafe.getChannelInfo(self.handle)
if self.pv_info is not None and self.record_type is None:
if "Not Supported" in self.pv_info.className:
if "Not Supported" in self.pv_info.className and self.check_rtyp:
_rtype = self.cafe.get(self.pv_name.split(".")[0] + ".RTYP")
self.record_type = _rtype if _rtype is not None else \
self.pv_info.className
@@ -621,7 +634,7 @@ class PVGateway(QWidget):
DAQ may be in BS mode, but channels within DAQ stream that
are not BS enabled will be flagged as CA Mode, i.e., CARead
'''
_current_qt_dynamic_property = self.qt_dynamic_property_get()
alarm_severity = daq_pvd.alarmSeverity
@@ -695,7 +708,7 @@ class PVGateway(QWidget):
def receive_monitor_dbr_time(self, pvdata, alarm_severity):
print("called from gateway", self.pv_name, alarm_severity)
print("called from gateway", self.pv_name, alarm_severity, flush=True)
pvdata.show()
def receive_monitor_update(self, value, status, alarm_severity):
@@ -752,6 +765,8 @@ class PVGateway(QWidget):
'''Callback function to be invoked on change of pv value.
cafe.getCache and cafe.set operations permitted within callback.
'''
self.mutex.lock()
pv_name = pvname
pvd = pvdata
@@ -783,8 +798,8 @@ class PVGateway(QWidget):
else:
self.trigger_monitor_float.emit(float(pvd.value[0]), pvd.status,
_alarm_severity)
self.mutex.unlock()
def monitor_start(self):
'''Initiate monitor on pv.'''
if self.handle > 0:
@@ -940,6 +955,8 @@ class PVGateway(QWidget):
elif self.qt_object_name == self.PV_DAQ_BS:
self.color_mode = self.READBACK_STATIC
#if 'READ' in self.pv_name:
# print('color mode',self.pv_name, self.color_mode)
self._qt_dynamic_property_set(self.color_mode)
else:
@@ -983,7 +1000,6 @@ class PVGateway(QWidget):
self._qt_readback_color_mode()
#self.setStatusTip(self.status_tip)
elif self.qt_object_name == self.PV_CONTROLLER:
if self.color_mode == self.ACT_ON_BEAM:
#self.setStatusTip("PV setting acts directly on beam")
@@ -992,7 +1008,6 @@ class PVGateway(QWidget):
self.color_mode = self.NOT_ACT_ON_BEAM
#self.setStatusTip("PV setting does not influence beam")
#self._qt_property_selected =
self._qt_dynamic_property_set(self.color_mode)
@@ -1330,7 +1345,7 @@ class PVGateway(QWidget):
if self.pv_info is None:
self.pv_info = self.cafe.getChannelInfo(self.handle)
if self.pv_info is not None and self.record_type is None:
if "Not Supported" in self.pv_info.className:
if "Not Supported" in self.pv_info.className and self.check_rtyp:
_rtype = self.cafe.get(self.pv_name.split(".")[0] + ".RTYP")
self.record_type = _rtype if _rtype is not None else \
self.pv_info.className
@@ -1374,7 +1389,7 @@ class PVGateway(QWidget):
if self.pv_info is None:
self.pv_info = self.cafe.getChannelInfo(self.handle)
if self.pv_info is not None and self.record_type is None:
if "Not Supported" in self.pv_info.className:
if "Not Supported" in self.pv_info.className and self.check_rtyp:
_rtype = self.cafe.get(self.pv_name.split(".")[0] + ".RTYP")
self.record_type = _rtype if _rtype is not None else \
self.pv_info.className
@@ -1479,8 +1494,7 @@ class PVGateway(QWidget):
self.pv_status_text_display_limits())
self.pv_message_in_a_box.setText(
self.pv_status_text_header(source=_source) + _text_data
)
self.pv_status_text_header(source=_source) + _text_data)
QApplication.processEvents()
self.pv_message_in_a_box.exec()

File diff suppressed because it is too large Load Diff