Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b66a8657d9 | |||
| e4213dfaee | |||
| 13fa5c0f2e |
@@ -584,6 +584,7 @@ class PVGateway(QWidget):
|
||||
|
||||
if status == self.cyca.ICAFE_CS_CONN:
|
||||
self.initialize_connect = True
|
||||
time.sleep(0.01)
|
||||
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:
|
||||
|
||||
22
pvwidgets.py
22
pvwidgets.py
@@ -163,13 +163,17 @@ class CAQLabel(QLabel, PVGateway):
|
||||
def __init__(self, parent=None, pv_name: str = "", monitor_callback=None,
|
||||
pv_within_daq_group: bool = False, color_mode=None,
|
||||
show_units: bool = False, prefix: str = "", suffix: str = "",
|
||||
notify_freq_hz: int = 0, precision: int = 0):
|
||||
notify_freq_hz: int = 0, precision: int = 0,
|
||||
scale_factor: float = 1):
|
||||
|
||||
super().__init__(parent, pv_name, monitor_callback, pv_within_daq_group,
|
||||
color_mode, show_units, prefix, suffix,
|
||||
connect_callback=self.py_connect_callback,
|
||||
notify_freq_hz=notify_freq_hz, precision=precision)
|
||||
|
||||
|
||||
self.scale_factor = scale_factor
|
||||
|
||||
self.is_initialize_complete()
|
||||
|
||||
self.configure_widget()
|
||||
@@ -185,12 +189,16 @@ class CAQLabel(QLabel, PVGateway):
|
||||
|
||||
@Slot(object, str, int)
|
||||
def receive_daq_update(self, daq_pvd, daq_mode, daq_state):
|
||||
if self.scale_factor != 1:
|
||||
daq_pvd.value[0] = daq_pvd.value[0] * self.scale_factor
|
||||
PVGateway.receive_daq_update(self, daq_pvd, daq_mode, daq_state)
|
||||
|
||||
@Slot(str, int, int)
|
||||
@Slot(int, int, int)
|
||||
@Slot(float, int, int)
|
||||
def receive_monitor_update(self, value, status, alarm_severity):
|
||||
if self.scale_factor != 1:
|
||||
value = value * self.scale_factor
|
||||
PVGateway.receive_monitor_update(self, value, status, alarm_severity)
|
||||
|
||||
@Slot(int, str, int)
|
||||
@@ -279,8 +287,8 @@ class CAQMenu(QComboBox, PVGateway):
|
||||
|
||||
_width_scaling_factor = 1.1
|
||||
|
||||
self.setFixedHeight(fm.lineSpacing()*1.8)
|
||||
self.setFixedWidth((qrect.width()+40) * _width_scaling_factor)
|
||||
self.setFixedHeight(round(fm.lineSpacing()*1.8))
|
||||
self.setFixedWidth(round((qrect.width()+40) * _width_scaling_factor))
|
||||
|
||||
self.qt_property_initial_values(qt_object_name=self.PV_CONTROLLER)
|
||||
|
||||
@@ -468,8 +476,8 @@ class CAQMessageButton(QPushButton, PVGateway):
|
||||
_width_scaling_factor = 1.0
|
||||
|
||||
self.setText(self.msg_label)
|
||||
self.setFixedHeight(int(fm.lineSpacing()*1.8))
|
||||
self.setFixedWidth(int(qrect.width() * _width_scaling_factor))
|
||||
self.setFixedHeight(round(fm.lineSpacing()*1.8))
|
||||
self.setFixedWidth(round(qrect.width() * _width_scaling_factor))
|
||||
|
||||
self.qt_property_initial_values(qt_object_name=self.PV_CONTROLLER)
|
||||
|
||||
@@ -597,8 +605,8 @@ class CAQTextEntry(QLineEdit, PVGateway):
|
||||
qrect = fm.boundingRect(self.suggested_text)
|
||||
_width_scaling_factor = 1.2
|
||||
|
||||
self.setFixedHeight(int(fm.lineSpacing()*1.8))
|
||||
self.setFixedWidth(int(qrect.width()+20 * _width_scaling_factor))
|
||||
self.setFixedHeight(round(fm.lineSpacing()*1.8))
|
||||
self.setFixedWidth(round(qrect.width()+20 * _width_scaling_factor))
|
||||
|
||||
self.qt_property_initial_values(qt_object_name=self.PV_CONTROLLER)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user