Index: fact/tools/PyDimCtrl/pyfactctrl.py
===================================================================
--- fact/tools/PyDimCtrl/pyfactctrl.py	(revision 13814)
+++ fact/tools/PyDimCtrl/pyfactctrl.py	(revision 13818)
@@ -1,4 +1,6 @@
 #!/usr/bin/python -tti
 from factdimserver import *
+
+
 
 # List of Wobble Positions
@@ -33,7 +35,5 @@
 
             VoltageOn( mode='current' )
-            for i in range(4):
-                msg("Taking Data Run "+str(i+1)+" of 4")
-                TakeDataRun()
+            TakeData() #Ped | ExtLP | 4x Data
             VoltageOff()
 
@@ -223,4 +223,6 @@
         In all other cases, the method will perform the needed steps to switch
         on the bias voltage, the way the user requested
+        
+        raises NotImplementedError in case of 'feedback'
     """
     msg = MSG( verbose )
@@ -234,5 +236,6 @@
         fb_target = 10 #TempControl
     elif mode == 'feedback':
-        fb_target = 11 # FeedbackControl
+        #fb_target = 11 # FeedbackControl
+        raise NotImplementedError('The author of this script did not know how to start this mode')
     elif mode == 'current':
         fb_target = 12 #CurrentControl
@@ -242,19 +245,31 @@
     starttime = time.time()
     
-    while not ((bias.stn == bias_target) and (fb.stn == fb_target)):
+    long_enough = (time.time() - bias.last_st_change > 2) and (time.time() - fb.last_st_change > 2)
+    while not ((bias.stn == bias_target) and (fb.stn == fb_target) and long_enough):
+        
         if time.time() - starttime > timeout:
             msg.fail("VoltageOn did not succeed after "+str(timeout)+' seconds')
             return False
-            
+        
         elif fb.stn == fb_target-3: # everything fine, but output disabled
             fb.enable_output(1)
-            bias.set_global_dac(1)
+        
         
         elif fb.stn == fb_target and bias.stn == 5: # feedback ok, but we are Ramping
             # lets try to wait
             time.sleep(0.5)
+            
+        elif fb.stn == 6: #Connected
+            if mode == 'temperature':
+                fb.start_temp_control(0.0)
+            elif mode == 'current':
+                fb.start_current_control(0.0)
+            elif mode == 'feedback':
+                raise NotImplementedError('The author of this script did not know how to start this mode')
         
         elif bias.stn == 1: #Disconnected
             bias.reconnect()
+            # makes no sense to be quick in this case
+            time.sleep(2)
             
         elif bias.stn == 6: # Overcurrent
@@ -279,12 +294,32 @@
             # if nothing was done. sleep a while
             time.sleep(0.5)
-    
-    
+        
+        long_enough = (time.time() - bias.last_st_change > 2) and (time.time() - fb.last_st_change > 2)
  
-
-    msg("waiting 45sec...")    
-    time.sleep(45)
-    return True
-
+    
+    msg.ok("Voltage is On")
+    if mode == 'current':
+        msg("Waiting 45sec, so we get at least 3 current readings")
+        time.sleep(45)
+    
+    return True
+
+def VoltageOff( timeout = 10, verbose = True):
+    """ High Level Method for switching off the bias Voltage
+    """
+    msg = MSG( verbose )
+    bias = bias_control
+    
+    bias.set_zero_voltage()
+    
+    starttime = time.time()
+    while not bias.stn == 7: # VoltageOff
+        if time.time() - starttime > timeout:
+            msg.fail("VoltageOff did not succeed after "+str(timeout)+' seconds')
+            return False
+        time.sleep(1)
+
+    msg.ok("Voltage is Off")    
+    return True
 
 
@@ -305,5 +340,6 @@
 
 
-def IsReadyForDataTaking( verbose = True ):
+#==============================================================================
+def IsReadyForDataTaking( TrackingNeeded = True, verbose = True ):
     drive = drive_control
     bias = bias_control
@@ -315,9 +351,10 @@
 
     ok = True
-    if not drive.stn == 7:
-        msg.warn(drive.name + ':' + drive.sts + "  NOT ok")
-        ok = False
-    else:
-        msg.ok(drive.name + ':' + drive.sts + "      OK")
+    if TrackingNeeded:
+        if not drive.stn == 7:
+            msg.warn(drive.name + ':' + drive.sts + "  NOT ok")
+            ok = False
+        else:
+            msg.ok(drive.name + ':' + drive.sts + "      OK")
 
     if not feedback.stn == 12:
@@ -347,6 +384,6 @@
 def TakeDataRun( verbose = True ):
     fad = fad_control    
-    msg = MSG()
-    msg.output = verbose
+    msg = MSG(verbose)
+
     if not IsReadyForDataTaking( verbose=False ):
         msg.fail("System not Ready for DataTaking")
@@ -364,7 +401,7 @@
 
 def TakePedestalOnRun( verbose = True ):
-    msg = MSG()
-    msg.output = verbose
-    if not IsReadyForDataTaking( verbose=False ):
+    msg = MSG(verbose)
+
+    if not IsReadyForDataTaking( TrackingNeeded=False, verbose=False ):
         msg.fail("System not Ready for DataTaking")
         IsReadyForDataTaking( verbose=True )
@@ -381,7 +418,6 @@
     
 def TakeExtLpRun( verbose = True ):
-    msg = MSG()
-    msg.output = verbose
-    if not IsReadyForDataTaking( verbose=False ):
+    msg = MSG(verbose)
+    if not IsReadyForDataTaking( TrackingNeeded=False, verbose=False ):
         msg.fail("System not Ready for DataTaking")
         IsReadyForDataTaking( verbose=True )
@@ -398,6 +434,5 @@
 
 def TakeData( verbose = True):
-    msg = MSG()
-    msg.output = verbose
+    msg = MSG(verbose)
     TakePedestalOnRun()
     TakeExtLpRun()
@@ -696,20 +731,4 @@
 
 #==============================================================================
-# standard watchdog:
-def std_bias_watchdog( state, verbose=True ):
-    msg = MSG(verbose)
-    if state == 1: #Disconnected
-        msg.warn("BIAS just DISCONNECTED .. trying to reconnect")
-        msg.warn("current runnumber:"+fad_control.runnumber() )
-        bias.reconnect()
-        time.sleep(1)
-        bias.set_zero_voltage()
-        # TODO: This should work, but it is stupid.
-        bias.reset_over_current_status()
-        bias.reset_over_current_status()
-        bias.set_zero_voltage()
-        bias.reset_over_current_status()
-        bias.set_global_dac(1)
-
 # create introduction:
 class INTRO(object):
@@ -721,6 +740,4 @@
         print "welcome to PyDimCtrl V0.1:"
         print "--------------------------"
-        print "If the hardware is ON but not all the software is connected try:"
-        print "      Connect()"
         print "If all the programs are already up and running, you might want to"
         print "     TakeDrsAmplitudeCalibration(roi=1024) or "
@@ -736,16 +753,12 @@
         print "Switch off with:"
         print "     VoltageOff()"
+        print "In case you would like to simply take Data of a certain source try:"
+        print "     TakeFullSet(source = 'Crab')"
         print ""
-        print "In case you would like a Watchdog to check, if the Voltage is up"
-        print "and the BiasCrate is not disconnected, then try:"
-        print "     VoltageOn( mode='--see above--', Watchdog=True )"
-        print "PLEASE NOTE: The Watchdog will monitor the State of BIAS_CONTROL"
-        print "and in case of a connection loss, it will: "
-        print "     * print a warning"
-        print "     * issue a the RECONNECT command" 
-        print "     * issue SET_ZERO_VOLTAGE - since this is the only way to get referenced"
-        print "     * Ramp up again, using the same settings as before"
-        print "     * possible OverCurrent situation will be treated as usual"
-        print "The Watchdog will not react on any other state change, like OverCurrent or VoltageOff"
+        print "look at the 'source_list' to get an overview, of the "
+        print "current sources available:"
+        print "     pprint(source_list)"
+        print ""
+        print ""
         print ""
         print ""
