Update non-templated drivers to log to ../log/ instead of /tmp/

This commit is contained in:
Douglas Clowes
2014-06-16 10:42:17 +10:00
parent 1010003d6c
commit fa3154bdcd
13 changed files with 35 additions and 35 deletions

View File

@ -8,7 +8,7 @@ namespace eval ::scobj::ls460 {
# /envcont/setpoint # /envcont/setpoint
# /envcont/sensor/value # /envcont/sensor/value
proc debug_log {args} { proc debug_log {args} {
set fd [open "/tmp/ls460.log" a] set fd [open "../log/ls460.log" a]
puts $fd "[clock format [clock seconds] -format "%T"] $args" puts $fd "[clock format [clock seconds] -format "%T"] $args"
close $fd close $fd
} }
@ -453,7 +453,7 @@ debug_log "Registering node $nodeName for write callback"
# @param port, the IP protocol port number of the device # @param port, the IP protocol port number of the device
# @param _tol (optional), this is the initial tolerance setting # @param _tol (optional), this is the initial tolerance setting
proc add_ls460 {name IP port terminator {_tol 5.0}} { proc add_ls460 {name IP port terminator {_tol 5.0}} {
set fd [open "/tmp/ls460.log" a] set fd [open "../log/ls460.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_ls460 std ${IP}:$port" puts $fd "makesctcontroller sct_ls460 std ${IP}:$port"
makesctcontroller sct_ls460 std ${IP}:$port $terminator makesctcontroller sct_ls460 std ${IP}:$port $terminator
@ -466,7 +466,7 @@ proc add_ls460 {name IP port terminator {_tol 5.0}} {
} }
puts stdout "file evaluation of sct_lakeshore_ls460.tcl" puts stdout "file evaluation of sct_lakeshore_ls460.tcl"
set fd [open "/tmp/ls460.log" w] set fd [open "../log/ls460.log" w]
puts $fd "file evaluation of sct_lakeshore_ls460.tcl" puts $fd "file evaluation of sct_lakeshore_ls460.tcl"
close $fd close $fd

View File

@ -11,7 +11,7 @@ namespace eval ::scobj::cybaman {
# /envcont/setpoint # /envcont/setpoint
# /envcont/sensor/value # /envcont/sensor/value
proc debug_log {args} { proc debug_log {args} {
set fd [open "/tmp/cybaman.log" a] set fd [open "../log/cybaman.log" a]
puts $fd "[clock format [clock seconds] -format "%T"] $args" puts $fd "[clock format [clock seconds] -format "%T"] $args"
close $fd close $fd
} }
@ -1122,7 +1122,7 @@ debug_log "Creating node $nodeName"
# @param IP, the IP address of the device, this can be a hostname, (eg ca1-kowari) # @param IP, the IP address of the device, this can be a hostname, (eg ca1-kowari)
# @param port, the IP protocol port number of the device (62944) # @param port, the IP protocol port number of the device (62944)
proc add_cybaman {name IP port terminator {_tol 1.0}} { proc add_cybaman {name IP port terminator {_tol 1.0}} {
set fd [open "/tmp/cybaman.log" a] set fd [open "../log/cybaman.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_cybaman std ${IP}:$port" puts $fd "makesctcontroller sct_cybaman std ${IP}:$port"
makesctcontroller sct_cybaman std ${IP}:$port $terminator makesctcontroller sct_cybaman std ${IP}:$port $terminator
@ -1133,7 +1133,7 @@ proc add_cybaman {name IP port terminator {_tol 1.0}} {
} }
puts stdout "file evaluation of sct_cybaman.tcl" puts stdout "file evaluation of sct_cybaman.tcl"
set fd [open "/tmp/cybaman.log" w] set fd [open "../log/cybaman.log" w]
puts $fd "file evaluation of sct_cybaman.tcl" puts $fd "file evaluation of sct_cybaman.tcl"
close $fd close $fd

View File

@ -19,7 +19,7 @@ namespace eval ::scobj::k2700 {
# /envcont/setpoint # /envcont/setpoint
# /envcont/sensor/value # /envcont/sensor/value
proc debug_log {args} { proc debug_log {args} {
set fd [open "/tmp/k2700.log" a] set fd [open "../log/k2700.log" a]
puts $fd "[clock format [clock seconds] -format "%T"] $args" puts $fd "[clock format [clock seconds] -format "%T"] $args"
close $fd close $fd
} }
@ -665,7 +665,7 @@ debug_log "Registering node $nodeName for write callback"
# @param IP, the IP address of the device, this can be a hostname, (eg ca1-kowari) # @param IP, the IP address of the device, this can be a hostname, (eg ca1-kowari)
# @param port, the IP protocol port number of the device # @param port, the IP protocol port number of the device
proc add_k2700 {name IP port terminator {_tol 1.0} {CID 1} {CTYPE V} } { proc add_k2700 {name IP port terminator {_tol 1.0} {CID 1} {CTYPE V} } {
set fd [open "/tmp/k2700.log" a] set fd [open "../log/k2700.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_k2700 std ${IP}:$port" puts $fd "makesctcontroller sct_k2700 std ${IP}:$port"
makesctcontroller sct_k2700 std ${IP}:$port $terminator makesctcontroller sct_k2700 std ${IP}:$port $terminator
@ -676,7 +676,7 @@ proc add_k2700 {name IP port terminator {_tol 1.0} {CID 1} {CTYPE V} } {
} }
puts stdout "file evaluation of sct_keithley_2700.tcl" puts stdout "file evaluation of sct_keithley_2700.tcl"
set fd [open "/tmp/k2700.log" w] set fd [open "../log/k2700.log" w]
puts $fd "file evaluation of sct_keithley_2700.tcl" puts $fd "file evaluation of sct_keithley_2700.tcl"
close $fd close $fd

View File

@ -8,7 +8,7 @@ namespace eval ::scobj::et2000 {
# /tempcont/setpoint # /tempcont/setpoint
# /tempcont/sensor/value # /tempcont/sensor/value
proc debug_log {args} { proc debug_log {args} {
set fd [open "/tmp/et2000.log" a] set fd [open "../log/et2000.log" a]
puts $fd $args puts $fd $args
close $fd close $fd
} }
@ -349,7 +349,7 @@ debug_log "halt $tc_root"
# @param port, the IP protocol port number of the device (502 for modbus) # @param port, the IP protocol port number of the device (502 for modbus)
# @param _tol (optional), this is the initial tolerance setting # @param _tol (optional), this is the initial tolerance setting
proc add_et2000 {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} { proc add_et2000 {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
set fd [open "/tmp/et2000.log" a] set fd [open "../log/et2000.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port" puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port"
makesctcontroller sct_${name} modbus ${IP}:$port makesctcontroller sct_${name} modbus ${IP}:$port
@ -362,7 +362,7 @@ proc add_et2000 {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
} }
puts stdout "file evaluation of sct_eurotherm_2000.tcl" puts stdout "file evaluation of sct_eurotherm_2000.tcl"
set fd [open "/tmp/et2000.log" w] set fd [open "../log/et2000.log" w]
puts $fd "file evaluation of sct_eurotherm_2000.tcl" puts $fd "file evaluation of sct_eurotherm_2000.tcl"
close $fd close $fd

View File

@ -781,7 +781,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
} }
proc mk_sct_driver {sct_controller klass name tol} { proc mk_sct_driver {sct_controller klass name tol} {
set [ns]::log_file "/tmp/[set [ns]::ven_dev]_${name}.log" set [ns]::log_file "../log/[set [ns]::ven_dev]_${name}.log"
debug_log 1 "mk_sct_driver $sct_controller $klass $name $tol" debug_log 1 "mk_sct_driver $sct_controller $klass $name $tol"
set catch_status [ catch { set catch_status [ catch {
@ -903,7 +903,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
###puts "[ns]::vendor [set [ns]::vendor]" ###puts "[ns]::vendor [set [ns]::vendor]"
###puts "[ns]::device [set [ns]::device]" ###puts "[ns]::device [set [ns]::device]"
###puts "[ns]::ven_dev [set [ns]::ven_dev]" ###puts "[ns]::ven_dev [set [ns]::ven_dev]"
set [ns]::log_file "/tmp/[set [ns]::ven_dev]_[set name].log" set [ns]::log_file "../log/[set [ns]::ven_dev]_[set name].log"
debug_log 1 "add_[set [ns]::vendor]_[set [ns]::device] ${name} ${IP} ${port} ${_tol}" debug_log 1 "add_[set [ns]::vendor]_[set [ns]::device] ${name} ${IP} ${port} ${_tol}"
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
debug_log 1 "makesctcontroller sct_ls370_${name} std ${IP}:${port}" debug_log 1 "makesctcontroller sct_ls370_${name} std ${IP}:${port}"

View File

@ -8,7 +8,7 @@ namespace eval ::scobj::itc500 {
# /tempcont/setpoint # /tempcont/setpoint
# /tempcont/sensor/value # /tempcont/sensor/value
proc debug_log {args} { proc debug_log {args} {
set fd [open "/tmp/itc500.log" a] set fd [open "../log/itc500.log" a]
puts $fd "[clock format [clock seconds] -format "%T"] $args" puts $fd "[clock format [clock seconds] -format "%T"] $args"
close $fd close $fd
} }
@ -525,7 +525,7 @@ debug_log "halt $tc_root"
# @param port, the IP protocol port number of the device # @param port, the IP protocol port number of the device
# @param _tol (optional), this is the initial tolerance setting # @param _tol (optional), this is the initial tolerance setting
proc add_itc500 {name IP port {_tol 5.0} {addr "@1"} } { proc add_itc500 {name IP port {_tol 5.0} {addr "@1"} } {
set fd [open "/tmp/itc500.log" a] set fd [open "../log/itc500.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_itc500 oxford ${IP}:$port \"\r\"" puts $fd "makesctcontroller sct_itc500 oxford ${IP}:$port \"\r\""
makesctcontroller sct_itc500 oxford ${IP}:$port "\r" makesctcontroller sct_itc500 oxford ${IP}:$port "\r"
@ -538,7 +538,7 @@ proc add_itc500 {name IP port {_tol 5.0} {addr "@1"} } {
} }
puts stdout "file evaluation of sct_oxford_500.tcl" puts stdout "file evaluation of sct_oxford_500.tcl"
set fd [open "/tmp/itc500.log" w] set fd [open "../log/itc500.log" w]
puts $fd "file evaluation of sct_oxford_500.tcl" puts $fd "file evaluation of sct_oxford_500.tcl"
close $fd close $fd

View File

@ -864,7 +864,7 @@ if {0} {
} }
proc add_[set vendor]_[set device] {the_name IP port CID CTYPE terminator {_tol 5.0}} { proc add_[set vendor]_[set device] {the_name IP port CID CTYPE terminator {_tol 5.0}} {
set [ns]::log_file "/tmp/[set [ns]::ven_dev]_[set the_name].log" set [ns]::log_file "../log/[set [ns]::ven_dev]_[set the_name].log"
set fd [open [set [ns]::log_file] "w"] set fd [open [set [ns]::log_file] "w"]
close $fd close $fd
debug_log 1 "add_[set [ns]::vendor]_[set [ns]::device] ${the_name} ${IP} ${port} ${_tol}" debug_log 1 "add_[set [ns]::vendor]_[set [ns]::device] ${the_name} ${IP} ${port} ${_tol}"

View File

@ -8,7 +8,7 @@ namespace eval ::scobj::qlink {
# /tempcont/setpoint # /tempcont/setpoint
# /tempcont/sensor/value # /tempcont/sensor/value
proc debug_log {args} { proc debug_log {args} {
set fd [open "/tmp/qlink.log" a] set fd [open "../log/qlink.log" a]
puts $fd $args puts $fd $args
close $fd close $fd
} }
@ -115,7 +115,7 @@ debug_log "rdValue new data for $tc_root [sct] result=$data"
# @param port, the IP protocol port number of the device # @param port, the IP protocol port number of the device
# @param _tol (optional), this is the initial tolerance setting # @param _tol (optional), this is the initial tolerance setting
proc add_qlink {name IP port {_tol 5.0}} { proc add_qlink {name IP port {_tol 5.0}} {
set fd [open "/tmp/qlink.log" a] set fd [open "../log/qlink.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_qlink std ${IP}:$port" puts $fd "makesctcontroller sct_qlink std ${IP}:$port"
makesctcontroller sct_qlink std ${IP}:$port makesctcontroller sct_qlink std ${IP}:$port
@ -126,7 +126,7 @@ proc add_qlink {name IP port {_tol 5.0}} {
} }
puts stdout "file evaluation of sct_qlink.tcl" puts stdout "file evaluation of sct_qlink.tcl"
set fd [open "/tmp/qlink.log" w] set fd [open "../log/qlink.log" w]
puts $fd "file evaluation of sct_qlink.tcl" puts $fd "file evaluation of sct_qlink.tcl"
close $fd close $fd

View File

@ -12,7 +12,7 @@ namespace eval ::scobj::newport_rva {
# /tempcont/setpoint # /tempcont/setpoint
# /tempcont/sensor/value # /tempcont/sensor/value
proc debug_log {args} { proc debug_log {args} {
set fd [open "/tmp/newport_rva.log" a] set fd [open "../log/newport_rva.log" a]
puts $fd "[clock format [clock seconds] -format "%T"] $args" puts $fd "[clock format [clock seconds] -format "%T"] $args"
close $fd close $fd
} }
@ -1071,7 +1071,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
# @param port, the IP protocol port number of the device (502 for modbus) # @param port, the IP protocol port number of the device (502 for modbus)
# @param _tol (optional), this is the initial tolerance setting # @param _tol (optional), this is the initial tolerance setting
proc add_newport_rva {name IP port {_tol 1.0}} { proc add_newport_rva {name IP port {_tol 1.0}} {
set fd [open "/tmp/newport_rva.log" a] set fd [open "../log/newport_rva.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_${name} newport ${IP}:$port" puts $fd "makesctcontroller sct_${name} newport ${IP}:$port"
makesctcontroller sct_${name} newport ${IP}:$port makesctcontroller sct_${name} newport ${IP}:$port
@ -1084,7 +1084,7 @@ mk_sct_newport_rva sct_${name} environment $name $_tol
} }
puts stdout "file evaluation of sct_newport_rva.tcl" puts stdout "file evaluation of sct_newport_rva.tcl"
set fd [open "/tmp/newport_rva.log" w] set fd [open "../log/newport_rva.log" w]
puts $fd "file evaluation of sct_newport_rva.tcl" puts $fd "file evaluation of sct_newport_rva.tcl"
close $fd close $fd

View File

@ -11,7 +11,7 @@ namespace eval ::scobj::watlow_pm {
# /tempcont/setpoint # /tempcont/setpoint
# /tempcont/sensor/value # /tempcont/sensor/value
proc debug_log {args} { proc debug_log {args} {
set fd [open "/tmp/watlow_pm.log" a] set fd [open "../log/watlow_pm.log" a]
puts $fd "[clock format [clock seconds] -format "%T"] $args" puts $fd "[clock format [clock seconds] -format "%T"] $args"
close $fd close $fd
} }
@ -523,7 +523,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
# @param port, the IP protocol port number of the device (502 for modbus) # @param port, the IP protocol port number of the device (502 for modbus)
# @param _tol (optional), this is the initial tolerance setting # @param _tol (optional), this is the initial tolerance setting
proc add_watlow_pm {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} { proc add_watlow_pm {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
set fd [open "/tmp/watlow_pm.log" a] set fd [open "../log/watlow_pm.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port" puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port"
makesctcontroller sct_${name} modbus ${IP}:$port makesctcontroller sct_${name} modbus ${IP}:$port
@ -536,7 +536,7 @@ proc add_watlow_pm {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
} }
puts stdout "file evaluation of sct_watlow_pm.tcl" puts stdout "file evaluation of sct_watlow_pm.tcl"
set fd [open "/tmp/watlow_pm.log" w] set fd [open "../log/watlow_pm.log" w]
puts $fd "file evaluation of sct_watlow_pm.tcl" puts $fd "file evaluation of sct_watlow_pm.tcl"
close $fd close $fd

View File

@ -11,7 +11,7 @@ namespace eval ::scobj::watlow_rm {
# /tempcont/setpoint # /tempcont/setpoint
# /tempcont/sensor/value # /tempcont/sensor/value
proc debug_log {args} { proc debug_log {args} {
set fd [open "/tmp/watlow_rm.log" a] set fd [open "../log/watlow_rm.log" a]
puts $fd "[clock format [clock seconds] -format "%T"] $args" puts $fd "[clock format [clock seconds] -format "%T"] $args"
close $fd close $fd
} }
@ -553,7 +553,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
# @param port, the IP protocol port number of the device (502 for modbus) # @param port, the IP protocol port number of the device (502 for modbus)
# @param _tol (optional), this is the initial tolerance setting # @param _tol (optional), this is the initial tolerance setting
proc add_watlow_rm {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} { proc add_watlow_rm {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
set fd [open "/tmp/watlow_rm.log" a] set fd [open "../log/watlow_rm.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port" puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port"
makesctcontroller sct_${name} modbus ${IP}:$port makesctcontroller sct_${name} modbus ${IP}:$port
@ -566,7 +566,7 @@ proc add_watlow_rm {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
} }
puts stdout "file evaluation of sct_watlow_rm.tcl" puts stdout "file evaluation of sct_watlow_rm.tcl"
set fd [open "/tmp/watlow_rm.log" w] set fd [open "../log/watlow_rm.log" w]
puts $fd "file evaluation of sct_watlow_rm.tcl" puts $fd "file evaluation of sct_watlow_rm.tcl"
close $fd close $fd

View File

@ -8,7 +8,7 @@ namespace eval ::scobj::watlow_st {
# /tempcont/setpoint # /tempcont/setpoint
# /tempcont/sensor/value # /tempcont/sensor/value
proc debug_log {args} { proc debug_log {args} {
set fd [open "/tmp/watlow_st.log" a] set fd [open "../log/watlow_st.log" a]
puts $fd "[clock format [clock seconds] -format "%T"] $args" puts $fd "[clock format [clock seconds] -format "%T"] $args"
close $fd close $fd
} }
@ -764,7 +764,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
# @param port, the IP protocol port number of the device (502 for modbus) # @param port, the IP protocol port number of the device (502 for modbus)
# @param _tol (optional), this is the initial tolerance setting # @param _tol (optional), this is the initial tolerance setting
proc add_watlow_st {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} { proc add_watlow_st {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
set fd [open "/tmp/watlow_st.log" a] set fd [open "../log/watlow_st.log" a]
if {[SplitReply [environment_simulation]]=="false"} { if {[SplitReply [environment_simulation]]=="false"} {
puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port" puts $fd "makesctcontroller sct_${name} modbus ${IP}:$port"
makesctcontroller sct_${name} modbus ${IP}:$port makesctcontroller sct_${name} modbus ${IP}:$port
@ -777,7 +777,7 @@ proc add_watlow_st {name IP port dev_id {_tol 5.0} {CID 1} {CTYPE T}} {
} }
puts stdout "file evaluation of sct_watlow_st4.tcl" puts stdout "file evaluation of sct_watlow_st4.tcl"
set fd [open "/tmp/watlow_st.log" w] set fd [open "../log/watlow_st.log" w]
puts $fd "file evaluation of sct_watlow_st4.tcl" puts $fd "file evaluation of sct_watlow_st4.tcl"
close $fd close $fd

View File

@ -244,7 +244,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
} }
proc mk_sct_driver {sct_controller klass name tol} { proc mk_sct_driver {sct_controller klass name tol} {
set [ns]::log_file "/tmp/[set [ns]::ven_dev]_${name}.log" set [ns]::log_file "../log/[set [ns]::ven_dev]_${name}.log"
debug_log 1 "mk_sct_driver $sct_controller $klass $name $tol" debug_log 1 "mk_sct_driver $sct_controller $klass $name $tol"
set catch_status [ catch { set catch_status [ catch {
@ -290,7 +290,7 @@ namespace eval ::scobj::[set vendor]_[set device] {
###puts "[ns]::vendor [set [ns]::vendor]" ###puts "[ns]::vendor [set [ns]::vendor]"
###puts "[ns]::device [set [ns]::device]" ###puts "[ns]::device [set [ns]::device]"
###puts "[ns]::ven_dev [set [ns]::ven_dev]" ###puts "[ns]::ven_dev [set [ns]::ven_dev]"
set [ns]::log_file "/tmp/[set [ns]::ven_dev]_[set name].log" set [ns]::log_file "../log/[set [ns]::ven_dev]_[set name].log"
set fd [open "[set [namespace current]::log_file]" "w" 0777] set fd [open "[set [namespace current]::log_file]" "w" 0777]
close $fd close $fd
debug_log 1 "add_[set [ns]::vendor]_[set [ns]::device] ${name} ${IP} ${port} ${_tol}" debug_log 1 "add_[set [ns]::vendor]_[set [ns]::device] ${name} ${IP} ${port} ${_tol}"