Remove superfluous trailing white space from TCL files
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
#-------------------------------------------------------------------------
|
||||
# Functions for writing NeXus files for a triple axis spectrometer and
|
||||
# Functions for writing NeXus files for a triple axis spectrometer and
|
||||
# configuration of the internal scan object to support this.
|
||||
#
|
||||
# Mark Koennecke, May 2005
|
||||
# reworked to new NeXus standards, Mark Koennecke, February 2007
|
||||
#-----------------------------------------------------------------------
|
||||
catch {sicsdatafactory new __transfer}
|
||||
catch {sicsdatafactory new __transfer}
|
||||
set __tasdata(out) ""
|
||||
#----------------------------------------------------------------------
|
||||
proc appendMotor {np motor alias} {
|
||||
set val [tasSplit [$motor]]
|
||||
if { [string length $val] > 0} {
|
||||
__transfer putfloat 0 $val
|
||||
nxscript putslab $alias [list $np] [list 1] __transfer
|
||||
nxscript putslab $alias [list $np] [list 1] __transfer
|
||||
} else {
|
||||
clientput "WARNING: failed to read $motor"
|
||||
}
|
||||
@@ -33,22 +33,22 @@ proc appendIfPresent {np obj alias} {
|
||||
proc appendFloat {np alias val} {
|
||||
if {[string length $val] > 0} {
|
||||
__transfer putfloat 0 $val
|
||||
nxscript putslab $alias [list $np] [list 1] __transfer
|
||||
nxscript putslab $alias [list $np] [list 1] __transfer
|
||||
} else {
|
||||
clientput "WARNING: failed to read $alias"
|
||||
clientput "WARNING: failed to read $alias"
|
||||
}
|
||||
}
|
||||
#-------------------------------------------------------------------
|
||||
proc appendCount {np value alias} {
|
||||
__transfer putint 0 $value
|
||||
nxscript putslab $alias [list $np] [list 1] __transfer
|
||||
nxscript putslab $alias [list $np] [list 1] __transfer
|
||||
}
|
||||
#--------------------------------------------------------------------
|
||||
#--------------------------------------------------------------------
|
||||
proc donothing {obj userobj} {
|
||||
}
|
||||
#---------------------------------------------------------------------
|
||||
proc xmlprepare {obj userobj} {
|
||||
global __tasdata
|
||||
global __tasdata
|
||||
#------- normal prepare
|
||||
tasscan prepare $obj $userobj
|
||||
|
||||
@@ -92,24 +92,24 @@ proc xmlprepare {obj userobj} {
|
||||
#--------------------------------------------------------------------
|
||||
proc xmlwritepoint {obj userobj np} {
|
||||
global __tasdata scripthome
|
||||
|
||||
|
||||
nxscript reopen $__tasdata(file) $scripthome/tasub.dic
|
||||
|
||||
|
||||
append line [format " %3d" $np]
|
||||
set scanvars [split [tasSplit [iscan getscanvars]]]
|
||||
foreach var $scanvars {
|
||||
if { [string length $var] > 1} {
|
||||
set val [tasSplit [eval $var]]
|
||||
append line [format "%9.4f " [tasSplit [$var]]]
|
||||
appendMotor $np $var sc_$var
|
||||
append line [format "%9.4f " [tasSplit [$var]]]
|
||||
appendMotor $np $var sc_$var
|
||||
lappend storedvars $var
|
||||
}
|
||||
}
|
||||
foreach var $__tasdata(out) {
|
||||
append line [format "%9.4f " [tasSplit [eval $var]]]
|
||||
appendMotor $np $var sc_$var
|
||||
appendMotor $np $var sc_$var
|
||||
lappend storedvars $var
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -118,12 +118,12 @@ proc xmlwritepoint {obj userobj np} {
|
||||
append line [format "%8.2f " [tasSplit [counter gettime]]]
|
||||
append line [format "%8d " [tasSplit [counter getcounts]]]
|
||||
clientput $line
|
||||
|
||||
|
||||
appendCount $np [tasSplit [counter getcounts]] counts
|
||||
appendCount $np [tasSplit [counter getmonitor 1]] cter_01
|
||||
appendCount $np [tasSplit [counter getcounts]] cter_02
|
||||
appendFloat $np motime [tasSplit [counter gettime]]
|
||||
|
||||
appendFloat $np motime [tasSplit [counter gettime]]
|
||||
|
||||
set varlist [list qh qk ql qm en ei ef a1 a2 a3 a4 a5 a6 sgu sgl]
|
||||
|
||||
foreach var $varlist {
|
||||
@@ -131,11 +131,11 @@ proc xmlwritepoint {obj userobj np} {
|
||||
appendMotor $np $var sc_${var}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if {$np == 0} {
|
||||
makeTASLinks
|
||||
}
|
||||
|
||||
|
||||
nxscript close
|
||||
}
|
||||
#====================== actual XML stuff ============================
|
||||
@@ -144,7 +144,7 @@ proc writeUserData {} {
|
||||
writeTextVar usaff affiliation
|
||||
writeTextVar usadd address
|
||||
writeTextVar usmail email
|
||||
writeTextVar lonam local
|
||||
writeTextVar lonam local
|
||||
}
|
||||
#-------------------------------------------------------------------
|
||||
proc writeMonochromator {} {
|
||||
@@ -249,19 +249,19 @@ proc makeScanLinks {} {
|
||||
if {$testalias == 1} {
|
||||
nxscript putattribute $alias axis 1
|
||||
set axis 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# if axis = 0 there is no alias; so we create something in here from the
|
||||
# scan data in iscan
|
||||
# if axis = 0 there is no alias; so we create something in here from the
|
||||
# scan data in iscan
|
||||
if {$axis == 0} {
|
||||
set data [tasSplit [iscan getvardata 0]]
|
||||
set count 0
|
||||
foreach e $data {
|
||||
set ar($count) [string trim $e]
|
||||
incr count
|
||||
}
|
||||
}
|
||||
nxscript putarray danascanvar ar [llength $data]
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,7 @@ proc xmltaswrite {obj userobj} {
|
||||
|
||||
writeAnalyzer
|
||||
|
||||
writeDetector
|
||||
writeDetector
|
||||
|
||||
|
||||
nxscript close
|
||||
@@ -326,7 +326,7 @@ proc xmlpowderwrite {obj userobj} {
|
||||
|
||||
writeAnalyzer
|
||||
|
||||
writeDetector
|
||||
writeDetector
|
||||
|
||||
makePowderLinks
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# O P T I O N S
|
||||
#--------------------------------------------------------------------------
|
||||
# simMode
|
||||
# - 0 real instrument
|
||||
# - 0 real instrument
|
||||
# - 1 development simulation
|
||||
# - 2 simserver at instrument
|
||||
#--------------------------------------------------------------------------
|
||||
@@ -16,7 +16,7 @@ set simMode 1
|
||||
set ts psts230.psi.ch
|
||||
set mupad 0
|
||||
|
||||
#---------- Enable this for more startup debugging
|
||||
#---------- Enable this for more startup debugging
|
||||
protocol set all
|
||||
|
||||
#--------------- define home
|
||||
@@ -40,7 +40,7 @@ ServerOption ReadTimeOut 10
|
||||
|
||||
ServerOption AcceptTimeOut 10
|
||||
|
||||
ServerOption ReadUserPasswdTimeout 500000
|
||||
ServerOption ReadUserPasswdTimeout 500000
|
||||
|
||||
ServerOption LogFileBaseName $loghome/tasplog
|
||||
|
||||
@@ -70,7 +70,7 @@ SicsUser lnsmanager lnsSICSlns 1
|
||||
SicsUser user 10lns1 2
|
||||
SicsUser taspuser 10lns1 2
|
||||
#---------------------------------------------------------------------------
|
||||
# M O T O R S
|
||||
# M O T O R S
|
||||
|
||||
if {$simMode == 0} {
|
||||
|
||||
@@ -95,7 +95,7 @@ Motor MCV el734hp mota 3 # Monochromator curvature vertical
|
||||
Motor SRO el734hp mota 12 # Sample table second ring
|
||||
Motor MTL el734hp mota 4 # Monochromator translation lower
|
||||
Motor MTU el734hp mota 5 # Monochromator Translation upper
|
||||
Motor MGL el734hp mota 7 # Monochromator lower goniometer
|
||||
Motor MGL el734hp mota 7 # Monochromator lower goniometer
|
||||
|
||||
|
||||
MakeRS232Controller motb $ts 3003
|
||||
@@ -115,14 +115,14 @@ Motor STL el734hp motb 1 # Sample lower translation
|
||||
Motor STU el734hp motb 2 # Sample upper translation
|
||||
Motor ATL el734hp motb 7 # Analyzer lower translation
|
||||
Motor ATU el734hp motb 8 # Analyzer upper translation
|
||||
#Motor SGL SIM -17 17 -1 .0 # Monochromator upper goniometer
|
||||
#Motor SGU SIM -17 17 -1 .0 # Monochromator upper goniometer
|
||||
Motor SGL el734hp motb 3 # Sample lower goniometer
|
||||
Motor SGU el734hp motb 4 # Sample upper goniometer
|
||||
Motor AGL el734hp motb 11 # Analyzer lower goniometer
|
||||
#Motor AGU SIM -30. 30. -.1 2. # Analyzer upper goniometer
|
||||
#Motor MSC SIM -30. 30. -.1 2. # Monochromator changer
|
||||
#Motor ASC SIM -30. 30. -.1 2. # Analyzer changer
|
||||
#Motor SGL SIM -17 17 -1 .0 # Monochromator upper goniometer
|
||||
#Motor SGU SIM -17 17 -1 .0 # Monochromator upper goniometer
|
||||
Motor SGL el734hp motb 3 # Sample lower goniometer
|
||||
Motor SGU el734hp motb 4 # Sample upper goniometer
|
||||
Motor AGL el734hp motb 11 # Analyzer lower goniometer
|
||||
#Motor AGU SIM -30. 30. -.1 2. # Analyzer upper goniometer
|
||||
#Motor MSC SIM -30. 30. -.1 2. # Monochromator changer
|
||||
#Motor ASC SIM -30. 30. -.1 2. # Analyzer changer
|
||||
#Motor CSC SIM -30. 30. -.1 2. # Collimator changer
|
||||
mcv precision .1
|
||||
} else {
|
||||
@@ -141,10 +141,10 @@ Motor SGL sim -19 19 -1. 0 # Sample lower translation
|
||||
Motor SGU SIM -30. 30. -.1 2. # Sample upper translation
|
||||
Motor ATL sim -17 17 -.1 .1 # Analyzer lower translation
|
||||
Motor ATU sim -17 17 -.1 .1 # Analyzer upper translation
|
||||
Motor MGL sim -10 10 -.1 .1 # Monochromator lower goniometer
|
||||
Motor SGL sim -16 16 -.1 .1 # Sample lower goniometer
|
||||
Motor SGU sim -16 16 -.1 .1 # Sample upper goniometer
|
||||
Motor AGL sim -10 10 -.1 .1 # Analyzer lower goniometer
|
||||
Motor MGL sim -10 10 -.1 .1 # Monochromator lower goniometer
|
||||
Motor SGL sim -16 16 -.1 .1 # Sample lower goniometer
|
||||
Motor SGU sim -16 16 -.1 .1 # Sample upper goniometer
|
||||
Motor AGL sim -10 10 -.1 .1 # Analyzer lower goniometer
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# C U R R E N T S
|
||||
@@ -180,7 +180,7 @@ MakeCounter counter sim -1.
|
||||
#--------------------------------------------------------------------------
|
||||
VarMake instrument Text Mugger
|
||||
instrument TASPUB
|
||||
instrument lock
|
||||
instrument lock
|
||||
|
||||
VarMake title Text User
|
||||
VarMake user Text User
|
||||
@@ -203,12 +203,12 @@ source $scripthome/stddrive.tcl
|
||||
source $scripthome/slsecho.tcl
|
||||
if {$simMode == 0} {
|
||||
makesctcontroller slssct slsecho taspmagnet:5001
|
||||
slsecho::makeslsecho i1 0 slssct
|
||||
slsecho::makeslsecho i2 1 slssct
|
||||
slsecho::makeslsecho i3 2 slssct
|
||||
slsecho::makeslsecho i4 3 slssct
|
||||
slsecho::makeslsecho i5 4 slssct
|
||||
slsecho::makeslsecho i6 5 slssct
|
||||
slsecho::makeslsecho i1 0 slssct
|
||||
slsecho::makeslsecho i2 1 slssct
|
||||
slsecho::makeslsecho i3 2 slssct
|
||||
slsecho::makeslsecho i4 3 slssct
|
||||
slsecho::makeslsecho i5 4 slssct
|
||||
slsecho::makeslsecho i6 5 slssct
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ MakeTasUB tasub
|
||||
MakeScanCommand iscan counter tas.hdd recover.bin
|
||||
MakePeakCenter iscan
|
||||
MakeTasScan iscan tasub
|
||||
#-------------------------- new exe manager
|
||||
#-------------------------- new exe manager
|
||||
definealias do exe
|
||||
alias batchroot exe batchpath
|
||||
#-------------------------- normal drive command
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#---------------------------------------------------------------------------
|
||||
# The triple axis people love to have the command set emulate the command
|
||||
# set of TASMAD as closely as possible. This is implemented through
|
||||
# The triple axis people love to have the command set emulate the command
|
||||
# set of TASMAD as closely as possible. This is implemented through
|
||||
# some scripting. This version is for the new syntax to be used with the
|
||||
# new UB matrix calculaus for triple axis.
|
||||
#
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# This file contains all the scripted commands to make a SICS-TAS look
|
||||
# almost like a MAD-TAS.
|
||||
# almost like a MAD-TAS.
|
||||
#
|
||||
# This version is special to RITA-2!!
|
||||
#
|
||||
# Mark Koennecke, September 2005
|
||||
#
|
||||
# The specialities for RITA have been separated and this is controlled
|
||||
# by testing the instrument name. This way I can use the same version for
|
||||
# The specialities for RITA have been separated and this is controlled
|
||||
# by testing the instrument name. This way I can use the same version for
|
||||
# TASP, RITA-2 and EIGER
|
||||
#
|
||||
#
|
||||
# Mark Koennecke, November 2010
|
||||
#------------------------------------------------------------------------
|
||||
# quite often we need to split a SICS answer of the form x = y and
|
||||
# quite often we need to split a SICS answer of the form x = y and
|
||||
# extract the y. This is done here.
|
||||
#-----------------------------------------------------------------------
|
||||
proc tasSplit {text} {
|
||||
@@ -152,7 +152,7 @@ if { [info exists tasubinit] == 0 } {
|
||||
}
|
||||
#------------------------------------------------------------------------
|
||||
# TASMAD relies on the order of variables in memory in order to interpret
|
||||
# scan or drive commands. In the new syntax motor order is only preserved
|
||||
# scan or drive commands. In the new syntax motor order is only preserved
|
||||
# for the QE motors, not for real motors. This list configures the order.
|
||||
#------------------------------------------------------------------------
|
||||
set tasOrderList [list qh qk ql en]
|
||||
@@ -166,7 +166,7 @@ for {set i 0} {$i < [llength $tasmot]} { incr i } {
|
||||
set tasmap(l$mot) [format "%s softlowerlim " $mot]
|
||||
set tasmap(z$mot) [format "madZero %s " $mot]
|
||||
set tasmap(u$mot) [format "%s softupperlim " $mot]
|
||||
}
|
||||
}
|
||||
set tasmap(ss) "scatSense ss "
|
||||
set tasmap(sa) "scatSense sa "
|
||||
set tasmap(sm) "scatSense sm "
|
||||
@@ -186,7 +186,7 @@ for {set i 0} { $i < 8} { incr i} {
|
||||
# clientput [format " %s = %s" $e $tasmap($e)]
|
||||
#}
|
||||
#----------------------------------------------------------------------
|
||||
# put an angle into 360
|
||||
# put an angle into 360
|
||||
proc circlify {val} {
|
||||
set p $val
|
||||
while {$p > 360.0} {
|
||||
@@ -207,12 +207,12 @@ proc madZero args {
|
||||
set length [llength $args]
|
||||
if { $length < 1} {
|
||||
error "ERROR: expected at least motor name as a parameter to madZero"
|
||||
}
|
||||
}
|
||||
set mot [lindex $args 0]
|
||||
if {$length == 1 } {
|
||||
#inquiry case
|
||||
set zero [tasSplit [$mot softzero]]
|
||||
return [format "madZero = %f " [expr -$zero]]
|
||||
return [format "madZero = %f " [expr -$zero]]
|
||||
} else {
|
||||
# a new value has been given.
|
||||
set val [lindex $args 1]
|
||||
@@ -225,14 +225,14 @@ proc madZero args {
|
||||
$mot softupperlim [circlify [expr $high - $displacement]]
|
||||
$mot softlowerlim [circlify [expr $low - $displacement]]
|
||||
}
|
||||
}
|
||||
}
|
||||
#--------------------------------------------------------------------------
|
||||
# This routine throws an error if a bad value for fx is given
|
||||
#--------------------------------------------------------------------------
|
||||
proc fxi { {val UNKNOWN} } {
|
||||
if {[string compare $val UNKNOWN] ==0} {
|
||||
return [format " fx = %2s " [tasSplit [tasub const]] ]
|
||||
}
|
||||
}
|
||||
return [tasub const $val]
|
||||
}
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -258,17 +258,17 @@ proc scatSense {par {val -1000} } {
|
||||
error "ERROR: unknown scattering sense $par"
|
||||
}
|
||||
}
|
||||
#-------- inquiry case
|
||||
#-------- inquiry case
|
||||
if { $val == -1000 } {
|
||||
switch $par {
|
||||
sm {
|
||||
return [format "sm = %d" [tasSplit [tasub mono ss]]]
|
||||
return [format "sm = %d" [tasSplit [tasub mono ss]]]
|
||||
}
|
||||
ss {
|
||||
return [format "ss = %d" [tasSplit [tasub ss]]]
|
||||
return [format "ss = %d" [tasSplit [tasub ss]]]
|
||||
}
|
||||
sa {
|
||||
return [format "sa = %d" [tasSplit [tasub ana ss]]]
|
||||
return [format "sa = %d" [tasSplit [tasub ana ss]]]
|
||||
}
|
||||
default {
|
||||
error "Unknown scattering sense requested"
|
||||
@@ -325,9 +325,9 @@ proc scatSense {par {val -1000} } {
|
||||
madZero $mot $newzero
|
||||
$mot softupperlim $newupper
|
||||
$mot softlowerlim $newlower
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#-------------------------------------------------------------------------
|
||||
# The output command
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -350,11 +350,11 @@ proc ou args {
|
||||
# typeATokenizer extracts tokens from a command string. Tokens can be
|
||||
# either variable names or - indicating a series of variables.
|
||||
# Returns the token value or END if the end of the string text is
|
||||
# reached. Uses and updates a variable pos which indicates the current
|
||||
# reached. Uses and updates a variable pos which indicates the current
|
||||
# position in the string.
|
||||
#---------------------------------------------------------------------------
|
||||
proc typeATokenizer {text pos} {
|
||||
upvar pos p
|
||||
upvar pos p
|
||||
set l [string length $text]
|
||||
#------- check for end
|
||||
if {$p >= $l} {
|
||||
@@ -408,7 +408,7 @@ proc cl args {
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
#------ trying to clear individual fixed motors
|
||||
set command [join $args]
|
||||
set command [string tolower $command]
|
||||
@@ -438,10 +438,10 @@ proc cl args {
|
||||
error [format "ERROR: %s is no motor" $e]
|
||||
} else {
|
||||
clientput [format "%s unfixed" $e]
|
||||
}
|
||||
}
|
||||
if {[string compare $e $stop] == 0 } {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#------ should be a single motor here
|
||||
@@ -451,7 +451,7 @@ proc cl args {
|
||||
error [format "ERROR: %s is no motor" $token]
|
||||
} else {
|
||||
clientput [format "%s unfixed" $token]
|
||||
}
|
||||
}
|
||||
}
|
||||
#------- do not forget to proceed
|
||||
set token [typeATokenizer $command $pos]
|
||||
@@ -478,7 +478,7 @@ proc fi args {
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
#------ parse motors to fix
|
||||
set command [join $args]
|
||||
set command [string tolower $command]
|
||||
@@ -508,10 +508,10 @@ proc fi args {
|
||||
error [format "ERROR: %s is no motor" $e]
|
||||
} else {
|
||||
clientput [format "%s fixed" $e]
|
||||
}
|
||||
}
|
||||
if {[string compare $e $stop] == 0 } {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#------ should be a single motor here
|
||||
@@ -521,7 +521,7 @@ proc fi args {
|
||||
error [format "ERROR: %s is no motor" $token]
|
||||
} else {
|
||||
clientput [format "%s fixed" $token]
|
||||
}
|
||||
}
|
||||
}
|
||||
#------- do not forget to proceed
|
||||
set token [typeATokenizer $command $pos]
|
||||
@@ -532,7 +532,7 @@ proc fi args {
|
||||
# handles pos as in type A syntax above.
|
||||
#--------------------------------------------------------------------------
|
||||
proc varToken {text pos} {
|
||||
upvar pos p
|
||||
upvar pos p
|
||||
set l [string length $text]
|
||||
#------- check for end
|
||||
if {$p >= $l} {
|
||||
@@ -565,7 +565,7 @@ proc varToken {text pos} {
|
||||
# varSet parses a string containing MAD variable statements and sets the
|
||||
# variables. Thereby it has to take care of mappings and special variables
|
||||
# which have to be set by special functions. The only format allowed here
|
||||
# are name value pairs.
|
||||
# are name value pairs.
|
||||
#--------------------------------------------------------------------------
|
||||
proc varSet { command } {
|
||||
global tasmap
|
||||
@@ -580,7 +580,7 @@ proc varSet { command } {
|
||||
[string compare $token local] == 0 } {
|
||||
eval $command
|
||||
return
|
||||
}
|
||||
}
|
||||
if { [string compare $token out] == 0 || \
|
||||
[string compare $token ou] == 0 } {
|
||||
append txt $token " " [string range $command $pos end]
|
||||
@@ -597,37 +597,37 @@ proc varSet { command } {
|
||||
if { [info exists tasmap($token)] == 1} {
|
||||
set ret [catch {eval $tasmap($token) $value} msg]
|
||||
if { $ret != 0} {
|
||||
error [format "ERROR: > %s < while setting %s" $msg $token]
|
||||
error [format "ERROR: > %s < while setting %s" $msg $token]
|
||||
} else {
|
||||
clientput [format " %s = %s" $token $value]
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
set ret [catch {eval $token $value} msg]
|
||||
if { $ret != 0 } {
|
||||
error [format "ERROR: error %s while setting %s" $msg $token]
|
||||
error [format "ERROR: error %s while setting %s" $msg $token]
|
||||
} else {
|
||||
clientput [format " %s = %s" $token $value]
|
||||
}
|
||||
}
|
||||
}
|
||||
set token [varToken $command $pos]
|
||||
set value [varToken $command $pos]
|
||||
}
|
||||
catch {tasub update} msg
|
||||
}
|
||||
#--------------------------------------------------------------------------
|
||||
# co for count is the funny MAD count procedure. Please note, that the
|
||||
# co for count is the funny MAD count procedure. Please note, that the
|
||||
# count mode is automatically set through the last MN or TI variable.
|
||||
#--------------------------------------------------------------------------
|
||||
proc coritacount {mode preset nloop} {
|
||||
set rmode [ritamode]
|
||||
set rmode [ritamode]
|
||||
hm countmode $mode
|
||||
hm preset $preset
|
||||
for { set i 0} {$i < $nloop} {incr i} {
|
||||
set ret [catch {eval hm countblock} msg]
|
||||
set ret [catch {eval hm countblock} msg]
|
||||
if {$ret != 0} {
|
||||
error $msg
|
||||
}
|
||||
#----- format output
|
||||
#----- format output
|
||||
set cts [tasSplit [hm sum 0 127 0 127]]
|
||||
set m1 [tasSplit [counter getmonitor 1]]
|
||||
set m2 [tasSplit [counter getmonitor 2]]
|
||||
@@ -642,18 +642,18 @@ proc coritacount {mode preset nloop} {
|
||||
append txt [format " %s = %d" $win [sumPSDWindow $i]]
|
||||
}
|
||||
clientput $txt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#------------------------------------------------------------------------
|
||||
proc conormalcount {mode preset nloop} {
|
||||
counter setmode $mode
|
||||
for { set i 0} {$i < $nloop} {incr i} {
|
||||
set ret [catch {eval counter count $preset } msg]
|
||||
set ret [catch {eval counter count $preset } msg]
|
||||
if {$ret != 0} {
|
||||
error $msg
|
||||
}
|
||||
#----- format output
|
||||
#----- format output
|
||||
set cts [tasSplit [counter getcounts]]
|
||||
set m1 [tasSplit [counter getmonitor 1]]
|
||||
set m2 [tasSplit [counter getmonitor 2]]
|
||||
@@ -664,7 +664,7 @@ proc conormalcount {mode preset nloop} {
|
||||
" Counts = %8d, M1 = %8d, M2 = %8d, M3 = %8d, Time = %8.2f" \
|
||||
$cts $m1 $m2 $m3 $time]
|
||||
}
|
||||
}
|
||||
}
|
||||
#-------------------------------------------------------------------------
|
||||
proc co args {
|
||||
global ritaspecial
|
||||
@@ -712,17 +712,17 @@ proc co args {
|
||||
#----------------------------------------------------------------------------
|
||||
proc fm args {
|
||||
#------ do the scan first
|
||||
append com "sc " [ join $args]
|
||||
append com "sc " [ join $args]
|
||||
set ret [catch {eval $com} msg]
|
||||
if { $ret != 0 } {
|
||||
error $msg
|
||||
}
|
||||
}
|
||||
# iscan simscan 15 .3 1000
|
||||
#----- calculate the center
|
||||
set ret [catch {eval peak value} msg]
|
||||
if { $ret != 0 } {
|
||||
error $msg
|
||||
}
|
||||
}
|
||||
if { [string first "WARN" $msg ] >= 0 } {
|
||||
error [format "ERROR: failed to find peak: %s" $msg]
|
||||
}
|
||||
@@ -737,7 +737,7 @@ proc fm args {
|
||||
set ret [catch {eval dr $var $val} msg]
|
||||
if { $ret != 0 } {
|
||||
error $msg
|
||||
}
|
||||
}
|
||||
}
|
||||
#------------------------------------------------------------------------
|
||||
# fz does almost the same as fm, but also sets the current position to be
|
||||
@@ -745,17 +745,17 @@ proc fm args {
|
||||
#------------------------------------------------------------------------
|
||||
proc fz args {
|
||||
#------ do the scan first
|
||||
append com "sc " [ join $args]
|
||||
append com "sc " [ join $args]
|
||||
set ret [catch {eval $com} msg]
|
||||
if { $ret != 0 } {
|
||||
error $msg
|
||||
}
|
||||
}
|
||||
iscan simscan 15 .3 1000
|
||||
#----- calculate the center
|
||||
set ret [catch {eval peak value} msg]
|
||||
if { $ret != 0 } {
|
||||
error $msg
|
||||
}
|
||||
}
|
||||
if { [string first "WARN" $msg ] >= 0 } {
|
||||
error [format "ERROR: failed to find peak: %s" $msg]
|
||||
}
|
||||
@@ -770,7 +770,7 @@ proc fz args {
|
||||
set ret [catch {eval dr $var $val} msg]
|
||||
if { $ret != 0 } {
|
||||
error $msg
|
||||
}
|
||||
}
|
||||
#------- now do zero point
|
||||
set temp [eval $var hardposition]
|
||||
set newZero [tasSplit $temp]
|
||||
@@ -785,16 +785,16 @@ proc pr args {
|
||||
set line [join $args]
|
||||
set line [string tolower $line]
|
||||
set pos 0
|
||||
set token [varToken $line $pos]
|
||||
set token [varToken $line $pos]
|
||||
while { [string compare $token -end] } {
|
||||
#-------- check for mapped values first
|
||||
if { [info exists tasmap($token)] == 1 } {
|
||||
set val [tasSplit [eval $tasmap($token)]]
|
||||
clientput [format " %s = %s" $token $val]
|
||||
clientput [format " %s = %s" $token $val]
|
||||
} else {
|
||||
#------ simple variables go here
|
||||
set val [tasSplit [$token] ]
|
||||
clientput [format " %s = %s" $token $val]
|
||||
clientput [format " %s = %s" $token $val]
|
||||
}
|
||||
set token [varToken $line $pos]
|
||||
}
|
||||
@@ -858,7 +858,7 @@ proc lz args {
|
||||
incr count
|
||||
if { $count == 6 } {
|
||||
append outPut " \n"
|
||||
}
|
||||
}
|
||||
}
|
||||
return $outPut
|
||||
}
|
||||
@@ -962,7 +962,7 @@ proc le args {
|
||||
append output [format "POSN: %s" $val]
|
||||
append output [format "TARG: %s" $val2]
|
||||
|
||||
return $output
|
||||
return $output
|
||||
}
|
||||
#-----------------------------------------------------------------------
|
||||
# fmtMot formats a motors parameters in order to fit the format for
|
||||
@@ -980,7 +980,7 @@ proc fmtMot mot {
|
||||
set txt [format "%-7s%1s %7.2f %7.2f %7.2f" $mot $fix $pos $target \
|
||||
$zero]
|
||||
return $txt
|
||||
}
|
||||
}
|
||||
#-------------------------------------------------------------------------
|
||||
# lt --> list targets
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -1011,7 +1011,7 @@ proc lt args {
|
||||
[fmtMot MTL] " " ]
|
||||
append output [format "%s | %s\n" \
|
||||
[fmtMot MTU] " " ]
|
||||
return $output
|
||||
return $output
|
||||
}
|
||||
#--------------------------------------------------------------------
|
||||
# li --> list everything
|
||||
@@ -1044,9 +1044,9 @@ proc log args {
|
||||
if { [ llength $args] == 0 } {
|
||||
if { [string compare $madlog disabled] == 0 } {
|
||||
return "Logging is disabled"
|
||||
} else {
|
||||
} else {
|
||||
return [format "Logging to %s" $madlog]
|
||||
}
|
||||
}
|
||||
}
|
||||
#------args, action according to keyword
|
||||
set key [string tolower [lindex $args 0]]
|
||||
@@ -1070,7 +1070,7 @@ proc log args {
|
||||
append output "\tLog close : stop logging\n"
|
||||
return $output
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
@@ -1080,7 +1080,7 @@ proc sz args {
|
||||
global tasmot
|
||||
set usage "\n Usage: \n\t sz motor newval \n"
|
||||
set line [string tolower [join $args]]
|
||||
set pos 0
|
||||
set pos 0
|
||||
set mot [varToken $line $pos]
|
||||
set val [varToken $line $pos]
|
||||
if { [lsearch $tasmot $mot] < 0 } {
|
||||
@@ -1091,7 +1091,7 @@ proc sz args {
|
||||
}
|
||||
#-------- output, output, output.........
|
||||
append output [format "Values : Lo(hard) Lo(soft) Posn%s" \
|
||||
" Target Hi(soft) Hi(hard) Zero\n"]
|
||||
" Target Hi(soft) Hi(hard) Zero\n"]
|
||||
set zero [tasSplit [madZero $mot]]
|
||||
set loh [tasSplit [eval $mot hardlowerlim]]
|
||||
set loh [expr $loh + $zero]
|
||||
@@ -1134,7 +1134,7 @@ proc pa args {
|
||||
set fil $fil.pal
|
||||
}
|
||||
polfile $fil
|
||||
}
|
||||
}
|
||||
#--------------------------------------------------------------------------
|
||||
# on and off for switching spin flippers
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -1148,7 +1148,7 @@ proc checkarg args {
|
||||
return $flipper
|
||||
} else {
|
||||
error [format "%s not a recognized flipper" $flipper]
|
||||
}
|
||||
}
|
||||
}
|
||||
#------------------------------------------------------------------------
|
||||
proc on args {
|
||||
@@ -1198,7 +1198,7 @@ proc syncdrive {mot pos} {
|
||||
}
|
||||
}
|
||||
#--------------------------------------------------------------------------
|
||||
# "set posttion" sp to reset the zero-position.
|
||||
# "set posttion" sp to reset the zero-position.
|
||||
# syntax: "SP <axes> <value>" to set the softzero value of <axes>
|
||||
# in a way that the targetposition is set to <value>.
|
||||
# J. Stahn, 10. 2001
|
||||
@@ -1255,7 +1255,7 @@ proc scan {name} {
|
||||
info {
|
||||
set scanvar [findscanvar]
|
||||
append result [tasSplit [iscan np]] ",1," $scanvar
|
||||
append result ,
|
||||
append result ,
|
||||
append result [string trim [tasSplit [iscan getfile]]]
|
||||
return $result
|
||||
}
|
||||
@@ -1291,7 +1291,7 @@ proc dr args {
|
||||
error "ERROR: do not know what to drive to $token"
|
||||
}
|
||||
} else {
|
||||
set lastVar $token
|
||||
set lastVar $token
|
||||
lappend motors $lastVar
|
||||
}
|
||||
set token [varToken $command $pos]
|
||||
@@ -1340,7 +1340,7 @@ proc sc args {
|
||||
set lastVar quarkPhaser
|
||||
set pos 0
|
||||
set state 0
|
||||
# states:
|
||||
# states:
|
||||
# 0 = expectToken, 1 = expectPosition, 2 = continuePosition
|
||||
# 3 = expectIncrement, 4 = continueIncrement
|
||||
|
||||
@@ -1423,7 +1423,7 @@ proc sc args {
|
||||
error "ERROR: nothing to scan"
|
||||
}
|
||||
set __tasdata(qe) 0
|
||||
set qeVars [list qh qk ql ei ef en qm ki kf]
|
||||
set qeVars [list qh qk ql ei ef en qm ki kf]
|
||||
foreach var $scanvars {
|
||||
if {[lsearch -exact $qeVars [string tolower $var]] >= 0} {
|
||||
set __tasdata(qe) 1
|
||||
@@ -1445,7 +1445,7 @@ proc sc args {
|
||||
set start [expr $scanpos($var) - $inc($var) * ($np - 1)/2.]
|
||||
iscan add $var $start $inc($var)
|
||||
}
|
||||
return [iscan run $np $mode $preset]
|
||||
return [iscan run $np $mode $preset]
|
||||
}
|
||||
#---------------------------------------------------------------------
|
||||
proc cell args {
|
||||
@@ -1454,7 +1454,7 @@ proc cell args {
|
||||
#--------------------------------------------------------------------
|
||||
proc ref args {
|
||||
if { [llength $args] == 0} {
|
||||
return [tasub listref]
|
||||
return [tasub listref]
|
||||
}
|
||||
set key [string trim [lindex $args 0]]
|
||||
if { [string compare $key clear] == 0} {
|
||||
@@ -1470,13 +1470,13 @@ proc ref args {
|
||||
} elseif {[string compare $key aux] == 0} {
|
||||
set qpos [lrange $args 1 end]
|
||||
append cmd "tasub addauxref " [join $qpos]
|
||||
return [eval $cmd]
|
||||
return [eval $cmd]
|
||||
} else {
|
||||
return [eval tasub addref $args]
|
||||
}
|
||||
}
|
||||
#--------------------------------------------------------------------
|
||||
proc makeub args {
|
||||
proc makeub args {
|
||||
if { [llength $args] >= 2} {
|
||||
tasub makeub [lindex $args 0] [lindex $args 1]
|
||||
return OK
|
||||
@@ -1485,7 +1485,7 @@ proc makeub args {
|
||||
}
|
||||
}
|
||||
#--------------------------------------------------------------------
|
||||
proc makeauxub {qh qk ql} {
|
||||
proc makeauxub {qh qk ql} {
|
||||
tasub makeauxub $qh $qk $ql
|
||||
}
|
||||
#-------------------------------------------------------------------
|
||||
@@ -1493,18 +1493,18 @@ proc addauxref {qh qk ql} {
|
||||
tasub addauxref $qh $qk $ql
|
||||
}
|
||||
#--------------------------------------------------------------------
|
||||
proc makeubfromcell args {
|
||||
proc makeubfromcell args {
|
||||
return [tasub makeubfromcell]
|
||||
}
|
||||
#---------------------------------------------------------------------
|
||||
proc listub args {
|
||||
proc listub args {
|
||||
append output [tasSplit [tasub cell]]
|
||||
append output "\n"
|
||||
append output [tasub listub]
|
||||
append output [tasub listref]
|
||||
return $output
|
||||
}
|
||||
#----------------------------------------------------------------------
|
||||
#----------------------------------------------------------------------
|
||||
proc sf args {
|
||||
tasscan fast 1
|
||||
set ret [catch {eval sc $args} msg]
|
||||
|
||||
Reference in New Issue
Block a user