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

syntaxLoadSICS /data/lnslib/data/DMC/2003/dmcstatus.tcl

#--------- 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
 