@@ -0,0 +1,942 @@
+# -*- coding: utf-8 -*-%0Afrom lib.DeviceManager import *%0Aimport lib.DataManager as DataManager%0Aimport os, sys%0Afrom numpy import *%0Afrom PyQt4 import QtGui%0A%0A%0A%0Aconfig = 'config/default.cfg'%0Aif len(sys.argv) %3E 1:%0A    config = sys.argv%5B1%5D%0Aconfig = os.path.abspath(config)%0A%0Adm = DeviceManager(config)%0Adatam = DataManager.createDataHandler('junk/data')%0A%0Aprint %22Loading patch module..%22%0Aqtcam = dm.loadModule(module='Patch', name='Patch0', config=%7B'clampDev': 'Clamp0'%7D)%0A%0A## If running interactively, just return to the prompt and let python call the qt event loop for us.%0A## Otherwise, we need to run it ourselves:%0Aprint %22Checking to see if we should start the Qt event loop%22%0Aif not sys.stdin.isatty():%0A    print %22  .. starting the Qt event loop.%22%0A    app.exec_()%0Aelse:%0A    print %22Exiting script, hopefully entering interactive mode..%22%0A%0A## isatty is broken for cygwin shell. This should not be needed for regular windows shell..%0Aapp.exec_()%0A%0Adm.quit()

test script for PAtch module