Implement "settle_time" in generated drivers

This commit is contained in:
Douglas Clowes
2014-03-19 13:44:04 +11:00
parent 0581b2b8e1
commit 8964750835
3 changed files with 34 additions and 2 deletions

View File

@@ -967,10 +967,25 @@ def put_checkstatus_function(MyDriver, func):
txt += [' if {[sct driving]} {']
txt += [' set sp "[sct target]"']
txt += [' set pv "[hval ${tc_root}/[sct driveable]]"']
txt += [' if { ${pv} > ${sp} - [sct tolerance] && ${pv} < ${sp} + [sct tolerance] } {']
txt += [' if { abs(${pv} - ${sp}) <= [sct tolerance] } {']
txt += [' if { [hpropexists [sct] settle_time] } {']
txt += [' if { [hpropexists [sct] settle_time_start] } {']
txt += [' if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} {']
txt += [' sct driving 0']
txt += [' return "idle"']
txt += [' }']
txt += [' return "busy"']
txt += [' } else {']
txt += [' sct utime settle_time_start']
txt += [' return "busy"']
txt += [' }']
txt += [' }']
txt += [' sct driving 0']
txt += [' return "idle"']
txt += [' }']
txt += [' if { [hpropexists [sct] settle_time_start] } {']
txt += [' hdelprop [sct] settle_time_start']
txt += [' }']
txt += [' return "busy"']
txt += [' } else {']
txt += [' return "idle"']