43 lines
1.1 KiB
Tcl
43 lines
1.1 KiB
Tcl
#!/usr/bin/env tclsh
|
|
# TODO setup loopback devices for controllers.
|
|
|
|
# $Revision: 1.1 $
|
|
# $Date: 2006-10-12 23:06:05 $
|
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
|
# Last revision by $Author: ffr $
|
|
|
|
# Load troubleshooting setup
|
|
#source dmc2280_util.tcl
|
|
|
|
if { $argc > 0 } {
|
|
set configFileName [lindex $argv 0]
|
|
}
|
|
|
|
proc loadConfig {fName} {
|
|
global ContList
|
|
global IPtoContName;
|
|
|
|
if [info exists ContList] {unset ContList}
|
|
# Temporarily define unknown proc to skip undefined procs
|
|
rename ::unknown _unknown
|
|
proc ::unknown {args} {}
|
|
if [catch {uplevel #0 source $fName} errMsg] {
|
|
rename ::unknown ""
|
|
rename _unknown ::unknown
|
|
error $errMsg
|
|
} else {
|
|
rename ::unknown ""
|
|
rename _unknown ::unknown
|
|
}
|
|
if [catch {set ContList [uplevel #0 info vars dmc2280_controller*]} result] {error $result}
|
|
if {[llength $ContList] == 0} {error "Error: There are no dmc2280_controllerN(host/port) arrays in the $fName configuration file"}
|
|
#Add the controller to the sics_config namespace
|
|
foreach c $ContList {
|
|
upvar #0 $c cont;
|
|
set IPtoContName($cont(host)) $c;
|
|
puts "$c IP:port = $cont(host):$cont(port)";
|
|
}
|
|
}
|
|
|
|
|