Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@pyqtSlot(tuple)
def recv_enums(self, enums):
"""
Get enum strings signal
:param enums: enum strings
:type enums: tuple of str
"""
self.enums = enums
self.enums_updated_signal.emit()
@pyqtSlot(int)
def recv_sevr(self, sevr):
"""
Get alarm state signal
:param sevr: alarm state
:type sevr: int
"""
self.sevr = sevr
self.sevr_updated_signal.emit()
@pyqtSlot(float)
@pyqtSlot(str)
def send_value(self, value):
"""
Send desired value to plugin slot.
:param value: value to send
:type value: int, float, or str
"""
self.send_value_signal[type(value)].emit(value)
@pyqtSlot(int)
def alarmSeverityChanged(self, new_alarm_severity):
if new_alarm_severity == 0:
self.no_alarm_signal.emit()
elif new_alarm_severity == 1:
self.minor_alarm_signal.emit()
elif new_alarm_severity == 2:
self.major_alarm_signal.emit()
elif new_alarm_severity == 3:
self.invalid_alarm_signal.emit()
@pyqtSlot(bool)
def connectionStateChanged(self, connected):
if connected:
self.connected_signal.emit()
else:
self.disconnected_signal.emit()
@pyqtSlot()
def edit_curves(self):
edit_curves_dialog = WaveformPlotCurveEditorDialog(self.waveform_plot)
edit_curves_dialog.exec_()
@pyqtSlot()
def move_motors(self):
if self.moving:
return
self.moving = True
self.ui.pushButton.setEnabled(False)
self.display_manager_window.statusBar().showMessage("Moving motors...")
self.motor1pv.put(self.m1des)
self.motor2pv.put(self.m2des)
self.motor3pv.put(self.m3des)
waiting = True
while waiting:
time.sleep(0.001)
waiting = not all([pv.put_complete for pv in self.motor_pvs])
self.display_manager_window.statusBar().showMessage("Motor move complete.", 2000)
@pyqtSlot(np.ndarray)
def put_waveform(self, value):
"""
This is a deprecated function kept temporarily for compatibility
with old code.
:param value: The waveform value we'd like to put to our attr.
:type value: np.ndarray
"""
self.put_value(value)
@pyqtSlot()
def edit_curves(self):
edit_curves_dialog = TimePlotCurveEditorDialog(self.time_plot)
edit_curves_dialog.exec_()
@pyqtSlot(str)
@pyqtSlot(np.ndarray)
def put_value(self, value):
"""
Set our object attribute's value. If the attribute is a function,
we will execute it.
:param value: The value we'd like to set in our object.
:type value: int, float, str, or np.ndarray.
"""
# Field: replace value
if self.nargs is None:
try:
setattr(obj, self.attr, value)
except:
return
# Function of zero arguments: call function