################################################################################
#
#  Install subject: ppa - Pick and Place Application
#  $Revision: 1.5 $
#
#
#
################################################################################
# Install.cmd script for installation of the Pick and Place Application add-on package.
#
# Use:
#      this file will be included by the root to the main installation script
#      with the specific 'include' command.
#      Used variables:
#		var 54: Value 1 if this install has already been done
#
################################################################################


#############
# Beginning #
#############

if -var 54 -value 1 -label NO_INSTALL
setvar -var 54 -value 1

#######################################################
# Include cnv application rel 3_1.20
# change in next major revision e.g. rel 3_2
#######################################################

include -path $BOOTPATH/inst_cnv.cmd

echo -text " "
echo -text "Installing Pick and Place"
echo -text "Application option"

#
#################################################
# Base national Language Dependent files (text) #
#################################################
echo -text "Install text files"
text -filename $BOOTPATH/rlppa.eng -package 0
text -filename $BOOTPATH/ppa_elog.$LANG -package 0

#
#########################################################
# Rapid national Language Independent files (Rapid sys) #
#########################################################
echo -text "Install Rapid files"

# copy -from $BOOTPATH/ppa77.prg          -to ppa77.prg
# copy -from $BOOTPATH/ppacal377.prg      -to ppacal377.prg
copy -from $BOOTPATH/ppacal.prg         -to ppacal.prg
# copy -from $BOOTPATH/PutCal0.prg        -to PutCal0.prg
# copy -from $BOOTPATH/PutCal0Off.prg     -to PutCal0Off.prg
copy -from $BOOTPATH/PutCal0_340.prg    -to PutCal0_340.prg
copy -from $BOOTPATH/PutCal0_6ax.prg    -to PutCal0_6ax.prg
copy -from $BOOTPATH/ppasys.sys         -to ppasys.sys
#
#######################################
# National Language Independent files #
#######################################
echo -text "Setup system configuration"

# Rapid : cfg (Rapid programming rules)
config -filename $BOOTPATH/rlppa.cfg -domain MMC -internal

# EIO   : cfg (definitions & configurations)
# Check how many conveyors that was installed
if -var 11 -value 30 -label INSTALL_BOARD_2
if -var 11 -value 20 -label INSTALL_BOARD_2

echo -text "How many DigIO boards should be installed?"
query -text "  1       2     " -var 10 -fk_text
if -var 10 -value 20 -label INSTALL_BOARD_2
if -var 10 -value 10 -label INSTALL_BOARD_1

#INSTALL_BOARD_2
config -filename $BOOTPATH/ppaeio2.cfg -domain EIO
#INSTALL_BOARD_1
config -filename $BOOTPATH/ppaeio1.cfg -domain EIO
config -filename $BOOTPATH/ppasim.cfg -domain EIO

# CAB   : cfg (definitions & configurations)
config -filename $BOOTPATH/ppasys.cfg -domain SYS -internal
config -filename $BOOTPATH/ppasyspub.cfg -domain SYS

# SIO   : cfg (definitions & configurations) 
config -filename $BOOTPATH/ppacom.cfg -domain SIO

append -from $BOOTPATH/opt_ppa.cmd -to opt_l2.cmd

echo -text "...done with PPA installation"

#
# The following has to be done afterwards in the base install.cmd script:
#
#    new -resource cab
#    # Make System WarmStart (use startup.cmd):
#    restart
#
#NO_INSTALL




