(generalvclamp.py) error checking in slope command
authordevicerandom <devnull@localhost>
Mon, 2 Mar 2009 13:36:42 +0000 (13:36 +0000)
committerdevicerandom <devnull@localhost>
Mon, 2 Mar 2009 13:36:42 +0000 (13:36 +0000)
generalvclamp.py

index b7c9ed03cbc2e9c915e53748d7fbf460d84b53e3..f4351d0b504b31c7ce991ca93154d2557c730a14 100644 (file)
@@ -228,7 +228,11 @@ class generalvclampCommands:
         
         # Calls the function linefit_between
         parameters=[0,0,[],[]]
-        parameters=self.linefit_between(clickedpoints[0],clickedpoints[1])
+        try:
+            parameters=self.linefit_between(clickedpoints[0],clickedpoints[1])
+        except:
+            print 'Cannot fit. Did you click twice the same point?'
+            return
           
         # Outputs the relevant slope parameter
         print 'Slope:'