- Rearranged directory structure for forking out ANSTO
- Refactored site specific stuff into a site module - PSI specific stuff is now in the PSI directory. - The old version has been tagged with pre-ansto
This commit is contained in:
97
utils/check/amorcheck
Executable file
97
utils/check/amorcheck
Executable file
@ -0,0 +1,97 @@
|
||||
#! /bin/sh
|
||||
#next line is executed by sh, not by Tcl \
|
||||
exec tclsh $0 ${1+"$@"}
|
||||
#--------------------------------------------------------------------------
|
||||
# This is the SICS syntax checker for the AMOR reflectometer
|
||||
#
|
||||
# Mark Koennecke, March 2003
|
||||
#--------------------------------------------------------------------------
|
||||
source /data/koenneck/src/sics/utils/check/sicssyntaxlib.tcl
|
||||
|
||||
#------------ define AMOR motors and aliases
|
||||
sicsSyntaxMap ftz syntaxMotor
|
||||
sicsSyntaxMap fom syntaxMotor
|
||||
sicsSyntaxMap d1l syntaxMotor
|
||||
sicsSyntaxMap d1r syntaxMotor
|
||||
sicsSyntaxMap d1t syntaxMotor
|
||||
sicsSyntaxMap d1b syntaxMotor
|
||||
sicsSyntaxMap moz syntaxMotor
|
||||
sicsSyntaxMap mty syntaxMotor
|
||||
sicsSyntaxMap mom syntaxMotor
|
||||
sicsSyntaxMap mtz syntaxMotor
|
||||
sicsSyntaxMap d2l syntaxMotor
|
||||
sicsSyntaxMap d2r syntaxMotor
|
||||
sicsSyntaxMap d2t syntaxMotor
|
||||
sicsSyntaxMap d2b syntaxMotor
|
||||
sicsSyntaxMap d3l syntaxMotor
|
||||
sicsSyntaxMap d3r syntaxMotor
|
||||
sicsSyntaxMap d3t syntaxMotor
|
||||
sicsSyntaxMap d3b syntaxMotor
|
||||
sicsSyntaxMap stz syntaxMotor
|
||||
sicsSyntaxMap som syntaxMotor
|
||||
sicsSyntaxMap sch syntaxMotor
|
||||
sicsSyntaxMap soz syntaxMotor
|
||||
sicsSyntaxMap stb syntaxMotor
|
||||
sicsSyntaxMap d4l syntaxMotor
|
||||
sicsSyntaxMap d4r syntaxMotor
|
||||
sicsSyntaxMap d4t syntaxMotor
|
||||
sicsSyntaxMap d4b syntaxMotor
|
||||
sicsSyntaxMap aoz syntaxMotor
|
||||
sicsSyntaxMap aom syntaxMotor
|
||||
sicsSyntaxMap atz syntaxMotor
|
||||
sicsSyntaxMap d5l syntaxMotor
|
||||
sicsSyntaxMap d5r syntaxMotor
|
||||
sicsSyntaxMap d5t syntaxMotor
|
||||
sicsSyntaxMap d5b syntaxMotor
|
||||
sicsSyntaxMap coz syntaxMotor
|
||||
sicsSyntaxMap c3z syntaxMotor
|
||||
sicsSyntaxMap com syntaxMotor
|
||||
sicsSyntaxMap cox syntaxMotor
|
||||
|
||||
#------------ define AMOR counters
|
||||
sicsSyntaxMap counter syntaxCounter
|
||||
sicsSyntaxMap hm syntaxHM
|
||||
|
||||
#------------ define AMOR variables
|
||||
sicsSyntaxMap title syntaxTextPar
|
||||
sicsSyntaxMap user syntaxTextPar
|
||||
sicsSyntaxMap adres syntaxTextPar
|
||||
sicsSyntaxMap collimation syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap comment1 syntaxTextPar
|
||||
sicsSyntaxMap comment2 syntaxTextPar
|
||||
sicsSyntaxMap comment3 syntaxTextPar
|
||||
sicsSyntaxMap fax syntaxTextPar
|
||||
sicsSyntaxMap email syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
|
||||
#----------- define AMOR environment
|
||||
sicsSyntaxMap temperature evSyntax
|
||||
sicsSyntaxMap tt evSyntax
|
||||
sicsSyntaxMap pby evSyntax
|
||||
sicsSyntaxMap aby evSyntax
|
||||
sicsSyntaxMap magnet evSyntax
|
||||
|
||||
#---------- define AMOR auxiliary
|
||||
sicsSyntaxMap dr syntaxDrive
|
||||
sicsSyntaxMap s2t syntaxNumPar
|
||||
sicsSyntaxMap o2t syntaxNumPar
|
||||
sicsSyntaxMap td syntaxNumPar
|
||||
sicsSyntaxMap aw syntaxNumPar
|
||||
sicsSyntaxMap shutter syntaxTextPar
|
||||
|
||||
#syntaxLoadSICS amorstatus.tcl
|
||||
#puts stdout [array names sicsPar]
|
||||
|
||||
if { $argc < 1} {
|
||||
puts stdout "Usage: \n\tamorcheck filename"
|
||||
exit 0
|
||||
}
|
||||
set filename [lindex $argv 0]
|
||||
lappend fileList [file tail $filename]
|
||||
puts stdout "Syntax checking --> $filename <-- ........."
|
||||
source $filename
|
||||
puts stdout "If this completed without errors the likelihoof of your script"
|
||||
puts stdout "executing properly on the instrument has increased significantly"
|
||||
exit 1
|
||||
|
68
utils/check/dmccheck
Executable file
68
utils/check/dmccheck
Executable file
@ -0,0 +1,68 @@
|
||||
#! /bin/sh
|
||||
#next line is executed by sh, not by Tcl \
|
||||
exec tclsh $0 ${1+"$@"}
|
||||
#--------------------------------------------------------------------------
|
||||
# This is the SICS syntax checker for the DMC powder diffractometer
|
||||
#
|
||||
# Mark Koennecke, March 2003
|
||||
#--------------------------------------------------------------------------
|
||||
source /data/koenneck/src/sics/utils/check/sicssyntaxlib.tcl
|
||||
|
||||
#------------------------- define DMC motors and aliases
|
||||
sicsSyntaxMap omegam syntaxMotor
|
||||
sicsSyntaxMap twothetam syntaxMotor
|
||||
sicsSyntaxMap monox syntaxMotor
|
||||
sicsSyntaxMap monoy syntaxMotor
|
||||
sicsSyntaxMap curvem syntaxMotor
|
||||
sicsSyntaxMap monophi syntaxMotor
|
||||
sicsSyntaxMap monochi syntaxMotor
|
||||
sicsSyntaxMap table syntaxMotor
|
||||
sicsSyntaxMap twothetad syntaxMotor
|
||||
sicsSyntaxMap a1 syntaxMotor
|
||||
sicsSyntaxMap a2 syntaxMotor
|
||||
sicsSyntaxMap a3 syntaxMotor
|
||||
sicsSyntaxMap a4 syntaxMotor
|
||||
sicsSyntaxMap a5 syntaxMotor
|
||||
sicsSyntaxMap a6 syntaxMotor
|
||||
sicsSyntaxMap a7 syntaxMotor
|
||||
sicsSyntaxMap a8 syntaxMotor
|
||||
sicsSyntaxMap a9 syntaxMotor
|
||||
|
||||
#------------ define DMC counters
|
||||
sicsSyntaxMap counter syntaxCounter
|
||||
sicsSyntaxMap banana syntaxHM
|
||||
|
||||
#------------ define DMC variables
|
||||
sicsSyntaxMap title syntaxTextPar
|
||||
sicsSyntaxMap user syntaxTextPar
|
||||
sicsSyntaxMap collimation syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap comment1 syntaxTextPar
|
||||
sicsSyntaxMap comment2 syntaxTextPar
|
||||
sicsSyntaxMap comment3 syntaxTextPar
|
||||
sicsSyntaxMap fax syntaxTextPar
|
||||
sicsSyntaxMap email syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap lambda syntaxNumPar
|
||||
|
||||
#----------- define DMC environment
|
||||
sicsSyntaxMap temperature evSyntax
|
||||
sicsSyntaxMap tt evSyntax
|
||||
|
||||
#---------- define DMC auxiliary
|
||||
sicsSyntaxMap beam syntaxDummy
|
||||
|
||||
#--------- Main checking stuff
|
||||
|
||||
if { $argc < 1} {
|
||||
puts stdout "Usage: \n\tdmccheck filename"
|
||||
exit 0
|
||||
}
|
||||
set filename [lindex $argv 0]
|
||||
lappend fileList [file tail $filename]
|
||||
puts stdout "Syntax checking --> $filename <-- ........."
|
||||
source $filename
|
||||
puts stdout "If this completed without errors the likelihoof of your script"
|
||||
puts stdout "executing properly on the instrument has increased significantly"
|
||||
exit 1
|
||||
|
82
utils/check/focuscheck
Executable file
82
utils/check/focuscheck
Executable file
@ -0,0 +1,82 @@
|
||||
#! /bin/sh
|
||||
#next line is executed by sh, not by Tcl \
|
||||
exec tclsh $0 ${1+"$@"}
|
||||
#--------------------------------------------------------------------------
|
||||
# This is the SICS syntax checker for the FOCUS TOF diffractometer
|
||||
#
|
||||
# Mark Koennecke, March 2003
|
||||
#--------------------------------------------------------------------------
|
||||
source /data/koenneck/src/sics/utils/check/sicssyntaxlib.tcl
|
||||
|
||||
#------------ define FOCUS motors and aliases
|
||||
sicsSyntaxMap mtt syntaxMotor
|
||||
sicsSyntaxMap msl syntaxMotor
|
||||
sicsSyntaxMap mth syntaxMotor
|
||||
sicsSyntaxMap mtx syntaxMotor
|
||||
sicsSyntaxMap mty syntaxMotor
|
||||
sicsSyntaxMap mgo syntaxMotor
|
||||
sicsSyntaxMap m1ch syntaxMotor
|
||||
sicsSyntaxMap m1cv syntaxMotor
|
||||
sicsSyntaxMap m2ch syntaxMotor
|
||||
sicsSyntaxMap m2cv syntaxMotor
|
||||
sicsSyntaxMap mex syntaxMotor
|
||||
sicsSyntaxMap som syntaxMotor
|
||||
sicsSyntaxMap sth syntaxMotor
|
||||
sicsSyntaxMap sph syntaxMotor
|
||||
sicsSyntaxMap theta syntaxMotor
|
||||
|
||||
sicsSyntaxMap a1 syntaxMotor
|
||||
sicsSyntaxMap a2 syntaxMotor
|
||||
|
||||
#------------ define FOCUS counters
|
||||
sicsSyntaxMap counter syntaxCounter
|
||||
sicsSyntaxMap hm syntaxHM
|
||||
|
||||
#------------ define FOCUS variables
|
||||
sicsSyntaxMap title syntaxTextPar
|
||||
sicsSyntaxMap user syntaxTextPar
|
||||
sicsSyntaxMap adres syntaxTextPar
|
||||
sicsSyntaxMap collimation syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap comment1 syntaxTextPar
|
||||
sicsSyntaxMap comment2 syntaxTextPar
|
||||
sicsSyntaxMap comment3 syntaxTextPar
|
||||
sicsSyntaxMap fax syntaxTextPar
|
||||
sicsSyntaxMap email syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap lambda syntaxNumPar
|
||||
|
||||
#----------- define FOCUS environment
|
||||
sicsSyntaxMap temperature evSyntax
|
||||
sicsSyntaxMap tt evSyntax
|
||||
|
||||
#---------- define FOCUS auxiliary
|
||||
sicsSyntaxMap fermispeed syntaxNumPar
|
||||
sicsSyntaxMap diskspeed syntaxNumPar
|
||||
sicsSyntaxMap ratio syntaxNumPar
|
||||
sicsSyntaxMap phase syntaxNumPar
|
||||
|
||||
sicsSyntaxMap shutter syntaxTextPar
|
||||
sicsSyntaxMap colli syntaxTextPar
|
||||
sicsSyntaxMap td syntaxNumPar
|
||||
sicsSyntaxMap aw syntaxNumPar
|
||||
sicsSyntaxMap helium syntaxDummy
|
||||
|
||||
sicsSyntaxMap mono syntaxDummy
|
||||
|
||||
#--------- Main checking stuff
|
||||
#syntaxLoadSICS focusstatus.tcl
|
||||
#puts stdout [array names sicsPar]
|
||||
|
||||
if { $argc < 1} {
|
||||
puts stdout "Usage: \n\tfocuscheck filename"
|
||||
exit 0
|
||||
}
|
||||
set filename [lindex $argv 0]
|
||||
lappend fileList [file tail $filename]
|
||||
puts stdout "Syntax checking --> $filename <-- ........."
|
||||
source $filename
|
||||
puts stdout "If this completed without errors the likelihoof of your script"
|
||||
puts stdout "executing properly on the instrument has increased significantly"
|
||||
exit 1
|
||||
|
149
utils/check/focusstatus.tcl
Normal file
149
utils/check/focusstatus.tcl
Normal file
@ -0,0 +1,149 @@
|
||||
sampleangle 0.000000
|
||||
sampleangle setAccess 2
|
||||
delay 155.800003
|
||||
delay setAccess 2
|
||||
environment Void
|
||||
environment setAccess 2
|
||||
fermidist 3000.000000
|
||||
fermidist setAccess 1
|
||||
flightpathlength 3000.000000
|
||||
flightpathlength setAccess 1
|
||||
flightpath Standard
|
||||
flightpath setAccess 1
|
||||
bestatus 0
|
||||
bestatus setAccess 2
|
||||
# Motor a2
|
||||
a2 sign 1.000000
|
||||
a2 SoftZero 0.000000
|
||||
a2 SoftLowerLim -184.000000
|
||||
a2 SoftUpperLim 356.000000
|
||||
a2 Fixed -1.000000
|
||||
a2 InterruptMode 0.000000
|
||||
a2 AccessCode 2.000000
|
||||
# Motor a1
|
||||
a1 sign 1.000000
|
||||
a1 SoftZero 0.000000
|
||||
a1 SoftLowerLim 17.500000
|
||||
a1 SoftUpperLim 70.000000
|
||||
a1 Fixed -1.000000
|
||||
a1 InterruptMode 0.000000
|
||||
a1 AccessCode 2.000000
|
||||
batchroot /home/FOCUS/batch
|
||||
batchroot setAccess 2
|
||||
email fanni.juranyi@psi.ch
|
||||
email setAccess 2
|
||||
fax 2939
|
||||
fax setAccess 2
|
||||
phone 3176
|
||||
phone setAccess 2
|
||||
adress LNS
|
||||
adress setAccess 2
|
||||
comment3 UNKNOWN
|
||||
comment3 setAccess 2
|
||||
comment2 UNKNOWN
|
||||
comment2 setAccess 2
|
||||
comment1 UNKNOWN
|
||||
comment1 setAccess 2
|
||||
sample Zr95Al5 (42)
|
||||
sample setAccess 2
|
||||
user F. Juranyi
|
||||
user setAccess 2
|
||||
title I/02 B-9
|
||||
title setAccess 2
|
||||
lastscancommand cscan mth 33.94 0.05 25 10000
|
||||
lastscancommand setAccess 2
|
||||
hm CountMode monitor
|
||||
hm preset 1000000.000000
|
||||
hm genbin 9000.000000 50.000000 648
|
||||
hm init
|
||||
# Counter counter
|
||||
counter SetPreset 1000000.000000
|
||||
counter SetMode Monitor
|
||||
# Motor mex
|
||||
mex sign 1.000000
|
||||
mex SoftZero 0.000000
|
||||
mex SoftLowerLim -0.500000
|
||||
mex SoftUpperLim 180.399994
|
||||
mex Fixed -1.000000
|
||||
mex InterruptMode 0.000000
|
||||
mex AccessCode 2.000000
|
||||
# Motor m2cv
|
||||
m2cv sign 1.000000
|
||||
m2cv SoftZero 0.000000
|
||||
m2cv SoftLowerLim -0.700000
|
||||
m2cv SoftUpperLim 14.300000
|
||||
m2cv Fixed -1.000000
|
||||
m2cv InterruptMode 0.000000
|
||||
m2cv AccessCode 2.000000
|
||||
# Motor m2ch
|
||||
m2ch sign 1.000000
|
||||
m2ch SoftZero 0.000000
|
||||
m2ch SoftLowerLim -0.070000
|
||||
m2ch SoftUpperLim 6.800000
|
||||
m2ch Fixed -1.000000
|
||||
m2ch InterruptMode 0.000000
|
||||
m2ch AccessCode 2.000000
|
||||
# Motor m1cv
|
||||
m1cv sign 1.000000
|
||||
m1cv SoftZero 0.000000
|
||||
m1cv SoftLowerLim -5.000000
|
||||
m1cv SoftUpperLim 10.800000
|
||||
m1cv Fixed -1.000000
|
||||
m1cv InterruptMode 0.000000
|
||||
m1cv AccessCode 2.000000
|
||||
# Motor m1ch
|
||||
m1ch sign 1.000000
|
||||
m1ch SoftZero 0.000000
|
||||
m1ch SoftLowerLim -1.100000
|
||||
m1ch SoftUpperLim 6.800000
|
||||
m1ch Fixed -1.000000
|
||||
m1ch InterruptMode 0.000000
|
||||
m1ch AccessCode 2.000000
|
||||
# Motor mgo
|
||||
mgo sign 1.000000
|
||||
mgo SoftZero 0.000000
|
||||
mgo SoftLowerLim -0.600000
|
||||
mgo SoftUpperLim 0.600000
|
||||
mgo Fixed -1.000000
|
||||
mgo InterruptMode 0.000000
|
||||
mgo AccessCode 2.000000
|
||||
# Motor mty
|
||||
mty sign 1.000000
|
||||
mty SoftZero 0.000000
|
||||
mty SoftLowerLim -12.000000
|
||||
mty SoftUpperLim 12.000000
|
||||
mty Fixed -1.000000
|
||||
mty InterruptMode 0.000000
|
||||
mty AccessCode 2.000000
|
||||
# Motor mtx
|
||||
mtx sign 1.000000
|
||||
mtx SoftZero 0.000000
|
||||
mtx SoftLowerLim -12.000000
|
||||
mtx SoftUpperLim 14.000000
|
||||
mtx Fixed -1.000000
|
||||
mtx InterruptMode 0.000000
|
||||
mtx AccessCode 2.000000
|
||||
# Motor mth
|
||||
mth sign 1.000000
|
||||
mth SoftZero 0.000000
|
||||
mth SoftLowerLim 17.500000
|
||||
mth SoftUpperLim 70.000000
|
||||
mth Fixed -1.000000
|
||||
mth InterruptMode 0.000000
|
||||
mth AccessCode 2.000000
|
||||
# Motor msl
|
||||
msl sign 1.000000
|
||||
msl SoftZero 0.000000
|
||||
msl SoftLowerLim 0.000000
|
||||
msl SoftUpperLim 218.000000
|
||||
msl Fixed -1.000000
|
||||
msl InterruptMode 0.000000
|
||||
msl AccessCode 2.000000
|
||||
# Motor mtt
|
||||
mtt sign 1.000000
|
||||
mtt SoftZero 0.000000
|
||||
mtt SoftLowerLim -184.000000
|
||||
mtt SoftUpperLim 356.000000
|
||||
mtt Fixed -1.000000
|
||||
mtt InterruptMode 0.000000
|
||||
mtt AccessCode 2.000000
|
85
utils/check/hrptcheck
Executable file
85
utils/check/hrptcheck
Executable file
@ -0,0 +1,85 @@
|
||||
#! /bin/sh
|
||||
#next line is executed by sh, not by Tcl \
|
||||
exec tclsh $0 ${1+"$@"}
|
||||
#--------------------------------------------------------------------------
|
||||
# This is the SICS syntax checker for the HRPT powder diffractometer
|
||||
#
|
||||
# Mark Koennecke, March 2003
|
||||
#--------------------------------------------------------------------------
|
||||
source /data/koenneck/src/sics/utils/check/sicssyntaxlib.tcl
|
||||
|
||||
#------------------------- define HRPT motors and aliases
|
||||
sicsSyntaxMap momu syntaxMotor
|
||||
sicsSyntaxMap mtvu syntaxMotor
|
||||
sicsSyntaxMap mtpu syntaxMotor
|
||||
sicsSyntaxMap mgvu syntaxMotor
|
||||
sicsSyntaxMap mgpu syntaxMotor
|
||||
sicsSyntaxMap mcvu syntaxMotor
|
||||
sicsSyntaxMap moml syntaxMotor
|
||||
sicsSyntaxMap mtvl syntaxMotor
|
||||
sicsSyntaxMap mtpl syntaxMotor
|
||||
sicsSyntaxMap mgvl syntaxMotor
|
||||
sicsSyntaxMap mcvl syntaxMotor
|
||||
sicsSyntaxMap mexz syntaxMotor
|
||||
sicsSyntaxMap som syntaxMotor
|
||||
sicsSyntaxMap stt syntaxMotor
|
||||
sicsSyntaxMap cex1 syntaxMotor
|
||||
sicsSyntaxMap cex2 syntaxMotor
|
||||
sicsSyntaxMap a1 syntaxMotor
|
||||
sicsSyntaxMap a3 syntaxMotor
|
||||
sicsSyntaxMap om syntaxMotor
|
||||
sicsSyntaxMap omega syntaxMotor
|
||||
sicsSyntaxMap a4 syntaxMotor
|
||||
sicsSyntaxMap th syntaxMotor
|
||||
sicsSyntaxMap b1 syntaxMotor
|
||||
sicsSyntaxMap a17 syntaxMotor
|
||||
sicsSyntaxMap a18 syntaxMotor
|
||||
sicsSyntaxMap a12 syntaxMotor
|
||||
sicsSyntaxMap a13 syntaxMotor
|
||||
sicsSyntaxMap a14 syntaxMotor
|
||||
sicsSyntaxMap a15 syntaxMotor
|
||||
sicsSyntaxMap a16 syntaxMotor
|
||||
sicsSyntaxMap a37 syntaxMotor
|
||||
sicsSyntaxMap a22 syntaxMotor
|
||||
sicsSyntaxMap a24 syntaxMotor
|
||||
sicsSyntaxMap a25 syntaxMotor
|
||||
sicsSyntaxMap a26 syntaxMotor
|
||||
#------------ define HRPT counters
|
||||
sicsSyntaxMap counter syntaxCounter
|
||||
sicsSyntaxMap banana syntaxHM
|
||||
|
||||
#------------ define HRPT variables
|
||||
sicsSyntaxMap title syntaxTextPar
|
||||
sicsSyntaxMap user syntaxTextPar
|
||||
sicsSyntaxMap collimation syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap comment1 syntaxTextPar
|
||||
sicsSyntaxMap comment2 syntaxTextPar
|
||||
sicsSyntaxMap comment3 syntaxTextPar
|
||||
sicsSyntaxMap fax syntaxTextPar
|
||||
sicsSyntaxMap email syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap lambda syntaxNumPar
|
||||
sicsSyntaxMap mtt syntaxNumPar
|
||||
|
||||
#----------- define HRPT environment
|
||||
sicsSyntaxMap temperature evSyntax
|
||||
sicsSyntaxMap tt evSyntax
|
||||
|
||||
#---------- define HRPT auxiliary
|
||||
sicsSyntaxMap beam syntaxDummy
|
||||
sicsSyntaxMap graphit syntaxTextPar
|
||||
#--------- Main checking stuff
|
||||
|
||||
if { $argc < 1} {
|
||||
puts stdout "Usage: \n\thrptcheck filename"
|
||||
exit 0
|
||||
}
|
||||
set filename [lindex $argv 0]
|
||||
lappend fileList [file tail $filename]
|
||||
puts stdout "Syntax checking --> $filename <-- ........."
|
||||
source $filename
|
||||
puts stdout "If this completed without errors the likelihoof of your script"
|
||||
puts stdout "executing properly on the instrument has increased significantly"
|
||||
exit 1
|
||||
|
144
utils/check/sanscheck
Executable file
144
utils/check/sanscheck
Executable file
@ -0,0 +1,144 @@
|
||||
#! /bin/sh
|
||||
#next line is executed by sh, not by Tcl \
|
||||
exec tclsh $0 ${1+"$@"}
|
||||
#--------------------------------------------------------------------------
|
||||
# This is the SICS syntax checker for the SANS small angle machine
|
||||
#
|
||||
# Mark Koennecke, March 2003
|
||||
#--------------------------------------------------------------------------
|
||||
source /data/koenneck/src/sics/utils/check/sicssyntaxlib.tcl
|
||||
|
||||
#------------------------- define SANS motors and aliases
|
||||
sicsSyntaxMap som syntaxMotor
|
||||
sicsSyntaxMap sax syntaxMotor
|
||||
sicsSyntaxMap say syntaxMotor
|
||||
sicsSyntaxMap saz syntaxMotor
|
||||
sicsSyntaxMap spos syntaxMotor
|
||||
sicsSyntaxMap mz syntaxMotor
|
||||
sicsSyntaxMap mom syntaxMotor
|
||||
sicsSyntaxMap gphi syntaxMotor
|
||||
sicsSyntaxMap gtheta syntaxMotor
|
||||
sicsSyntaxMap gomega syntaxMotor
|
||||
sicsSyntaxMap detectorx syntaxMotor
|
||||
sicsSyntaxMap detectory syntaxMotor
|
||||
sicsSyntaxMap detectorrotation syntaxMotor
|
||||
sicsSyntaxMap beamstopy syntaxMotor
|
||||
sicsSyntaxMap beamstopx syntaxMotor
|
||||
|
||||
#------------ multimotors and their aliases
|
||||
sicsSyntaxMap emagnetsampleholder mumoSyntax
|
||||
set sicsPar(emagnetsampleholder.alias) [list z om]
|
||||
set sicsPar(emagnetsampleholder.nampos) [list back]
|
||||
|
||||
sicsSyntaxMap msh mumoSyntax
|
||||
set sicsPar(msh.alias) [list z om]
|
||||
set sicsPar(msh.nampos) [list back]
|
||||
|
||||
sicsSyntaxMap cryomagnetsampleholder mumoSyntax
|
||||
set sicsPar(cryomagnetsampleholder.alias) [list phi theta omega]
|
||||
set sicsPar(cryomagnetsampleholder.nampos) [list back]
|
||||
|
||||
sicsSyntaxMap cryo mumoSyntax
|
||||
set sicsPar(cryo.alias) [list phi theta omega]
|
||||
set sicsPar(cryo.nampos) [list back]
|
||||
|
||||
sicsSyntaxMap sampletable mumoSyntax
|
||||
set sicsPar(sampletable.alias) [list omega x y z posi]
|
||||
set sicsPar(sampletable.nampos) [list back]
|
||||
|
||||
sicsSyntaxMap st mumoSyntax
|
||||
set sicsPar(st.alias) [list omega x y z posi]
|
||||
set sicsPar(st.nampos) [list back]
|
||||
|
||||
sicsSyntaxMap detector mumoSyntax
|
||||
set sicsPar(detector.alias) [list x y phi]
|
||||
set sicsPar(detector.nampos) [list back]
|
||||
|
||||
sicsSyntaxMap dt mumoSyntax
|
||||
set sicsPar(dt.alias) [list x y phi]
|
||||
set sicsPar(dt.nampos) [list back]
|
||||
|
||||
sicsSyntaxMap beamstop mumoSyntax
|
||||
set sicsPar(beamstop.alias) [list x y]
|
||||
set sicsPar(beamstop.nampos) [list back]
|
||||
|
||||
sicsSyntaxMap bs mumoSyntax
|
||||
set sicsPar(bs.alias) [list x y]
|
||||
set sicsPar(bs.nampos) [list back]
|
||||
|
||||
#------------ define SANS counters
|
||||
sicsSyntaxMap counter syntaxCounter
|
||||
sicsSyntaxMap banana syntaxHM
|
||||
|
||||
#------------ define SANS variables
|
||||
sicsSyntaxMap title syntaxTextPar
|
||||
sicsSyntaxMap user syntaxTextPar
|
||||
sicsSyntaxMap collimation syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap comment1 syntaxTextPar
|
||||
sicsSyntaxMap comment2 syntaxTextPar
|
||||
sicsSyntaxMap comment3 syntaxTextPar
|
||||
sicsSyntaxMap fax syntaxTextPar
|
||||
sicsSyntaxMap email syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap lambda syntaxNumPar
|
||||
sicsSyntaxMap nvs syntaxNumPar
|
||||
|
||||
#----------- define SANS environment
|
||||
sicsSyntaxMap temperature evSyntax
|
||||
sicsSyntaxMap tt evSyntax
|
||||
|
||||
|
||||
|
||||
#---------- define SANS auxiliary
|
||||
sicsSyntaxMap beam syntaxDummy
|
||||
sicsSyntaxMap detemp syntaxDummy
|
||||
sicsSyntaxMap temp2 syntaxDummy
|
||||
sicsSyntaxMap temp3 syntaxDummy
|
||||
sicsSyntaxMap temp4 syntaxDummy
|
||||
sicsSyntaxMap coll syntaxNumPar
|
||||
sicsSyntaxMap att syntaxNumPar
|
||||
sicsSyntaxMap shutter syntaxTextPar
|
||||
sicsSyntaxMap bschange syntaxNumPar
|
||||
sicsSyntaxMap qrange syntaxNumPar
|
||||
sicsSyntaxMap bsin syntaxDummy
|
||||
sicsSyntaxMap bsout syntaxDummy
|
||||
|
||||
#------------- SANS xy-tables
|
||||
sicsSyntaxMap xydata0 syntaxXY
|
||||
sicsSyntaxMap xydata1 syntaxXY
|
||||
sicsSyntaxMap xydata2 syntaxXY
|
||||
sicsSyntaxMap xydata3 syntaxXY
|
||||
sicsSyntaxMap xydata4 syntaxXY
|
||||
sicsSyntaxMap xydata5 syntaxXY
|
||||
sicsSyntaxMap xydata6 syntaxXY
|
||||
sicsSyntaxMap xydata7 syntaxXY
|
||||
sicsSyntaxMap xydata8 syntaxXY
|
||||
sicsSyntaxMap xydata9 syntaxXY
|
||||
sicsSyntaxMap xydata syntaxXY
|
||||
|
||||
#--------- do we need this?
|
||||
sicsSyntaxMap save syntaxDummy
|
||||
sicsSyntaxMap SplitReply syntaxDummy
|
||||
sicsSyntaxMap Publish syntaxDummy
|
||||
|
||||
#--------- Main checking stuff
|
||||
|
||||
if { $argc < 1} {
|
||||
puts stdout "Usage: \n\tsanscheck filename"
|
||||
exit 0
|
||||
}
|
||||
set filename [lindex $argv 0]
|
||||
lappend fileList [file tail $filename]
|
||||
puts stdout "Syntax checking --> $filename <-- ........."
|
||||
source $filename
|
||||
puts stdout "If this completed without errors the likelihoof of your script"
|
||||
puts stdout "executing properly on the instrument has increased significantly"
|
||||
exit 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
86
utils/check/sicssyntax.tex
Normal file
86
utils/check/sicssyntax.tex
Normal file
@ -0,0 +1,86 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
%%\usepackage[dvips]{graphics}
|
||||
%%\usepackage{epsf}
|
||||
\setlength{\textheight}{24cm}
|
||||
\setlength{\textwidth}{16cm}
|
||||
\setlength{\headheight}{0cm}
|
||||
\setlength{\headsep}{0cm}
|
||||
\setlength{\topmargin}{0cm}
|
||||
\setlength{\oddsidemargin}{0cm}
|
||||
\setlength{\evensidemargin}{0cm}
|
||||
\setlength{\hoffset}{0cm}
|
||||
\setlength{\marginparwidth}{0cm}
|
||||
|
||||
\begin{document}
|
||||
\begin{center}
|
||||
\begin{Large}
|
||||
SICS Syntax Checker\\
|
||||
Implementation Notes\\
|
||||
\end{Large}
|
||||
Mark K\"onnecke\\
|
||||
Mark.Koennecke@psi.ch\\
|
||||
March/April 2003\\
|
||||
Laboratory for Neutron Scattering\\
|
||||
Paul Scherrer Institute\\
|
||||
CH--5232 Villigen--PSI
|
||||
Switzerland
|
||||
\end{center}
|
||||
|
||||
Users wish to check their batch files for syntax errors before
|
||||
submitting them to SICS for the weekend or the night. Unfortunately
|
||||
checking SICS syntax is not so easy as it consists of Tcl syntax plus
|
||||
SICS commands. In order to implement a syntax checker various
|
||||
possibilities exist:\begin{itemize}
|
||||
\item Implement the syntax checker as a calculation mode within
|
||||
SICS. This has the disadvantage that the syntax check can only be run
|
||||
by one person and only when the SICS server is not performing an
|
||||
experiment. This is due to the fact, that SICS has only one set of
|
||||
variables which may be changed dureing the syntax check. In order to
|
||||
prevent corruption the security measures stated above are necessary.
|
||||
\item Use a SICServer with simulated hardware. This would
|
||||
work. Problems are that this is very time consuming to set up and the
|
||||
synchronisation of parameter values with the main SICServer. This has
|
||||
been solved through the sync command and thus this option is available
|
||||
for complex scripts.
|
||||
\item Use a Tcl interpreter with dummy SICS commands as a syntax
|
||||
checker. In many cases batch files are fairly simple and a complete
|
||||
simulation is not needed. The such a option would be sufficient.
|
||||
\end{itemize}
|
||||
\end{document}
|
||||
|
||||
\section{The Tcl Syntax Checker}
|
||||
This section describes the syntax checker built from a Tcl interpreter
|
||||
with dummy routines testing SICS syntax. The dummy procedures only
|
||||
have to test the syntax and else do nothing. Not many such proecdures
|
||||
have to be implemented but a means is needed for mapping names, for
|
||||
instance motor names, to a suitable procedure for checking the syntax.
|
||||
|
||||
This syntax checker can be used in a variety of situations:
|
||||
\begin{itemize}
|
||||
\item Standalone: the preferred mode of operation
|
||||
\item Within SICS: SICS would need to have a second Tcl interpreter
|
||||
for this purpose in order to prevent corruption of the main
|
||||
interpreter. Even then a rogue script could go into an endless loop
|
||||
and thus hang the SICS server. Thus this second interpreter would have
|
||||
to run as a separate process or thread.
|
||||
\item This syntax checker could also help debugging SICS scripts.
|
||||
\end{itemize}
|
||||
|
||||
For each instrument two files are needed for this syntax checker. The
|
||||
first is a common library file which implements the syntax checking
|
||||
procedures and the sics_alias procedure which maps names to
|
||||
procedures. The second is a mapping file which defines the instrument
|
||||
and enables those names the instrument provides. This is much like the
|
||||
instrument initialization file for the main SICS program.
|
||||
|
||||
In order to help in script debugging, a global array with parameter
|
||||
values defined through the user script will be maintained.
|
||||
|
||||
In a latter stage a connection to the main SICS could be added to the
|
||||
system. Through this connection the actual configuration of the
|
||||
instrument could be queried. Also parameter values can be updated in
|
||||
order to help in debugging sophisticated scripts. Moreover this
|
||||
connection could be used to check limit violations.
|
||||
|
||||
|
||||
|
1088
utils/check/sicssyntaxlib.tcl
Normal file
1088
utils/check/sicssyntaxlib.tcl
Normal file
File diff suppressed because it is too large
Load Diff
2
utils/check/test.tcl
Normal file
2
utils/check/test.tcl
Normal file
@ -0,0 +1,2 @@
|
||||
drive mex -190
|
||||
|
142
utils/check/topsicheck
Executable file
142
utils/check/topsicheck
Executable file
@ -0,0 +1,142 @@
|
||||
#! /bin/sh
|
||||
#next line is executed by sh, not by Tcl \
|
||||
exec tclsh $0 ${1+"$@"}
|
||||
#--------------------------------------------------------------------------
|
||||
# This is the SICS syntax checker for the TOPSI diffractometer
|
||||
#
|
||||
# Mark Koennecke, March 2003
|
||||
#--------------------------------------------------------------------------
|
||||
source /data/koenneck/src/sics/utils/check/sicssyntaxlib.tcl
|
||||
|
||||
#------------------------- define TOPSI motors and aliases
|
||||
sicsSyntaxMap d1r syntaxMotor
|
||||
sicsSyntaxMap d1l syntaxMotor
|
||||
sicsSyntaxMap d2r syntaxMotor
|
||||
sicsSyntaxMap d2l syntaxMotor
|
||||
sicsSyntaxMap d3r syntaxMotor
|
||||
sicsSyntaxMap d3l syntaxMotor
|
||||
sicsSyntaxMap dxt syntaxMotor
|
||||
sicsSyntaxMap dxb syntaxMotor
|
||||
sicsSyntaxMap utz syntaxMotor
|
||||
sicsSyntaxMap uty syntaxMotor
|
||||
sicsSyntaxMap sth syntaxMotor
|
||||
sicsSyntaxMap stt syntaxMotor
|
||||
sicsSyntaxMap stx syntaxMotor
|
||||
sicsSyntaxMap sty syntaxMotor
|
||||
sicsSyntaxMap sgx syntaxMotor
|
||||
sicsSyntaxMap sgy syntaxMotor
|
||||
sicsSyntaxMap utt syntaxMotor
|
||||
sicsSyntaxMap scx syntaxMotor
|
||||
sicsSyntaxMap scy syntaxMotor
|
||||
sicsSyntaxMap po1 syntaxMotor
|
||||
sicsSyntaxMap po2 syntaxMotor
|
||||
sicsSyntaxMap mth syntaxMotor
|
||||
sicsSyntaxMap mtt syntaxMotor
|
||||
sicsSyntaxMap mtx syntaxMotor
|
||||
sicsSyntaxMap mty syntaxMotor
|
||||
sicsSyntaxMap mgx syntaxMotor
|
||||
sicsSyntaxMap mfv syntaxMotor
|
||||
sicsSyntaxMap d1b syntaxMotor
|
||||
sicsSyntaxMap d2b syntaxMotor
|
||||
sicsSyntaxMap d3b syntaxMotor
|
||||
sicsSyntaxMap d1t syntaxMotor
|
||||
sicsSyntaxMap d2t syntaxMotor
|
||||
sicsSyntaxMap d3t syntaxMotor
|
||||
#------------ aliases
|
||||
sicsSyntaxMap s1r syntaxMotor
|
||||
sicsSyntaxMap s1l syntaxMotor
|
||||
sicsSyntaxMap s2r syntaxMotor
|
||||
sicsSyntaxMap s2l syntaxMotor
|
||||
sicsSyntaxMap s3r syntaxMotor
|
||||
sicsSyntaxMap s3l syntaxMotor
|
||||
sicsSyntaxMap a6 syntaxMotor
|
||||
sicsSyntaxMap a5 syntaxMotor
|
||||
sicsSyntaxMap a3 syntaxMotor
|
||||
sicsSyntaxMap som syntaxMotor
|
||||
sicsSyntaxMap th syntaxMotor
|
||||
sicsSyntaxMap om syntaxMotor
|
||||
sicsSyntaxMap a4 syntaxMotor
|
||||
sicsSyntaxMap s2t syntaxMotor
|
||||
sicsSyntaxMap tth syntaxMotor
|
||||
sicsSyntaxMap 2t syntaxMotor
|
||||
sicsSyntaxMap stu syntaxMotor
|
||||
sicsSyntaxMap stl syntaxMotor
|
||||
sicsSyntaxMap sgu syntaxMotor
|
||||
sicsSyntaxMap sgl syntaxMotor
|
||||
sicsSyntaxMap mgu syntaxMotor
|
||||
sicsSyntaxMap sch syntaxMotor
|
||||
sicsSyntaxMap sph syntaxMotor
|
||||
sicsSyntaxMap pol syntaxMotor
|
||||
sicsSyntaxMap ana syntaxMotor
|
||||
sicsSyntaxMap a1 syntaxMotor
|
||||
sicsSyntaxMap mom syntaxMotor
|
||||
sicsSyntaxMap a2 syntaxMotor
|
||||
sicsSyntaxMap m2t syntaxMotor
|
||||
sicsSyntaxMap mtu syntaxMotor
|
||||
sicsSyntaxMap mtl syntaxMotor
|
||||
sicsSyntaxMap mcv syntaxMotor
|
||||
sicsSyntaxMap sttl syntaxMotor
|
||||
sicsSyntaxMap u2t syntaxMotor
|
||||
|
||||
#------------ define TOPSI counters
|
||||
sicsSyntaxMap counter syntaxCounter
|
||||
|
||||
#------------ define TOPSI variables
|
||||
sicsSyntaxMap title syntaxTextPar
|
||||
sicsSyntaxMap user syntaxTextPar
|
||||
sicsSyntaxMap collimation syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap comment1 syntaxTextPar
|
||||
sicsSyntaxMap comment2 syntaxTextPar
|
||||
sicsSyntaxMap comment3 syntaxTextPar
|
||||
sicsSyntaxMap fax syntaxTextPar
|
||||
sicsSyntaxMap email syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap lambda syntaxNumPar
|
||||
|
||||
#----------- define TOPSI environment
|
||||
sicsSyntaxMap temperature evSyntax
|
||||
sicsSyntaxMap tt evSyntax
|
||||
|
||||
#---------- define TOPSI auxiliary
|
||||
sicsSyntaxMap beam syntaxDummy
|
||||
sicsSyntaxMap o2t syntaxNumPar
|
||||
sicsSyntaxMap o2tl syntaxNumPar
|
||||
sicsSyntaxMap o2u syntaxNumPar
|
||||
sicsSyntaxMap ttc syntaxTextPar
|
||||
sicsSyntaxMap sttc syntaxTextPar
|
||||
sicsSyntaxMap sef syntaxTextPar
|
||||
sicsSyntaxMap remote syntaxTextPar
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# some strange TOPSI commands with 3 numeric parameters
|
||||
#-----------------------------------------------------------------------
|
||||
proc dah {w1 w2 w3} {
|
||||
if { [syntaxNumeric $w1] != 1 } {
|
||||
error "ERROR: expected numeric w1, got $w1"
|
||||
}
|
||||
if { [syntaxNumeric $w2] != 1 } {
|
||||
error "ERROR: expected numeric w2, got $w2"
|
||||
}
|
||||
if { [syntaxNumeric $w3] != 1 } {
|
||||
error "ERROR: expected numeric w3, got $w3"
|
||||
}
|
||||
}
|
||||
proc dav {w1 w2 w3} {
|
||||
dah $w1 $w2 $w3
|
||||
}
|
||||
|
||||
#--------- Main checking stuff
|
||||
|
||||
if { $argc < 1} {
|
||||
puts stdout "Usage: \n\ttopsicheck filename"
|
||||
exit 0
|
||||
}
|
||||
set filename [lindex $argv 0]
|
||||
lappend fileList [file tail $filename]
|
||||
puts stdout "Syntax checking --> $filename <-- ........."
|
||||
source $filename
|
||||
puts stdout "If this completed without errors the likelihoof of your script"
|
||||
puts stdout "executing properly on the instrument has increased significantly"
|
||||
exit 1
|
||||
|
288
utils/check/tricscheck
Executable file
288
utils/check/tricscheck
Executable file
@ -0,0 +1,288 @@
|
||||
#! /bin/sh
|
||||
#next line is executed by sh, not by Tcl \
|
||||
exec tclsh $0 ${1+"$@"}
|
||||
#--------------------------------------------------------------------------
|
||||
# This is the SICS syntax checker for the TRICS
|
||||
#
|
||||
# Mark Koennecke, March 2003
|
||||
#--------------------------------------------------------------------------
|
||||
source /data/koenneck/src/sics/utils/check/sicssyntaxlib.tcl
|
||||
|
||||
#------------ define TRICS motors and aliases
|
||||
sicsSyntaxMap momu syntaxMotor
|
||||
sicsSyntaxMap mtvu syntaxMotor
|
||||
sicsSyntaxMap mtpu syntaxMotor
|
||||
sicsSyntaxMap mgvu syntaxMotor
|
||||
sicsSyntaxMap mgpu syntaxMotor
|
||||
sicsSyntaxMap mcvu syntaxMotor
|
||||
sicsSyntaxMap moml syntaxMotor
|
||||
sicsSyntaxMap mtvl syntaxMotor
|
||||
sicsSyntaxMap mtpl syntaxMotor
|
||||
sicsSyntaxMap mgvl syntaxMotor
|
||||
sicsSyntaxMap mcvl syntaxMotor
|
||||
sicsSyntaxMap mexz syntaxMotor
|
||||
sicsSyntaxMap cex1 syntaxMotor
|
||||
sicsSyntaxMap som syntaxMotor
|
||||
sicsSyntaxMap stt syntaxMotor
|
||||
sicsSyntaxMap sch syntaxMotor
|
||||
sicsSyntaxMap sph syntaxMotor
|
||||
sicsSyntaxMap dg1 syntaxMotor
|
||||
sicsSyntaxMap dg2 syntaxMotor
|
||||
sicsSyntaxMap dg3 syntaxMotor
|
||||
sicsSyntaxMap a17 syntaxMotor
|
||||
sicsSyntaxMap a18 syntaxMotor
|
||||
sicsSyntaxMap a1 syntaxMotor
|
||||
sicsSyntaxMap a12 syntaxMotor
|
||||
sicsSyntaxMap a13 syntaxMotor
|
||||
sicsSyntaxMap a14 syntaxMotor
|
||||
sicsSyntaxMap a15 syntaxMotor
|
||||
sicsSyntaxMap a16 syntaxMotor
|
||||
sicsSyntaxMap b1 syntaxMotor
|
||||
sicsSyntaxMap a22 syntaxMotor
|
||||
sicsSyntaxMap a23 syntaxMotor
|
||||
sicsSyntaxMap a24 syntaxMotor
|
||||
sicsSyntaxMap a25 syntaxMotor
|
||||
sicsSyntaxMap a26 syntaxMotor
|
||||
sicsSyntaxMap a37 syntaxMotor
|
||||
sicsSyntaxMap a3 syntaxMotor
|
||||
sicsSyntaxMap om syntaxMotor
|
||||
sicsSyntaxMap a4 syntaxMotor
|
||||
sicsSyntaxMap th syntaxMotor
|
||||
sicsSyntaxMap a10 syntaxMotor
|
||||
sicsSyntaxMap a20 syntaxMotor
|
||||
sicsSyntaxMap ch syntaxMotor
|
||||
sicsSyntaxMap chi syntaxMotor
|
||||
sicsSyntaxMap ph syntaxMotor
|
||||
sicsSyntaxMap a31 syntaxMotor
|
||||
sicsSyntaxMap a32 syntaxMotor
|
||||
sicsSyntaxMap a33 syntaxMotor
|
||||
sicsSyntaxMap phi syntaxMotor
|
||||
sicsSyntaxMap muca syntaxMotor
|
||||
|
||||
|
||||
#------------ define TRICS counters
|
||||
sicsSyntaxMap counter syntaxCounter
|
||||
sicsSyntaxMap hm1 syntaxHM
|
||||
sicsSyntaxMap hm2 syntaxHM
|
||||
sicsSyntaxMap hm3 syntaxHM
|
||||
|
||||
#------------ define TRICS variables
|
||||
sicsSyntaxMap title syntaxTextPar
|
||||
sicsSyntaxMap user syntaxTextPar
|
||||
sicsSyntaxMap adres syntaxTextPar
|
||||
sicsSyntaxMap collimation syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
sicsSyntaxMap comment1 syntaxTextPar
|
||||
sicsSyntaxMap comment2 syntaxTextPar
|
||||
sicsSyntaxMap comment3 syntaxTextPar
|
||||
sicsSyntaxMap fax syntaxTextPar
|
||||
sicsSyntaxMap email syntaxTextPar
|
||||
sicsSyntaxMap sample syntaxTextPar
|
||||
|
||||
#----------- define TRICS environment
|
||||
sicsSyntaxMap temperature evSyntax
|
||||
sicsSyntaxMap tt evSyntax
|
||||
|
||||
#---------- define TRICS auxiliary
|
||||
proc xbu {fname} {
|
||||
fileeval $fname
|
||||
}
|
||||
proc exe {fname} {
|
||||
fileeval $fname
|
||||
}
|
||||
proc do {fname} {
|
||||
fileeval $fname
|
||||
}
|
||||
sicsSyntaxMap o2t syntaxNumPar
|
||||
sicsSyntaxMap four syntaxTextPar
|
||||
sicsSyntaxMap hmc hmcSyntax
|
||||
sicsSyntaxMap hkl syntaxHKL
|
||||
sicsSyntaxMap opti optiSyntax
|
||||
sicsSyntaxMap rliste syntaxWarn
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# TRICS uses a couple of special scan commands with a special common
|
||||
# syntax. This is defined here.
|
||||
#-----------------------------------------------------------------------
|
||||
proc tttscan { var start delta np {mode NULL} {preset NULL} } {
|
||||
if { [syntaxNumeric $start] != 1} {
|
||||
error "ERROR: $start is no number, expected scan start"
|
||||
}
|
||||
if { [syntaxNumeric $delta] != 1} {
|
||||
error "ERROR: $delta is no number, expected scan step"
|
||||
}
|
||||
if { [syntaxNumeric $np] != 1} {
|
||||
error "ERROR: $np is no number, expected scan noPoints"
|
||||
}
|
||||
if { [string compare $preset NULL] != 0 } {
|
||||
if { [syntaxNumeric $preset] != 1} {
|
||||
error "ERROR: $preset is no number, expected scan preset"
|
||||
}
|
||||
}
|
||||
if { [string compare $mode NULL] != 0 } {
|
||||
set mode [string trim [string tolower $mode]]
|
||||
if { [syntaxCounterMode $mode] != 1} {
|
||||
error "ERROR: $mode is no valid count mode!"
|
||||
}
|
||||
}
|
||||
syntaxLimit $var $start
|
||||
syntaxLimit $var [expr $start + $np*$delta]
|
||||
}
|
||||
proc tricsscan {start step np {mode NULL} {preset NULL} } {
|
||||
tttscan om $start $step $np $mode $preset
|
||||
}
|
||||
proc detscan {start step np {mode NULL} {preset NULL} } {
|
||||
tttscan stt $start $step $np $mode $preset
|
||||
}
|
||||
proc phscan {start step np {mode NULL} {preset NULL} } {
|
||||
tttscan ph $start $step $np $mode $preset
|
||||
}
|
||||
#----------------------------------------------------------------------
|
||||
# psdrefscan syntax. I wonder if anyone is using this........
|
||||
#-----------------------------------------------------------------------
|
||||
proc psdrefscan {filename step {mode NULL} {preset NULL}} {
|
||||
if { [syntaxNumeric $step] != 1} {
|
||||
error "ERROR: $step is no number, expected scan step"
|
||||
}
|
||||
if { [syntaxNumeric $np] != 1} {
|
||||
error "ERROR: $np is no number, expected scan noPoints"
|
||||
}
|
||||
if { [string compare $preset NULL] != 0 } {
|
||||
if { [syntaxNumeric $preset] != 1} {
|
||||
error "ERROR: $preset is no number, expected scan preset"
|
||||
}
|
||||
}
|
||||
if { [string compare $mode NULL] != 0 } {
|
||||
set mode [string trim [string tolower $mode]]
|
||||
if { [syntaxCountMode $mode] != 1} {
|
||||
error "ERROR: $mode is no valid count mode!"
|
||||
}
|
||||
}
|
||||
}
|
||||
#----------------------------------------------------------------------
|
||||
# mess measures a whole file with reflections
|
||||
#----------------------------------------------------------------------
|
||||
lappend messKey start file nb bi close writereflection
|
||||
|
||||
proc mess args {
|
||||
global messKey sicsPar
|
||||
|
||||
if { [llength $args] < 1} {
|
||||
error "ERROR: need subcommand to mess"
|
||||
}
|
||||
set subcommand [string trim [string tolower [lindex $args 0]]]
|
||||
if { [lsearch $messKey $subcommand] >= 0} {
|
||||
return
|
||||
}
|
||||
switch $subcommand {
|
||||
preset -
|
||||
np -
|
||||
step -
|
||||
compact {
|
||||
if { [llength $args] > 1} {
|
||||
set val [lindex $args 1]
|
||||
if { [syntaxNumeric $val] != 1} {
|
||||
error \
|
||||
"ERROR: expected numeric par to $subcommand, got $val"
|
||||
}
|
||||
set sicsPar(mess.$subcommand) $val
|
||||
} else {
|
||||
return [syntaxGet mess.$subcommand]
|
||||
}
|
||||
}
|
||||
mode -
|
||||
countmode {
|
||||
if { [llength $args] > 1} {
|
||||
set val [lindex $args 1]
|
||||
if { [syntaxCounterMode $val] != 1} {
|
||||
error ERROR: expected counter mode, got $val
|
||||
}
|
||||
set sicsPar(mess.mode) $val
|
||||
} else {
|
||||
return [syntaxGet mess.mode]
|
||||
}
|
||||
}
|
||||
reopen -
|
||||
genlist -
|
||||
measure {
|
||||
if { [llength $args] < 2} {
|
||||
error "ERROR: no filename to process for $subcommand"
|
||||
}
|
||||
}
|
||||
default {
|
||||
error "ERROR: subcommand $subcommand to mess not known"
|
||||
}
|
||||
}
|
||||
}
|
||||
#-------------------------------------------------------------------------
|
||||
# The local maximum search command
|
||||
#------------------------------------------------------------------------
|
||||
lappend lomaPar window threshold steepness cogwindow cogcontour
|
||||
|
||||
proc lomax args {
|
||||
global lomaPar sicsPar
|
||||
|
||||
if { [llength $args] < 1} {
|
||||
error "ERROR: need subcommand to lomax"
|
||||
}
|
||||
set subcommand [string trim [string tolower [lindex $args 0]]]
|
||||
if { [lsearch $lomaPar $subcommand] >= 0} {
|
||||
if { [llength $args] > 1} {
|
||||
set val [lindex $args 1]
|
||||
if { [syntaxNumeric $val] != 1} {
|
||||
error "ERROR: expected numeric arg to $subcommand, got $val"
|
||||
}
|
||||
set sicsPar(lomax.$subcommand) $val
|
||||
} else {
|
||||
return [syntaxGet lomax.$subcommand]
|
||||
}
|
||||
}
|
||||
switch $subcommand {
|
||||
stat -
|
||||
search {
|
||||
if { [llength $args] < 2} {
|
||||
error "ERROR: need a hm to $subcommand"
|
||||
}
|
||||
set p [string trim [string tolower [lindex $args 1]]]
|
||||
set ret [catch {info body $p} msg]
|
||||
if { $ret != 0 } {
|
||||
error [format "ERROR: no %s to $subcommand found" $p]
|
||||
}
|
||||
}
|
||||
cog {
|
||||
if { [llength $args] < 4} {
|
||||
error "ERROR: not enough arguments to lomax cog"
|
||||
}
|
||||
set p [string trim [string tolower [lindex $args 1]]]
|
||||
set ret [catch {info body $p} msg]
|
||||
if { $ret != 0 } {
|
||||
error [format "ERROR: no %s to calc COG fromfound" $p]
|
||||
}
|
||||
for {set i 2} {$i < [llength $args]} {incr i} {
|
||||
set val [lindex $args $i]
|
||||
if { [syntaxNumeric $val] != 1} {
|
||||
error "ERROR: expected numeric par to cog, got $val"
|
||||
}
|
||||
}
|
||||
}
|
||||
default {
|
||||
error "ERROR: subcommand $subcommand to lomax not known"
|
||||
}
|
||||
}
|
||||
}
|
||||
#--------------------------- main program --------------------------------
|
||||
#syntaxLoadSICS amorstatus.tcl
|
||||
#puts stdout [array names sicsPar]
|
||||
|
||||
if { $argc < 1} {
|
||||
puts stdout "Usage: \n\ttricscheck filename"
|
||||
exit 0
|
||||
}
|
||||
set filename [lindex $argv 0]
|
||||
lappend fileList [file tail $filename]
|
||||
puts stdout "Syntax checking --> $filename <-- ........."
|
||||
source $filename
|
||||
puts stdout "If this completed without errors the likelihoof of your script"
|
||||
puts stdout "executing properly on the instrument has increased significantly"
|
||||
exit 1
|
||||
|
0
utils/check/tst
Normal file
0
utils/check/tst
Normal file
Reference in New Issue
Block a user