#!/bin/sh

Dytest=/virgoDev/Dy/v8r09/test
CmV=/virgoApp/Cm/v7r12p3
FdV=/virgoDev/Fd/v3r14
UNAME=`uname`

if [ ${#} -eq 0 ] ; then
  echo " "
  echo "Give a test number:"
  echo "   1=data from one file  2=data from one dir  3=cm connection to fbsim_1"
  echo "   4=static cm connection as tutu  5=cm connection to fbsim_1 (only time plot)"
  echo "                                   6=cm connection to fbsim_1 (only fft plot)"
  echo "                                   7=data from file (only time-frequency plot)"
  echo " "
  exit 0 
fi

cd $Dytest

# First test
if [ ${1} -eq "1" ] ; then
  ../OSF1/dataDisplay ddfileall.car
fi

# Second test
if [ ${1} -eq "2" ] ; then
  ../OSF1/dataDisplay dddirall.car
fi

# Third test
if [ ${1} -eq "3" ] ; then
  xterm -sb -sl 1024 -geometry 168x10+10+0   -T "fbsim_1 - `date +\"%d %b %Y-%T\"`"  -e $FdV/$UNAME/FBSim.exe tutu &
  sleep 2
  ../OSF1/dataDisplay ddcmall.car
  $CmV/$UNAME/cm.exe send -to fbsim_1 -type CfgExit
fi

# Fourth test
if [ ${1} -eq "4" ] ; then
  xterm -sb -sl 1024 -geometry 168x10+10+0   -T "fbsim_1 - `date +\"%d %b %Y-%T\"`"  -e $FdV/$UNAME/FBSim.exe tutu &
  sleep 2
  ../OSF1/dataDisplay ddcmstaticall.car
  $CmV/$UNAME/cm.exe send -to fbsim_1 -type CfgExit
fi

# Fith test
if [ ${1} -eq "5" ] ; then
  xterm -sb -sl 1024 -geometry 168x10+10+0   -T "fbsim_1 - `date +\"%d %b %Y-%T\"`"  -e $FdV/$UNAME/FBSim.exe tutu &
  sleep 2
  ../OSF1/dataDisplay ddcmtime.car
  $CmV/$UNAME/cm.exe send -to fbsim_1 -type CfgExit
fi

# Sixth test
if [ ${1} -eq "6" ] ; then
  xterm -sb -sl 1024 -geometry 168x10+10+0   -T "fbsim_1 - `date +\"%d %b %Y-%T\"`"  -e $FdV/$UNAME/FBSim.exe tutu &
  sleep 2
  ../OSF1/dataDisplay ddcmfft.car
  $CmV/$UNAME/cm.exe send -to fbsim_1 -type CfgExit
fi

# Sixth test
if [ ${1} -eq "7" ] ; then
  ../OSF1/dataDisplay ddfiletimefreq.car
fi


