Changeset 14462


Ignore:
Timestamp:
10/03/12 23:05:18 (12 years ago)
Author:
neise
Message:
debugged some printing issues
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/PyDimCtrl/ScriptsForPyDimCtrl.py

    r14461 r14462  
    55import numpy as np
    66import types
     7import sys
    78
    89last_drive_kwargs = {}
     
    1112bias_calibration = {}
    1213
    13 report_length = None
     14report_length = 0
    1415
    1516def wait_nice(self, state_num, timeout=None):                           
     17  global report_length
    1618  if not hasattr(self, 'stn'):
    1719    raise TypeError(self.name+' has no CMD called STATE')
     
    2527    time.sleep(0.1)
    2628    if time.time() - intermed >= 1.:
    27       report = str(fad_control.events()[0]) + ' events @ ' +
    28                 str( ftm_control.trigger_rates()[3]) + ' Hz'
    29       if report_length:
    30         print '\b'*report_length,
    31       print report,
     29      report = str(fad_control.events()[0]) + ' events @ ' + str( ftm_control.trigger_rates()[3]) + ' Hz'
     30     
     31      sys.stdout.write('\r'+' '*report_length)
     32      sys.stdout.flush()
     33      sys.stdout.write('\r'+report)
     34      sys.stdout.flush()
    3235      report_length = len(report)
     36
    3337      intermed = time.time()
    3438   
    3539    if time.time() >= start+timeout:
    36       print
     40      report_length=0       
    3741      return False
    38   print
     42  report_length=0       
    3943  return True
    4044
     
    788792  print '...waiting for DRIVE_CONTROL'
    789793  print '   to be in state 6: Armed'
    790 
     794  drive_control.stop()
    791795  drive_control.wait(6) #Armed
    792796  print 'DRIVE: ARMED'
Note: See TracChangeset for help on using the changeset viewer.