Oops calling the deleted hlistplainprop function instead of the new hlistprop. sans/config/commands/commands.tcl Set beamstop diameter (BSdiam) when selecting a beamstop sans optics/aperture_configuration.tcl The entrance app is 50mm when guide config is g1 to g9 or p1 to p9 sans parameters.tcl Added GuideConfig parameter to record the last configuration set by SICS. r2870 | ffr | 2010-01-15 18:19:22 +1100 (Fri, 15 Jan 2010) | 12 lines
86 lines
1.6 KiB
Tcl
86 lines
1.6 KiB
Tcl
namespace eval optics {
|
|
array set AttRotLookupTable {
|
|
0 0.0
|
|
30 1.5
|
|
60 3.4
|
|
90 4.9
|
|
120 6.4
|
|
150 8.3
|
|
180 9.8
|
|
210 11.2
|
|
240 13.2
|
|
270 18.1
|
|
300 23.0
|
|
330 25.0
|
|
}
|
|
|
|
array set EApLookupTable {
|
|
0 { 5 circ}
|
|
30 {10 circ}
|
|
60 {20 circ}
|
|
90 {30 circ}
|
|
120 {40 circ}
|
|
150 {50 circ}
|
|
180 {50 squ }
|
|
210 {open open}
|
|
240 {open open}
|
|
270 {open open}
|
|
300 {open open}
|
|
330 {open open}
|
|
}
|
|
}
|
|
|
|
proc ::optics::AttRotLookup {angle} {
|
|
variable AttRotLookupTable
|
|
set foundit false
|
|
foreach vangle [array names AttRotLookupTable] {
|
|
if {$vangle == [expr int($angle)]} {
|
|
set foundit true
|
|
break
|
|
}
|
|
}
|
|
if {$foundit == true} {
|
|
return [lindex $AttRotLookupTable($vangle) 0]
|
|
} else {
|
|
return -1
|
|
}
|
|
}
|
|
|
|
proc ::optics::EApLookUp {angle param} {
|
|
variable EApLookupTable
|
|
|
|
set foundit false
|
|
if [ catch {
|
|
if {$param == "size"} {
|
|
set cgf [SplitReply [GuideConfig]]
|
|
if {[string first $cgf "g1 g2 g3 g4 g5 g6 g7 g8 g9 p1 p2 p3 p4 p5 p6 p7 p8 p9"] != -1} {
|
|
return 50
|
|
}
|
|
}
|
|
switch $param {
|
|
"size" {set index 0}
|
|
"shape" {set index 1}
|
|
default {
|
|
error "ERROR: Invalid lookup parameter $param"
|
|
}
|
|
}
|
|
foreach vangle [array names EApLookupTable] {
|
|
if {$vangle == [expr int($angle)]} {
|
|
set foundit true
|
|
break
|
|
}
|
|
}
|
|
if {$foundit == true} {
|
|
return [lindex $EApLookupTable($vangle) $index]
|
|
} else {
|
|
switch $param {
|
|
"size" {return 0}
|
|
"shape" {return "UNKNOWN"}
|
|
}
|
|
}
|
|
} message ] {
|
|
if {$::errorCode == "NONE"} {return $message}
|
|
return -code error "$message"
|
|
}
|
|
}
|