#!/bin/sh
# \
exec oagtclsh "$0" "$@"
set auto_path [linsert $auto_path 0 /usr/local/oag/apps/lib/$env(HOST_ARCH)]
set auto_path [linsert $auto_path 0 /usr/local/oag/lib_patch/$env(HOST_ARCH)]

set args $argv
set suffix ""
set bpmtype msAve
set config default
set xray 1
APSParseArguments {suffix config xray}

set dataDir /home/helios/oagData/sr/orbitControllaw/lattices/default
set tmpFile /tmp/[APSTmpString]
exec cp $dataDir/h.$config/config $tmpFile.h.config
exec cp $dataDir/v.$config/config $tmpFile.v.config
if $xray {
    set opt -x
} else {
    set opt ""
}

if [catch {eval exec makesadtfile -suffix $suffix -type $bpmtype -o $tmpFile $opt \
	       $tmpFile.h.config $tmpFile.v.config } result] {
    APSAlertBox [APSUniqueName .] -errorMessage "$result"
    return
}
exec adt -f $tmpFile &

exit 0