From 3fcb9768161f3acff5b5bb4b800df95842bf70f0 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Tue, 23 Oct 2007 12:59:44 +1000 Subject: [PATCH] Optics subsystem. Currently only guide configuration is implemented. r2194 | ffr | 2007-10-23 12:59:44 +1000 (Tue, 23 Oct 2007) | 3 lines --- .../instrument/sans/config/optics/README.TXT | 1 + .../config/optics/guide_configuration.tcl | 80 +++++++++++++++++++ .../instrument/sans/config/optics/optics.tcl | 1 + 3 files changed, 82 insertions(+) create mode 100644 site_ansto/instrument/sans/config/optics/README.TXT create mode 100644 site_ansto/instrument/sans/config/optics/guide_configuration.tcl create mode 100644 site_ansto/instrument/sans/config/optics/optics.tcl diff --git a/site_ansto/instrument/sans/config/optics/README.TXT b/site_ansto/instrument/sans/config/optics/README.TXT new file mode 100644 index 00000000..bd84ac14 --- /dev/null +++ b/site_ansto/instrument/sans/config/optics/README.TXT @@ -0,0 +1 @@ +Optical Components: Neutron Guides, Apertures, Polariser, Focussing Lenses and Prisms diff --git a/site_ansto/instrument/sans/config/optics/guide_configuration.tcl b/site_ansto/instrument/sans/config/optics/guide_configuration.tcl new file mode 100644 index 00000000..8ba446a2 --- /dev/null +++ b/site_ansto/instrument/sans/config/optics/guide_configuration.tcl @@ -0,0 +1,80 @@ +## +# @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 { +# A configuration table is made up of a set of named rows which provide +# configuration parameters +# Rows can be of mixed type +array set guide_configuration { + GA {MT A A A A A A A A } + MT {MT MT MT MT MT MT MT MT MT } + LP {MT MT MT MT MT MT MT MT LP } + LENS {MT MT MT MT MT MT MT MT L } + P1 {P A MT MT MT MT MT MT MT } + P1LP {P A MT MT MT MT MT MT LP } + P1LENS {P A MT MT MT MT MT MT L } + G1 {G A MT MT MT MT MT MT MT } + P2 {P G A MT MT MT MT MT MT } + G2 {G G A MT MT MT MT MT MT } + P3 {P G G A MT MT MT MT MT } + G3 {G G G A MT MT MT MT MT } + P4 {P G G G A MT MT MT MT } + G4 {G G G G A MT MT MT MT } + P5 {P G G G G A MT MT MT } + G5 {G G G G G A MT MT MT } + P6 {P G G G G G A MT MT } + G6 {G G G G G G A MT MT } + P7 {P G G G G G G A MT } + G7 {G G G G G G G A MT } + P8 {P G G G G G G G A } + G8 {G G G G G G G G A } + P9 {P G G G G G G G G } + G9 {G G G G G G G G G } +} + +# 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 + namespace export set_guide +} +## +# @brief set_guide uses a lookup table to setup the collimation system +# @param row, selects a row from the guide configuration table +# +# eg\n +# set_guide HIRES +proc ::optics::set_guide {row} { + variable guide_configuration + variable guide_configuration_columns + + 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 {LP 1 MT 2 G 3 A 4 L 5} + + foreach el $guide_configuration($row) guide $guide_configuration_columns { + lappend to_config $guide + lappend to_config [set ${guide}_map($el)] + } + drive $to_config +} +namespace import ::optics::set_guide + +publish set_guide user diff --git a/site_ansto/instrument/sans/config/optics/optics.tcl b/site_ansto/instrument/sans/config/optics/optics.tcl new file mode 100644 index 00000000..c5b59654 --- /dev/null +++ b/site_ansto/instrument/sans/config/optics/optics.tcl @@ -0,0 +1 @@ +fileeval $cfPath(optics)/guide_configuration.tcl