Changeset 14462
- Timestamp:
- 10/03/12 23:05:18 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/PyDimCtrl/ScriptsForPyDimCtrl.py
r14461 r14462 5 5 import numpy as np 6 6 import types 7 import sys 7 8 8 9 last_drive_kwargs = {} … … 11 12 bias_calibration = {} 12 13 13 report_length = None14 report_length = 0 14 15 15 16 def wait_nice(self, state_num, timeout=None): 17 global report_length 16 18 if not hasattr(self, 'stn'): 17 19 raise TypeError(self.name+' has no CMD called STATE') … … 25 27 time.sleep(0.1) 26 28 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() 32 35 report_length = len(report) 36 33 37 intermed = time.time() 34 38 35 39 if time.time() >= start+timeout: 36 print40 report_length=0 37 41 return False 38 print42 report_length=0 39 43 return True 40 44 … … 788 792 print '...waiting for DRIVE_CONTROL' 789 793 print ' to be in state 6: Armed' 790 794 drive_control.stop() 791 795 drive_control.wait(6) #Armed 792 796 print 'DRIVE: ARMED'
Note:
See TracChangeset
for help on using the changeset viewer.