- Many fixes to the triple axis stuff
* update after a1-a6 drive * intrduction of targets - POLDI writing - Moved HKL calculation 4 TRICS to fourlib
This commit is contained in:
65
tascom.tcl
65
tascom.tcl
@@ -148,7 +148,7 @@ proc scatSense {par {val -1000} } {
|
||||
if { $val == -1000 } {
|
||||
return [eval $par]
|
||||
}
|
||||
if {$val != 1 && $val != -1 } {
|
||||
if {$val != 1 && $val != -1 && $val != 0 } {
|
||||
error "ERROR: invalid scattering sense $val"
|
||||
}
|
||||
switch $par {
|
||||
@@ -162,14 +162,43 @@ proc scatSense {par {val -1000} } {
|
||||
}
|
||||
sa {
|
||||
set oldzero [tasSplit [madZero $mot]]
|
||||
set newZero [expr $val*180 + $oldzero]
|
||||
madZero $mot $newZero
|
||||
a5 softlowerlim $newZero
|
||||
$par $val
|
||||
set oldupper [tasSplit [$mot softupperlim]]
|
||||
set oldlower [tasSplit [$mot softlowerlim]]
|
||||
set oldsa [tasSplit [sa]]
|
||||
if { $val == 0 && $oldsa == 1} {
|
||||
set newzero [expr $oldzero - 90.]
|
||||
set newlower [expr $oldlower - 90.]
|
||||
set newupper [expr $oldupper - 90.]
|
||||
} elseif {$val == 0 && $oldsa == -1} {
|
||||
set newzero [expr $oldzero + 90.]
|
||||
set newlower [expr $oldlower + 90.]
|
||||
set newupper [expr $oldupper + 90.]
|
||||
} elseif { $val == 1 && $oldsa == 0} {
|
||||
set newzero [expr $oldzero + 90.]
|
||||
set newlower [expr $oldlower + 90.]
|
||||
set newupper [expr $oldupper + 90.]
|
||||
} elseif { $val == -1 && $oldsa == 0} {
|
||||
set newzero [expr $oldzero - 90.]
|
||||
set newlower [expr $oldlower - 90.]
|
||||
set newupper [expr $oldupper - 90.]
|
||||
} elseif { $val == 1 && $oldsa == -1} {
|
||||
set newzero [expr $oldzero + 180. ]
|
||||
set newlower [expr $oldlower + 180. ]
|
||||
set newupper [expr $oldupper + 180. ]
|
||||
} elseif {$val == -1 && $oldsa == 1} {
|
||||
set newzero [expr $oldzero - 180. ]
|
||||
set newlower [expr $oldlower - 180. ]
|
||||
set newupper [expr $oldupper - 180. ]
|
||||
} else {
|
||||
error "Unknown SA setting combination"
|
||||
}
|
||||
$par $val
|
||||
madZero $mot $newzero
|
||||
$mot softupperlim $newupper
|
||||
$mot softlowerlim $newlower
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# The output command
|
||||
|
||||
@@ -190,7 +219,7 @@ proc ou args {
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# typeATokenizer extracts tokens from acpmmand string. Tokens can be
|
||||
# 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
|
||||
@@ -431,7 +460,6 @@ proc varSet { command } {
|
||||
} else {
|
||||
clientput [format " %s = %s" $token $value]
|
||||
}
|
||||
|
||||
} else {
|
||||
set ret [catch {eval $token $value} msg]
|
||||
if { $ret != 0 } {
|
||||
@@ -443,8 +471,8 @@ proc varSet { command } {
|
||||
set token [varToken $command $pos]
|
||||
set value [varToken $command $pos]
|
||||
}
|
||||
catch {updateqe} msg
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# 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.
|
||||
@@ -570,7 +598,7 @@ proc se args {
|
||||
#------- is it the only command line case?
|
||||
if {[llength $args] > 0 } {
|
||||
set line [join $args]
|
||||
return [varSet $line]
|
||||
return [varSet $line]
|
||||
} else {
|
||||
#------- we are prompting
|
||||
while { 1== 1} {
|
||||
@@ -728,14 +756,26 @@ proc le args {
|
||||
set v7 [tasSplit [ql]]
|
||||
set val [format " %9.4f %9.4f %9.4f %9.4f %9.4f %9.4f %9.4f \n" \
|
||||
$v1 $v2 $v3 $v4 $v5 $v6 $v7]
|
||||
set v1 [tasSplit [tei]]
|
||||
set v2 [tasSplit [tki]]
|
||||
set v3 [tasSplit [tef]]
|
||||
set v4 [tasSplit [tkf]]
|
||||
set v5 [tasSplit [tqh]]
|
||||
set v6 [tasSplit [tqk]]
|
||||
set v7 [tasSplit [tql]]
|
||||
set val2 [format " %9.4f %9.4f %9.4f %9.4f %9.4f %9.4f %9.4f \n" \
|
||||
$v1 $v2 $v3 $v4 $v5 $v6 $v7]
|
||||
append output [format "POSN: %s" $val]
|
||||
append output [format "TARG: %s" $val]
|
||||
append output [format "TARG: %s" $val2]
|
||||
append output [format " EN QM\n"]
|
||||
set v1 [tasSplit [en]]
|
||||
set v2 [tasSplit [qm]]
|
||||
set val [format " %9.4f %9.4f\n" $v1 $v2]
|
||||
set v1 [tasSplit [ten]]
|
||||
set v2 [tasSplit [qm]]
|
||||
set val2 [format " %9.4f %9.4f\n" $v1 $v2]
|
||||
append output [format "POSN: %s" $val]
|
||||
append output [format "TARG: %s" $val]
|
||||
append output [format "TARG: %s" $val2]
|
||||
|
||||
return $output
|
||||
}
|
||||
@@ -885,6 +925,7 @@ proc sz args {
|
||||
#-------action
|
||||
set newZero [expr $zero + ($val - $pos)]
|
||||
madZero $mot $newZero
|
||||
catch {updateqe} msg
|
||||
#-------- more output
|
||||
set zero [tasSplit [madZero $mot]]
|
||||
set loh [tasSplit [eval $mot hardlowerlim]]
|
||||
|
||||
Reference in New Issue
Block a user