#! /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/lnslib/bin/sicscheck/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 /data/lnslib/data/FOCUS/2003/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
 
