Create object when in simulation mode nxscripts_common_1.tcl Set units attributes on script context objects data sans aperture_configuration.tcl Update rotary attenuator lookup table. Set parameters when motors positions are within tolerance of the lookup table positions. sans, parameters.tcl sct_velsel.tcl Set units and update parameter names to be consistent quokka_configuration.tcl Add convenience command to load environment controllers. server_config.tcl Make sure that controllers are properly generated when loading them from the ext raconfig.tcl. r2881 | ffr | 2010-01-29 16:50:51 +1100 (Fri, 29 Jan 2010) | 20 lines
86 lines
1.7 KiB
Tcl
86 lines
1.7 KiB
Tcl
namespace eval optics {
|
|
array set AttRotLookupTable {
|
|
0 0.0
|
|
30 1.3
|
|
60 3.3
|
|
90 4.9
|
|
120 6.4
|
|
150 8.3
|
|
180 9.6
|
|
210 11.2
|
|
240 13.1
|
|
270 15.0
|
|
300 18.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 tol} {
|
|
variable AttRotLookupTable
|
|
set foundit false
|
|
foreach vangle [array names AttRotLookupTable] {
|
|
if {$vangle >= [expr {$angle-$tol}] && $vangle <= [expr {$angle+$tol}]} {
|
|
set foundit true
|
|
break
|
|
}
|
|
}
|
|
if {$foundit == true} {
|
|
return [lindex $AttRotLookupTable($vangle) 0]
|
|
} else {
|
|
return -1
|
|
}
|
|
}
|
|
|
|
proc ::optics::EApLookUp {angle param tol} {
|
|
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 {$angle-$tol}] && $vangle <= [expr {$angle+$tol}]} {
|
|
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"
|
|
}
|
|
}
|