#**********************************************************************#
#*                                                                    *#
#* Copyright (c) 2001 by Sun Microsystems, Inc.                       *#
#* All rights reserved.                                               *#
#*                                                                    *#
#**********************************************************************#

: $Workfile:   ncd97start.sh  $ $Revision:   1.0  $
# ncd97start
# start Sun MTP system in development mode 

# params:  4    Model 4 window (43x80)
#          5    Model 5 window (27x132)


LINES=25
COLUMNS=80
set -- `getopt 45 $*`

#while options to process
while test  "$1" != "--"
do
    case $1 in
	    -4)
                LINES=43
                COLUMNS=80
	        ;;
	    -5)
                LINES=27
	        COLUMNS=132
	        ;;
    esac
    shift
done

# default COBSW for MicroFocus runtime system.
COBSW=${COBSW}-F
export COBSW

# remove any temporary files hanging around
cd $KIXSYS
/bin/rm -f core *.out *.log *.dbg *.err

# start system. options are as follows:
#	-f	display log messages in window 
#	-F	run unikixmain in foreground - required by animator
#	-w	create window for animator

unikixmain -f -F -w

# start additional windows for terminals
# All Sun MTP terminal windows must be at least 25 x 80.  The 25th line
# provides room for the 3270 status indicator

export LINES COLUMNS

# next start terminal window
if test $LINES -eq 25
then
    ncd97unikix unikix "+100+0"
elif test $LINES -eq 43
then
    ncd97unikix -4 unikix "+100+0"
else
    ncd97unikix -5 unikix "+100+0"
fi

sleep 1

# finally, start configuration window
ncd97unikix kixmenu "-0+400" 
exit 0
