code cleanup
r2960 | dcl | 2010-06-25 15:06:37 +1000 (Fri, 25 Jun 2010) | 2 lines
This commit is contained in:
@@ -20,10 +20,10 @@ namespace eval ::scobj::lh45 {
|
||||
proc setPoint {tc_root nextState cmd} {
|
||||
set par [sct target]
|
||||
|
||||
if [hval $tc_root/apply_tolerance] {
|
||||
if {[hval $tc_root/apply_tolerance]} {
|
||||
set tol [hval $tc_root/tolerance]
|
||||
hset $tc_root/subtemp_warnlimit [expr $par - $tol]
|
||||
hset $tc_root/overtemp_warnlimit [expr $par + $tol]
|
||||
hset $tc_root/subtemp_warnlimit [expr {$par - $tol}]
|
||||
hset $tc_root/overtemp_warnlimit [expr {$par + $tol}]
|
||||
}
|
||||
hset $tc_root/power 1
|
||||
hset $tc_root/status "busy"
|
||||
@@ -84,7 +84,7 @@ namespace eval ::scobj::lh45 {
|
||||
if {$intol==0} { sct utime timecheck }
|
||||
set setpt [hval $tc_root/setpoint]
|
||||
set temp [hval $tc_root/sensor/value]
|
||||
if {[expr abs($setpt - $temp)] > 0.2} {
|
||||
if { abs($setpt - $temp) > 0.2} {
|
||||
hset $tc_root/emon/monmode "drive"
|
||||
hset $tc_root/status "busy"
|
||||
} else {
|
||||
@@ -104,11 +104,11 @@ namespace eval ::scobj::lh45 {
|
||||
|
||||
proc getState {tc_root nextState cmd} {
|
||||
# Apply tolerance
|
||||
if [hval $tc_root/apply_tolerance] {
|
||||
if {[hval $tc_root/apply_tolerance]} {
|
||||
set tol [hval $tc_root/tolerance]
|
||||
set setpt [hval $tc_root/setpoint]
|
||||
hset $tc_root/subtemp_warnlimit [expr $setpt - $tol]
|
||||
hset $tc_root/overtemp_warnlimit [expr $setpt + $tol]
|
||||
hset $tc_root/subtemp_warnlimit [expr {$setpt - $tol}]
|
||||
hset $tc_root/overtemp_warnlimit [expr {$setpt + $tol}]
|
||||
}
|
||||
sct send $cmd
|
||||
return $nextState
|
||||
@@ -123,7 +123,7 @@ namespace eval ::scobj::lh45 {
|
||||
return 0
|
||||
} else {
|
||||
set timeout [hval $tc_root/tolerance/settletime]
|
||||
if {[expr $currtime - $timecheck] > $timeout} {
|
||||
if { ($currtime - $timecheck) > $timeout} {
|
||||
hset $tc_root/emon/isintol 1
|
||||
}
|
||||
return 1
|
||||
@@ -184,7 +184,7 @@ namespace eval ::scobj::lh45 {
|
||||
# NOTE: The drive adapter initially sets the writestatus to "start" and will
|
||||
# only call this when writestatus!="start"
|
||||
proc drivestatus {tc_root} {
|
||||
if [sct driving] {
|
||||
if {[sct driving]} {
|
||||
return busy
|
||||
} else {
|
||||
return idle
|
||||
@@ -198,7 +198,7 @@ namespace eval ::scobj::lh45 {
|
||||
}
|
||||
|
||||
proc mk_sct_julabo_lh45 {sct_controller klass tempobj tol} {
|
||||
if [ catch {
|
||||
if {[ catch {
|
||||
set ns ::scobj::lh45
|
||||
|
||||
MakeSICSObj $tempobj SCT_OBJECT
|
||||
@@ -332,7 +332,7 @@ namespace eval ::scobj::lh45 {
|
||||
if {[SplitReply [environment_simulation]]=="false"} {
|
||||
ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/setpoint $scobj_hpath/sensor/value $sct_controller
|
||||
}
|
||||
} message ] {
|
||||
} message ]} {
|
||||
return -code error $message
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user