cleaner app starting, new application settings class
This commit is contained in:
12
camera.py
12
camera.py
@@ -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_()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user