#!/bin/csh -f
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# This file is distributed subject to a Software License Agreement found
# in the file LICENSE that is included with this distribution. 
#*************************************************************************
set HOST_ARCH = `/usr/local/epics/startup/HostArch`
setenv HOST_ARCH  $HOST_ARCH
set PVT_LOC = $EPICS_EXTENSIONS/bin/$HOST_ARCH

if ${?EPICS_EXTENSIONS_PVT} == 1 then 
	set PVT_LOC = $EPICS_EXTENSIONS_PVT/bin/$HOST_ARCH
endif


setenv IDL_DEVICE X

if ${?EPICS_EXTENSIONS_PVT} == 1 then
        source $EPICS_EXTENSIONS_PVT/bin/$HOST_ARCH/ezcaidl_setup
else
        source $EPICS_EXTENSIONS/bin/$HOST_ARCH/ezcaidl_setup
endif

	set exe = "-rt=$EPICS_EXTENSIONS/bin/$HOST_ARCH/scanSee.exe2.idl53"
	if ${?EPICS_EXTENSIONS_PVT} == 1 then
	set exe = "-rt=$EPICS_EXTENSIONS_PVT/bin/$HOST_ARCH/scanSee.exe2.idl53"
	endif
	if -e scanSee.exe2.idl53 then
	set exe = "scanSee.exe2.idl53"
	endif

if ( "$1" == "" ) then
if `isainfo -b` == 64 then
	source /usr/local/rsi/idl_5.4/bin/idl_setup
	idl -32 $exe
else
	source /usr/local/rsi/idl_5.3/bin/idl_setup
	idl $exe
endif
exit
endif

set xdr = "DC"

echo ".run readScan.pro" >! go_viewer
echo ".run DC.pro" >>! go_viewer
echo ".run vw2d.pro" >>! go_viewer
echo ".run panimage.pro" >>! go_viewer
echo "$xdr" >>! go_viewer
if `isainfo -b` == 64 then
	source /usr/local/rsi/idl_5.4/bin/idl_setup
	idl -32  go_viewer
else
	source /usr/local/rsi/idl_5.3/bin/idl_setup
	idl go_viewer
endif
rm go_viewer
