SICS-771 Add sample_aperture size macro.

Make sure that positions are saved as -9999 if the guides are misaligned.
This commit is contained in:
Ferdi Franceschini
2014-09-03 12:20:00 +10:00
parent 6ec4cf66cb
commit 9a7f4608b7

View File

@ -57,9 +57,14 @@ foreach pos {27 55 84 114 146 179 213 248 288 333} {
} }
sapmot positions {*}$poslist sapmot positions {*}$poslist
sapmot position_names D2.5 D5 D7.5 D10 D12.5 D15 D17.5 D20 D30 D40 sapmot position_names D2.5 D5 D7.5 D10 D12.5 D15 D17.5 D20 D30 D40
# sap is a 10 position virtual motor for sapmot. D2.5 is at position 1
make_vmot sap sapmot count
sapmot precision 0.001 sapmot precision 0.001
# TODO implement target
::utility::macro::getset text sample_aperture { {target "NONE"} } {
return "sample_aperture = [posname sapmot]"
}
sicslist setatt sample_aperture klass sample
sicslist setatt sample_aperture long_name sample_aperture
################################################################################ ################################################################################
##################### Time of flight calculations ############################## ##################### Time of flight calculations ##############################
@ -82,7 +87,7 @@ proc filter_non_numeric {retval} {
if [string is double $val] { if [string is double $val] {
return $retval return $retval
} else { } else {
return [lindex $retval 0] = -9999 return "[lindex $retval 0] = -9999"
} }
} }
@ -140,7 +145,7 @@ proc nguide { {num "REPORTNUM"} {sel_ap_name "NONE"} {aprest_name "NONE"}} {
set catch_status [ catch { set catch_status [ catch {
set FINDFIRST 1 set FINDFIRST 1
set COUNT 2 set COUNT 2
set CheckDrive 0 set CheckDrive false
set ap_names { D10 D20 D40 S40 R100 } set ap_names { D10 D20 D40 S40 R100 }
array set EMSG { array set EMSG {
invalidarg "Invalid arguments" invalidarg "Invalid arguments"
@ -235,7 +240,7 @@ proc nguide { {num "REPORTNUM"} {sel_ap_name "NONE"} {aprest_name "NONE"}} {
incr ng incr ng
set state $COUNT set state $COUNT
} else { } else {
clientput "$EMSG(misaligned)" return "$EMSG(misaligned)"
break break
} }
} }
@ -244,7 +249,7 @@ proc nguide { {num "REPORTNUM"} {sel_ap_name "NONE"} {aprest_name "NONE"}} {
incr ng incr ng
} else { } else {
# ERROR There shouldn't be any gaps in the selection # ERROR There shouldn't be any gaps in the selection
clientput "$EMSG(gaps)" return "$EMSG(gaps)"
break break
} }
} }
@ -255,7 +260,7 @@ proc nguide { {num "REPORTNUM"} {sel_ap_name "NONE"} {aprest_name "NONE"}} {
set drive_ok true set drive_ok true
if {$ng != $num} { if {$ng != $num} {
set drive_ok false set drive_ok false
clientput "$EMSG(drivefailed): Failed to selected guides" clientput "$EMSG(drivefailed): Failed to select guides"
} }
foreach {ap_mot ap_name} $ap_target_list { foreach {ap_mot ap_name} $ap_target_list {
set pos [SplitReply [$ap_mot]] set pos [SplitReply [$ap_mot]]
@ -272,8 +277,8 @@ proc nguide { {num "REPORTNUM"} {sel_ap_name "NONE"} {aprest_name "NONE"}} {
} else { } else {
clientput "nguide finished with errors" clientput "nguide finished with errors"
} }
return "[lindex [info level 0] 0] = $ng $ap_posname_list"
} }
return "[lindex [info level 0] 0] = $ng $ap_posname_list"
} message ] } message ]
handle_exception $catch_status $message handle_exception $catch_status $message
} }
@ -366,7 +371,7 @@ proc L2_curtainr {} {
return "[lindex [info level 0] 0] = $retval" return "[lindex [info level 0] 0] = $retval"
} }
publish L2_curtainr user publish L2_curtainr user
::utility::macro::getset float L2_curtainr {} { ::utility::macro::getset float gs_L2_curtainr {} {
filter_non_numeric [ L2_curtainr ] filter_non_numeric [ L2_curtainr ]
} }
sicslist setatt gs_L2_curtainr klass instrument sicslist setatt gs_L2_curtainr klass instrument