Merge branch 'splitIntoTwoModules' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into isolatingMock
commit
073102d1a3
@ -0,0 +1,251 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<BoatConfig>
|
||||||
|
|
||||||
|
<Modified>2012-05-17T07:49:40+0200</Modified>
|
||||||
|
|
||||||
|
<Version>12</Version>
|
||||||
|
|
||||||
|
<Settings>
|
||||||
|
|
||||||
|
<RaceBoatType Type="AC45" />
|
||||||
|
|
||||||
|
<BoatDimension BoatLength="14.019" HullLength="13.449" />
|
||||||
|
|
||||||
|
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347" />
|
||||||
|
|
||||||
|
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100" />
|
||||||
|
|
||||||
|
</Settings>
|
||||||
|
|
||||||
|
<BoatShapes>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="0">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-2.659" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="18.359" X="-2.659" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="18.359" X="2.659" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="2.659" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="1">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-1.278" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="8.876" X="-1.278" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="8.876" X="1.278" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="1.278" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="2">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-1.1" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="8.3" X="-1.1" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="8.3" X="1.1" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="1.1" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="3">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-0.75" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="3" X="-0.75" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="3" X="0.75" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="0.75" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="4">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="13.449" X="-3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="14.019" X="0" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="13.449" X="3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="5" Y="0" X="3.46" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
<Catamaran>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="1.769" X="-2.752" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="0" X="-2.813" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="0" X="-3.34" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="5.351" X="-3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="5" Y="10.544" X="-3.387" />
|
||||||
|
|
||||||
|
<Vtx Seq="6" Y="13.449" X="-3.075" />
|
||||||
|
|
||||||
|
<Vtx Seq="7" Y="10.851" X="-2.793" />
|
||||||
|
|
||||||
|
<Vtx Seq="8" Y="6.669" X="-2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="9" Y="6.669" X="2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="10" Y="10.851" X="2.793" />
|
||||||
|
|
||||||
|
<Vtx Seq="11" Y="13.449" X="3.075" />
|
||||||
|
|
||||||
|
<Vtx Seq="12" Y="10.544" X="3.387" />
|
||||||
|
|
||||||
|
<Vtx Seq="13" Y="5.351" X="3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="14" Y="0" X="3.34" />
|
||||||
|
|
||||||
|
<Vtx Seq="15" Y="0" X="2.813" />
|
||||||
|
|
||||||
|
<Vtx Seq="16" Y="1.769" X="2.752" />
|
||||||
|
|
||||||
|
</Catamaran>
|
||||||
|
|
||||||
|
<Bowsprit>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="6.669" X="-0.2" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="11.377" X="-0.2" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="14.019" X="0" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="11.377" X="0.2" />
|
||||||
|
|
||||||
|
<Vtx Seq="5" Y="6.669" X="0.2" />
|
||||||
|
|
||||||
|
</Bowsprit>
|
||||||
|
|
||||||
|
<Trampoline>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="2" X="-2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="6.438" X="-2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="6.438" X="2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="2" X="2.699" />
|
||||||
|
|
||||||
|
</Trampoline>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="5" />
|
||||||
|
|
||||||
|
</BoatShapes>
|
||||||
|
|
||||||
|
<Boats>
|
||||||
|
|
||||||
|
<Boat Type="RC" SourceID="121" ShapeID="0" HullNum="RG01" StoweName="PRO" ShortName="PRO"
|
||||||
|
|
||||||
|
BoatName="Regardless">
|
||||||
|
|
||||||
|
<GPSposition Z="6.840" Y="7.800" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="7.800" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="122" ShapeID="1" HullNum="LC05" StoweName="CON" ShortName="Constellation"
|
||||||
|
|
||||||
|
BoatName="Constellation">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="123" ShapeID="1" HullNum="LC04" StoweName="MIS" ShortName="Mischief"
|
||||||
|
|
||||||
|
BoatName="Mischief">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="124" ShapeID="1" HullNum="LC03" ShortName="Atalanta" BoatName="Atalanta">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat SourceID="125" ShapeID="1" StoweName="VOL" HullNum="LC01" ShortName="Volunteer"
|
||||||
|
|
||||||
|
BoatName="Volunteer">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="126" ShapeID="1" HullNum="LC13" StoweName="MS2" ShortName="Defender"
|
||||||
|
|
||||||
|
BoatName="Defender">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="128" ShapeID="1" HullNum="LC01" ShortName="Shamrock" BoatName="Shamrock">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Yacht" SourceID="101" ShapeID="4" HullNum="AC4501" StoweName="KOR" ShortName="TEAM KOREA"
|
||||||
|
|
||||||
|
BoatName="TEAM KOREA" Country="KOR">
|
||||||
|
|
||||||
|
<GPSposition Z="1.738" Y="0.625" X="0.001" />
|
||||||
|
|
||||||
|
<MastTop Z="21.496" Y="4.233" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
</Boats>
|
||||||
|
|
||||||
|
</BoatConfig>
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile name="Maven default annotation processors profile" enabled="true">
|
||||||
|
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||||
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||||
|
<outputRelativeToContentRoot value="true" />
|
||||||
|
<module name="visualiser" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
<bytecodeTargetLevel>
|
||||||
|
<module name="visualiser" target="1.8" />
|
||||||
|
</bytecodeTargetLevel>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: com.beust:jcommander:1.64">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/beust/jcommander/1.64/jcommander-1.64.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/beust/jcommander/1.64/jcommander-1.64-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/beust/jcommander/1.64/jcommander-1.64-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: com.github.bfsmith:geotimezone:1.0.3">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/github/bfsmith/geotimezone/1.0.3/geotimezone-1.0.3.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/github/bfsmith/geotimezone/1.0.3/geotimezone-1.0.3-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/github/bfsmith/geotimezone/1.0.3/geotimezone-1.0.3-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: com.spatial4j:spatial4j:0.4.1">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/spatial4j/spatial4j/0.4.1/spatial4j-0.4.1.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/spatial4j/spatial4j/0.4.1/spatial4j-0.4.1-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/spatial4j/spatial4j/0.4.1/spatial4j-0.4.1-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: commons-pool:commons-pool:1.5.4">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: java3d:vecmath:1.3.2">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/java3d/vecmath/1.3.2/vecmath-1.3.2.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/java3d/vecmath/1.3.2/vecmath-1.3.2-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/java3d/vecmath/1.3.2/vecmath-1.3.2-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: javax.media:jai_core:1.1.3">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/javax/media/jai_core/1.1.3/jai_core-1.1.3.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/javax/media/jai_core/1.1.3/jai_core-1.1.3-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/javax/media/jai_core/1.1.3/jai_core-1.1.3-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: jgridshift:jgridshift:1.0">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/jgridshift/jgridshift/1.0/jgridshift-1.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/jgridshift/jgridshift/1.0/jgridshift-1.0-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/jgridshift/jgridshift/1.0/jgridshift-1.0-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: joda-time:joda-time:2.7">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/joda-time/joda-time/2.7/joda-time-2.7.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/joda-time/joda-time/2.7/joda-time-2.7-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/joda-time/joda-time/2.7/joda-time-2.7-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: junit:junit:4.12">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: net.java.dev.jsr-275:jsr-275:1.0-beta-2">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/net/java/dev/jsr-275/jsr-275/1.0-beta-2/jsr-275-1.0-beta-2.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/net/java/dev/jsr-275/jsr-275/1.0-beta-2/jsr-275-1.0-beta-2-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/net/java/dev/jsr-275/jsr-275/1.0-beta-2/jsr-275-1.0-beta-2-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: org.geotools:gt-metadata:9.0">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-metadata/9.0/gt-metadata-9.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-metadata/9.0/gt-metadata-9.0-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-metadata/9.0/gt-metadata-9.0-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: org.geotools:gt-opengis:9.0">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-opengis/9.0/gt-opengis-9.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-opengis/9.0/gt-opengis-9.0-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-opengis/9.0/gt-opengis-9.0-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: org.geotools:gt-referencing:9.0">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-referencing/9.0/gt-referencing-9.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-referencing/9.0/gt-referencing-9.0-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-referencing/9.0/gt-referencing-9.0-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: org.hamcrest:hamcrest-core:1.3">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: org.mockito:mockito-all:1.9.5">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: org.testng:testng:6.11">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/6.11/testng-6.11.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/6.11/testng-6.11-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/6.11/testng-6.11-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: org.yaml:snakeyaml:1.17">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.17/snakeyaml-1.17-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.17/snakeyaml-1.17-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="MavenProjectsManager">
|
||||||
|
<option name="originalFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/classes" />
|
||||||
|
</component>
|
||||||
|
<component name="SvnConfiguration">
|
||||||
|
<configuration>$USER_HOME$/.subversion</configuration>
|
||||||
|
</component>
|
||||||
|
<component name="masterDetails">
|
||||||
|
<states>
|
||||||
|
<state key="ProjectJDKs.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>1.8</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="ScopeChooserConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
</states>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/visualiser.iml" filepath="$PROJECT_DIR$/visualiser.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Palette2">
|
||||||
|
<group name="Swing">
|
||||||
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="Button" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="RadioButton" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="CheckBox" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="Label" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||||
|
<preferred-size width="200" height="200" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||||
|
<preferred-size width="200" height="200" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||||
|
<preferred-size width="-1" height="20" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||||
|
</item>
|
||||||
|
</group>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,156 @@
|
|||||||
|
package seng302.Mock;
|
||||||
|
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import org.w3c.dom.Element;
|
||||||
|
import org.w3c.dom.Node;
|
||||||
|
import org.w3c.dom.NodeList;
|
||||||
|
import org.xml.sax.SAXException;
|
||||||
|
import seng302.XMLReader;
|
||||||
|
|
||||||
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Joseph on 24/04/2017.
|
||||||
|
*/
|
||||||
|
public class BoatXMLReader extends XMLReader {
|
||||||
|
Map<Integer, StreamedBoat> streamedBoatMap = new HashMap<>();
|
||||||
|
Map<Integer, StreamedBoat> participants = new HashMap<>();
|
||||||
|
private List<Color> colours;
|
||||||
|
private static int currentColourIndex = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for Boat XML Reader
|
||||||
|
* @param filePath path of the file
|
||||||
|
* @throws IOException error
|
||||||
|
* @throws SAXException error
|
||||||
|
* @throws ParserConfigurationException error
|
||||||
|
*/
|
||||||
|
public BoatXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException, ParseException {
|
||||||
|
this(filePath, false);
|
||||||
|
makeColours();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for Boat XML Reader
|
||||||
|
* @param filePath file path to read
|
||||||
|
* @param read whether or not to read and store the files straight away.
|
||||||
|
* @throws IOException error
|
||||||
|
* @throws SAXException error
|
||||||
|
* @throws ParserConfigurationException error
|
||||||
|
*/
|
||||||
|
public BoatXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException, ParseException {
|
||||||
|
super(filePath);
|
||||||
|
makeColours();
|
||||||
|
if (read) {
|
||||||
|
read();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void read() {
|
||||||
|
readSettings();
|
||||||
|
readShapes();
|
||||||
|
readBoats();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads boats settings.
|
||||||
|
* INFORMATION FROM HERE IS IGNORED FOR NOW
|
||||||
|
*/
|
||||||
|
private void readSettings() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads different kinds of boat.
|
||||||
|
* INFORMATION FROM HERE IS IGNORED FOR NOW
|
||||||
|
*/
|
||||||
|
private void readShapes() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the boats in the race
|
||||||
|
*/
|
||||||
|
private void readBoats() {
|
||||||
|
Element nBoats = (Element) doc.getElementsByTagName("Boats").item(0);
|
||||||
|
for (int i = 0; i < nBoats.getChildNodes().getLength(); i++) {
|
||||||
|
Node boat = nBoats.getChildNodes().item(i);
|
||||||
|
if (boat.getNodeName().equals("Boat")) {
|
||||||
|
readSingleBoat(boat);
|
||||||
|
currentColourIndex = (currentColourIndex + 1) % colours.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the information about one boat
|
||||||
|
* Ignored values: ShapeID, StoweName, HullNum, Skipper
|
||||||
|
*/
|
||||||
|
private void readSingleBoat(Node boat) {
|
||||||
|
StreamedBoat streamedBoat;
|
||||||
|
String type = "None";
|
||||||
|
int sourceID = -1;
|
||||||
|
String boatName = null;
|
||||||
|
String shortName = null;
|
||||||
|
String country = null;
|
||||||
|
if (exists(boat, "Type")) type = boat.getAttributes().getNamedItem("Type").getTextContent();
|
||||||
|
if (exists(boat, "SourceID")) sourceID = Integer.parseInt(boat.getAttributes().getNamedItem("SourceID").getTextContent());
|
||||||
|
if (exists(boat, "BoatName")) boatName = boat.getAttributes().getNamedItem("BoatName").getTextContent();
|
||||||
|
if (exists(boat, "ShortName")) shortName = boat.getAttributes().getNamedItem("ShortName").getTextContent();
|
||||||
|
if (exists(boat, "Country")) country = boat.getAttributes().getNamedItem("Country").getTextContent();
|
||||||
|
|
||||||
|
// Ignore all non participating boats
|
||||||
|
if (participants.containsKey(sourceID)) {
|
||||||
|
|
||||||
|
if (!streamedBoatMap.containsKey(sourceID)) {
|
||||||
|
if (country != null) {
|
||||||
|
streamedBoat = new StreamedBoat(sourceID, boatName, colours.get(currentColourIndex), country);
|
||||||
|
} else {
|
||||||
|
streamedBoat = new StreamedBoat(sourceID, boatName, colours.get(currentColourIndex), shortName);
|
||||||
|
}
|
||||||
|
streamedBoatMap.put(sourceID, streamedBoat);
|
||||||
|
// Override boat with new boat
|
||||||
|
participants.put(sourceID, streamedBoat);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < boat.getChildNodes().getLength(); i++) {
|
||||||
|
Node GPSPosition = boat.getChildNodes().item(i);
|
||||||
|
if (GPSPosition.getNodeName().equals("GPSposition")) readBoatPositionInformation(sourceID, GPSPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the positional information about a boat
|
||||||
|
* Ignored values: FlagPosition, MastTop, Z value of GPSposition
|
||||||
|
*/
|
||||||
|
private void readBoatPositionInformation(int sourceID, Node GPSPosition) {
|
||||||
|
// TODO Get relative point before implementing. (GPSposition is based off a relative point).
|
||||||
|
}
|
||||||
|
|
||||||
|
private void makeColours() {
|
||||||
|
colours = new ArrayList<Color>(Arrays.asList(
|
||||||
|
Color.BLUEVIOLET,
|
||||||
|
Color.BLACK,
|
||||||
|
Color.RED,
|
||||||
|
Color.ORANGE,
|
||||||
|
Color.DARKOLIVEGREEN,
|
||||||
|
Color.LIMEGREEN,
|
||||||
|
Color.PURPLE,
|
||||||
|
Color.DARKGRAY,
|
||||||
|
Color.YELLOW
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParticipants(Map<Integer, StreamedBoat> participants) {
|
||||||
|
this.participants = participants;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Integer, StreamedBoat> getStreamedBoatMap() {
|
||||||
|
return streamedBoatMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package seng302.Mock;
|
||||||
|
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import seng302.GPSCoordinate;
|
||||||
|
import seng302.Model.Boat;
|
||||||
|
import seng302.Model.BoatInRace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Joseph on 24/04/2017.
|
||||||
|
*/
|
||||||
|
public class StreamedBoat extends BoatInRace {
|
||||||
|
private int sourceID;
|
||||||
|
private boolean complete;
|
||||||
|
|
||||||
|
public StreamedBoat(int sourceID, String name, Color colour, String abbrev) {
|
||||||
|
super(name, colour, abbrev);
|
||||||
|
this.sourceID = sourceID;
|
||||||
|
this.complete = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StreamedBoat(int sourceID) {
|
||||||
|
super("None", Color.BLACK, "None");
|
||||||
|
this.sourceID = sourceID;
|
||||||
|
this.complete = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overridden to ignore this function
|
||||||
|
* @deprecated
|
||||||
|
* @return 0
|
||||||
|
*/
|
||||||
|
public double getScaledVelocity() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overridden to ignore this function
|
||||||
|
* @deprecated
|
||||||
|
* @param velocity of boat
|
||||||
|
*/
|
||||||
|
public void setScaledVelocity(double velocity) {
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
package seng302.Mock;
|
||||||
|
|
||||||
|
import seng302.GPSCoordinate;
|
||||||
|
import seng302.Model.BoatInRace;
|
||||||
|
import seng302.Model.Leg;
|
||||||
|
import seng302.Model.RaceClock;
|
||||||
|
import seng302.RaceDataSource;
|
||||||
|
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by jjg64 on 21/04/17.
|
||||||
|
*/
|
||||||
|
public class StreamedCourse implements RaceDataSource {
|
||||||
|
StreamedCourseXMLReader streamedCourseXMLReader = null;
|
||||||
|
BoatXMLReader boatXMLReader = null;
|
||||||
|
RegattaXMLReader regattaXMLReader = null;
|
||||||
|
List<GPSCoordinate> boundary = new ArrayList<>();
|
||||||
|
|
||||||
|
public StreamedCourse(StreamedCourseXMLReader streamedCourseXMLReader) {
|
||||||
|
this.streamedCourseXMLReader = streamedCourseXMLReader;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StreamedCourse(BoatXMLReader boatXMLReader) {
|
||||||
|
this.boatXMLReader = boatXMLReader;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBoatXMLReader(BoatXMLReader boatXMLReader) {
|
||||||
|
this.boatXMLReader = boatXMLReader;
|
||||||
|
if (streamedCourseXMLReader != null) {
|
||||||
|
boatXMLReader.setParticipants(streamedCourseXMLReader.getParticipants());
|
||||||
|
boatXMLReader.read();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStreamedCourseXMLReader(StreamedCourseXMLReader streamedCourseXMLReader) {
|
||||||
|
this.streamedCourseXMLReader = streamedCourseXMLReader;
|
||||||
|
if (streamedCourseXMLReader != null) {
|
||||||
|
boatXMLReader.setParticipants(streamedCourseXMLReader.getParticipants());
|
||||||
|
boatXMLReader.read();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegattaXMLReader(RegattaXMLReader regattaXMLReader) {
|
||||||
|
this.regattaXMLReader = regattaXMLReader;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RegattaXMLReader getRegattaXMLReader() {
|
||||||
|
return regattaXMLReader;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BoatInRace> getBoats() {
|
||||||
|
return new ArrayList<>(boatXMLReader.getStreamedBoatMap().values());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Leg> getLegs() {
|
||||||
|
return streamedCourseXMLReader.getLegs();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<GPSCoordinate> getBoundary() {
|
||||||
|
return streamedCourseXMLReader.getBoundary();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ZonedDateTime getZonedDateTime() {
|
||||||
|
return RaceClock.getCurrentZonedDateTime(regattaXMLReader.getRegatta().getGPSCoordinate());
|
||||||
|
}
|
||||||
|
|
||||||
|
public GPSCoordinate getMapTopLeft() {
|
||||||
|
return streamedCourseXMLReader.getMapTopLeft();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GPSCoordinate getMapBottomRight() {
|
||||||
|
return streamedCourseXMLReader.getMapBottomRight();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package seng302.Mock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cbt24 on 25/04/17.
|
||||||
|
*/
|
||||||
|
public class StreamedCourseXMLException extends Throwable {
|
||||||
|
}
|
||||||
@ -0,0 +1,239 @@
|
|||||||
|
package seng302.Mock;
|
||||||
|
|
||||||
|
import org.w3c.dom.Element;
|
||||||
|
import org.w3c.dom.NamedNodeMap;
|
||||||
|
import org.w3c.dom.Node;
|
||||||
|
import org.w3c.dom.NodeList;
|
||||||
|
import org.xml.sax.SAXException;
|
||||||
|
import seng302.GPSCoordinate;
|
||||||
|
import seng302.Model.Leg;
|
||||||
|
import seng302.Model.Marker;
|
||||||
|
import seng302.XMLReader;
|
||||||
|
|
||||||
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by jjg64 on 21/04/17.
|
||||||
|
*/
|
||||||
|
public class StreamedCourseXMLReader extends XMLReader {
|
||||||
|
private static double COORDINATEPADDING = 0.0005;
|
||||||
|
private GPSCoordinate mapTopLeft, mapBottomRight;
|
||||||
|
private List<GPSCoordinate> boundary = new ArrayList<>();
|
||||||
|
private Map<Integer,Element> marks = new HashMap<>();
|
||||||
|
private Map<Integer, StreamedBoat> participants = new HashMap<>();
|
||||||
|
private List<Leg> legs = new ArrayList<>();
|
||||||
|
Date creationTimeDate;
|
||||||
|
Date raceStartTime;
|
||||||
|
int raceID;
|
||||||
|
String raceType;
|
||||||
|
boolean postpone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for Streamed Race XML
|
||||||
|
* @param filePath path of the file
|
||||||
|
* @throws IOException error
|
||||||
|
* @throws SAXException error
|
||||||
|
* @throws ParserConfigurationException error
|
||||||
|
*/
|
||||||
|
public StreamedCourseXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException, ParseException, StreamedCourseXMLException {
|
||||||
|
this(filePath, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for Streamed Race XML
|
||||||
|
* @param filePath file path to read
|
||||||
|
* @param read whether or not to read and store the files straight away.
|
||||||
|
* @throws IOException error
|
||||||
|
* @throws SAXException error
|
||||||
|
* @throws ParserConfigurationException error
|
||||||
|
*/
|
||||||
|
public StreamedCourseXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException, ParseException, StreamedCourseXMLException {
|
||||||
|
super(filePath);
|
||||||
|
if (read) {
|
||||||
|
read();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void read() throws ParseException, StreamedCourseXMLException {
|
||||||
|
readRace();
|
||||||
|
readParticipants();
|
||||||
|
readCourse();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void readRace() throws ParseException {
|
||||||
|
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
||||||
|
Element settings = (Element) doc.getElementsByTagName("Race").item(0);
|
||||||
|
|
||||||
|
raceID = Integer.parseInt(getTextValueOfNode(settings, "RaceID"));
|
||||||
|
raceType = getTextValueOfNode(settings, "RaceType");
|
||||||
|
creationTimeDate = dateFormat.parse(getTextValueOfNode(settings, "CreationTimeDate"));
|
||||||
|
NamedNodeMap raceTimeTag = doc.getElementsByTagName("RaceStartTime").item(0).getAttributes();
|
||||||
|
raceStartTime = dateFormat.parse(raceTimeTag.getNamedItem("Time").getTextContent());
|
||||||
|
postpone = Boolean.parseBoolean(raceTimeTag.getNamedItem("Postpone").getTextContent());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void readParticipants() {
|
||||||
|
Element nParticipants = (Element) doc.getElementsByTagName("Participants").item(0);
|
||||||
|
for (int i = 0; i < nParticipants.getChildNodes().getLength(); i++) {
|
||||||
|
int sourceID;
|
||||||
|
Node yacht = nParticipants.getChildNodes().item(i);
|
||||||
|
if (yacht.getNodeName().equals("Yacht")) {
|
||||||
|
if (exists(yacht, "SourceID")) {
|
||||||
|
sourceID = Integer.parseInt(yacht.getAttributes().getNamedItem("SourceID").getTextContent());
|
||||||
|
participants.put(sourceID, new StreamedBoat(sourceID));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void readCourse() throws StreamedCourseXMLException {
|
||||||
|
readCompoundMarks();
|
||||||
|
readCompoundMarkSequence();
|
||||||
|
readCourseLimit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indexes CompoundMark elements by their ID for use in generating the course.
|
||||||
|
*/
|
||||||
|
private void readCompoundMarks() {
|
||||||
|
Element nCourse = (Element) doc.getElementsByTagName("Course").item(0);
|
||||||
|
for(int i = 0; i < nCourse.getChildNodes().getLength(); i++) {
|
||||||
|
Node compoundMark = nCourse.getChildNodes().item(i);
|
||||||
|
if(compoundMark.getNodeName().equals("CompoundMark")) {
|
||||||
|
marks.put(getCompoundMarkID((Element)compoundMark),(Element)compoundMark);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a Marker from the CompoundMark element with given ID.
|
||||||
|
* @param compoundMarkID index of required CompoundMark element
|
||||||
|
* @return generated Marker
|
||||||
|
* @throws StreamedCourseXMLException if CompoundMark element contains unhandled number of marks
|
||||||
|
* @see seng302.Model.Marker
|
||||||
|
*/
|
||||||
|
private Marker getMarker(int compoundMarkID) throws StreamedCourseXMLException {
|
||||||
|
Element compoundMark = marks.get(compoundMarkID);
|
||||||
|
NodeList nMarks = compoundMark.getElementsByTagName("Mark");
|
||||||
|
Marker marker;
|
||||||
|
|
||||||
|
switch(nMarks.getLength()) {
|
||||||
|
case 1: marker = new Marker(getCoordinate((Element)nMarks.item(0))); break;
|
||||||
|
case 2: marker = new Marker(getCoordinate((Element)nMarks.item(0)), getCoordinate((Element)nMarks.item(1))); break;
|
||||||
|
default: throw new StreamedCourseXMLException();
|
||||||
|
}
|
||||||
|
|
||||||
|
return marker;
|
||||||
|
}
|
||||||
|
|
||||||
|
private GPSCoordinate getCoordinate(Element mark) {
|
||||||
|
double lat = Double.parseDouble(mark.getAttribute("TargetLat"));
|
||||||
|
double lon = Double.parseDouble(mark.getAttribute("TargetLng"));
|
||||||
|
return new GPSCoordinate(lat,lon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads "compoundMarkID" attribute of CompoundMark or Corner element
|
||||||
|
* @param element with "compoundMarkID" attribute
|
||||||
|
* @return value of "compoundMarkID" attribute
|
||||||
|
*/
|
||||||
|
private int getCompoundMarkID(Element element) {
|
||||||
|
return Integer.parseInt(element.getAttribute("CompoundMarkID"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads "name" attribute of CompoundMark element with corresponding CompoundMarkID
|
||||||
|
* @param compoundMarkID unique ID for CompoundMark element
|
||||||
|
* @return value of "name" attribute
|
||||||
|
*/
|
||||||
|
private String getCompoundMarkName(int compoundMarkID) {
|
||||||
|
return marks.get(compoundMarkID).getAttribute("Name");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populates list of legs given CompoundMarkSequence element and referenced CompoundMark elements.
|
||||||
|
* @throws StreamedCourseXMLException if markers cannot be resolved from CompoundMark
|
||||||
|
*/
|
||||||
|
private void readCompoundMarkSequence() throws StreamedCourseXMLException {
|
||||||
|
Element nCompoundMarkSequence = (Element) doc.getElementsByTagName("CompoundMarkSequence").item(0);
|
||||||
|
NodeList nCorners = nCompoundMarkSequence.getElementsByTagName("Corner");
|
||||||
|
Marker lastMarker = getMarker(getCompoundMarkID((Element)nCorners.item(0)));
|
||||||
|
String legName = getCompoundMarkName(getCompoundMarkID((Element)nCorners.item(0)));
|
||||||
|
for(int i = 1; i < nCorners.getLength(); i++) {
|
||||||
|
Element markXML = (Element)nCorners.item(i);
|
||||||
|
Marker currentMarker = getMarker(getCompoundMarkID(markXML));
|
||||||
|
legs.add(new Leg(legName, lastMarker, currentMarker, i-1));
|
||||||
|
lastMarker = currentMarker;
|
||||||
|
legName = getCompoundMarkName(getCompoundMarkID(markXML));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void readCourseLimit() {
|
||||||
|
Element nCourseLimit = (Element) doc.getElementsByTagName("CourseLimit").item(0);
|
||||||
|
for(int i = 0; i < nCourseLimit.getChildNodes().getLength(); i++) {
|
||||||
|
Node limit = nCourseLimit.getChildNodes().item(i);
|
||||||
|
if (limit.getNodeName().equals("Limit")) {
|
||||||
|
double lat = Double.parseDouble(limit.getAttributes().getNamedItem("Lat").getTextContent());
|
||||||
|
double lon = Double.parseDouble(limit.getAttributes().getNamedItem("Lon").getTextContent());
|
||||||
|
boundary.add(new GPSCoordinate(lat, lon));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
double maxLatitude = boundary.stream().max(Comparator.comparingDouble(GPSCoordinate::getLatitude)).get().getLatitude() + COORDINATEPADDING;
|
||||||
|
double maxLongitude = boundary.stream().max(Comparator.comparingDouble(GPSCoordinate::getLongitude)).get().getLongitude() + COORDINATEPADDING;
|
||||||
|
double minLatitude = boundary.stream().min(Comparator.comparingDouble(GPSCoordinate::getLatitude)).get().getLatitude() + COORDINATEPADDING;
|
||||||
|
double minLongitude = boundary.stream().min(Comparator.comparingDouble(GPSCoordinate::getLongitude)).get().getLongitude() + COORDINATEPADDING;
|
||||||
|
|
||||||
|
mapTopLeft = new GPSCoordinate(minLatitude, minLongitude);
|
||||||
|
mapBottomRight = new GPSCoordinate(maxLatitude, maxLongitude);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<GPSCoordinate> getBoundary() {
|
||||||
|
return boundary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GPSCoordinate getMapTopLeft() {
|
||||||
|
return mapTopLeft;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GPSCoordinate getMapBottomRight() {
|
||||||
|
return mapBottomRight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Leg> getLegs() {
|
||||||
|
return legs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getPadding() {
|
||||||
|
return COORDINATEPADDING;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreationTimeDate() {
|
||||||
|
return creationTimeDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getRaceStartTime() {
|
||||||
|
return raceStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRaceID() {
|
||||||
|
return raceID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRaceType() {
|
||||||
|
return raceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPostpone() {
|
||||||
|
return postpone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Integer, StreamedBoat> getParticipants() {
|
||||||
|
return participants;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
package seng302.Mock;
|
||||||
|
|
||||||
|
import javafx.collections.FXCollections;
|
||||||
|
import seng302.Controllers.RaceController;
|
||||||
|
import seng302.Model.BoatInRace;
|
||||||
|
import seng302.Model.Leg;
|
||||||
|
import seng302.Model.Race;
|
||||||
|
import seng302.RaceDataSource;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by jjg64 on 21/04/17.
|
||||||
|
*/
|
||||||
|
public class StreamedRace extends Race {
|
||||||
|
private RaceDataSource raceData;
|
||||||
|
|
||||||
|
public StreamedRace(RaceDataSource raceData, RaceController controller, int scaleFactor) {
|
||||||
|
super(raceData.getBoats(), raceData.getLegs(), controller, scaleFactor);
|
||||||
|
this.raceData = raceData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initialiseBoats() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the boat cannot finish the race
|
||||||
|
* @return True if boat cannot finish the race
|
||||||
|
*/
|
||||||
|
protected boolean doNotFinish() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks the position of the boat, this updates the boats current position.
|
||||||
|
*
|
||||||
|
* @param boat Boat that the postion is to be updated for.
|
||||||
|
* @param timeElapsed Time that has elapse since the start of the the race.
|
||||||
|
* @see BoatInRace
|
||||||
|
*/
|
||||||
|
protected void checkPosition(BoatInRace boat, long timeElapsed) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the boat's gps coordinates
|
||||||
|
*
|
||||||
|
* @param boat to be updated
|
||||||
|
* @param millisecondsElapsed time since last update
|
||||||
|
*/
|
||||||
|
protected void updatePosition(BoatInRace boat, int millisecondsElapsed) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,251 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<BoatConfig>
|
||||||
|
|
||||||
|
<Modified>2012-05-17T07:49:40+0200</Modified>
|
||||||
|
|
||||||
|
<Version>12</Version>
|
||||||
|
|
||||||
|
<Settings>
|
||||||
|
|
||||||
|
<RaceBoatType Type="AC45" />
|
||||||
|
|
||||||
|
<BoatDimension BoatLength="14.019" HullLength="13.449" />
|
||||||
|
|
||||||
|
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347" />
|
||||||
|
|
||||||
|
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100" />
|
||||||
|
|
||||||
|
</Settings>
|
||||||
|
|
||||||
|
<BoatShapes>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="0">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-2.659" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="18.359" X="-2.659" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="18.359" X="2.659" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="2.659" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="1">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-1.278" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="8.876" X="-1.278" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="8.876" X="1.278" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="1.278" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="2">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-1.1" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="8.3" X="-1.1" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="8.3" X="1.1" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="1.1" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="3">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-0.75" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="3" X="-0.75" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="3" X="0.75" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="0.75" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="4">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="13.449" X="-3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="14.019" X="0" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="13.449" X="3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="5" Y="0" X="3.46" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
<Catamaran>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="1.769" X="-2.752" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="0" X="-2.813" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="0" X="-3.34" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="5.351" X="-3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="5" Y="10.544" X="-3.387" />
|
||||||
|
|
||||||
|
<Vtx Seq="6" Y="13.449" X="-3.075" />
|
||||||
|
|
||||||
|
<Vtx Seq="7" Y="10.851" X="-2.793" />
|
||||||
|
|
||||||
|
<Vtx Seq="8" Y="6.669" X="-2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="9" Y="6.669" X="2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="10" Y="10.851" X="2.793" />
|
||||||
|
|
||||||
|
<Vtx Seq="11" Y="13.449" X="3.075" />
|
||||||
|
|
||||||
|
<Vtx Seq="12" Y="10.544" X="3.387" />
|
||||||
|
|
||||||
|
<Vtx Seq="13" Y="5.351" X="3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="14" Y="0" X="3.34" />
|
||||||
|
|
||||||
|
<Vtx Seq="15" Y="0" X="2.813" />
|
||||||
|
|
||||||
|
<Vtx Seq="16" Y="1.769" X="2.752" />
|
||||||
|
|
||||||
|
</Catamaran>
|
||||||
|
|
||||||
|
<Bowsprit>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="6.669" X="-0.2" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="11.377" X="-0.2" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="14.019" X="0" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="11.377" X="0.2" />
|
||||||
|
|
||||||
|
<Vtx Seq="5" Y="6.669" X="0.2" />
|
||||||
|
|
||||||
|
</Bowsprit>
|
||||||
|
|
||||||
|
<Trampoline>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="2" X="-2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="6.438" X="-2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="6.438" X="2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="2" X="2.699" />
|
||||||
|
|
||||||
|
</Trampoline>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="5" />
|
||||||
|
|
||||||
|
</BoatShapes>
|
||||||
|
|
||||||
|
<Boats>
|
||||||
|
|
||||||
|
<Boat Type="RC" SourceID="121" ShapeID="0" HullNum="RG01" StoweName="PRO" ShortName="PRO"
|
||||||
|
|
||||||
|
BoatName="Regardless">
|
||||||
|
|
||||||
|
<GPSposition Z="6.840" Y="7.800" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="7.800" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="122" ShapeID="1" HullNum="LC05" StoweName="CON" ShortName="Constellation"
|
||||||
|
|
||||||
|
BoatName="Constellation">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="123" ShapeID="1" HullNum="LC04" StoweName="MIS" ShortName="Mischief"
|
||||||
|
|
||||||
|
BoatName="Mischief">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="124" ShapeID="1" HullNum="LC03" ShortName="Atalanta" BoatName="Atalanta">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat SourceID="125" ShapeID="1" StoweName="VOL" HullNum="LC01" ShortName="Volunteer"
|
||||||
|
|
||||||
|
BoatName="Volunteer">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="126" ShapeID="1" HullNum="LC13" StoweName="MS2" ShortName="Defender"
|
||||||
|
|
||||||
|
BoatName="Defender">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="128" ShapeID="1" HullNum="LC01" ShortName="Shamrock" BoatName="Shamrock">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Yacht" SourceID="101" ShapeID="4" HullNum="AC4501" StoweName="KOR" ShortName="TEAM KOREA"
|
||||||
|
|
||||||
|
BoatName="TEAM KOREA" Country="KOR">
|
||||||
|
|
||||||
|
<GPSposition Z="1.738" Y="0.625" X="0.001" />
|
||||||
|
|
||||||
|
<MastTop Z="21.496" Y="4.233" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
</Boats>
|
||||||
|
|
||||||
|
</BoatConfig>
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<Race>
|
||||||
|
|
||||||
|
<RaceID>11080703</RaceID>
|
||||||
|
|
||||||
|
<RaceType>Match</RaceType>
|
||||||
|
|
||||||
|
<CreationTimeDate>2011-08-06T13:25:00-0000</CreationTimeDate >
|
||||||
|
|
||||||
|
<RaceStartTime Time="2011-08-06T13:30:00-0700" Postpone="false" />
|
||||||
|
|
||||||
|
<Participants>
|
||||||
|
|
||||||
|
<Yacht SourceID="101" Entry="Port" />
|
||||||
|
|
||||||
|
<Yacht SourceID="108" Entry="Stbd" />
|
||||||
|
|
||||||
|
</Participants>
|
||||||
|
|
||||||
|
<Course>
|
||||||
|
|
||||||
|
<CompoundMark CompoundMarkID="1" Name="StartLine">
|
||||||
|
|
||||||
|
<Mark SeqID="1" Name="PRO" TargetLat="-36.83" TargetLng="174.83" SourceID="101" />
|
||||||
|
|
||||||
|
<Mark SeqID="2" Name="PIN" TargetLat="-36.84" TargetLng="174.81" SourceID="102" />
|
||||||
|
|
||||||
|
</CompoundMark>
|
||||||
|
|
||||||
|
<CompoundMark CompoundMarkID="2" Name="M1">
|
||||||
|
|
||||||
|
<Mark Name="M1" TargetLat="-36.63566590" TargetLng="174.88543944" SourceID="103" />
|
||||||
|
|
||||||
|
</CompoundMark>
|
||||||
|
|
||||||
|
<CompoundMark CompoundMarkID="3" Name="M2">
|
||||||
|
|
||||||
|
<Mark Name="M2" TargetLat="-36.83" TargetLng="174.80" SourceID="102" />
|
||||||
|
|
||||||
|
</CompoundMark>
|
||||||
|
|
||||||
|
<CompoundMark CompoundMarkID="4" Name="Gate">
|
||||||
|
|
||||||
|
<Mark SeqID="1" Name="G1" TargetLat="-36.63566590" TargetLng="174.97205159" SourceID="104" />
|
||||||
|
|
||||||
|
<Mark SeqID="2" Name="G2" TargetLat="-36.64566590" TargetLng="174.98205159" SourceID="105" />
|
||||||
|
|
||||||
|
</CompoundMark>
|
||||||
|
|
||||||
|
</Course>
|
||||||
|
|
||||||
|
<CompoundMarkSequence>
|
||||||
|
|
||||||
|
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3" />
|
||||||
|
|
||||||
|
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3" />
|
||||||
|
|
||||||
|
<Corner SeqID="3" CompoundMarkID="3" Rounding="Stbd" ZoneSize="6" />
|
||||||
|
|
||||||
|
<Corner SeqID="4" CompoundMarkID="4" Rounding="PS" ZoneSize="6" />
|
||||||
|
|
||||||
|
<Corner SeqID="5" CompoundMarkID="1" Rounding="SP" ZoneSize="3"/>
|
||||||
|
|
||||||
|
</CompoundMarkSequence>
|
||||||
|
|
||||||
|
<CourseLimit>
|
||||||
|
|
||||||
|
<Limit SeqID="1" Lat="-36.8325" Lon="174.8325"/>
|
||||||
|
|
||||||
|
<Limit SeqID="2" Lat="-36.82883" Lon="174.81983"/>
|
||||||
|
|
||||||
|
<Limit SeqID="3" Lat="-36.82067" Lon="174.81983"/>
|
||||||
|
|
||||||
|
<Limit SeqID="4" Lat="-36.811" Lon="174.8265"/>
|
||||||
|
|
||||||
|
<Limit SeqID="5" Lat="-36.81033" Lon="174.83833"/>
|
||||||
|
|
||||||
|
<Limit SeqID="6" Lat="-36.81533" Lon="174.8525"/>
|
||||||
|
|
||||||
|
<Limit SeqID="7" Lat="-36.81533" Lon="174.86733"/>
|
||||||
|
|
||||||
|
<Limit SeqID="8" Lat="-36.81633" Lon="174.88217"/>
|
||||||
|
|
||||||
|
<Limit SeqID="9" Lat="-36.83383" Lon="174.87117"/>
|
||||||
|
|
||||||
|
<Limit SeqID="10" Lat="-36.83417" Lon="174.84767"/>
|
||||||
|
|
||||||
|
</CourseLimit>
|
||||||
|
|
||||||
|
</Race>
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RegattaConfig>
|
||||||
|
|
||||||
|
<RegattaID>3</RegattaID>
|
||||||
|
|
||||||
|
<RegattaName>New Zealand Test</RegattaName>
|
||||||
|
|
||||||
|
<CourseName>North Head</CourseName>
|
||||||
|
|
||||||
|
<CentralLatitude>-36.82791529</CentralLatitude>
|
||||||
|
|
||||||
|
<CentralLongitude>174.81218919</CentralLongitude>
|
||||||
|
|
||||||
|
<CentralAltitude>0.00</CentralAltitude>
|
||||||
|
|
||||||
|
<UtcOffset>12</UtcOffset>
|
||||||
|
|
||||||
|
<MagneticVariation>14.1</MagneticVariation>
|
||||||
|
|
||||||
|
</RegattaConfig>
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package seng302.Mock;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by jjg64 on 21/04/17.
|
||||||
|
*/
|
||||||
|
public class BoatsXMLTest {
|
||||||
|
BoatXMLReader boatXMLReader;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setup() {
|
||||||
|
try {
|
||||||
|
boatXMLReader = new BoatXMLReader("mockXML/boatXML/boatTest.xml", false);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
//fail("Cannot find mockXML/raceXML/raceTest.xml in the resources folder");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInvalidParticipant() {
|
||||||
|
Map<Integer, StreamedBoat> inputParticipants = new HashMap<>();
|
||||||
|
inputParticipants.put(420, new StreamedBoat(420));
|
||||||
|
boatXMLReader.setParticipants(inputParticipants);
|
||||||
|
boatXMLReader.read();
|
||||||
|
assertEquals(boatXMLReader.getStreamedBoatMap().size(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testValidParticipant() {
|
||||||
|
Map<Integer, StreamedBoat> inputParticipants = new HashMap<>();
|
||||||
|
inputParticipants.put(101, new StreamedBoat(101));
|
||||||
|
boatXMLReader.setParticipants(inputParticipants);
|
||||||
|
boatXMLReader.read();
|
||||||
|
assertTrue(boatXMLReader.getStreamedBoatMap().containsKey(101));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
package seng302.Mock;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import seng302.GPSCoordinate;
|
||||||
|
import seng302.Model.Leg;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests only work on the current version of mockXML/raceXML/raceTest.xml
|
||||||
|
*/
|
||||||
|
public class StreamedRaceTest {
|
||||||
|
StreamedCourseXMLReader streamedCourseXMLReader;
|
||||||
|
List<GPSCoordinate> boundary;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setup() {
|
||||||
|
try {
|
||||||
|
streamedCourseXMLReader = new StreamedCourseXMLReader("mockXML/raceXML/raceTest.xml", true);
|
||||||
|
boundary = streamedCourseXMLReader.getBoundary();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
//fail("Cannot find mockXML/raceXML/raceTest.xml in the resources folder");
|
||||||
|
} catch (StreamedCourseXMLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllBoundaryPointsRead() {
|
||||||
|
assertEquals(boundary.size(), 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBoundaryPointData() {
|
||||||
|
// First point
|
||||||
|
assertEquals(boundary.get(0).getLatitude(), -36.8325, 1e-6);
|
||||||
|
assertEquals(boundary.get(0).getLongitude(), 174.8325, 1e-6);
|
||||||
|
|
||||||
|
// Last point
|
||||||
|
assertEquals(boundary.get(boundary.size() - 1).getLatitude(), -36.83417, 1e-6);
|
||||||
|
assertEquals(boundary.get(boundary.size() - 1).getLongitude(), 174.84767, 1e-6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testMapEdges() {
|
||||||
|
double maxLatitude = streamedCourseXMLReader.getMapBottomRight().getLatitude() - streamedCourseXMLReader.getPadding();
|
||||||
|
double maxLongitude = streamedCourseXMLReader.getMapBottomRight().getLongitude() - streamedCourseXMLReader.getPadding();
|
||||||
|
double minLatitude = streamedCourseXMLReader.getMapTopLeft().getLatitude() - streamedCourseXMLReader.getPadding();
|
||||||
|
double minLongitude = streamedCourseXMLReader.getMapTopLeft().getLongitude() - streamedCourseXMLReader.getPadding();
|
||||||
|
|
||||||
|
assertEquals(maxLatitude, -36.81033, 1e-6);
|
||||||
|
assertEquals(maxLongitude, 174.88217, 1e-6);
|
||||||
|
assertEquals(minLatitude, -36.83417, 1e-6);
|
||||||
|
assertEquals(minLongitude, 174.81983, 1e-6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRaceSettings() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void correctLegSequence() {
|
||||||
|
List<Leg> legs = streamedCourseXMLReader.getLegs();
|
||||||
|
String[] expectedNames = {
|
||||||
|
"StartLine",
|
||||||
|
"M1",
|
||||||
|
"M2",
|
||||||
|
"Gate"
|
||||||
|
};
|
||||||
|
for(int i = 0; i < legs.size(); i++) assertEquals(expectedNames[i], legs.get(i).getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,173 +1,18 @@
|
|||||||
package seng302.Model;
|
package seng302.Model;
|
||||||
|
|
||||||
import javafx.scene.paint.Color;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import seng302.GPSCoordinate;
|
import org.mockito.Mock;
|
||||||
|
import seng302.RaceDataSource;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by esa46 on 15/03/17.
|
* Created by esa46 on 15/03/17.
|
||||||
*/
|
*/
|
||||||
public class RaceTest {
|
public class RaceTest {
|
||||||
|
|
||||||
Leg START_LEG = new Leg("Start", new Marker(new GPSCoordinate(0, 0)), new Marker(new GPSCoordinate(1, 1)), 0);
|
|
||||||
Leg FINISH_LEG = new Leg("Finish", new Marker(new GPSCoordinate(1, 1)), new Marker(new GPSCoordinate(2, 2)), 0);
|
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
|
||||||
public void timerCanBeDisabled() {
|
|
||||||
BoatInRace boat1 = new BoatInRace("Test 1", 10000, Color.ALICEBLUE, "t1");
|
|
||||||
BoatInRace boat2 = new BoatInRace("Test 2", 10000, Color.BURLYWOOD, "t2");
|
|
||||||
BoatInRace[] boats = new BoatInRace[]{boat1, boat2};
|
|
||||||
|
|
||||||
ArrayList<Leg> legs = new ArrayList<>();
|
|
||||||
legs.add(START_LEG); legs.add(FINISH_LEG);
|
|
||||||
|
|
||||||
ConstantVelocityRace race = new ConstantVelocityRace(boats, legs, null, 5);
|
|
||||||
race.disableTimer();
|
|
||||||
race.setDnfChance(0);
|
|
||||||
long timeStarted = System.currentTimeMillis();
|
|
||||||
race.run();
|
|
||||||
|
|
||||||
assertTrue(System.currentTimeMillis() - timeStarted < 4000);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void checkPositionUpdatesNumberFinishedBoats() {
|
|
||||||
|
|
||||||
BoatInRace finishedBoat = new BoatInRace("Test", 1000, Color.ALICEBLUE, "tt");
|
|
||||||
finishedBoat.setDistanceTravelledInLeg(500);
|
|
||||||
|
|
||||||
finishedBoat.setCurrentLeg(FINISH_LEG);
|
|
||||||
|
|
||||||
ArrayList<Leg> legs = new ArrayList<>();
|
|
||||||
legs.add(FINISH_LEG);
|
|
||||||
|
|
||||||
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[1], legs, null, 1);
|
|
||||||
race.setDnfChance(0);
|
|
||||||
assertEquals(race.boatsFinished, 0);
|
|
||||||
|
|
||||||
|
|
||||||
race.checkPosition(finishedBoat, 100000);
|
|
||||||
assertEquals(race.boatsFinished, 1);
|
|
||||||
assertEquals(finishedBoat.getTimeFinished(), 100000);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void checkPositionDoesntUpdateNumberFinishedBoats() {
|
|
||||||
|
|
||||||
BoatInRace unFinishedBoat = new BoatInRace("Test", 10, Color.ALICEBLUE, "tt");
|
|
||||||
unFinishedBoat.setDistanceTravelledInLeg(0);
|
|
||||||
|
|
||||||
unFinishedBoat.setCurrentLeg(FINISH_LEG);
|
|
||||||
|
|
||||||
ArrayList<Leg> legs = new ArrayList<>();
|
|
||||||
legs.add(FINISH_LEG);
|
|
||||||
|
|
||||||
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[1], legs, null, 1);
|
|
||||||
race.setDnfChance(0);
|
|
||||||
assertEquals(race.boatsFinished, 0);
|
|
||||||
|
|
||||||
race.checkPosition(unFinishedBoat, 100);
|
|
||||||
assertEquals(race.boatsFinished, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void distanceTravelledBeforeUpdatingLegIsRetained() {
|
|
||||||
|
|
||||||
ArrayList<Leg> legs = new ArrayList<>();
|
|
||||||
|
|
||||||
|
|
||||||
legs.add(START_LEG);
|
|
||||||
legs.add(FINISH_LEG);
|
|
||||||
|
|
||||||
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[1], legs, null, 1);
|
|
||||||
race.setDnfChance(0);
|
|
||||||
|
|
||||||
BoatInRace unFinishedBoat = new BoatInRace("Test", 10, Color.ALICEBLUE, "tt");
|
|
||||||
unFinishedBoat.setDistanceTravelledInLeg(100);
|
|
||||||
unFinishedBoat.setCurrentLeg(START_LEG);
|
|
||||||
|
|
||||||
race.checkPosition(unFinishedBoat, 100);
|
|
||||||
assertEquals(unFinishedBoat.getCurrentLeg().getName(), "Finish");
|
|
||||||
assertTrue(unFinishedBoat.getDistanceTravelledInLeg() > 0);
|
|
||||||
assertTrue(unFinishedBoat.getDistanceTravelledInLeg() < 100);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*@Test
|
|
||||||
|
|
||||||
//Test temporarily removed as countdown timer now uses animation timer
|
|
||||||
|
|
||||||
public void timerDelaysByHalfSecond() {
|
|
||||||
|
|
||||||
ArrayList<Leg> legs = new ArrayList<>();
|
|
||||||
legs.add(START_LEG);
|
|
||||||
|
|
||||||
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[1], legs, null, 1);
|
|
||||||
race.PRERACE_TIME = 500;
|
|
||||||
|
|
||||||
long timeStarted = System.currentTimeMillis();
|
|
||||||
race.countdownTimer();
|
|
||||||
|
|
||||||
//assertTrue(System.currentTimeMillis() - timeStarted > 500);
|
|
||||||
System.out.println(System.currentTimeMillis() - timeStarted);
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void scalerScalesVelocityCorrectly() {
|
|
||||||
|
|
||||||
int scaleFactor = 3;
|
|
||||||
float vel1 = 0;
|
|
||||||
float vel2 = (float) 1.999;
|
|
||||||
float vel3 = (float) 32.5;
|
|
||||||
float vel4 = 500;
|
|
||||||
BoatInRace boat1 = new BoatInRace("test", vel1, Color.ALICEBLUE, "tt");
|
|
||||||
BoatInRace boat2 = new BoatInRace("test", vel2, Color.ALICEBLUE, "tt");
|
|
||||||
BoatInRace boat3 = new BoatInRace("test", vel3, Color.ALICEBLUE, "tt");
|
|
||||||
BoatInRace boat4 = new BoatInRace("test", vel4, Color.ALICEBLUE, "tt");
|
|
||||||
BoatInRace[] boats = new BoatInRace[]{boat1, boat2, boat3, boat4};
|
|
||||||
|
|
||||||
ArrayList<Leg> legs = new ArrayList<>();
|
|
||||||
legs.add(START_LEG);
|
|
||||||
|
|
||||||
ConstantVelocityRace race = new ConstantVelocityRace(boats, legs, null, scaleFactor);
|
|
||||||
race.setDnfChance(0);
|
|
||||||
|
|
||||||
assertEquals(race.getStartingBoats().get(0).getScaledVelocity(), vel1 * scaleFactor, 1e-6);
|
|
||||||
assertEquals(race.getStartingBoats().get(1).getScaledVelocity(), vel2 * scaleFactor, 1e-6);
|
|
||||||
assertEquals(race.getStartingBoats().get(2).getScaledVelocity(), vel3 * scaleFactor, 1e-6);
|
|
||||||
assertEquals(race.getStartingBoats().get(3).getScaledVelocity(), vel4 * scaleFactor, 1e-6);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void scalerScalesRaceClockTo1MinCorrectly() {
|
|
||||||
int scaleFactor = 10;
|
|
||||||
|
|
||||||
ArrayList<Leg> legs = new ArrayList<>();
|
|
||||||
legs.add(START_LEG);
|
|
||||||
|
|
||||||
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[5], legs, null, scaleFactor);
|
|
||||||
race.totalTimeElapsed = 6000; //6 seconds
|
|
||||||
assertTrue(race.calcTimer().equals("Race clock: 00:01:00"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void scalerScalesRaceClockHoursMinutesAndSecondsCorrectly() {
|
|
||||||
int scaleFactor = 3;
|
|
||||||
ArrayList<Leg> legs = new ArrayList<>();
|
|
||||||
legs.add(START_LEG);
|
|
||||||
|
|
||||||
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[5], legs, null, scaleFactor);
|
|
||||||
race.totalTimeElapsed = 3213000;
|
|
||||||
assertTrue(race.calcTimer().equals("Race clock: 02:40:39"));
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,251 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<BoatConfig>
|
||||||
|
|
||||||
|
<Modified>2012-05-17T07:49:40+0200</Modified>
|
||||||
|
|
||||||
|
<Version>12</Version>
|
||||||
|
|
||||||
|
<Settings>
|
||||||
|
|
||||||
|
<RaceBoatType Type="AC45" />
|
||||||
|
|
||||||
|
<BoatDimension BoatLength="14.019" HullLength="13.449" />
|
||||||
|
|
||||||
|
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347" />
|
||||||
|
|
||||||
|
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100" />
|
||||||
|
|
||||||
|
</Settings>
|
||||||
|
|
||||||
|
<BoatShapes>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="0">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-2.659" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="18.359" X="-2.659" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="18.359" X="2.659" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="2.659" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="1">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-1.278" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="8.876" X="-1.278" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="8.876" X="1.278" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="1.278" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="2">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-1.1" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="8.3" X="-1.1" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="8.3" X="1.1" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="1.1" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="3">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-0.75" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="3" X="-0.75" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="3" X="0.75" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="0" X="0.75" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="4">
|
||||||
|
|
||||||
|
<Vertices>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="0" X="-3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="13.449" X="-3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="14.019" X="0" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="13.449" X="3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="5" Y="0" X="3.46" />
|
||||||
|
|
||||||
|
</Vertices>
|
||||||
|
|
||||||
|
<Catamaran>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="1.769" X="-2.752" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="0" X="-2.813" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="0" X="-3.34" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="5.351" X="-3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="5" Y="10.544" X="-3.387" />
|
||||||
|
|
||||||
|
<Vtx Seq="6" Y="13.449" X="-3.075" />
|
||||||
|
|
||||||
|
<Vtx Seq="7" Y="10.851" X="-2.793" />
|
||||||
|
|
||||||
|
<Vtx Seq="8" Y="6.669" X="-2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="9" Y="6.669" X="2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="10" Y="10.851" X="2.793" />
|
||||||
|
|
||||||
|
<Vtx Seq="11" Y="13.449" X="3.075" />
|
||||||
|
|
||||||
|
<Vtx Seq="12" Y="10.544" X="3.387" />
|
||||||
|
|
||||||
|
<Vtx Seq="13" Y="5.351" X="3.46" />
|
||||||
|
|
||||||
|
<Vtx Seq="14" Y="0" X="3.34" />
|
||||||
|
|
||||||
|
<Vtx Seq="15" Y="0" X="2.813" />
|
||||||
|
|
||||||
|
<Vtx Seq="16" Y="1.769" X="2.752" />
|
||||||
|
|
||||||
|
</Catamaran>
|
||||||
|
|
||||||
|
<Bowsprit>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="6.669" X="-0.2" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="11.377" X="-0.2" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="14.019" X="0" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="11.377" X="0.2" />
|
||||||
|
|
||||||
|
<Vtx Seq="5" Y="6.669" X="0.2" />
|
||||||
|
|
||||||
|
</Bowsprit>
|
||||||
|
|
||||||
|
<Trampoline>
|
||||||
|
|
||||||
|
<Vtx Seq="1" Y="2" X="-2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="2" Y="6.438" X="-2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="3" Y="6.438" X="2.699" />
|
||||||
|
|
||||||
|
<Vtx Seq="4" Y="2" X="2.699" />
|
||||||
|
|
||||||
|
</Trampoline>
|
||||||
|
|
||||||
|
</BoatShape>
|
||||||
|
|
||||||
|
<BoatShape ShapeID="5" />
|
||||||
|
|
||||||
|
</BoatShapes>
|
||||||
|
|
||||||
|
<Boats>
|
||||||
|
|
||||||
|
<Boat Type="RC" SourceID="121" ShapeID="0" HullNum="RG01" StoweName="PRO" ShortName="PRO"
|
||||||
|
|
||||||
|
BoatName="Regardless">
|
||||||
|
|
||||||
|
<GPSposition Z="6.840" Y="7.800" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="7.800" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="122" ShapeID="1" HullNum="LC05" StoweName="CON" ShortName="Constellation"
|
||||||
|
|
||||||
|
BoatName="Constellation">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="123" ShapeID="1" HullNum="LC04" StoweName="MIS" ShortName="Mischief"
|
||||||
|
|
||||||
|
BoatName="Mischief">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="124" ShapeID="1" HullNum="LC03" ShortName="Atalanta" BoatName="Atalanta">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat SourceID="125" ShapeID="1" StoweName="VOL" HullNum="LC01" ShortName="Volunteer"
|
||||||
|
|
||||||
|
BoatName="Volunteer">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="126" ShapeID="1" HullNum="LC13" StoweName="MS2" ShortName="Defender"
|
||||||
|
|
||||||
|
BoatName="Defender">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Mark" SourceID="128" ShapeID="1" HullNum="LC01" ShortName="Shamrock" BoatName="Shamrock">
|
||||||
|
|
||||||
|
<GPSposition Z="5.334" Y="3.804" X="0.000" />
|
||||||
|
|
||||||
|
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<Boat Type="Yacht" SourceID="101" ShapeID="4" HullNum="AC4501" StoweName="KOR" ShortName="TEAM KOREA"
|
||||||
|
|
||||||
|
BoatName="TEAM KOREA" Country="KOR">
|
||||||
|
|
||||||
|
<GPSposition Z="1.738" Y="0.625" X="0.001" />
|
||||||
|
|
||||||
|
<MastTop Z="21.496" Y="4.233" X="0.000" />
|
||||||
|
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
</Boats>
|
||||||
|
|
||||||
|
</BoatConfig>
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<Race>
|
||||||
|
|
||||||
|
<RaceID>11080703</RaceID>
|
||||||
|
|
||||||
|
<RaceType>Match</RaceType>
|
||||||
|
|
||||||
|
<CreationTimeDate>2011-08-06T13:25:00-0000</CreationTimeDate >
|
||||||
|
|
||||||
|
<RaceStartTime Time="2011-08-06T13:30:00-0700" Postpone="false" />
|
||||||
|
|
||||||
|
<Participants>
|
||||||
|
|
||||||
|
<Yacht SourceID="107" Entry="Port" />
|
||||||
|
|
||||||
|
<Yacht SourceID="108" Entry="Stbd" />
|
||||||
|
|
||||||
|
</Participants>
|
||||||
|
|
||||||
|
<Course>
|
||||||
|
|
||||||
|
<CompoundMark CompoundMarkID="1" Name="StartLine">
|
||||||
|
|
||||||
|
<Mark SeqID="1" Name="PRO" TargetLat="-36.83" TargetLng="174.83" SourceID="101" />
|
||||||
|
|
||||||
|
<Mark SeqID="2" Name="PIN" TargetLat="-36.84" TargetLng="174.81" SourceID="102" />
|
||||||
|
|
||||||
|
</CompoundMark>
|
||||||
|
|
||||||
|
<CompoundMark CompoundMarkID="2" Name="M1">
|
||||||
|
|
||||||
|
<Mark Name="M1" TargetLat="-36.63566590" TargetLng="174.88543944" SourceID="103" />
|
||||||
|
|
||||||
|
</CompoundMark>
|
||||||
|
|
||||||
|
<CompoundMark CompoundMarkID="3" Name="M2">
|
||||||
|
|
||||||
|
<Mark Name="M2" TargetLat="-36.83" TargetLng="174.80" SourceID="102" />
|
||||||
|
|
||||||
|
</CompoundMark>
|
||||||
|
|
||||||
|
<CompoundMark CompoundMarkID="4" Name="Gate">
|
||||||
|
|
||||||
|
<Mark SeqID="1" Name="G1" TargetLat="-36.63566590" TargetLng="174.97205159" SourceID="104" />
|
||||||
|
|
||||||
|
<Mark SeqID="2" Name="G2" TargetLat="-36.64566590" TargetLng="174.98205159" SourceID="105" />
|
||||||
|
|
||||||
|
</CompoundMark>
|
||||||
|
|
||||||
|
</Course>
|
||||||
|
|
||||||
|
<CompoundMarkSequence>
|
||||||
|
|
||||||
|
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3" />
|
||||||
|
|
||||||
|
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3" />
|
||||||
|
|
||||||
|
<Corner SeqID="3" CompoundMarkID="3" Rounding="Stbd" ZoneSize="6" />
|
||||||
|
|
||||||
|
<Corner SeqID="4" CompoundMarkID="4" Rounding="PS" ZoneSize="6" />
|
||||||
|
|
||||||
|
<Corner SeqID="5" CompoundMarkID="1" Rounding="SP" ZoneSize="3"/>
|
||||||
|
|
||||||
|
</CompoundMarkSequence>
|
||||||
|
|
||||||
|
<CourseLimit>
|
||||||
|
|
||||||
|
<Limit SeqID="1" Lat="-36.8325" Lon="174.8325"/>
|
||||||
|
|
||||||
|
<Limit SeqID="2" Lat="-36.82883" Lon="174.81983"/>
|
||||||
|
|
||||||
|
<Limit SeqID="3" Lat="-36.82067" Lon="174.81983"/>
|
||||||
|
|
||||||
|
<Limit SeqID="4" Lat="-36.811" Lon="174.8265"/>
|
||||||
|
|
||||||
|
<Limit SeqID="5" Lat="-36.81033" Lon="174.83833"/>
|
||||||
|
|
||||||
|
<Limit SeqID="6" Lat="-36.81533" Lon="174.8525"/>
|
||||||
|
|
||||||
|
<Limit SeqID="7" Lat="-36.81533" Lon="174.86733"/>
|
||||||
|
|
||||||
|
<Limit SeqID="8" Lat="-36.81633" Lon="174.88217"/>
|
||||||
|
|
||||||
|
<Limit SeqID="9" Lat="-36.83383" Lon="174.87117"/>
|
||||||
|
|
||||||
|
<Limit SeqID="10" Lat="-36.83417" Lon="174.84767"/>
|
||||||
|
|
||||||
|
</CourseLimit>
|
||||||
|
|
||||||
|
</Race>
|
||||||
Loading…
Reference in new issue