#
# MakeWebIndex.pl
#
# Syntax: MakeWebIndex.pl <DUTSerialNumber> <SequenceType>
# (You probably need to say perl MakeWebIndex.pl... on Windows)
#
# DUTSerialNumber is as you specified in sctdaq config
# SequenceType    is a user string, it might be something like
#                   Hybrid_Initial or Module_Longterm
#                 it is used as a directory name in $archive
#
# If installing this script afresh on a new system, you also need the perl
# libraries SctDAQWebLib.pl and LocalVariables.pl; You should (at least) look
# at LocalVariables.pl to check it is OK for your local system
#
# This script should run happily on Windows and Linux
#
# Send feedback to Dave.Charlton@cern.ch
#
# Version 0.5 DGC  Mods for rewritten SctDAQWebLib.pl version 0.5
# Version 0.4 DGC  Minor change to define $LTT here
# Version 0.3 DGC  First version, from earlier code of DGC and PWP

require "SctDAQWebLib.pl" || die "Cannot load SctDAQWebLib.pl" ;
&InitialiseVariables ;

if ( $#ARGV!=1 ) {
    print "syntax: MakeWebIndex <s/n> <TestSequence>\n" ;
    die "bad arguments" ;
}
$DUT=$ARGV[0] ;
$TestSequence=$ARGV[1] ;

$Directory="$archive/$DUT/$TestSequence" ;

&FindResultFiles($DUT,$Directory) ;
&FindPSFiles($DUT,$Directory) ;

open(HTML,">$Directory/index.html") ;
&ProcessLogFiles($Directory,$TestSequence) ;
&WriteIndexHTMLHeader($DUT,$TestSequence) ;
&PrintDCSTable ;
&PrintAllTestHTML($TestSequence) ;
&PrintDefectTables ;
&PrintXMLAndLogFiles ;
&WriteIndexHTMLTrailer ;
close(HTML) ;

print "\n$0 execution complete\n" ;
exit 0 ;


