Commit Graph
797 Commits
Author SHA1 Message Date
Connor Taylor-Brown 8ee4e84236 Merge remote-tracking branch 'remotes/origin/story63' into Development
# Conflicts:
#	racevisionGame/src/main/java/mock/model/MockBoat.java
#	racevisionGame/src/main/java/mock/model/MockRace.java
2017-08-07 15:02:13 +12:00
Joseph Gardner f6cdf66bfe Sails can be toggled on the visualiser and the rotate sails button rotates the sail visually. #story[1098] 2017-08-07 15:01:16 +12:00
Connor Taylor-Brown dad4fa57c6 Fixed WindCommand not updating downwind command when moving upwind.
#story[1096]
2017-08-07 14:51:32 +12:00
Connor Taylor-Brown 55798447ab Cherry-picked CommandFactory connection between ControllerServer and RaceLogic.
#story[1096]
2017-08-07 14:25:30 +12:00
Connor Taylor-Brown e76de1cbf9 Added test for WindCommand
#story[1096]
2017-08-07 14:13:14 +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
hba56 62752c142a building blocks for drawing the race line around the course
#story[1087]
2017-08-07 12:47:55 +12:00
hba56 747c31b948 Merge remote-tracking branch 'remotes/origin/story68' into Development 2017-08-07 12:29:56 +12:00
hba56 4195d41814 removed outdated comments
#story[1087]
2017-08-07 12:28:44 +12:00
Jessica Syder 7c5670f8c2 Sails are displayed on first boat in a race. Optimised imports.
- Implemented drawSails method
- Sail position is displayed and updated using a boat's heading
- Sails conform to 'Points of sail'
- Javadoc'd new method and tidied up existing
- Sped up track point frequency (visualiserBoat class)
- Optimised imports (any other classes changed)
- A lot of canvas drawing and sail rotating issues were discovered and eventually overcome along the way. Using a sail image to draw and rotate on the existing canvas rather than a JavaFX shape on a new canvas was the final decision.

#story[1098]
2017-08-07 12:20:52 +12:00
hba56 950a801d16 rounding fix for the xml
#story[1087]
2017-08-07 12:16:37 +12:00
Joseph Gardner 0bf2c6106b Boat updating speed after key press has been fixed. #fix #story[1094] 2017-08-07 12:03:34 +12:00
zwu18 ddaa2623ca Added tests for TackGybeCommand class.
#Story[1097]
2017-08-07 02:56:24 +12:00
Fan-Wu Yang fef35d0b00 The race is rotated with it's initial rotation in mind
- RaceXMLCreator now checks the bearing of the race with getLineAngle()
- Split some methods into functions so that it is more readable
#story[1096]
2017-08-07 02:37:05 +12:00
Fan-Wu Yang 2ce1c0786e The course points can now be rotated,
- Created markToGPSCoordinate Class
- Added Rotation to marks
#story[1092]
2017-08-07 02:01:41 +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
zwu18 a388989827 Reworked TackGybeCommand. Current boat in race will now tack and gybe when control is pressed.
#Story[1097]
2017-08-06 16:38:44 +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
zwu18 18f14c7542 VMGCommand now toggles autoVMG on and off. Linked up observer and observable so the current boat can now be controlled. Fixed autoVMG not working.
#Story[1097]
2017-08-06 16:12:53 +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
zwu18 dab0f2b402 Merge branch 'story63' into CommandFactory
# Conflicts:
#	racevisionGame/src/main/java/mock/model/commandFactory/TackGybeCommand.java
2017-08-06 14:54:21 +12:00
zwu18 074e2e590b VMGCommand now toggles autoVMG on and off. Linked up observer and observable so the current boat can now be controlled.
#Story[1097]
2017-08-06 14:48:46 +12:00
fjc40 a0f98eadaa Added some documentation to BoatStatus.
issue #35 #36
#story[1095]
2017-08-06 13:57:09 +12:00
zwu18 3d417c3a40 Merge branch 'story63' into CommandFactory
# Conflicts:
#	racevisionGame/src/main/java/mock/model/MockRace.java
#	racevisionGame/src/main/java/mock/model/RaceLogic.java
#	racevisionGame/src/main/java/mock/model/RaceState.java
#	racevisionGame/src/main/java/mock/model/commandFactory/CommandFactory.java
#	racevisionGame/src/main/java/mock/model/commandFactory/VMGCommand.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java
2017-08-06 13:48:41 +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
Connor Taylor-Brown 554f8a2a0f Added WindCommand and multiple command execution to RaceLogic
- Dispatch commands with CompositeCommand
- Single WindCommand handles upwind and downwind logic
- Changed key bindings as Mac lacks PgUp PgDn
- ControllerServer is observable, RaceLogic updates CompositeCommand as observer
2017-08-04 23:08:07 +12:00
hba56 0b74acadff rounding checks are now done by port or starboard side depending on what the compound marks type is
#story[1101]
2017-08-04 22:19:07 +12:00
hba56 db1efab225 rounding checks are now done by port or starboard side depending on what the compound marks type is
#story[1101]
2017-08-04 22:17:17 +12:00
hba56 be8b0e672d Updated the xml reader to pull in the rounding type of the compound marks and set each mark with that value
#story[1101]
2017-08-04 22:01:21 +12:00
Connor Taylor-Brown 425cc7f91f Changed ControlKey to use BoatActionEnum instead of magic numbers. 2017-08-04 21:27:53 +12:00
zwu18 14ce5fcaff Made changes to TackGybeCommand and VMGCommand classes to fit pattern layout.
#Story[1097]
2017-08-04 03:56:55 +12:00
zwu18 6e699f7037 Merge branch 'RaceFactory' into CommandFactory 2017-08-04 03:00:31 +12:00
Fan-Wu Yang f23c3f854d Seperated race xml creation into a class of its own
- Created RaceXMLCreator class
- made a function to convert limit to GPS Coordinate (limitToGPSCoordinate)
- can rotate a GPS Coordinate around a point (rotate)
- can get center of a race with (getCenter)
#story[1092]
2017-08-03 23:13:28 +12:00
Connor Taylor-Brown 851bbb4fde Merged branch "RaceFactory" with master 2017-08-03 23:03:15 +12:00