Remove superfluous trailing white space from TCL files

This commit is contained in:
Douglas Clowes
2014-05-16 12:30:51 +10:00
parent 89e4e37f9e
commit 92d3acb5d5
230 changed files with 1835 additions and 1835 deletions

View File

@@ -1,6 +1,6 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
source $cfPath(anticollider)/anticollider_common.tcl
source $cfPath(anticollider)/anticollider_common.tcl
# NOTE: This is called with a list of motorname target pairs
proc ::anticollider::enable {args} {

View File

@@ -14,7 +14,7 @@
# tuning 1
# currtol 1
# interval 2
# }
# }
#
# NOTE:
# If tuning=1 this will generate xxx/set_current and xxx/set_frequency
@@ -31,7 +31,7 @@
# voltage increases to 34 Vem and the current decreases;
# " switch off the RF output;
# " decrease current setting by rotating the potentiometer 10 turns counter-clockwise;
# " verify the vacuum level in the tank and restart the flipper operation only if it is below 0.01 mbar.
# " verify the vacuum level in the tank and restart the flipper operation only if it is below 0.01 mbar.
namespace eval ::scobj::rfgen {
# Control states
@@ -118,7 +118,7 @@ proc ::scobj::rfgen::set_current {basePath} {
variable RAMPSTART
set newCurr [sct target]
set current [expr {round(10.0 * $newCurr)}]
hsetprop $basePath targetCurr $current
hsetprop $basePath opCurr $current
@@ -135,7 +135,7 @@ proc ::scobj::rfgen::set_frequency {basePath} {
variable RAMPSTART
set newFreq [sct target]
hsetprop $basePath targetFreq $newFreq
hsetprop $basePath opFreq $newFreq
hsetprop $basePath ramping $RAMPSTART
@@ -186,11 +186,11 @@ proc ::scobj::rfgen::rdStatFunc {} {
set statList [join $temp]
mkStatArr stateArr $statList
if {$statList != [sct oldStateRep]} {
if {$statList != [sct oldStateRep]} {
hset $basePath/flip_current [expr {$stateArr(curr) / 10.0}]
hset $basePath/flip_frequency $stateArr(freq)
hset $basePath/flip_voltage $stateArr(voltage)
hset $basePath/flip_on $stateArr(O)
hset $basePath/flip_frequency $stateArr(freq)
hset $basePath/flip_voltage $stateArr(voltage)
hset $basePath/flip_on $stateArr(O)
hset $basePath/state_report $statList
sct update $statList
sct utime updatetime
@@ -209,10 +209,10 @@ proc ::scobj::rfgen::rdStatFunc {} {
##
# @brief State transition function
proc ::scobj::rfgen::stateFunc {} {
variable RAMPIDLE
variable RAMPSTOP
variable RAMPIDLE
variable RAMPSTOP
variable RAMPSTART
variable RAMPBUSY
variable RAMPBUSY
variable RAMPTOZERO
variable FLIPOFF
variable MAXVOLTAGE
@@ -223,7 +223,7 @@ proc ::scobj::rfgen::stateFunc {} {
mkStatArr stateArr [hval $basePath/state_report]
set currControlStatus [sct status]
switch $currSuperState [ subst -nocommands {
$RAMPSTART {
# broadcast RAMPSTART
@@ -328,8 +328,8 @@ proc ::scobj::rfgen::rampFunc {} {
##
# @brief Make an RF generator control object
#
# @param argList, {name "analyser" address "1" opCurr 68 opFreq 241 IP localhost PORT 65123 tuning 0 interval 1}
#
# @param argList, {name "analyser" address "1" opCurr 68 opFreq 241 IP localhost PORT 65123 tuning 0 interval 1}
#
# name: name of RF generator object
# address: address assigned to RF generator 1-9
@@ -360,7 +360,7 @@ proc ::scobj::rfgen::mkRFGen {argList} {
hfactory /sics/$pa(NAME)/flip_voltage plain internal int
hfactory /sics/$pa(NAME)/flip_on plain internal int
hsetprop /sics/$pa(NAME) read ::scobj::rfgen::rqStatFunc
hsetprop /sics/$pa(NAME) read ::scobj::rfgen::rqStatFunc
hsetprop /sics/$pa(NAME) rdState ::scobj::rfgen::rdStatFunc
hsetprop /sics/$pa(NAME) stateChange ::scobj::rfgen::stateFunc
hsetprop /sics/$pa(NAME) ramp ::scobj::rfgen::rampFunc
@@ -404,9 +404,9 @@ proc ::scobj::rfgen::mkRFGen {argList} {
makesctcontroller $SCT_RFGEN rfamp $pa(IP):$pa(PORT)
hsetprop /sics/$pa(NAME) contname $SCT_RFGEN
# mkStatArr stateArr [split [$SCT_RFGEN transact "L:$pa(ADDRESS)"] "|="]
hset /sics/$pa(NAME)/flip_current 0
hset /sics/$pa(NAME)/flip_frequency $pa(OPFREQ)
hset /sics/$pa(NAME)/flip_frequency $pa(OPFREQ)
hset /sics/$pa(NAME)/flip_voltage 0
hset /sics/$pa(NAME)/flip_on 0
hsetprop /sics/$pa(NAME) targetFreq $pa(OPFREQ)

View File

@@ -154,7 +154,7 @@ proc rdPwdAck {} {
return NXTCHOPPER
}
} message ]
handle_exception $catch_status $message
handle_exception $catch_status $message
}
# Create chopper control
@@ -175,7 +175,7 @@ proc rdPwdAck {} {
hfactory $chopperPath/device_error plain spy text
hset $chopperPath/device_error ""
# Must be set by user
hfactory $chopperPath/geometry plain spy none
hfactory $chopperPath/geometry/position plain spy none
@@ -186,7 +186,7 @@ proc rdPwdAck {} {
hfactory $chopperPath/geometry/position/ChopperPosZ plain user float
hsetprop $chopperPath/geometry/position/ChopperPosZ units "mm"
hfactory $chopperPath/geometry/position/ChopperCoordScheme plain user text
# Setup nodes for state report parameters
foreach ch {"ch1" "ch2" "ch3" "ch4"} {
hfactory $chopperPath/$ch plain spy none

View File

@@ -26,7 +26,7 @@ namespace eval beam {
::beam::attenuator -addfb text BeamAttenuator
namespace eval exp_mode {
variable valid_modes
variable valid_modes
variable guide_for_mode ;#guide element for a specific mode
variable c1ht_pos
#0=polarisation
@@ -37,9 +37,9 @@ namespace eval exp_mode {
variable c1ht_pos
set valid_modes [list SB DB FOC MT POL POLANAL]
set c1ht_pos [list 1057 806.7 557.1 320 68.9 68.9]
command set_mode "text=[join $valid_modes ,] arg " { ;#need to change all softzero's
global ::exp_mode::valid_modes
global ::exp_mode::valid_modes
if {[lsearch $::exp_mode::valid_modes $arg] == -1} {
Clientput "Mode is: $::exp_mode::valid_modes - (POL, POLANAL, MT, FOC, DB, SB)"
return -code error "Mode is: $::exp_mode::valid_modes - (polarisation, polarisation and analysis, mt,focussing,DB,single)"
@@ -54,17 +54,17 @@ namespace eval exp_mode {
twotheta -1
return -code ok
}
proc ::exp_mode::omega_2theta { arg1 arg2 {s1vg 0} {s2vg 0} {s3vg 0} {s4vg 0}} {
#need to set omega first. This is because
#for Single bounce the twotheta positions depend on the angle of incidence
# whenever omega_2theta is called, or the mode is changed, the slits should close
# this is to save the detector from being overloaded.
# the following line does the job. However, it is duplicated when the mode is set in
# the following line does the job. However, it is duplicated when the mode is set in
# set_omega, so it is commented out for now.
# drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0
# drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0
# if {[catch {::exp_mode::set_omega $arg1} errMsg]} {return -code error $errMsg}
# if {[catch {::exp_mode::set_two_theta $arg2} errMsg]} {return -code error $errMsg}
@@ -72,21 +72,21 @@ proc ::exp_mode::omega_2theta { arg1 arg2 {s1vg 0} {s2vg 0} {s3vg 0} {s4vg 0}} {
twotheta $arg2
if {![string is double $arg1] || ![string is double $arg2]} {
return -code error "omega and two theta should be a proper number"
}
}
statemon start om2th
if {[catch {
::exp_mode::set_omega $arg1
::exp_mode::set_two_theta $arg2
} errMsg ] } {
omega -1
twotheta -1
twotheta -1
broadcast ERROR: omega_2theta command did not complete correctly
broadcast $errMsg
broadcast $errMsg
return -code error $errMsg
}
if {![string is double $s1vg] || ![string is double $s2vg] || ![string is double $s3vg] || ![string is double $s4vg]} {
return -code error "ERROR: all the slit openings need to be numbers"
}
}
drive ss1u [expr 0.5 * $s1vg] ss1d [expr -0.5 * $s1vg] ss2u [expr 0.5 * $s2vg] ss2d [expr -0.5 * $s2vg] ss3u [expr 0.5 * $s3vg] ss3d [expr -0.5 * $s3vg] ss4u [expr 0.5 * $s4vg] ss4d [expr -0.5*$s4vg]
statemon stop om2th
return -code ok
@@ -102,7 +102,7 @@ proc ::exp_mode::set_guide_element { arg } {
global ::exp_mode::c1ht_pos
global ::exp_mode::valid_modes
drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0
drive ss1u 0 ss1d 0 ss2u 0 ss2d 0 ss3u 0 ss3d 0 ss4u 0 ss4d 0
if {[lsearch $::exp_mode::valid_modes $arg] == -1} {
Clientput "Mode is: $::exp_mode::valid_modes - (polarisation, polarisation and analysis, mt, focussing, DB, single)"
return -code error "Mode is: $::exp_mode::valid_modes - (polarisation,polarisation and analysis, mt, focussing, DB, single)"
@@ -112,9 +112,9 @@ proc ::exp_mode::set_guide_element { arg } {
return -code error $errMsg
} else {
guide_element $arg
return -code ok
return -code ok
}
}
}
proc ::exp_mode::set_omega { arg } {
set expmode [SplitReply [mode]]
@@ -154,17 +154,17 @@ proc ::exp_mode::set_omega { arg } {
;#offset is the vertical drop from the beam centre onto the middle of the second compound mirror
;# each compound mirror is 600mm long
;# therefore the distance between the place where the beam hits the centre of both mirrors is
;# 2 * 300 * cos(1.2) = 599.868
;# 2 * 300 * cos(1.2) = 599.868
;# guide2_distance is therefore the distance from the midpoint of the second compound mirror to chopper disc 1.
;# i.e. sample-> midpoint of compound mirror2 = 1546 + 300*cos3.6 = 1845.4
set offset [expr 599.868*sin($temp)]
set offset [expr 599.868*sin($temp)]
set arg 4.8 ;#fixed angle
set d1 [expr [SplitReply [slit3_distance]] - [SplitReply [guide2_distance]]]
set d2 [expr [SplitReply [sample_distance]] - [SplitReply [guide2_distance]]]
set h1 [expr -1. * $d1 * tan($argrad) - $offset]
set h1 [expr -1. * $d1 * tan($argrad) - $offset]
set h2 [expr -1. * $d2 * tan($argrad) - $offset]
if { [catch {checkMotionAndDrive st3vt $h1} errMsg]} {return -code error $errMsg}
@@ -208,20 +208,20 @@ proc ::exp_mode::set_omega { arg } {
drive sth $arg st3vt 0
}
default {
return -code error "omega driving not specified for that mode"
return -code error "omega driving not specified for that mode"
}
}
return -code ok
}
publish ::exp_mode::set_omega user
proc ::exp_mode::set_two_theta { arg } {
set expmode [SplitReply [mode]]
set expomega [SplitReply [omega]]
if {[lsearch $::exp_mode::valid_modes $expmode] == -1} {
return -code error "please set the mode and omega first"
return -code error "please set the mode and omega first"
}
if {$expomega == "NaN"} {
return -code error "please set omega first"
@@ -248,14 +248,14 @@ proc ::exp_mode::set_two_theta { arg } {
set h3 [expr -1. * $d4 * tan($omegarad)]
set b [expr $d3 / cos($omegarad)]
set c [expr $d3 / cos($argrad-$omegarad)]
set h4 [expr sqrt(pow($b,2) + pow($c,2) - 2*$b*$c*cos($argrad))]
set h4 [expr sqrt(pow($b,2) + pow($c,2) - 2*$b*$c*cos($argrad))]
if { [catch {isszst4vtsafe st4vt [expr $h2 + $h1]} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive st4vt [expr $h2 + $h1]} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive dz [expr $h3 + $h4]} errMsg]} {return -code error $errMsg}
}
DB { ;#checked ARJN 081231
set temp [deg2rad 2.4]
set offset [expr 599.868*sin($temp)]
set offset [expr 599.868*sin($temp)]
set expomega 4.8
set omegarad [deg2rad $expomega]
@@ -272,7 +272,7 @@ proc ::exp_mode::set_two_theta { arg } {
set h3 [expr -1. * $d4 * tan($omegarad) - $offset]
set b [expr $d3 / cos($omegarad)]
set c [expr $d3 / cos($argrad-$omegarad)]
set h4 [expr sqrt(pow($b,2) + pow($c,2) - 2*$b*$c*cos($argrad))]
set h4 [expr sqrt(pow($b,2) + pow($c,2) - 2*$b*$c*cos($argrad))]
if { [catch {isszst4vtsafe st4vt [expr $h2 + $h1]} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive st4vt [expr $h2 + $h1]} errMsg]} {return -code error $errMsg}
if { [catch {checkMotionAndDrive dz [expr $h3 + $h4]} errMsg]} {return -code error $errMsg}
@@ -288,7 +288,7 @@ proc ::exp_mode::set_two_theta { arg } {
checkMotion dz $h1
} errMsg]} {
return -code error $errMsg
}
}
drive st4vt $h2 dz $h1
}
MT {
@@ -302,7 +302,7 @@ proc ::exp_mode::set_two_theta { arg } {
checkMotion dz $h1
} errMsg ] } {
return -code error $errMsg
}
}
drive st4vt $h2 dz $h1
}
POL {
@@ -316,7 +316,7 @@ proc ::exp_mode::set_two_theta { arg } {
checkMotion dz $h1
} errMsg ] } {
return -code error $errMsg
}
}
drive st4vt $h2 dz $h1 analz -200 analtilt 0
}
POLANAL {
@@ -335,7 +335,7 @@ proc ::exp_mode::set_two_theta { arg } {
checkMotion analtilt $ang1
} errMsg ] } {
return -code error $errMsg
}
}
drive st4vt $h2 dz $h1 analz $h3 analtilt $ang1
}
default {
@@ -350,14 +350,14 @@ proc ::exp_mode::checkMotion { scan_variable target } {
set motor_list [sicslist type motor]
if {[lsearch $motor_list $scan_variable]==-1} {
return -code error "you tried to drive a motor that doesn't exist"
return -code error "you tried to drive a motor that doesn't exist"
}
set softzero [SplitReply [$scan_variable softzero]]
set absoluteTarget [expr $softzero+$target]
if { [catch {isszst4vtsafe $scan_variable $target} errMsg]} {return -code error $errMsg}
if {[catch {
if {[catch {
::scan::check_limit $scan_variable hardlowerlim $absoluteTarget
::scan::check_limit $scan_variable hardupperlim $absoluteTarget
::scan::check_limit $scan_variable softlowerlim $target
@@ -373,22 +373,22 @@ proc ::exp_mode::checkMotionAndDrive { scan_variable target } {
set motor_list [sicslist type motor]
#lappend motorlist [sicslist type configurablevirtualmotor]
set precision [SplitReply [$scan_variable precision]]
set precision [SplitReply [$scan_variable precision]]
if {[catch {
if {[catch {
::exp_mode::checkMotion $scan_variable $target
}]} {
return -code error $::errorInfo
} else {
drive $scan_variable $target
set position [SplitReply [$scan_variable]]
set position [SplitReply [$scan_variable]]
if {[expr [expr $position-$target] > abs($precision)]} {
return -code error "move of: $scan_variable did not reach required precision"
} else {
Clientput "New $scan_variable Position: $position"
Clientput "Driving finished successfully"
}
return -code ok
return -code ok
}
}
publish ::exp_mode::checkMotionAndDrive user
@@ -409,7 +409,7 @@ proc ::exp_mode::isszst4vtsafe { scan_variable target } {
st4vt {
set st4vtPosition [expr $target + $st4vtsoftzero]
}
}
}
set distance [expr $szHardUpperLim - $szPosition + $st4vtPosition ]
if { $distance < 98. } {
return -code error "You would have a collision between st4vt and sz if you tried to move $scan_variable to $target"

View File

@@ -5,7 +5,7 @@ namespace eval counter {
variable isc_numchannels
variable isc_monitor_address
variable isc_portlist
variable isc_beam_monitor_list
variable isc_beam_monitor_list
proc set_sobj_attributes {} {
}
}

View File

@@ -1,4 +1,4 @@
set hpaths [list experiment ]
set hpaths [list experiment ]
# Maps devices (eg motors) to hipadaba paths.
# obj name path

View File

@@ -18,6 +18,6 @@ dhv1 upper 3000
evfactory new dhv2 nhq200 acq 2
dhv2 tolerance 5
dhv2 rate 25
dhv2 upper 1500
dhv2 upper 1500
#dhv2 lock
}

View File

@@ -3,7 +3,7 @@ set sim_mode [SplitReply [hmm_simulation]]
proc ::histogram_memory::init_OAT_TABLE {} {
if [ catch {
# We don't need a MAX_CHAN parameter for time because the time channel
# We don't need a MAX_CHAN parameter for time because the time channel
# is scaled by calling the ::histogram_memory::clock_scale function
OAT_TABLE X -setdata MAX_CHAN 421
OAT_TABLE Y -setdata MAX_CHAN 221
@@ -18,7 +18,7 @@ proc ::histogram_memory::init_OAT_TABLE {} {
hmm configure fat_frame_frequency $freq
hmm configure fat_frame_source EXTERNAL
OAT_TABLE -set X { -210.5 -209.5 } NXC 421 Y { -110.5 -109.5 } NYC 221 T { 0 40 } NTC 1000
OAT_TABLE -set X { -210.5 -209.5 } NXC 421 Y { -110.5 -109.5 } NYC 221 T { 0 40 } NTC 1000
} message ] {
if {$::errorCode=="NONE"} {return $message}
return -code error $message
@@ -86,7 +86,7 @@ proc ::histogram_memory::tochfreq {} {
# @param tochfreq updates chopper status and then sets histmem frame frequency to match
# the chopper frequency.
#
# NOTE: If the chopper is stopped (ie freq=0) then the histogram frequency will be set to
# NOTE: If the chopper is stopped (ie freq=0) then the histogram frequency will be set to
# 50Hz with an internal frame_source.\n
# @see ::histogram_memory::set_frame_freq
proc histmem {cmd args} {

View File

@@ -27,15 +27,15 @@ set m1ro_home 134658
set bat_home 8308518
set st3vt_home 5250496
#set st3vt_home 8742250 - victim of the encoder rearrangement
set st4vt_home 6560460
set st4vt_home 6560460
set sth_home 23541737
#set sphi_home 7548440 - victim of the NaN
set sphi_home 7450470
set sx_home 8574000
set sy_home 7500000
set sz_home 8927484
set dy_home 8694183
set dz_home 7788617
set dy_home 8694183
set dz_home 7788617
#Measured or computed step rate for sz (Sample Raise)
# Motor:25000/turn, gear:1/25, screw:5mm/turn
@@ -325,7 +325,7 @@ Motor st4vt $motor_driver_type [params \
cntsPerX 8192]
st4vt part slits.$slit4VGroup
st4vt long_name st4vt
st4vt softlowerlim 1
st4vt softlowerlim 1
st4vt softupperlim 247
st4vt home 0
st4vt backlash_offset -0.1
@@ -468,7 +468,7 @@ Motor sz $motor_driver_type [params \
absEncHome $sz_home\
cntsPerX $szCountRate]
sz part sample
sz long_name translate_z
sz long_name translate_z
sz softlowerlim 0
sz softupperlim 280.0
sz home 0

View File

@@ -164,13 +164,13 @@ namespace eval ::scobj::galil {
# Report the abstract status to GumTree
hfactory $batpath/status plain user text
hsetprop $batpath/status read ${NS}::getStatus
hsetprop $batpath/status read ${NS}::getStatus
hsetprop $batpath/status rdStatus ${NS}::rdStatus $batObjName
hsetprop $batpath/status values busy,idle
hsetprop $batpath/status oldval UNKNOWN
hsetprop $batpath/status oldStatus UNKNOWN
hset $batpath/status idle
# Report the current position in encoder counts
# Useful as an activity monitor and troubleshooting.
hfactory $batpath/pos plain user int
@@ -179,10 +179,10 @@ namespace eval ::scobj::galil {
hsetprop $batpath/pos oldval UNKNOWN
if {$sim_mode == "false"} {
sct_mc1 poll $batpath/pos
sct_mc1 poll $batpath/action
sct_mc1 poll $batpath/status
sct_mc1 write $batpath/action
sct_mc1 poll $batpath/pos
sct_mc1 poll $batpath/action
sct_mc1 poll $batpath/status
sct_mc1 write $batpath/action
}
# Set hipadaba properties for GumTree interface

View File

@@ -51,7 +51,7 @@ foreach vn {
}
foreach vn {
mode
mode
guide_element
} {
::utility::mkVar $vn Text manager $vn true parameter true true
@@ -60,7 +60,7 @@ foreach vn {
detector_distance 10000
detector_base 300
anal_distance 6894.94
anal_distance 6894.94
anal_base 20
slit4_distance 5331.15
slit4_base 20
@@ -69,14 +69,14 @@ sample_base 50
slit3_distance 4744.4
slit3_base 20
guide1_distance 2900.4 ;# distance measured to axis of rotation
guide1_base
guide1_base
guide2_distance 3200 ;# distance measured to midpoint of the 2nd compound mirror (i.e. closest to the sample)
guide2_base
slit2_distance 1909.9
slit2_base 20
chopper4_distance 808
chopper4_base 20
chopper4_phase_offset 14.465
chopper4_phase_offset 14.465
chopper3_distance 359
chopper3_base 20
chopper3_phase_offset 14.59

View File

@@ -1,5 +1,5 @@
set sim_mode [SplitReply [plc_simulation]]
if {$sim_mode == "false"} {
if {$sim_mode == "false"} {
MakeAsyncQueue plc_chan SafetyPLC 137.157.211.22 31001
MakeSafetyPLC plc plc_chan 0
}

View File

@@ -1,4 +1,4 @@
source $cfPath(scan)/scan_common_1.tcl
source $cfPath(scan)/scan_common_1.tcl
::scan::runscan_reset_position true
##
# @brief Make sure that the chopper is ready before starting a scan.
@@ -6,7 +6,7 @@ source $cfPath(scan)/scan_common_1.tcl
#proc ::scan::pre_hmm_scan_prepare {} {
# if [catch {::histogram_memory::tochfreq} errmsg] {
# return -code error $errmsg
# }
# }
#}
proc ::scan::isc_initialize {} {

View File

@@ -1,8 +1,8 @@
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Required by server_config.tcl
# Required by server_config.tcl
VarMake Instrument Text Internal
Instrument platypus
Instrument platypus
Instrument lock
#START SERVER CONFIGURATION SECTION