Copied in-situ modifications from ics1-quokka.

This commit is contained in:
Ferdi Franceschini
2013-02-20 18:19:44 +11:00
parent b5b4d7a747
commit e7a478489e
17 changed files with 299 additions and 78 deletions

View File

@@ -8,7 +8,7 @@ namespace eval ::scobj::ips120 {
# /envcont/setpoint
# /envcont/sensor/value
proc debug_log {args} {
set fd [open "/tmp/ips120.log" a]
set fd [open "../log/ips120.log" a]
puts $fd "[clock format [clock seconds] -format "%T"] $args"
close $fd
}
@@ -94,9 +94,9 @@ debug_log "setPoint new data for $tc_root [sct] result=$par"
hset $tc_root/status "busy"
sct print "status: busy"
hset $tc_root/drive_state "START"
hsetprop $tc_root/setpoint driving 1
} catch_message ]
if {$catch_status != 0} {
hsetprop $tc_root/setpoint driving 0
return -code error $catch_message
}
sct print "setPoint: [hget $tc_root/drive_state]"
@@ -455,8 +455,7 @@ debug_log "rdState $tc_root error scan status = $rslt on $my_status"
set setpoint [sct target]
set lolimit [hval $tc_root/lowerlimit]
set hilimit [hval $tc_root/upperlimit]
if {$setpoint < $lolimit || $setpoint > $hilimit} {
sct driving 0
if {$setpoint <= $lolimit || $setpoint => $hilimit} {
error "setpoint violates limits"
}
return OK
@@ -646,8 +645,8 @@ debug_log "Registering node $nodeName for write callback"
createNode $scobj_hpath $sct_controller $cmdGroup $varName $readable $writable $drivable $dataType $permission $rdCmd $rdFunc $wrCmd $wrFunc $allowedValues $klass
}
hsetprop $scobj_hpath/sensor/value lowerlimit -12
hsetprop $scobj_hpath/sensor/value upperlimit 12
hsetprop $scobj_hpath/sensor/value lowerlimit -10
hsetprop $scobj_hpath/sensor/value upperlimit 10
hsetprop $scobj_hpath/sensor/value units "T"
hfactory $scobj_hpath/apply_tolerance plain user int
@@ -745,7 +744,7 @@ debug_log "Registering node $nodeName for write callback"
# @param port, the IP protocol port number of the device
# @param _tol (optional), this is the initial tolerance setting
proc add_ips120 {name IP port {_tol 5.0}} {
set fd [open "/tmp/ips120.log" a]
set fd [open "../log/ips120.log" a]
if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_ips120 oxford ${IP}:$port"
makesctcontroller sct_ips120 oxford ${IP}:$port
@@ -758,7 +757,7 @@ proc add_ips120 {name IP port {_tol 5.0}} {
}
puts stdout "file evaluation of sct_oxford_ips.tcl"
set fd [open "/tmp/ips120.log" w]
set fd [open "../log/ips120.log" w]
puts $fd "file evaluation of sct_oxford_ips.tcl"
close $fd