Fix for driveable/driving generated code

This commit is contained in:
Douglas Clowes
2014-02-28 09:04:39 +11:00
parent 3abc6c9e60
commit 23c7b0f000

View File

@ -772,6 +772,11 @@ def put_write_function(MyDriver, func):
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
txt += [' return -code error "[sct geterror]"']
txt += [' }']
txt += [' if { [hpropexists [sct] driving] } {']
txt += [' if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } {']
txt += [' sct driving 1']
txt += [' }']
txt += [' }']
txt += [' debug_log 1 "%s sct send ${cmd}"' % func]
txt += [' sct send "${cmd}"']
txt += [' return ${nextState}']
@ -916,7 +921,7 @@ def put_checkstatus_function(MyDriver, func):
txt += ['# hook code ends']
txt += [' if {[sct driving]} {']
txt += [' set sp "[sct target]"']
txt += [' set pv "[hget ${tc_root}/[sct driveable]]"']
txt += [' set pv "[hval ${tc_root}/[sct driveable]]"']
txt += [' if { ${pv} > ${sp} - [sct tolerance] && ${pv} < ${sp} + [sct tolerance] } {']
txt += [' sct driving 0']
txt += [' return "idle"']