#!/bin/csh

set id1 = $1
set id2 = $2
set dir = ${id2}_${id1}
set sen1 = "`scripts/get_sensor.csh $id1`"
set sen2 = "`scripts/get_sensor.csh $id2`"
set sennam = "${sen2}-vs-${sen1}"
set testid = $dir
cd $dir
foreach f (../templates/*mission*.tpl)
  set ofile = `basename $f | sed "s/tpl/html/g"`
  sed -e `echo "s|TESTID1|$id1|g"` \
      -e `echo "s|TESTID2|$id2|g"` \
      -e `echo "s|TESTID|$testid|g"` \
      -e `echo "s|SENNAM|$sennam|g"` \
         $f > $ofile
end
foreach f (../templates/*repeat*.tpl)
  set ofile = `basename $f | sed "s/tpl/html/g"`
  sed -e `echo "s|TESTID1|$id1|g"` \
      -e `echo "s|TESTID2|$id2|g"` \
      -e `echo "s|TESTID|$testid|g"` \
      -e `echo "s|SENNAM|$sennam|g"` \
         $f > $ofile
end
cat ../templates/anomaly.html | sed "s/TESTID/$id1/g" > anomaly1.html
cat ../templates/anomaly.html | sed "s/TESTID/$id2/g" > anomaly2.html
cd ..

exit 0
