Implement "settle_time" in generated drivers
This commit is contained in:
@@ -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"']
|
||||
|
||||
Reference in New Issue
Block a user