#!/bin/sh

if [ $# = 0 ]
then
        echo "Argument= 2 pour executer fcs-2.1.5-SNAPSHOT, si pas d argument, par default c est 4.0.0."
        source .setupFCS_BIN-4.0.0
else
        source .setupFCS_BIN    
fi

echo "DISTRIBUTION_BIN=$DISTRIBUTION_BIN"

DESCRIPTION_FILE=fcs__simulation
echo "DESCRIPTION_FILE=$DESCRIPTION_FILE"


P0=java.util.logging.ConsoleHandler.level\=ALL
echo "P0=$P0"

P1=java.util.logging.FileHandler.formatter\=org.lsst.ccs.utilities.logging.TextFormatter
echo "P1=$P1"

P7=java.util.logging.FileHandler.level\=ALL

LOGFILENAME=java.util.logging.FileHandler.pattern\=%L/ccs-logs-%A-WholeFCS-simu.log
echo "LOGFILENAME=$LOGFILENAME"

P2=.level\=WARNING
echo "P2=$P2"

P3=org.lsst.ccs.level\=WARNING
#P3=org.lsst.ccs.level\=ALL

echo "P3=$P3"
 
P4=org.lsst.ccs.bus.level\=INFO
#P4=org.lsst.ccs.bus.level\=ALL
echo "P4=$P4"

P5=org.lsst.ccs.subsystems.fcs.level\=FINE
echo "P5=$P5"

P6=org.lsst.ccs.startInEngineeringMode\=true

/bin/sh $DISTRIBUTION_BIN/CCSbootstrap.sh -app FcsSubsystem --description $DESCRIPTION_FILE --configuration "" -D $P0 -D $P1 -D $P2 -D $P3 -D $P4 -D $P5 -D $LOGFILENAME -D $P7 $*
