Commit Graph
100 Commits
Author SHA1 Message Date
fjc40 20055b1883 Removed redunant calls in VisualiserRaceState.initialiseBoats().
Slightly refactored ResizableRaceCanvas - removed a redundant drawPoint() function, functions which alter the gc stroke call save/restore.
Text is drawn black, at 20pts.
The drawBoats() function: instead of drawing everything for each boat, one boat at a time, it draws the track points for all boats, then wake for all boats, etc..., to have better layering.
issue #18
2017-08-16 18:10:30 +12:00
fjc40 f1e41d5d8f Merge branch 'master' into issue_18_trackpoint 2017-08-16 16:52:32 +12:00
fjc40 85e703cba5 RaceController/info table now makes a copy of the boat list, to avoid race conditions.
#story[1095]
2017-08-15 23:10:32 +12:00
fjc40 bcb6b79f8d Fixed player boat not being highlighted.
#story[1095]
2017-08-15 22:41:43 +12:00
fjc40 a4755ed88b Maybe fixed updating boat list on FX thread. 2017-08-15 21:08:56 +12:00
fjc40 0483859c40 Fixed sparkline y axis labelling. Reverted it to how it previously worked (negative data values instead of negative scale).
issue #32
2017-08-15 20:40:29 +12:00
fjc40 9ab12a9c58 MockBoat: Removed redundant isAutoVMG() function.
TackGybeCommand now disables autoVMG.
Removed print statements from VMGCommand.
2017-08-15 18:48:14 +12:00
fjc40 dc4610d6eb Fixed sparkline not updating.
#story[1095]
2017-08-15 18:41:28 +12:00
fjc40 5ae8393126 Fixed null pointer exception when a boat finishes the race.
Boats now default to have position (0, 0).
Added mark rounding data to single player race.xml
2017-08-15 17:13:12 +12:00
fjc40 3a0bd10a57 Merge remote-tracking branch 'origin/master' into story_61
# Conflicts:
#	racevisionGame/src/main/java/mock/model/MockRace.java
#	racevisionGame/src/main/java/mock/model/commandFactory/CommandFactory.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerClient.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java
#	racevisionGame/src/main/resources/visualiser/scenes/race.fxml
2017-08-15 14:49:58 +12:00
fjc40 c9875f3987 RaceLogic no longer uses AnimationTimer for its main loop (since that ran in javafx thread). 2017-08-15 14:37:36 +12:00
fjc40 5a03d97713 Added comment. 2017-08-14 13:01:27 +12:00
fjc40 b07c30704a The trackpoint line is now a line (poly-line) instead of a sequence of circles. A point along the poly-line is added every 250ms.
issue #18
2017-08-14 12:58:05 +12:00
fjc40 175fb11178 Javadoc fixes.
#story[1095]
2017-08-14 01:02:58 +12:00
fjc40 7366aba5ec Added empty data sources, to be used by VisualiserRace.
Created FrameRateTracker which can be used to track framerate.
Updated RequestToJoinEnum and JoinAcceptanceEnum to match the agreed connection API.
Added AssignPlayerBoat message, which is used internally on the client to assign the player a source ID once they have connected.
Fixed some race conditions in the MessageRouter.
Updated ConnectionAcceptor.CheckClientConnection to wait slightly longer before removing connection (there was a slight race condition before).
Race no longer has a reference to LatestMessages. LatestMessages no longer has specific messages types in it.
Created RaceState class, which contains the state that is shared between VisualiserRaceState and MockRaceState (currently only used on visualiser).
Split VisualiserRace into VisualiserRaceState and VisualiserRaceService.
Added the VisualiserRace commands (BoatLocatonCommand, RaceStatusCommand, etc...).
Slightly increased the preferred width of race.fxml table columns.
issues #27 #37 #35
#story[1095]
2017-08-14 00:53:05 +12:00
fjc40 89b0aa8b77 Implemented MessageRouter.
Added ConnectionToServerCommandFactory, and JoinSuccessfulCommand, RaceParticipantsFullCOmmand, ServerFullCommand.
Added IncomingHeartBeatCommandFactory, and IncomingHeartBeatCommand.
Added ConnectionToServerState, which represents the client's connection state to server.
Renamed VisualiserInput to VisualiserRaceController.
Added ConnectionToServer, which tracks the client's connection to server.
Added ConnectionToServerController, which accepts JoinAcceptance messages, turns them into commands, and passes them to ConnectionToServer.
Added IncomingHeartBeatService, which tracks the heart beat status of the connection.
Added IncomingHeartBeatController, which accepts HeartBeat messages, turns them into commands, and passes them to IncomingHeartBeatService.
Refactored ServerConnection a bit.
#story[1095]
2017-08-12 19:58:47 +12:00
fjc40 6e5fb62880 Added REQUEST_RECEIVED and DECLINED to ConnnectionStateEnum.
#story[1095]
2017-08-12 01:05:45 +12:00
fjc40 41b0a5d7f7 Merge branch 'story_61' of eng-git.canterbury.ac.nz:seng302-2017/team-7 into story_61 2017-08-11 22:38:55 +12:00
fjc40 b625b6ab05 XMLReader.readXMLFileToString no longer throws a Transformer exception. 2017-08-11 22:38:39 +12:00
fjc40 61d18f85c5 javadoc fixes. 2017-08-10 23:57:54 +12:00
fjc40 19984772c0 Merge branch 'master' into story_61
Also got client-server handshake working. Multiple clients can connect and control their own boat.
The client's boat has a larger black triangle drawn around it. Probably needs tidying up.
Added isClientBoat boolean to VisualiserBoat.

WindGenerator is now an interface, implemented by ConstantWindGenerator (useful for testing) and RandomWindGenerator. Added ConstantWindGeneratorTest.
RandomWindGenerator was formerly WindGenerator.
The WindGenerator is passed in to MockRace.

CommandFactory throws a CommandConstructionException if it cannot create a command.

MessageSerialiser and MessageDeserialiser correctly terminate on error.

Readded VisualiserInput's switch statement in the main loop, pending a refactor.

Removed the sleep statement from LobbyController - it was blocking javaFX thread.

Lobby.fxml: moved buttons and text input into grid panes, so they don't break when you resize screen.

Added some test object creation functions in several test classes (MockRaceTest.createMockRace(), BoatXMLReaderTest.createBoatDataSource(), etc...).

#story[1095]
2017-08-10 23:49:21 +12:00
Fraser Cope a8af866228 Merge branch 'pom_profile_fix' into 'master'
Pom profile fix

The racevisionGame pom still had "profiles", which aren't needed with a single jar build, and the built jar didn't have a mainifest/main class.

See merge request !19
2017-08-10 13:29:05 +12:00
fjc40 5bc51343f5 Merge remote-tracking branch 'origin/master' into pom_profile_fix 2017-08-10 13:25:08 +12:00
Fraser Cope cdb6219cce Merge branch 'issue_28_36_decoders' into 'master'
Issue 28 & 36 - encoders and decoders refactor

This resolves #28 #36.
This was on the story_61 branch, but I figured it may be helpful to push this into master/other branches before then.

The main changes:
- Moved encoding functions from RaceVisionByteEncoder into their own encoder classes.
- Added a EncoderFactory and DecoderFactory, which return correct en/decoder based on MessageType.
- All encoders implement MessageEncoder interface, and all decoder implement MessageDecoder interface.

Extra changes:
- Added names to most threads that are created.
- Removed the nested while loop from MockOutput, and moved the XML stuff before the main loop (functionally it's the same).

See merge request !23
2017-08-10 13:21:42 +12:00
fjc40 130ffcbf07 Fixed some merge issues. 2017-08-10 13:16:53 +12:00
fjc40 805c12bf41 Merge remote-tracking branch 'origin/master' into issue_28_36_decoders
# Conflicts:
#	racevisionGame/src/main/java/mock/app/ConnectionAcceptor.java
#	racevisionGame/src/main/java/mock/app/Event.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java
2017-08-10 13:12:26 +12:00
Fraser Cope 7b382e48ac Merge branch 'story63' into 'master'
63. [C, M] I'd like to be able to make small adjustments to the heading of my boat, as Gemma, either upwind or downwind.

Note: each keypress should change the boat's heading by a small amount (3 degrees?) Pressing the 'upwind' key will turn the boat's head towards the wind by that small amount, while the 'downwind' key will do the opposite. Continuing to press the downwind key when the boat is already heading straight downwind, or upwind when heading directly upwind, achieves nothing.

Acceptance criteria:

- The player boat turns towards wind a small amount for each press of the 'upwind' key.
- The player boat turns away from the wind by a small amount for each press of the 'downwind' key.
- If the boat heading is directly into wind after a series of 'upwind' keypresses, the heading will continue to change in the same direction for one more keypress.
- Substitute 'downwind' for 'upwind' for the downwind case.


See merge request !21
2017-08-10 12:57:21 +12:00
fjc40 39b5cc2edc MockBoat has autoVMG disabled by default.
Wind/Tack commands disable autoVMG. VMG command enables it.
Upwind command was turning until boat was at 0 degrees, instead of being aligned with wind direction, but that's fixed.
#story[1096]
2017-08-10 12:44:42 +12:00
fjc40 7cc39abe57 WIP. Probably need to cherry pick stuff out of here.
Added ClientConnection and server-side handshake.
Added MessageSerialiser and Deserialiser.
#story[1095]
2017-08-10 12:13:40 +12:00
fjc40 3ec87582d3 Merge remote-tracking branch 'origin/master' into story_61 2017-08-08 20:58:53 +12:00
fjc40 634d78ab70 Added names to threads created.
MockOutput had a nested while loop, but it wasn't needed. Also tidied some of the error handling in MockOutput.

#story[1095]
2017-08-07 13:42:50 +12:00
fjc40 134586f407 The message encoders and decoders now catch exceptions, and throw InvalidMessageException.
Removed the big switch statement from BinaryMessageDecoder - it now uses the decoder factory instead.
issue #35 #36
#story[1095]
2017-08-06 22:25:43 +12:00
fjc40 9c64b678e3 Added MarkRoundingEncoder.
Refactored MarkRoundingDecoder - it now implements MessageDecoder.
Tidied up MarkRounding - it is now documented and has getters. Also Created MarkRoundingBoatStatusEnum, MarkRoundingIDEnum, MarkRoundingSideEnum, MarkRoundingTypeEnum.
Added MarkRoundingDecoderTest.
issue #35 #36
#story[1095]
2017-08-06 21:38:12 +12:00
fjc40 da800e659a Added AverageWindEncoder.
Refactored AverageWindDecoder - it now implements MessageDecoder.
Refactored AverageWind - it now uses milliseconds and knots, instead of packed MMperSec and tenths of a second. It also exposes its attributes now.
Added (un)packAverageWindPeriod to AC35UnitConverter.
Added AverageWindDecoderTest.
issue #35 #36
#story[1095]
2017-08-06 20:31:21 +12:00
fjc40 ce63f58429 Added RaceStartStatusEncoder.
Added RaceStartTypeEnum.
Refactored RaceStartStatusDecoder to implement the MessageDecoder interface.
Documented RaceStartStatus, and it actually exposes its properties now.
Updated RaceStartStatusDecoderTest.
issue #35 #36
#story[1095]
2017-08-06 19:36:21 +12:00
fjc40 e99ad00294 Javadoc fixes. 2017-08-06 18:54:45 +12:00
fjc40 750ea5c141 Added MessageDecoder interface. All decoder implement this.
Added DecoderFactory. This creates an appropriate decoder based on a MessageType.
BoatActionDecoder implements MessageDecoder.
BoatLocationDecoder implements MessageDecoder.
HeartBeatDecoder implements MessageDecoder.
JoinAcceptance implements MessageDecoder.
RaceStatusDecoder implements MessageDecoder.
RequestToJoinDecoder implements MessageDecoder.
XMLMessageDecoder implements MessageDecoder.
Refactored CourseWind decoder/encoder. CourseWind decoder/encoder is for an individual CourseWind.
CourseWinds decoder/encoder is for the combined message from the API.
Documented BoatAction, and it now contains a BoatActionEnum instead of a byte.
Refactored CourseWind and CourseWinds classes. They now expose correct units, instead of packed units.
Added CourseWindDecoderTest, and updated CourseWindsDecoderTest.
issue #35 #36
#story[1095]
2017-08-06 18:51:13 +12:00
fjc40 1fbdd09d70 Refactored BoatLocation message, encoders, decoders. It now exposes datatypes that we actually use in the program (double knots, bearings, etc..), instead of the bits-on-the-wire packed units (like int mmPerSec). Also documented it, and updated test.
issue #35 #36
#story[1095]
2017-08-06 16:13:25 +12:00
fjc40 ff262a6227 Added Knots <-> MMperSec conversions to AC35UnitConverter.
Removed redundant/unused conversions.
Documented all of the conversions, and renamed them to pack/unpackX, to match the API spec.
Updated/added some tests in AC35UnitConverterTest.
RaceStatus now contains a Bearing instead of a packed int bearing.
RaceStatus now contains wind speed in knots, instead of MMperSec packed.
This means that only RaceStatus decoder/encoder need to care about the bits-over-wire packed values.
issue #35 #36
#story[1095]
2017-08-06 14:57:51 +12:00
fjc40 a0f98eadaa Added some documentation to BoatStatus.
issue #35 #36
#story[1095]
2017-08-06 13:57:09 +12:00
fjc40 b1922fc3fc Added RaceStatusEncoder.
Refactored RaceStatusDecoder to be more consistent with other decoders - it now has a getMessage() function.
Added BoatStatus encoder and decoder - the RaceStatus encoder and decoder uses this for BoatStatuses. The BoatStatus encoder doesn't implement the MessageEncoder interface as BoatStatus is not a proper message type (doesn't inherit from AC35Data).
Added remaining cases to EncoderFactory, but commented them out.
BoatStatus now uses BoatStatusEnum instead of a byte.
Added some comments to RaceStatus, and it uses enums instead of bytes.
MockOutput logs a warning if a RaceStatus cannot be encoded.
Added a BoatStatusDecoderTest.
Updated RaceStatusDecoder to use new encoders/decoders.
issue #35 #36
#story[1095]
2017-08-06 13:38:27 +12:00
fjc40 e464ee298e javadoc fixes for some warnings. 2017-08-06 01:08:47 +12:00
fjc40 b486f99dbe Added XMLMessageEncoder.
Refactored XMLMessageDecoder to be consistent with other decoders - only needs to expose the XMLMessage.
Refactored BoatLocationDecoder to be consistent with other decoders - only needs to expose the BoatLocation.
Updated XMLMessageDecoderTest to use new encoder/decoder. Also tests all three message types.
Removed XMLMessageEncoderTest as it was redundant.
Updated BinaryMessageDecoderTest.xmlMessageTest() to use updated XMLMessage encoder/decoder.
issue #35 #36
#story[1095]
2017-08-06 01:01:05 +12:00
fjc40 8ef906472b Renamed Heartbeat to HeartBeat.
Added HeartBeatDecoder.
Added HeartBeatEncoder.
BinaryMessageDecoder now uses HeartBeatDecoder.
MockOutput now logs a warning if a heartBeat cannot be encoded.
Added HeartBeatDecoderTest.
issue #35 #36
#story[1095]
2017-08-05 23:27:28 +12:00
fjc40 c3ed30019c Added BoatLocationEncoder.
Updated BoatLocationDecoder test to use new encoder.
Updated MockOutput to use new encoder. It logs a warning if encoding fails.

#story[1095]
2017-08-05 22:11:54 +12:00
fjc40 31ce9fff94 Added BoatActonEncoder.
Updated ControllerClient to use RaceVisionByteEncoder.encode(message). It also logs a warning if the encoding fails. Also removed pointless and out of place encode/decode of the action enum.
Added a BoatActionDecoderTest which tests encoding/decoding a BoatAction Message.
issue #35 #36
#story[1095]
2017-08-05 21:53:54 +12:00
fjc40 16686678a7 Added an InvalidMessageTypeException - thrown whenever we encounter a MessageType that isn't recognised or isn't supported.
Added EncoderFactory. This creates specific MessageEncoders. Supports JoinAcceptance and RequestToJoin.
Added MessageEncoder interface.
Added JoinAcceptanceEncoder.
Added encode(AC35Data) function to RaceVisionByteEncoder.
Added RequestToJonEncoder.
Updated RequestToJoin and JoinAcceptance decode/encode tests to use the above.

issue #35 #36
#story[1095]
2017-08-05 21:31:47 +12:00
fjc40 7ea5b31fa1 RequestToJoinEnum contains an int instead of a byte.
Added requestToJoin and joinAcceptance encoding functions to RaceVisionByteEncoder.
Implemented JoinAcceptanceDecoder.
Implemented RequestToJoinDecoder.
Added tests for encoding/decoding RequestToJoin and JoinAcceptance messages.

issue #35
#story[1095]
2017-08-05 20:42:25 +12:00
fjc40 ca2b8a8899 Added missing javadoc.
#story[1095]
2017-08-05 19:43:58 +12:00
fjc40 f65ed79619 Implemented RequestToJoin and JoinAcceptance messages.
Also added their message types to MessageType.

issue #35
#story[1095]
2017-08-05 19:23:32 +12:00
fjc40 1385500e68 Added JoinAcceptance and RequestToJoin enumerations.
Issue #35
#story[1095]
2017-08-05 19:10:15 +12:00
fjc40 7feddeb49f Merge branch 'master' into story48 2017-08-05 15:23:33 +12:00
fjc40 148108a658 CommandFactory uses BoatActionEnum instead of raw ints.
#story[1094]
2017-08-03 21:11:25 +12:00
fjc40 2e325d5177 Added WindGeneratorTest. 2017-08-03 13:21:53 +12:00
fjc40 e4999a3c93 Added a light variant of the arrow image.
nightMode.css loads this instead of the regular dark arrow.
ResizableRaceCanvas doesn't cache the race boundary background, as it was unneccessary and stopped the canvas from being transparent.
#story[1093]
2017-08-03 12:56:15 +12:00
fjc40 2a5d0938ff Merge branch 'story48' into Development 2017-08-03 11:07:17 +12:00
fjc40 e1905e9e36 javadoc fix. 2017-08-02 18:27:40 +12:00
fjc40 9889a474ee Added ArrowController. This is the controller for arrow.fxml.
Removed arrow control stuff from ResizableRaceCanvas.
Added a wind speed label to arrow.fxml. Also created an outer GridPane to lay things out.
#story[1093]
2017-08-02 18:24:43 +12:00
fjc40 ed12ff659d mock:
Moved wind generation logic and state into the WindGenerator class.
MockRace initialises this, and calls it to update wind.
2017-08-02 13:59:19 +12:00
fjc40 99f3310d8b Created a setWind(bearing, knots) in Race, which updates the Wind with new values.
MockRace now uses Wind.
VisualiserRace now uses Wind.
#story[1093]
2017-08-01 18:45:17 +12:00
fjc40 5af3053537 Added shared.model.Wind class.
shared.model.Race now uses Wind. It is wrapped in Property<>.
#story[1093]
2017-08-01 18:15:35 +12:00
fjc40 fcea323cfd The racevisionGame pom still had "profiles", which aren't needed with a single jar build, and the built jar didn't have a mainifest/main class. 2017-07-28 09:30:26 +12:00
Fraser Cope 7966ac41fb Merge branch 'cbt-multi-controller' into 'master'
Cbt multi controller

Covers stories 4 and 6.

See merge request !17
2017-07-27 14:23:52 +12:00
fjc40 669b8167cd Merge branch 'cbt-multi-controller' of eng-git.canterbury.ac.nz:seng302-2017/team-7 into cbt-multi-controller 2017-07-27 14:08:19 +12:00
fjc40 1b5926007c Visualiser ConnectionController:
Clicking the host button doesn't create more than one server.
2017-07-27 14:07:25 +12:00
fjc40 f91f7055de Visualiser RaceController:
event.consume() is required to stop the keyboard event from propogating to other controls.
2017-07-27 13:52:55 +12:00
fjc40 0598724117 Added two more missing javadocs. 2017-07-23 14:37:24 +12:00
fjc40 38f3fe16a0 Revert "Added travis_wait to test CI build order."
This reverts commit 350ec41beb.
2017-07-20 12:30:54 +12:00
fjc40 350ec41beb Added travis_wait to test CI build order. 2017-07-20 12:29:20 +12:00
fjc40 ba21d81c91 Reordered modules in the main pom.xml file. Dunno :( 2017-07-20 12:10:38 +12:00
fjc40 5cddaaed8e mock.app.App now tells mock.app.Event that the xml file strings are XMLFileType.Contents.
Made network.MessageEncoders.RaceVisionByteEncoder methods static (they were effectively static already).

shared.dataInput.XMLReader#readXMLFileToString(..) now throws an XMLReaderException if the file cannot be found.

visualiser.Controllers.StartController assumed XML messages were resource paths instead of file contents - fixed.

Testing:
networking tests now work again.
2017-07-20 01:01:29 +12:00
fjc40 4bcfc01ceb shared.dataInput:
Added shared.enums.XMLFileType, which is used to specify if a string contains a file path or file contents.
Updated the XML readers to use it.

Testing:
Moved the networking tests and resources into racevisionGame module.
Moved the remaining tests from visualiser into racevisionGame, and added a few empty tests to implement later.
2017-07-19 23:18:52 +12:00
fjc40 10e80bca05 Moved mock.app.App#readFile(...) to shared.dataInput.XMLReader#readXMLFileToString(...).
Did the bare minimum to get the mock.model, mock.dataInput, shared.model tests working - many of them need to be tidied/refactored/moved as they don't take into account most of the refactorings.
2017-07-19 22:30:21 +12:00
fjc40 d0c6b5f716 Moved mock.model and mock.dataInput tests into the racevisionGame.tests.mock package. 2017-07-19 19:25:16 +12:00
fjc40 1cb2829015 Removed some .idea/... files that had been commited ages ago. 2017-07-17 12:25:53 +12:00
fjc40 46150bd3c6 Actually commited the previous pom.xml changes. 2017-07-11 03:21:10 +12:00
fjc40 2c5380f5d8 Removed old network files.
Renamed each test folder to test_old as tests haven't been updated to use new code!

Removed unused stuff from mock/visualiser pom.xml.
2017-07-11 03:20:49 +12:00
fjc40 2a82298571 Removed the old mock/network/visualiser files. 2017-07-11 03:13:32 +12:00
fjc40 3a85fad211 Currently, mock/pom.xml and visualiser/pom.xml build racevisionGame mock and visualiser.
Now using jetbrains nullable/notnull instead of sun (was causing maven issues).
2017-07-11 03:10:29 +12:00
fjc40 cab9bf9574 RaceClock no has run(), or is runnable, as it wasn't needed.
Refactored Sparkline a bit. Now listens to our data model instead of being manually updated. Boat position labels don't work currently, though.
VisualiserRace now also tracks the order in which boats pass each leg.
2017-07-11 02:04:53 +12:00
fjc40 7d3cf6ee80 I had accidentally broken the raceXML construction - fixed it.
Fixed a few issues where boat didn't have nextMark/previousMark times under certain circumstances.
LatestMessages wasn't actually notifying properly - fixed.
The various XML readers now treat a string constructor as containing file contents, not file name - this was how it was mostly already used.
Fixed some issues in RaceXMLReader, including where element.getChildNodes() was used instead of element.getElementsByName(...).
Boat: changes speed to a doubleProperty. Changed leg to a Property<Leg>.
Race.lastFps is now an IntegerProperty.
Added breaks to the case statements in VisualiserInput. Whoops.
ResizableRaceCanvas now handles drawing the race boundary. Tidied up code a bit.
Removed ResizableRaceMap.

Started refactoring Sparkline. Currently doesn't work.
2017-07-10 08:35:43 +12:00
fjc40 abbbf70146 Refactored Race, MockRace, and VisualiserRace to use RaceClock instead of keeping their own timers.
Moved FPS tracking to Race class, so both VisualiserRace and MockRace can monitor their FPS.
LatestMessages is now observable. It notifies observers when an XMLMessage is received.
Boat now has StringProperty for name and country/abbreviation.
Moved the MockRace timescale value to Constants.RaceTimeScale. This is passed in to MockRace on construction.
Tidied up StartController.
Copied the visualiser's resources into the resources folder.
Refactored RaceClock. Added comments. Tidied code a bit. Moved to shared.model.

Started work on RaceController.
2017-07-08 23:21:29 +12:00
fjc40 f057ad58b7 LatestMessages can hold MarkRounding messages. It also holds XMLMessage for each message type.
MockOutput now uses LatestMessages for xml messages.
Moved xml message encoding into RaceVisionByteEncoder. Removed XMLMessageEncoder.
Moved XML message sub types into an enumeration (XMLMessageType).
XMLMessage can now be queried for its attributes (like timestamp, length, etc...).

VisualiserInput now uses LatestMessages.
VisualiserInput now (as it did previously) uses switch statements for checking packet type, instead of if statements.
VisualiserRace now uses LatestMessages instead of VisualiserInput.
2017-07-07 02:05:21 +12:00
fjc40 8e18ad62ca Added LatestMessages to network.Messages. This is an object that encapsulates the latest up to date set of race messages.
Race stores a reference to it. MockRace writes to it, and eventually, VisualiserRace will read from it.
Updated MockRace, MockOutput, Event to use it.

Angle now implements hashCode().
2017-07-06 16:02:11 +12:00
fjc40 3a0b81834f Refactored mock.Event to work with MockRace.
Fixed the networking imports.
Race now keeps a reference to its Race, Boat, and Regatta data sources.
VisualiserRace can be provided with new Race/Boat/Regatta data sources during runtime. Currently it updates boundary and legs with a new RaceDataSource, and marker boats with a new BoatDataSource.
2017-07-06 15:25:00 +12:00
fjc40 8d36d89570 Refactored and moved RaceXMLReader to shared/dataInput.
RaceStatus can provide windspeed in knots in addition to mm/sec.
RaceDataSource now provides a list of participating boat sourceIDs instead of boats.
Added a RegattaDataSource interface.
Angle, Azimuth, Bearing and mutable - careful.
Boat has positionInRace.
CompoundMarks have an ID and name.
Marks can be moved (setPosition(...)).

Refactored Mock.Race, Visualiser.StreamedCourse, Visualiser.StreamedRace, into (shared) Race, MockRace, VisualiserRace.

VisualiserBoat has color.
Added xml and polar files into resources folder.
2017-07-06 01:30:55 +12:00
fjc40 7f027c8cc5 Refactored and moved XMLReader, RaceDataSource, BoatXMLReader, BoatDataSource, RegattaXMLReader to shared/dataInput. 2017-07-04 17:50:43 +12:00
fjc40 d0d63ca236 Copied remaining files into appropriate package. These need to be refactored and put into the shared package. 2017-07-04 16:22:25 +12:00
fjc40 bbbb1f2eb0 Renamed sharedModel module to racevisionGame - this is intended to be our single module program.
Moved Boat/MockBoat/VisualiserBoat into it.
Moved Polars, polarParser, VMG, and polar exception.
Moved the networking stuff into it.
Moved angle, azimuth, bearing into it.
Moved gpscoordinate into it.
Moved mark/compoundMark into it.
Moved leg into it.
Moved trackpoint into it.
2017-07-04 15:53:17 +12:00
Fraser Cope 93c1199392 Merge branch 'longMethodClassSmells' into 'master'
Long method class smells



See merge request !15
2017-07-04 14:29:55 +12:00
fjc40 a095f15eac Fixed finish controller not being stretch and centered. 2017-05-25 16:46:24 +12:00
fjc40 42ae89d20c Merge remote-tracking branch 'origin/sprint4_master' into fix_time_since_last_marker 2017-05-25 16:22:23 +12:00
fjc40 fdc03275fe Merge remote-tracking branch 'origin/sprint4_master' into fix_time_since_last_marker 2017-05-25 14:42:07 +12:00
fjc40 234748d056 Visualiser:
Fixed the issue where a boat's time since last mark started counting from when the race screen loaded.
It now starts counting when the race actually starts.
2017-05-25 14:41:51 +12:00
fjc40 1bd9fdd931 Merge remote-tracking branch 'origin/sprint4_master' into story36_boundary_fix_attempt_2
# Conflicts:
#	mock/src/main/java/seng302/Model/Race.java
Resolved.

Also reverted the change to the prestart and preparatory time, as they had gotten flipped around (prestart is > 3min to start, preparatory is < 1 min to start).
2017-05-25 14:04:06 +12:00
fjc40 f71e175f80 Mock.Race:
The race start time was current + prestart period + 1 second.
It is now current + prestart + 1 minute.
2017-05-25 13:53:27 +12:00
fjc40 8273cd5167 Merge branch 'sprint4_master' into story36_boundary_fix_attempt_2 2017-05-25 12:49:18 +12:00
fjc40 5d8380be8d Mock.Race:
Boats now tack only every 15 seconds (see tackPeriod variable).
Also doesn't attempt to calculate VMG (expensive operation) if it won't be used.
2017-05-25 12:35:57 +12:00
fjc40 7f3500202f Mock.Polars:
Moved some code into isBearingInsideInterval and isFlippedInterval utility functions.

Mock.Race:
Appear to have fixed the boats going out bounds issue at last, by fixing a few bugs, simplifying the code, and removing the boat turning speeds.
2017-05-24 19:20:30 +12:00
fjc40 824a5ed3a2 Merge branch 'boat_boundarty_fix' into story36
# Conflicts:
#	mock/src/main/java/seng302/Model/Race.java
Resolved.
2017-05-23 18:35:39 +12:00