cleaner app starting, new application settings class

This commit is contained in:
2022-07-20 17:52:55 +02:00
parent 4a6db36805
commit 569ce8a78d
8 changed files with 224 additions and 176 deletions

View File

@@ -341,6 +341,15 @@ if __name__ == "__main__":
exit(0)
n += 1
else:
def closeEvent(cam,evt):
print(args)
try:
pv=cam._pv['pic']
pv.clear_auto_monitor() # disconnect PV monitor callback -> program exit faster.
except AttributeError:
_log.warning('disconnect PV callback failed.')
class UIcamera(epics_cam):
def __init__(self, prefix="ESB-MX-CAM"):
@@ -446,7 +455,7 @@ if __name__ == "__main__":
## Display the data and assign each frame a time value from 1.0 to 3.0
cam = UIcamera(prefix=args.prefix)
win.closeEvent=lambda x:closeEvent(cam, x)
#cam.set_binning(4,4)
#cam.run()
@@ -470,3 +479,4 @@ if __name__ == "__main__":
## Start Qt event loop unless running in interactive mode.
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()