#! /bin/sh
set -x

function doDisp() {
    # pre the IO changes
    #java -Xmx1540M -ea -classpath /norbert/preIO/display/build/classes:/norbert/preIO/mkgmap/build/classes:/norbert/preIO/mkgmap/lib/compile/fastutil-6.5.15-mkg.1b.jar:/norbert/preIO/mkgmap/lib/compile/osmpbf-1.3.3.jar:/norbert/preIO/mkgmap/lib/compile/protobuf-java-2.5.0.jar $1 $2
    # current build
    java -Xmx1540M -ea -classpath /norbert/display/trunk/build/classes:/norbert/svn/trunk/build/classes:/norbert/svn/trunk/lib/compile/fastutil-6.5.15-mkg.1b.jar:/norbert/svn/trunk/lib/compile/osmpbf-1.3.3.jar:/norbert/svn/trunk/lib/compile/protobuf-java-2.5.0.jar $*
}

snglImg=${1:-74200001}

#na doDisp test.TestAll 00007420.XXX >TestAll.out

doDisp test.ExtractFile gmapsupp.img >ExtractFile.out
if [ -e ${snglImg}.img ]; then
   doDisp test.ExtractFile ${snglImg}.img >ExtractFile1.out
else
   # re-constitute the .img
   doDisp test.ZipFile ${snglImg}.img ${snglImg}.??? >ZipFile.out
fi

doDisp test.ListFile             osmmap.img >ListFile0.out
#no doDisp test.ListFile             osmmap.tdb >ListFileT.out
doDisp test.ListFile           gmapsupp.img >ListFile.out
doDisp test.ListFile           osmmap_mdr.img >ListFileM.out
doDisp test.ListFile           ${snglImg}.img >ListFile1.out
doDisp test.ListFile           ovm_${snglImg}.img >ListFileV.out

doDisp test.display.TdbDisplay   osmmap.tdb >TdbDisplayT.out
#no doDisp test.display.ImgDisplay   osmmap.tdb >ImgDisplayT.out
doDisp test.display.ImgDisplay   osmmap.img >ImgDisplay0.out
doDisp test.display.ImgDisplay gmapsupp.img >ImgDisplay.out
doDisp test.display.ImgDisplay osmmap_mdr.img >ImgDisplayM.out
doDisp test.display.ImgDisplay ${snglImg}.img >ImgDisplay1.out
doDisp test.display.ImgDisplay ovm_${snglImg}.img >ImgDisplayV.out

doDisp test.display.TreCalc    ovm_${snglImg}.img >TreCalcV.out
doDisp test.display.TreDisplay ovm_${snglImg}.img >TreDisplayV.out
doDisp test.display.RgnDisplay ovm_${snglImg}.img >RgnDisplayV.out
doDisp test.display.LblDisplay ovm_${snglImg}.img >LblDisplayV.out

doDisp test.display.MpsDisplay gmapsupp.img >MpsDisplay.out
doDisp test.display.TypDisplay gmapsupp.img >TypDisplay.out
doDisp test.display.SrtDisplay gmapsupp.img >SrtDisplay.out
doDisp test.display.MdrSummary gmapsupp.img >MdrSummary.out
doDisp test.display.MdrCheck   gmapsupp.img >MdrCheck.out
doDisp test.display.MdrDisplay gmapsupp.img >MdrDisplay.out

doDisp test.display.SrtDisplay osmmap_mdr.img >SrtDisplayM.out
doDisp test.display.MdrSummary osmmap_mdr.img >MdrSummaryM.out
doDisp test.display.MdrCheck   osmmap_mdr.img >MdrCheckM.out
doDisp test.display.MdrDisplay osmmap_mdr.img >MdrDisplayM.out

doDisp test.display.TreCalc      osmmap.img >TreCalcO.out
doDisp test.display.TreDisplay   osmmap.img >TreDisplayO.out
doDisp test.display.RgnDisplay   osmmap.img >RgnDisplay0.out
doDisp test.display.LblDisplay   osmmap.img >LblDisplayO.out

doDisp test.display.MdxDisplay   osmmap.mdx >MdxDisplayO.out

doDisp test.check.NodCheck     ${snglImg}.img >NodCheck.out
doDisp test.check.NetCheck     ${snglImg}.img >NetCheck.out
doDisp test.display.TreCalc    ${snglImg}.img >TreCalc.out
doDisp test.display.TreDisplay ${snglImg}.img >TreDisplay.out
doDisp test.display.LblDisplay ${snglImg}.img >LblDisplay.out
doDisp test.display.RgnDisplay ${snglImg}.img >RgnDisplay.out
doDisp test.display.NodDisplay ${snglImg}.img >NodDisplay.out
doDisp test.display.NetDisplay ${snglImg}.img >NetDisplay.out
#same as above 2: doDisp test.display.NNDisplay  ${snglImg}.img >NNDisplay.out
#dont have: doDisp test.display.DemDisplay ${snglImg}.img >DemDisplay.out

# these don't work becase code expects to find some of the other subfiles
#doDisp test.check.NodCheck     ${snglImg}.NOD >NodCheck.out
#doDisp test.check.NetCheck     ${snglImg}.NET >NetCheck.out
#doDisp test.display.TreCalc    ${snglImg}.TRE >TreCalc.out
#doDisp test.display.TreDisplay ${snglImg}.TRE >TreDisplay.out
#doDisp test.display.LblDisplay ${snglImg}.LBL >LblDisplay.out
#doDisp test.display.RgnDisplay ${snglImg}.RGN >RgnDisplay.out
#doDisp test.display.NodDisplay ${snglImg}.NOD >NodDisplay.out
#doDisp test.display.NetDisplay ${snglImg}.NET >NetDisplay.out

#doDisp test.display.NodConvert ${snglImg}.img >NodConvert.out
#Exception in thread "main" java.lang.AssertionError
#	at test.display.NodConvert.pointerPart(NodConvert.java:274)
#	at test.display.NodConvert.printNode(NodConvert.java:122)
#	at test.display.NodConvert.printNod1(NodConvert.java:93)
#	at test.display.NodConvert.print(NodConvert.java:69)
#	at test.display.CommonDisplay.display(CommonDisplay.java:204)
#	at test.display.NodConvert.main(NodConvert.java:422)

#no: doDisp test.svg.subdiv.Main ${snglImg}.img >svgSubdiv.out
#no: doDisp test.svg.nod.Main    ${snglImg}.img >svgNod.out

# then do: diff -r -s -q preIO .
# or: diff -r -s  prev .
# or: diff -r -s --text --exclude=*.img . rel
# that's it
