#! /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 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
syntaxLoadSICS /data/lnslib/data/HRPT/2003/hrptstatus.tcl
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
 
