Add two theta virtual motor

r2452 | dcl | 2008-04-14 13:53:18 +1000 (Mon, 14 Apr 2008) | 2 lines
This commit is contained in:
Douglas Clowes
2008-04-14 13:53:18 +10:00
parent 4562daf398
commit 6009f273c8

View File

@@ -1,5 +1,5 @@
# $Revision: 1.25 $ # $Revision: 1.26 $
# $Date: 2008-02-04 01:30:44 $ # $Date: 2008-04-14 03:53:18 $
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Last revision by: $Author: dcl $ # Last revision by: $Author: dcl $
@@ -901,6 +901,30 @@ make_gap_motors ss3hg gap ss3ho offset ss3r ss3l mm $slit3HGroup
make_gap_motors ss4vg gap ss4vo offset ss4u ss4d mm $slit4VGroup make_gap_motors ss4vg gap ss4vo offset ss4u ss4d mm $slit4VGroup
make_gap_motors ss4hg gap ss4ho offset ss4r ss4l mm $slit4HGroup make_gap_motors ss4hg gap ss4ho offset ss4r ss4l mm $slit4HGroup
proc set_two_theta { arg } {
set rad [expr ($arg/180.0)*3.1415926535897932384626433832795]
set d1 [expr [SplitReply [detector_distance]] - [SplitReply [sample_distance]]]
set d2 [expr [SplitReply [slit4_distance]] - [SplitReply [sample_distance]]]
set h1 [expr [SplitReply [detector_base]] + $d1 * tan($rad)]
set h2 [expr [SplitReply [slit4_base]] + $d2 * tan($rad)]
return "dz=$h1,st4vt=$h2"
}
publish set_two_theta user
proc get_two_theta {} {
set d1 [expr [SplitReply [detector_distance]] - [SplitReply [sample_distance]]]
set h1 [expr [SplitReply [dz]] - [SplitReply [detector_base]]]
return [expr (180.0*atan2($h1, $d1))/3.1415926535897932384626433832795]
}
publish get_two_theta user
MakeConfigurableMotor two_theta
two_theta readscript get_two_theta
two_theta drivescript set_two_theta
sicslist setatt two_theta klass sample
sicslist setatt two_theta long_name two_theta
sicslist setatt two_theta units degrees
proc motor_set_sobj_attributes {} { proc motor_set_sobj_attributes {} {
} }
# END MOTOR CONFIGURATION # END MOTOR CONFIGURATION