r3098 | jgn | 2011-04-08 16:16:38 +1000 (Fri, 08 Apr 2011) | 1 line

This commit is contained in:
Jing Chen
2011-04-08 16:16:38 +10:00
committed by Douglas Clowes
parent a9f7812e47
commit 729a4c6eff
4 changed files with 3 additions and 163 deletions

View File

@@ -1,94 +0,0 @@
namespace eval optics {
array set AttRotLookupTable {
0 { 0.0 1 }
30 { 1.3 0.498782 }
60 { 3.3 0.176433 }
90 { 4.9 0.0761367 }
120 { 6.4 0.0353985 }
150 { 8.3 0.0137137 }
180 { 9.6 0.00614167 }
210 {11.2 0.00264554 }
240 {13.1 0.000994504 }
270 {15.0 0.000358897 }
300 {18.0 7.2845e-05 }
330 {25.0 1.67827e-06 }
}
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 column tol} {
variable AttRotLookupTable
set catch_status [ catch {
set foundit false
foreach vangle [array names AttRotLookupTable] {
if {$vangle >= [expr {$angle-$tol}] && $vangle <= [expr {$angle+$tol}]} {
set foundit true
break
}
}
if {$foundit == true} {
switch $column {
"plex" { set index 0 }
"attfactor" { set index 1 }
default { error "$column is unknown, allowed values are plex or attfactor" }
}
return [lindex $AttRotLookupTable($vangle) $index]
} else {
return -1
}
} message ]
handle_exception $catch_status $message
}
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"
}
}

View File

@@ -1,66 +0,0 @@
##
# @file
# A guide configuration table where each line describes the setup
# for a mode of operation.
# The table will have a corresponding interpretation list which provides
# commands to setup the instrument.
namespace eval optics {
##
# @brief These arrays map the component identifiers (G, MT, etc) to the
# position index for each guide motor (c1, c2 ... c9)
array set c1_map {G 1 MT 2 P 3}
array set c2_map {MT 1 G 2 A 3}
array set c3_map {MT 1 G 2 A 3}
array set c4_map {MT 1 G 2 A 3}
array set c5_map {MT 1 G 2 A 3}
array set c6_map {MT 1 G 2 A 3}
array set c7_map {MT 1 G 2 A 3}
array set c8_map {MT 1 G 2 A 3}
array set c9_map {L 1 MT 2 G 3 A 4 LP 5}
# The guide configuration table is indexed by a configuration
# identifier (ga, mt, lp, etc). Each row has two elements,
# 1. A list of components selected for each guide (MT A ... etc)
# 2. The entrance aperature position in mm
# Eg $guide_configuration(p2) returns the following list
# {{P G A A A A A A A } 6934}
array set guide_configuration {
ga {{MT A A A A A A A A } 675}
mt {{MT MT MT MT MT MT MT MT MT} 675}
lp {{MT MT MT MT MT MT MT MT LP} 675}
lens {{MT MT MT MT MT MT MT MT L } 675}
p1 {{P A MT MT MT MT MT MT MT} 4621}
p1lp {{P A MT MT MT MT MT MT LP} 4621}
p1lens {{P A MT MT MT MT MT MT L } 4621}
g1 {{G A A A A A A A A } 4929}
p2 {{P G A A A A A A A } 6934}
g2 {{G G A A A A A A A } 6934}
p3 {{P G G A A A A A A } 8949}
g3 {{G G G A A A A A A } 8949}
p4 {{P G G G A A A A A } 10955}
g4 {{G G G G A A A A A } 10955}
p5 {{P G G G G A A A A } 12943}
g5 {{G G G G G A A A A } 12943}
p6 {{P G G G G G A A A } 14970}
g6 {{G G G G G G A A A } 14970}
p7 {{P G G G G G G A A } 16971}
g7 {{G G G G G G G A A } 16971}
p8 {{P G G G G G G G A } 18937}
g8 {{G G G G G G G G A } 18937}
p9 {{P G G G G G G G G } 19925}
g9 {{G G G G G G G G G } 19925}
}
# This list maps the motor names to columns of the
# guide_configuration table.
set guide_configuration_columns {
c1 c2 c3 c4 c5 c6 c7 c8 c9
}
}
namespace eval optics {
variable guide_configuration
variable guide_configuration_columns
}

View File

@@ -1,2 +1,2 @@
fileeval $cfPath(optics)/guide_configuration.tcl #fileeval $cfPath(optics)/guide_configuration.tcl
fileeval $cfPath(optics)/aperture_configuration.tcl #fileeval $cfPath(optics)/aperture_configuration.tcl

View File

@@ -21,7 +21,7 @@ fileeval $cfPath(motors)/motor_configuration.tcl
fileeval $cfPath(motors)/spin_galil.tcl fileeval $cfPath(motors)/spin_galil.tcl
fileeval $cfPath(motors)/positmotor_configuration.tcl fileeval $cfPath(motors)/positmotor_configuration.tcl
fileeval $cfPath(plc)/plc.tcl fileeval $cfPath(plc)/plc.tcl
#fileeval $cfPath(optics)/optics.tcl fileeval $cfPath(optics)/optics.tcl
fileeval $cfPath(counter)/counter.tcl fileeval $cfPath(counter)/counter.tcl
#fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl #fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl
#fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl #fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl