Commits

Anonymous committed 67fa8c9 Draft

Wrapped devices access in multi-channel start/stop callback in try .. except.

  • Participants
  • Parent commits 87c80c2

Comments (0)

Files changed (1)

expresso_python_api/expresso/gui/expresso_gui.py

+from __future__ import print_function
 import re
 import os
 import sys
                 dev = self.devs['devices'][devId]
                 # Multi channel mode stop
                 if self.multiChannelState == 'rsp':
-                    dev.getLevels_Rsp()
-                    dev.setModeStopped()
+                    # ---------------------------------------------------------
+                    # DEBUG - wrap in try loop
+                    try:
+                        dev.getLevels_Rsp()
+                        dev.setModeStopped()
+                    except Exception, e:
+                        print('Error in multi-channel stop: {0}'.format(e)) 
+                    # ---------------------------------------------------------
             #---
             self.multiChannelStart.setText('Start')
             self.statusbar.showMessage('Connected, Mode = Stopped')
             # Multi channel mode start
             for devId in self.devs['devices']:
                 dev = self.devs['devices'][devId]
-                dev.setModeMultiChannel()
+                # -------------------------------------------------------------
+                # DEBUG - wrap in try loop
+                try:
+                    dev.setModeMultiChannel()
+                except Exception, e:
+                    print('Error in multi-channel start: {0}'.format(e))
+                # -------------------------------------------------------------
             #---
             self.deviceTab.setEnabled(False)
             self.singleChannelTab.setEnabled(False)