Esempio n. 1
0
 def test_connectNone(self):
     t = CWCoreAPI()
     self.assertEqual(t.connectTarget, True)
     self.assertEqual(t.getTarget(), None)
     self.assertEqual(t.getScope(), None)
     self.assertEqual(t.capture1(), True)
     self.assertEqual(t.captureM(), True)
     sys.exit(self.app.exec_())
Esempio n. 2
0
 def test_connectNone(self):
     t = CWCoreAPI()
     self.assertEqual(t.connectTarget, True)
     self.assertEqual(t.getTarget(), None)
     self.assertEqual(t.getScope(), None)
     self.assertEqual(t.capture1(), True)
     self.assertEqual(t.captureM(), True)
     sys.exit(self.app.exec_())
Esempio n. 3
0
     Parameter.usePyQtGraph = True                               # Comment this line if you don't want to use the GUI
 api = CWCoreAPI()                                           # Instantiate the API
 
 if useGUI:
     app = cwc.makeApplication("Capture")                        # Change the name if you want a different settings scope
     gui = cwc.CWCaptureGUI(api)                                 # Comment this line if you don't want to use the GUI
 api.runScriptClass(UserScript)                              # Run the User Script (executes "run()" by default)
 
 #System should now be setup (assuming CW-Lite found). Do programming if hex-file specified, otherwise open GUI
 if useGUI:
     from PySide.QtGui import *
     for act in gui._ToolMenuItems:
         if act.text() == "CW-Lite XMEGA Programmer":
             act.activate(QAction.Trigger)
 else:   
     usb = api.getScope().scopetype.dev._cwusb
     _xmega = XMEGAPDI(usb)
     xmega = XMEGAProgrammer()
     xmega.setUSBInterface(_xmega)
     xmega.find()
     
     fname = sys.argv[1]
     print("Attempting to program %s to XMEGA"%fname)
     
     if os.path.isfile(fname):
         xmega.erase()
         xmega.program(fname)
     else:
         print("***** SPECIFIED FILE NOT FOUND ********")
         
     xmega.close()