diff --git a/site_ansto/instrument/config/environment/sct_cybaman.tcl b/site_ansto/instrument/config/environment/sct_cybaman.tcl index 787d52df..61b88d9d 100644 --- a/site_ansto/instrument/config/environment/sct_cybaman.tcl +++ b/site_ansto/instrument/config/environment/sct_cybaman.tcl @@ -16,26 +16,6 @@ namespace eval ::scobj::cybaman { close $fd } - proc basename {node} { - set point [string last "/" $node] - if { $point < 0 } { - return $node - } else { - incr point - return "[string range $node $point end]" - } - } - proc pathname {node} { - set point [string last "/" $node] - if { $point < 0 } { - return "" - } else { - incr point -1 - return "[string range $node 0 $point]" - } - return "[join [lrange [split $node '/'] 0 end-1] '/']" - } - proc splitxml {str} { set my_list [list] set idx 0 diff --git a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl index 7a467b41..8f0be9db 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_lakeshore_370.tcl @@ -74,25 +74,6 @@ namespace eval ::scobj::[set vendor]_[set device] { debug_log 1 "Extract channel $result from argument $arg" return $result } - proc basename {node} { - set point [string last "/" $node] - if { $point < 0 } { - return $node - } else { - incr point - return "[string range $node $point end]" - } - } - proc pathname {node} { - set point [string last "/" $node] - if { $point < 0 } { - return "" - } else { - incr point -1 - return "[string range $node 0 $point]" - } - return "[join [lrange [split $node '/'] 0 end-1] '/']" - } proc setValue {tc_root nextState cmd} { # send a command to set a value diff --git a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl index 24ecf683..fada3e70 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_oxford_mercury.tcl @@ -80,25 +80,6 @@ namespace eval ::scobj::[set vendor]_[set device] { debug_log 1 "Extract channel $result from argument $arg" return $result } - proc basename {node} { - set point [string last "/" $node] - if { $point < 0 } { - return $node - } else { - incr point - return "[string range $node $point end]" - } - } - proc pathname {node} { - set point [string last "/" $node] - if { $point < 0 } { - return "" - } else { - incr point -1 - return "[string range $node 0 $point]" - } - return "[join [lrange [split $node '/'] 0 end-1] '/']" - } proc setPoint {tc_root nextState cmd} { # send a command to set a value diff --git a/site_ansto/instrument/config/motors/sct_aerotech_soloist.tcl b/site_ansto/instrument/config/motors/sct_aerotech_soloist.tcl index c39a5790..858164d0 100644 --- a/site_ansto/instrument/config/motors/sct_aerotech_soloist.tcl +++ b/site_ansto/instrument/config/motors/sct_aerotech_soloist.tcl @@ -35,26 +35,6 @@ namespace eval ::scobj::[set vendor]_[set device] { } catch_message ] } - proc basename {node} { - set point [string last "/" $node] - if { $point < 0 } { - return $node - } else { - incr point - return "[string range $node $point end]" - } - } - proc pathname {node} { - set point [string last "/" $node] - if { $point < 0 } { - return "" - } else { - incr point -1 - return "[string range $node 0 $point]" - } - return "[join [lrange [split $node '/'] 0 end-1] '/']" - } - proc ns {} { return "[namespace current]" } diff --git a/site_ansto/instrument/util/extra_utility.tcl b/site_ansto/instrument/util/extra_utility.tcl index 1e5d3a0e..dd1aec36 100644 --- a/site_ansto/instrument/util/extra_utility.tcl +++ b/site_ansto/instrument/util/extra_utility.tcl @@ -1,3 +1,23 @@ +# utility functions like basename/dirname in bash (dcl) + proc basename {node} { + set point [string last "/" $node] + if { $point < 0 } { + return $node + } else { + incr point + return "[string range $node $point end]" + } + } + proc pathname {node} { + set point [string last "/" $node] + if { $point < 0 } { + return "" + } else { + incr point -1 + return "[string range $node 0 $point]" + } + } + # Many of these functions are also useful in test and debug code # running on an external Tcl interpreter. set errorInfo ""