Remove superfluous trailing white space from TCL files
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
## \file
|
||||
# Must be loaded into an instance of SICS with fileeval
|
||||
# eg
|
||||
# fileeval tests/query_sics.tcl
|
||||
# fileeval tests/query_sics.tcl
|
||||
fileeval util/check/query_sics.tcl
|
||||
set hdb_prop_list {
|
||||
{control data} {true false}
|
||||
@@ -18,7 +18,7 @@ proc checknode {node} {
|
||||
set query "$a \{$v\}"
|
||||
if {![query_propval $node $query]} {
|
||||
clientput "$node: $a should be one of ($v) not [::utility::hgetplainprop $node $a]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ proc checksobj {} {
|
||||
set attlist "$a \{$v\}"
|
||||
if {![query_attval $sobj $attlist]} {
|
||||
clientput "$sobj: $a should be one of ($v) not [getatt $sobj $a]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,14 +84,14 @@ proc query_attval {sobj query} {
|
||||
}
|
||||
##
|
||||
# prop_list list of property name value pairs
|
||||
# value can be a @any @missing a single value or a list optionally preceded by -not
|
||||
# value can be a @any @missing a single value or a list optionally preceded by -not
|
||||
# listnode / {data true sicsdev @missing type {-not part instrument nxvgroup}}
|
||||
proc listnode {hpath prop_list} {
|
||||
if {$hpath == "/"} {
|
||||
foreach hp [hlist /] {
|
||||
if [query_propval /$hp $prop_list] {
|
||||
clientput "/$hp"
|
||||
}
|
||||
}
|
||||
listnode /$hp $prop_list
|
||||
}
|
||||
} else {
|
||||
@@ -108,11 +108,11 @@ proc listsobj {sicstype att_list} {
|
||||
foreach sobj [sicslist type $sicstype] {
|
||||
if [query_attval $sobj $att_list] {
|
||||
clientput "$sobj"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publish query_propval user
|
||||
publish query_attval user
|
||||
publish listnode user
|
||||
publish listsobj user
|
||||
publish listsobj user
|
||||
|
||||
@@ -72,7 +72,7 @@ proc command {acmdName arglist body} {
|
||||
"feedback" {
|
||||
if {[info exists ${__cmd}_feedback_list] != 1} {
|
||||
return
|
||||
}
|
||||
}
|
||||
foreach {__var __fbvar} [set ${__cmd}_feedback_list] {
|
||||
eval [lindex $args 2] [lrange $args 3 end] $__fbvar $__var
|
||||
}
|
||||
@@ -107,13 +107,13 @@ proc command {acmdName arglist body} {
|
||||
if {[llength [sicslist ${__cmd}_${__ptype}_${__vname}]] == 0} {
|
||||
error_msg "${__cmd}_${__ptype}_${__vname} doesnt exist"
|
||||
return
|
||||
}
|
||||
}
|
||||
if {[info exists __val]} {
|
||||
${__cmd}_${__ptype}_${__vname} $__val
|
||||
return
|
||||
} else {
|
||||
return [SplitReply [${__cmd}_${__ptype}_${__vname}]]
|
||||
}
|
||||
}
|
||||
}
|
||||
-addfb {
|
||||
foreach {__type __var} [lrange $args 1 end] {
|
||||
|
||||
@@ -42,8 +42,8 @@ proc Motor {name type par} {
|
||||
# Returns the test result status colour for the gui
|
||||
proc color {status} {
|
||||
switch $status {
|
||||
TEST_PASSED {return green}
|
||||
TEST_FAILED {return red}
|
||||
TEST_PASSED {return green}
|
||||
TEST_FAILED {return red}
|
||||
default {return lightgrey}
|
||||
}
|
||||
}
|
||||
@@ -51,12 +51,12 @@ proc color {status} {
|
||||
# You can easily test the home position of individual motors
|
||||
# with this gui
|
||||
# Click on the button to run the checkHome command, the position
|
||||
# (in encoder counts or motor steps) will be displayed with
|
||||
# (in encoder counts or motor steps) will be displayed with
|
||||
# green if the configured home matches the reported position,
|
||||
# red otherwise.
|
||||
proc testgui {} {
|
||||
package require Tk
|
||||
global motors
|
||||
global motors
|
||||
toplevel .w
|
||||
frame .w.top
|
||||
|
||||
@@ -64,7 +64,7 @@ proc testgui {} {
|
||||
global ${m}_status
|
||||
set info($m) [frame .w.top.f$m]
|
||||
|
||||
set testResult $info($m).e$m
|
||||
set testResult $info($m).e$m
|
||||
button $info($m).$m -text $m -command "$testResult configure -background \[color \[checkHome $m\]\]"
|
||||
entry $testResult -textvariable ${m}_status(position)
|
||||
pack $info($m).$m -side left
|
||||
|
||||
@@ -24,7 +24,7 @@ proc loadConfig {fName} {
|
||||
if [info exists ContList] {unset ContList}
|
||||
# Temporarily define unknown proc to skip undefined procs
|
||||
rename ::unknown _unknown
|
||||
proc ::unknown {args} {}
|
||||
proc ::unknown {args} {}
|
||||
if [catch {uplevel #0 source $fName} errMsg] {
|
||||
rename ::unknown ""
|
||||
rename _unknown ::unknown
|
||||
|
||||
@@ -38,7 +38,7 @@ proc ::event::waitfor {sobj args} {
|
||||
eval $args
|
||||
while {$sobjBusy == 1} {
|
||||
wait 1
|
||||
}
|
||||
}
|
||||
scriptcallback remove $sobj $CBID
|
||||
SetStatus $oldStatus
|
||||
} message ] {
|
||||
@@ -53,12 +53,12 @@ namespace import ::event::waitfor
|
||||
|
||||
publish waitfor user
|
||||
|
||||
namespace eval ::batch::call_cleanup { }
|
||||
namespace eval ::batch::call_cleanup { }
|
||||
proc ::batch::cleanup {} {}
|
||||
##
|
||||
# @brief Calls a user defined cleanup script when a batch file ends or is aborted
|
||||
# The cleanup script must be called ::batch::call_cleanup
|
||||
proc ::batch::call_cleanup {} {
|
||||
proc ::batch::call_cleanup {} {
|
||||
::batch::cleanup
|
||||
proc ::batch::cleanup {} {}
|
||||
}
|
||||
|
||||
@@ -95,8 +95,8 @@ proc callStack {enable} {
|
||||
}
|
||||
publish callStack mugger
|
||||
callStack false
|
||||
|
||||
|
||||
|
||||
|
||||
# LIST FUNCTIONS
|
||||
proc head {args} {lindex [join $args] 0}
|
||||
proc tail {args} {join [lrange [join $args] 1 end]}
|
||||
@@ -149,7 +149,7 @@ proc isoneof {element setb} {
|
||||
switch $elb {
|
||||
alpha {set result [string is alpha $element]}
|
||||
text {set result [string is wordchar $element]}
|
||||
print {set result [string is print $element]}
|
||||
print {set result [string is print $element]}
|
||||
float {set result [string is double $element]}
|
||||
int {set result [string is integer $element]}
|
||||
default {set result [expr {$element == $elb}]}
|
||||
@@ -174,7 +174,7 @@ proc tolower_sicslist {args} {
|
||||
# \brief Enables or disables the debug_msg command
|
||||
#
|
||||
# \param mode on turns on debugging, off turns off debugging
|
||||
#
|
||||
#
|
||||
# \see debug_msg
|
||||
# TODO Set a callstack global variable
|
||||
proc debug_mode {mode} {
|
||||
@@ -190,22 +190,22 @@ proc debug_mode {mode} {
|
||||
# This probably only occurs if you debug_msg directly. Why would you do that?
|
||||
set cmdinfo [info level 0]
|
||||
set cmd [lindex $cmdinfo 0]
|
||||
set nscmd [namespace origin $cmd]
|
||||
set nscmd [namespace origin $cmd]
|
||||
clientput "DEBUG, ${nscmd}::$cmdinfo]$args"
|
||||
}
|
||||
2 {
|
||||
set cmdinfo [info level -1]
|
||||
set cmd [lindex $cmdinfo 0]
|
||||
set nscmd [namespace origin $cmd]
|
||||
set nscmd [namespace origin $cmd]
|
||||
clientput "DEBUG, ${nscmd}::$cmdinfo]$args"
|
||||
}
|
||||
3 - default {
|
||||
set cmdinfo [info level -1]
|
||||
set cmd [lindex $cmdinfo 0]
|
||||
set nscmd [namespace origin $cmd]
|
||||
set nscmd [namespace origin $cmd]
|
||||
set callerinfo [info level -2]
|
||||
set caller [lindex $callerinfo 0]
|
||||
set nscaller [namespace origin $caller]
|
||||
set nscaller [namespace origin $caller]
|
||||
clientput "DEBUG, ${nscaller}::$callerinfo\n\t${nscmd}::$cmdinfo]$args"
|
||||
}
|
||||
}
|
||||
@@ -217,7 +217,7 @@ proc debug_mode {mode} {
|
||||
}
|
||||
}
|
||||
|
||||
## \brief You can use debug_msg in place of 'puts' for debug info in Tcl macros.
|
||||
## \brief You can use debug_msg in place of 'puts' for debug info in Tcl macros.
|
||||
#
|
||||
# Add debug messages on the fly with
|
||||
# strace add execution <proc> enter debug_msg
|
||||
|
||||
@@ -45,14 +45,14 @@ proc reldrive {args} {
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return }
|
||||
return -code error $message
|
||||
}
|
||||
}
|
||||
}
|
||||
publish reldrive user
|
||||
|
||||
##
|
||||
# @brief A convenience command for fetching motor parameter values
|
||||
#
|
||||
# This convenience command is useful for avoiding command
|
||||
# This convenience command is useful for avoiding command
|
||||
# substitution problems when defining hdb node read scripts.
|
||||
proc getmotpar {motor par} {
|
||||
return [SplitReply [$motor $par]]
|
||||
|
||||
@@ -98,7 +98,7 @@ proc ::environment::mkSensors {sobj} {
|
||||
#
|
||||
# eg ::environment::mkenvinfo tc1 {heateron {priv user} range {priv manager}}
|
||||
proc ::environment::mkenvinfo {sobj paramlist} {
|
||||
lappend paramlist controlsensor {priv user}
|
||||
lappend paramlist controlsensor {priv user}
|
||||
if [ catch {
|
||||
# Create polling procedure to update hdb sensor data nodes.
|
||||
# proc ::environment::${sobj}_poll [subst {{sobj $sobj}}] {
|
||||
@@ -163,7 +163,7 @@ sicslist setatt $setpoint_script mutable true
|
||||
lappend env_macrolist $ctrlss_script
|
||||
}
|
||||
|
||||
# Create environment information structure for hdb
|
||||
# Create environment information structure for hdb
|
||||
set env_name [getatt $sobj environment_name]
|
||||
eval [subst {
|
||||
proc ::${sobj}_dict {} {
|
||||
@@ -233,13 +233,13 @@ namespace eval utility {
|
||||
return $instrument_name;
|
||||
}
|
||||
|
||||
# Initialise the attributes of sobj
|
||||
# Initialise the attributes of sobj
|
||||
# to make it ready for adding to the hdb tree.
|
||||
proc mkData {sobj name aklass args} {
|
||||
sicslist setatt $sobj long_name $name
|
||||
sicslist setatt $sobj nxalias $sobj
|
||||
sicslist setatt $sobj klass $aklass
|
||||
switch [getatt $sobj type] {
|
||||
switch [getatt $sobj type] {
|
||||
"sicsvariable" {
|
||||
sicslist setatt $sobj kind hobj
|
||||
sicslist setatt $sobj data true
|
||||
@@ -264,8 +264,8 @@ proc mkData {sobj name aklass args} {
|
||||
proc mkVar {name type access {along_name x} {anxsave false} {aklass @none} {acontrol false} {adata false}} {
|
||||
array set sicsAccess {spy spy user user manager mugger internal internal readonly internal}
|
||||
VarMake $name $type $sicsAccess($access);
|
||||
sicslist setatt $name privilege $access;
|
||||
sicslist setatt $name kind hobj;
|
||||
sicslist setatt $name privilege $access;
|
||||
sicslist setatt $name kind hobj;
|
||||
sicslist setatt $name mutable false
|
||||
if {$access != "internal"} {
|
||||
sicslist setatt $name data $adata
|
||||
@@ -306,7 +306,7 @@ proc ::utility::normalattlist {sicsobj} {
|
||||
foreach att [sicslist $sicsobj] {
|
||||
lappend atts [split [string range $att 0 end-1] =]
|
||||
}
|
||||
return [join $atts]
|
||||
return [join $atts]
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
@@ -341,7 +341,7 @@ with the lower limit at 85 and the upper limit at 97
|
||||
"
|
||||
if {$args == ""} {clientput $usage; return}
|
||||
array set params $args
|
||||
set motor $params(-motor)
|
||||
set motor $params(-motor)
|
||||
set home $params(-home)
|
||||
set lowlim [expr $home - $params(-lowrange)]
|
||||
set uplim [expr $home + $params(-uprange)]
|
||||
@@ -383,14 +383,14 @@ proc getinfo {object} {
|
||||
set wc [format "%s_*" $object];
|
||||
set objlist [sicslist match $wc];
|
||||
foreach v $objlist {
|
||||
if { [SplitReply [sicslist $v type]]== "SicsVariable"} {
|
||||
if { [SplitReply [sicslist $v type]]== "SicsVariable"} {
|
||||
clientput [$v];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Convenience function for setting klass group and name attributes
|
||||
# Convenience function for setting klass group and name attributes
|
||||
# on sics object metadata
|
||||
proc set_sicsobj_atts {sobj aklass agroup aname acontrol adata} {
|
||||
sicslist setatt $sobj klass $aklass;
|
||||
@@ -430,7 +430,7 @@ proc ::utility::set_sobj_attributes {} {
|
||||
}
|
||||
|
||||
proc ::utility::set_histomem_attributes {} {
|
||||
foreach hm [sicslist type histmem] {
|
||||
foreach hm [sicslist type histmem] {
|
||||
sicslist setatt $hm nxalias $hm
|
||||
sicslist setatt $hm mutable true
|
||||
}
|
||||
@@ -450,13 +450,13 @@ proc ::utility::set_motor_attributes {} {
|
||||
# The first entry in [sicslist type motor] is 'motor' when
|
||||
# we run the sicslist command on initialisation. This is because
|
||||
# The 'Motor' command has type motor, so we skip it with lrange.
|
||||
foreach m [lrange [sicslist type motor] 1 end] {
|
||||
foreach m [lrange [sicslist type motor] 1 end] {
|
||||
sicslist setatt $m kind hobj
|
||||
sicslist setatt $m data true
|
||||
sicslist setatt $m control true
|
||||
sicslist setatt $m nxsave true
|
||||
sicslist setatt $m mutable true
|
||||
catch {
|
||||
catch {
|
||||
# This block is specific to the dmc2280 driver.
|
||||
# Skip it for "tclmot" motors which don't
|
||||
# have 'units', 'part' or 'long_name' parameters
|
||||
@@ -476,7 +476,7 @@ proc ::utility::set_motor_attributes {} {
|
||||
3 {sicslist setatt $m privilege spy}
|
||||
}
|
||||
}
|
||||
foreach m [sicslist type configurablevirtualmotor] {
|
||||
foreach m [sicslist type configurablevirtualmotor] {
|
||||
sicslist setatt $m kind hobj
|
||||
sicslist setatt $m data true
|
||||
sicslist setatt $m control true
|
||||
@@ -485,7 +485,7 @@ proc ::utility::set_motor_attributes {} {
|
||||
sicslist setatt $m nxalias $m
|
||||
sicslist setatt $m mutable true
|
||||
}
|
||||
foreach m [sicslist type TasMot] {
|
||||
foreach m [sicslist type TasMot] {
|
||||
sicslist setatt $m klass sample
|
||||
sicslist setatt $m long_name $m
|
||||
sicslist setatt $m kind hobj
|
||||
@@ -498,7 +498,7 @@ proc ::utility::set_motor_attributes {} {
|
||||
}
|
||||
}
|
||||
proc ::utility::set_chopper_attributes {} {
|
||||
foreach ch [lrange [sicslist type chopperadapter] 1 end] {
|
||||
foreach ch [lrange [sicslist type chopperadapter] 1 end] {
|
||||
sicslist setatt $ch kind hobj
|
||||
sicslist setatt $ch data true
|
||||
sicslist setatt $ch control true
|
||||
@@ -575,9 +575,9 @@ proc lstarts_with {l1 l2} {
|
||||
#
|
||||
#\param port this can either be a port name or number
|
||||
#\return always returns the port number
|
||||
proc ::utility::get_portnum {port} {
|
||||
proc ::utility::get_portnum {port} {
|
||||
global env tcl_platform
|
||||
variable sics_port
|
||||
variable sics_port
|
||||
if [ catch {
|
||||
if [string is integer $port] {
|
||||
return $port
|
||||
@@ -643,7 +643,7 @@ proc ::utility::check_valid_options {arglist valid_options} {
|
||||
|
||||
##
|
||||
# @brief Raises an error if any of the required_options are not in the argument list arglist
|
||||
proc ::utility::check_required_options {arglist required_options} {
|
||||
proc ::utility::check_required_options {arglist required_options} {
|
||||
if [ catch {
|
||||
if {$arglist == ""} {
|
||||
error "ERROR: You must provide the following options: [join $required_options {, }]"
|
||||
@@ -655,7 +655,7 @@ proc ::utility::check_required_options {arglist required_options} {
|
||||
if {$req_opt == $opt} {
|
||||
set option_missing "false"
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if {$option_missing} {
|
||||
error "ERROR: Required option $req_opt is missing"
|
||||
@@ -702,10 +702,10 @@ proc ::utility::get_opt_arglist {args} {
|
||||
#
|
||||
# ::utility::tabmktable {NXgeometry geometry NXshape sicsvariable {shape size}}
|
||||
# returns
|
||||
# NXgeometry {geometry {NXshape {sicsvariable {shape size}}}}
|
||||
# NXgeometry {geometry {NXshape {sicsvariable {shape size}}}}
|
||||
# ::utility::tabxml hmm_table SAT
|
||||
# ::utility::tabset hmm_table SAT/SPLIT/_ATTLIST_/MIDPOINT 256
|
||||
# ::utility::tabget hmm_table SAT/SPLIT/_ATTLIST_/MIDPOINT
|
||||
# ::utility::tabget hmm_table SAT/SPLIT/_ATTLIST_/MIDPOINT
|
||||
# ::utility::tabxml hmm_table SAT
|
||||
# ::utility::tabget hmm_table OAT/_DATA_/T_MAX
|
||||
|
||||
@@ -723,7 +723,7 @@ proc ::utility::tabmktable {flatlist} {
|
||||
}
|
||||
set el [lindex $flatlist 0]
|
||||
set table [list $el \$subtable ]
|
||||
foreach el [lrange $flatlist 1 end-2] {
|
||||
foreach el [lrange $flatlist 1 end-2] {
|
||||
set subtable [list $el \$subtable]
|
||||
set table [subst $table]
|
||||
}
|
||||
@@ -737,8 +737,8 @@ proc ::utility::tabmktable {flatlist} {
|
||||
}
|
||||
|
||||
# If some component of the path doesn't exist then return
|
||||
# a list of indices up to the invalid step. Note if the
|
||||
# first step doesn't exist this returns nothing which is a
|
||||
# a list of indices up to the invalid step. Note if the
|
||||
# first step doesn't exist this returns nothing which is a
|
||||
# valid argument to lset and lindex representing the entire list
|
||||
proc ::utility::tabindices {itable tpath} {
|
||||
if [ catch {
|
||||
@@ -772,7 +772,7 @@ proc ::utility::tabdel {itable tpath} {
|
||||
set subtable [lreplace $subtable $datindex $datindex]
|
||||
incr datindex -1
|
||||
set subtable [lreplace $subtable $datindex $datindex]
|
||||
lset table $subtabpos $subtable
|
||||
lset table $subtabpos $subtable
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
@@ -785,7 +785,7 @@ proc ::utility::tabget {itable tpath} {
|
||||
if {[llength $indices] == [llength [split $tpath "/"] ]} {
|
||||
return [lindex $table $indices]
|
||||
} else {
|
||||
return
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -849,7 +849,7 @@ proc ::utility::macro::getset {type name arglist body} {
|
||||
publish $name spy
|
||||
if {$arglist == ""} {
|
||||
sicslist setatt $name access read_only
|
||||
} else {
|
||||
} else {
|
||||
sicslist setatt $name access user
|
||||
}
|
||||
sicslist setatt $name privilege user
|
||||
|
||||
Reference in New Issue
Block a user