# -------------------------------------------------------------------------- # Initialization script for testing SICS # # Started: Dr. Mark Koennecke, July 2006 #--------------------------------------------------------------------------- # O P T I O N S # --------------- Initialize Tcl internals -------------------------------- # first all the server options are set ServerOption ReadTimeOut 10 # timeout when checking for commands. In the main loop SICS checks for # pending commands on each connection with the above timeout, has # PERFORMANCE impact! ServerOption AcceptTimeOut 10 # timeout when checking for connection req. # Similar to above, but for connections ServerOption ReadUserPasswdTimeout 500000 # time to wiat for a user/passwd to be sent from a client. Increase this # if there is a problem connecting to a server due to network overload\ ServerOption ServerPort 2911 # the port number the server is going to listen at. The client MUST know # this number in order to connect. It is in client.ini ServerOption InterruptPort 2913 # The UDP port where the server will wait for Interrupts from clients. # Obviously, clients wishing to interrupt need to know this number. #--------------------------------------------------------------------------- # U S E R S # than the SICS users are specified # Syntax: SicsUser name password userRightsCode SicsUser Mugger Mugger 1 SicsUser User User 2 SicsUser Spy Spy 3 #SicsUser Spy 007 1 #----------------- SICS Variable VarMake lotte Text User #----------------- Motors --------------------------------------------------- Motor brumm regress MakeDrive #----------------- Alias ---------------------------------------------------- SicsAlias brumm miau #----------------- Counters ------------------------------------------------- MakeCounter aba regress MakeCounter hugo SIM -1. MakeCounter lieselotte SIM -1. #------------------------------ proc SICSValue {command} { set txt [eval $command] set l [split $txt =] return [string trim [lindex $l 1]] } #----------------------------- proc multitransfer {} { append res [SICSValue "aba gettime"] " " for {set i 0} {$i < 7} {incr i} { append res [SICSValue "aba getmonitor $i"] " " } return $res } #----------------------------------- MakeMultiCounter multi aba hugo lieselotte multi transferscript multitransfer #------------- For Scanning --------------------------------------------- # This is with the tricky bit set: we use a multicounter and use the # scantransfer function to return values of a gaussian for a4 positions. # This gives nice scan data which can be used to test all sorts of things. #------------------------------------------------------------------------- MakeDataNumber SicsDataNumber ./DataNumber VarMake SicsDataPath Text Mugger SicsDataPath ./ SicsDataPath lock VarMake SicsDataPrefix Text Mugger SicsDataPrefix regression SicsDataPrefix lock VarMake SicsDataPostFix Text Mugger SicsDataPostFix .dat SicsDataPostFix lock Motor a1 SIM -2 180 -.1 10 Motor a2 SIM 30 150 -.1 10 Motor a3 SIM -360 360 -.1 10 Motor a4 SIM -180 180 -.1 10 Motor a5 SIM -180 180 -.1 10 Motor a6 SIM -180 180 -.1 10 Motor sgu SIM -20 20 -.1 10 Motor sgl SIM -20 20 -.1 10 MakeMultiCounter scanCter aba proc scantransfer {} { set FWHM 1.5 set pos 5.33 set height 700 set stddev [expr $FWHM/2.354] set ftmp [expr ([SICSValue a4] - $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 test.hdd recover.bin MakePeakCenter xxxscan source scancommand.tcl MakeOptimise opti scancter MakeMaximize scancter #------------------------------------------------------------------------- # Histogram Memory #------------------------------------------------------------------------ MakeHM hm regress hm configure rank 1 hm configure dim0 23 hm configure testval 1 hm configure errortype 0 hm configure recover 1 hm configure init 1 hm init MakeHM tof regress tof configure rank 1 tof configure HistMode TOF tof configure dim0 23 tof configure testval 1 tof configure errortype 0 tof configure recover 1 tof genbin 10 12 100 tof configure init 1 tof init #------------------------------------------------------------------------- # NXscript #------------------------------------------------------------------------- MakeNXScript #------------------------------------------------------------------------- proc makearray {} { global ar for { set i 10} {$i < 20} {incr i} { set ar([expr $i - 10]) [expr $i*1.0] } } #------------------------------------------------------------------------ proc makeintarray {} { global ar for { set i 10} {$i < 20} {incr i} { set ar([expr $i - 10]) $i } } Publish makearray User Publish makeintarray User Publish parray User #------------------------------------------------------------------------ # SicsData #------------------------------------------------------------------------ sicsdatafactory new data sicsdatafactory new duta #----------------------------------------------------------------------- # tasub #----------------------------------------------------------------------- MakeTasUB tasub #----------------------------------------------------------------------- # MultiMotors #---------------------------------------------------------------------- MakeMulti sa sa alias a3 om sa alias a4 stt sa pos noeff a3 24 a4 48 sa endconfig #----------------------------------------------------------------------- # Hipadaba #---------------------------------------------------------------------- InstallHdb hmake /instrument spy none hmake /instrument/sample spy none hattach /instrument/sample a3 omega hattach /instrument/sample qh qh hmake /instrument/detector spy none hattach /instrument/detector hm data hattach /instrument lotte title restore