Implement "settle_time" in generated drivers
This commit is contained in:
@@ -77,10 +77,25 @@ proc ::scobj::hiden_xcs::checkstatus {tc_root} {
|
||||
if {[sct driving]} {
|
||||
set sp "[sct target]"
|
||||
set pv "[hval ${tc_root}/[sct driveable]]"
|
||||
if { ${pv} > ${sp} - [sct tolerance] && ${pv} < ${sp} + [sct tolerance] } {
|
||||
if { abs(${pv} - ${sp}) <= [sct tolerance] } {
|
||||
if { [hpropexists [sct] settle_time] } {
|
||||
if { [hpropexists [sct] settle_time_start] } {
|
||||
if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} {
|
||||
sct driving 0
|
||||
return "idle"
|
||||
}
|
||||
return "busy"
|
||||
} else {
|
||||
sct utime settle_time_start
|
||||
return "busy"
|
||||
}
|
||||
}
|
||||
sct driving 0
|
||||
return "idle"
|
||||
}
|
||||
if { [hpropexists [sct] settle_time_start] } {
|
||||
hdelprop [sct] settle_time_start
|
||||
}
|
||||
return "busy"
|
||||
} else {
|
||||
return "idle"
|
||||
@@ -819,6 +834,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } {
|
||||
hsetprop ${scobj_hpath}/humidity pid_ivalue "0.1"
|
||||
hsetprop ${scobj_hpath}/humidity pid_pvalue "0.2"
|
||||
hsetprop ${scobj_hpath}/humidity sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/humidity settle_time "5.25"
|
||||
hsetprop ${scobj_hpath}/humidity type "drivable"
|
||||
hsetprop ${scobj_hpath}/humidity nxalias "${name}_humidity"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user