- Extensions to the McStas simulated DMC in order to support MountainGum

This commit is contained in:
koennecke
2007-08-15 07:15:22 +00:00
parent 590a979290
commit 8693509927
6 changed files with 354 additions and 93 deletions

View File

@ -31,21 +31,22 @@ SicsUser lnsmanager lnsSICSlns 1
SicsUser Manager Manager 1
SicsUser user looser 2
SicsUser Spy 007 1
SicsUser User 07lns1 2
#--------------------------------------------------------------------------
# D E V I C E S : M O T O R S
#---------------------------------------------------------------------------
ClientPut "Installing Motors"
Motor OmegaM SIM 0 120 -.1 2.
Motor TwoThetaM SIM 30 100 -.1 1.
Motor MonoX SIM -30 30 -.1 3.0
Motor MonoY SIM -30 30 -.1 3.0
Motor CurveM SIM 0 20 -.1 3.0
Motor MonoPhi SIM -30 30 -.1 3.0
Motor MonoChi SIM -30 30 -.1 3.0
Motor OmegaM SIM 0 120 .0000001 2.
Motor TwoThetaM SIM 30 100 .0000001 1.
Motor MonoX SIM -30 30 .00000001 3.0
Motor MonoY SIM -30 30 .000000001 3.0
Motor CurveM SIM 0 20 .000000001 3.0
Motor MonoPhi SIM -30 30 .00000001 3.0
Motor MonoChi SIM -30 30 .00000001 3.0
# sample Table
Motor Table SIM -180 360 -.1 2.
Motor TwoThetaD SIM -10 120 -.1 1.
Motor Table SIM -180 360 .0000001 2.
Motor TwoThetaD SIM -10 120 .0000001 1.
#-------------------------------------------------------------
# Monochromator
#-------------------------------------------------------------
@ -66,6 +67,7 @@ allowexec $home/dmcafter
allowexec $home/dmc_sics05
ClientPut "Installing counter"
MakeCounter counter mcstas
counter SetExponent 1
MakeHM banana mcstas
@ -79,7 +81,7 @@ banana CountMode Timer
banana configure Counter counter
banana configure init 0
banana init
banana exponent 3
#banana exponent 3
#-------------------------------------------------------------------------
# Aliases
#-------------------------------------------------------------------------
@ -122,6 +124,7 @@ VarMake starttime Text User
starttime ""
VarMake SicsDataPrefix Text Internal
SicsDataPrefix vdmc
#--------- make data number
MakeDataNumber SicsDataNumber $home/DataNumber
VarMake SicsDataPostFix Text Internal
@ -132,6 +135,8 @@ VarMake fax Text User
VarMake email Text User
VarMake sample_mur Float User
VarMake lastdatafile Text User
VarMake lastscancommand Text User
lastscancommand "unknown scan"
#--------------------------------------------------------------------------
# P R O C E D U R E S
#--------------------------------------------------------------------------
@ -139,21 +144,44 @@ MakeDrive
MakeBatchManager
MakeNXScript
MakeRuenBuffer
#------------------------------------------------------------------------
# simulated scanning for demo purposes
#-----------------------------------------------------------------------
MakeCounter lieselotte SIM -1
MakeMultiCounter scanCter lieselotte
#------------------------------
proc SICSValue {command} {
set txt [eval $command]
set l [split $txt =]
return [string trim [lindex $l 1]]
}
#-----------------------------------------------------------------------
proc scantransfer {} {
set FWHM 1.5
set pos 5.33
set height 700
set stddev [expr $FWHM/2.354]
set ftmp [expr ([SICSValue a3] - $pos)/$stddev]
set count [expr 10 + $height*0.4*exp(-.5*$ftmp*$ftmp)]
set counti [expr int($count)]
append res [SICSValue "lieselotte gettime"] " "
append res $counti " "
for {set i 1} {$i < 7} {incr i} {
append res [SICSValue "lieselotte getmonitor $i"] " "
}
return $res
}
scancter transferscript scantransfer
MakeScanCommand xxxscan scancter $home/dmc.hdd $home/recover.bin
MakePeakCenter xxxscan
#-------------------- initialize scripted commands
source $home/vdmccom.tcl
#-------------------- configure commandlog
commandlog auto
commandlog intervall 5
#----------- enable sycamore
#InstallSinfox
#source sycFormat.tcl
#source /usr/lib/tcllib1.6.1/stooop/stooop.tcl
#namespace import stooop::*
#source sinfo.tcl
#source sycamore.tcl
#Publish sinfo Spy
#==================== install Hipadaba
proc hdbReadOnly {} {
error "Parameter is READ ONLY"
@ -169,82 +197,137 @@ proc maketwotheta {} {
return $result
}
#-------------------------------------
InstallProtocolHandler
InstallHdb
MakeStateMon
hmake /dmc spy none
hsetprop /dmc type instrument
MakeHdbQueue hdbqueue HdbQueue
hmake /instrument spy none
hsetprop /instrument type instrument
#-------- experiment
hmake /dmc/experiment spy none
hattach /dmc/experiment title title
hattach /dmc/experiment user user
hattach /dmc/experiment starttime starttime
hattach /dmc/experiment user user
hattach /dmc/experiment/user adress address
hattach /dmc/experiment/user phone phone
hattach /dmc/experiment/user email email
hattach /dmc/experiment comment1 comment1
hattach /dmc/experiment comment2 comment2
hattach /dmc/experiment comment3 comment3
hmake /instrument/experiment spy none
hattach /instrument/experiment title title
hattach /instrument/experiment starttime starttime
hattach /instrument/experiment user user
hattach /instrument/experiment/user adress address
hattach /instrument/experiment/user phone phone
hattach /instrument/experiment/user email email
hattach /instrument/experiment comment1 comment1
hattach /instrument/experiment comment2 comment2
hattach /instrument/experiment comment3 comment3
#------- SINQ
hmake /dmc/sinq spy none
hmakescript /dmc/sinq/proton_monitor "counter getmonitor 4" hdbReadOnly int
sicspoll /dmc/sinq/proton_monitor hdb 10
hmake /instrument/sinq spy none
hmake /instrument/sinq/proton_monitor internal int
hattach /instrument/sinq/proton_monitor counter 4
#-------- monochromator
hmake /dmc/monochromator spy none
hattach /dmc/monochromator lambda wavelength
hattach /dmc/monochromator OmegaM theta
hattach /dmc/monochromator TwoThetaM two_theta
hattach /dmc/monochromator MonoX x_translation
hattach /dmc/monochromator MonoY y_translation
hattach /dmc/monochromator MonoChi chi
hattach /dmc/monochromator MonoPhi phi
hattach /dmc/monochromator CurveM vertical_focusing
hmakescript /dmc/monochromator/d_value "mono dd" "mono dd" float
hsetprop /dmc/monochromator/d_value priv manager
hmakescript /dmc/monochromator/scattering_sense "mono ss" "mono ss" int
hsetprop /dmc/monochromator/scattering_sense priv manager
hmake /instrument/monochromator spy none
hattach /instrument/monochromator lambda wavelength
hsetprop /instrument/monochromator/wavelength priv user
hattach /instrument/monochromator OmegaM theta
hattach /instrument/monochromator TwoThetaM two_theta
hchain /instrument/monochromator/wavelength /instrument/monochromator/two_theta
hattach /instrument/monochromator MonoX x_translation
hattach /instrument/monochromator MonoY y_translation
hattach /instrument/monochromator MonoChi chi
hattach /instrument/monochromator MonoPhi phi
hattach /instrument/monochromator CurveM vertical_focusing
hmakescript /instrument/monochromator/d_value "mono dd" "mono dd" float
hsetprop /instrument/monochromator/d_value priv manager
hmakescript /instrument/monochromator/scattering_sense "mono ss" "mono ss" int
hsetprop /instrument/monochromator/scattering_sense priv manager
#----------- sample
hmake /dmc/sample spy none
hmakescript /dmc/sample/name sample sample Text
hattach /dmc/sample Table rotation
hmakescript /dmc/sample/monitor "counter getmonitor 1" hdbReadOnly int
hsetprop /dmc/sample/monitor priv internal
hmake /instrument/sample spy none
hmakescript /instrument/sample/name sample sample Text
hattach /instrument/sample Table rotation
hmake /instrument/sample/monitor internal int
hattach /instrument/sample/monitor counter 1
hsetprop /instrument/sample/monitor priv internal
hsetprop /instrument/sample/monitor sicsdev histogrammemory
#---------- detector
hmake /dmc/detector spy none
hattach /dmc/detector TwoThetaD two_theta
hmakescript /dmc/detector/preset "counter getpreset" hdbReadOnly float
hsetprop /dmc/detector/preset priv internal
hmakescript /dmc/detector/countmode "counter getmode" hdbReadOnly text
hsetprop /dmc/detector/countmode priv internal
sicspoll add /dmc/detector/preset hdb 30
sicspoll add /dmc/detector/countmode hdb 30
hmake /instrument/detector spy none
hattach /instrument/detector TwoThetaD two_theta
hmakescript /instrument/detector/preset "banana preset" hdbReadOnly float
hsetprop /instrument/detector/preset priv internal
hmakescript /instrument/detector/countmode "banana countmode" hdbReadOnly text
hsetprop /instrument/detector/countmode priv internal
sicspoll add /instrument/detector/preset hdb 30
sicspoll add /instrument/detector/countmode hdb 30
hmake /instrument/detector/count_time internal float
hattach /instrument/detector/count_time counter -1
#------------ commands
hmake /commands spy none
hcommand /commands/count count
hsetprop /commands/count type command
hsetprop /commands/count priv user
hmake /commands/count/mode user text
hsetprop /commands/count/mode values "monitor,timer"
hmake /commands/count/preset user float
hset /commands/count/preset 5
hset /commands/count/mode timer
hset /commands/count/preset 60000
hset /commands/count/mode monitor
hcommand /commands/killfile killfile
hsetprop /commands/killfile type command
hsetprop /commands/killfile priv manager
#------------- scan command
hcommand /commands/scan hdbscan
hsetprop /commands/scan type command
hsetprop /commands/scan priv user
hmake /commands/scan/scan_variables user text
hsetprop /commands/scan/scan_variables argtype drivable
hmake /commands/scan/scan_start user text
hmake /commands/scan/scan_increments user text
hmake /commands/scan/NP user int
hmake /commands/scan/mode user text
hsetprop /commands/scan/mode values "timer,monitor"
hmake /commands/scan/preset user float
hset /commands/scan/mode timer
hset /commands/scan/scan_start 2.
hset /commands/scan/scan_increments .3
hset /commands/scan/NP 25
hset /commands/scan/preset 2
#---------------- graphics
hmake /Graphics spy none
hmake /Graphics/powder_diagram spy none
hsetprop /Graphics/powder_diagram type graphdata
hsetprop /Graphics/powder_diagram viewer default
hmake /Graphics/powder_diagram/rank internal int
hset /Graphics/powder_diagram/rank 1
hmake /Graphics/powder_diagram/dim internal intar 1
hset /Graphics/powder_diagram/dim 400
hmakescript /Graphics/powder_diagram/two_theta maketwotheta hdbReadOnly floatar 400
sicspoll add /Graphics/powder_diagram/two_theta hdb 30
hsetprop /Graphics/powder_diagram/two_theta type axis
hsetprop /Graphics/powder_diagram/two_theta dim 0
hattach /Graphics/powder_diagram banana counts
hsetprop /Graphics/powder_diagram/counts type data
hsetprop /Graphics/powder_diagram/counts priv internal
sicspoll add /Graphics/powder_diagram/counts hdb 60
hmake /graphics spy none
hmake /graphics/powder_diagram spy none
hsetprop /graphics/powder_diagram type graphdata
hsetprop /graphics/powder_diagram viewer default
hmake /graphics/powder_diagram/rank internal int
hset /graphics/powder_diagram/rank 1
hmake /graphics/powder_diagram/dim internal intar 1
hset /graphics/powder_diagram/dim 400
hmakescript /graphics/powder_diagram/two_theta maketwotheta hdbReadOnly floatar 400
hchain /graphics/powder_diagram/two_theta /instrument/detector/two_theta
hsetprop /graphics/powder_diagram/two_theta type axis
hsetprop /graphics/powder_diagram/two_theta transfer zip
hsetprop /graphics/powder_diagram/two_theta dim 0
hattach /graphics/powder_diagram banana counts
hsetprop /graphics/powder_diagram/counts type data
hsetprop /graphics/powder_diagram/counts transfer zip
hsetprop /graphics/powder_diagram/counts priv internal
sicspoll add /graphics/powder_diagram/counts hdb 60
hmake /graphics/scan_data spy none
hsetprop /graphics/scan_data type graphdata
hsetprop /graphics/scan_data viewer default
hmake /graphics/scan_data/rank mugger int
hset /graphics/scan_data/rank 1
hsetprop /graphics/scan_data/rank priv internal
hmakescript /graphics/scan_data/dim "xxxscan np" hdbReadOnly intar 1
hsetprop /graphics/scan_data/dim priv internal
hmakescript /graphics/scan_data/scan_variable "gethdbscanvardata 0" hdbReadOnly floatvarar 1
hsetprop /graphics/scan_data/scan_variable type axis
hsetprop /graphics/scan_data/scan_variable dim 0
hsetprop /graphics/scan_data/scan_variable transfer zip
hsetprop /graphics/scan_data/scan_variable priv internal
hmakescript /graphics/scan_data/counts "gethdbscancounts" hdbReadOnly intvarar 1
hsetprop /graphics/scan_data/counts type data
hsetprop /graphics/scan_data/counts transfer zip
hsetprop /graphics/scan_data/counts priv internal
hlink / hdbqueue batch
hmake /gui spy none
hmake /gui/status internal text
status hdbinterest /gui/status
restore