Commit Graph
1260 Commits
Author SHA1 Message Date
hba56 d7294f73a1 boats now have polars stored in the
-added getter and setter for a boats polars

 #story[900]
2017-05-10 14:23:26 +12:00
cbt24 9aa4183a7c Merge remote-tracking branch 'origin/49Mock' into 49Mock 2017-05-10 13:57:36 +12:00
cbt24 69cd44bda8 Reads data from boat XML file
- Creates marks for building CompoundMarks (formerly Markers)
- Rearranged Boat constructor and removed velocity

#story[782]
2017-05-10 13:57:20 +12:00
Erika Savell 16d3fe2ef2 Added marker boats with correct gps positions into boats xml read by mock
#story[881]
2017-05-10 13:50:28 +12:00
hba56 5b010cad49 added the polar class for storing polars
#story[900]
2017-05-10 13:45:09 +12:00
Erika Savell 83d6cdbd59 Edited race xml read by mock
- It now includes source ids
- Legs are in the correct sequence order for the example race

#story[881]
2017-05-10 13:37:32 +12:00
cbt24 6e9386f4fb Switched mock to send out official xmls.
- Not reading official xmls yet

#story[881], #pair[cbt24, esa46]
2017-05-10 13:08:34 +12:00
Erika Savell 1b6693a19b Added xml files for mock to read in
- In process of switching to reading official xml format instead of our own

#story[881]
2017-05-10 12:39:58 +12:00
hba56 187acc6960 added an empty polarparser class to push a new branch
#story[900]
2017-05-10 12:30:46 +12:00
Jessica McAuslin 43757b34d1 General code tidy up (Visualiser)
- access modifiers adjusted
- unused declarations removed
- spelling fixes
- removed redundant code
2017-05-08 20:45:00 +12:00
Jessica McAuslin 2d983eccfd General code tidy up
- access modifiers adjusted
- unused declarations removed
- spelling fixes
- removed redundant code
2017-05-08 20:21:20 +12:00
Joseph Gardner e1ba2ae5b6 Now reads course wind direction from the live stream, so the wind arrow now changes when the wind changes. #story[882] 2017-05-08 17:23:55 +12:00
fjc40 a32775eab6 Fixed a few javadoc issues. 2017-05-08 10:59:13 +12:00
fjc40 b247244665 Did some large tidy ups, refactoring, and documenting.
Network:
Moved the Network message classes from the Utils package to the Messages package.
Renamed BoatLocationMessage to BoatLocation and BoatStatusMessage to BoatStatus to be consistent with other message classes.
Renamed the BoatStatus enumeration to BoatStatusEnum as it conflicted with BoatStatus (the message).
Moved the BoatStatusEnum and MessageType enumerations from the Utils package to the Messages/Enums package.
Changed the BoatStatusEnum and MessageType enumerations to use map look ups in the enum.fromByte(b) method - this means that there's less copy and pasted values, and the fromByte function doesn't need to be modified if new enumerations are added.
Added a sequenceNumber member to the Heartbeat class.
Added an InvalidMessageException in the package Networking/Exceptions. This is thrown when a message is read, but it is invalid in some way.
Refactored/tidied up the Networking/BinaryMessageEncoder and Decoder classes. The decoder throws InvalidMessageExceptions instead of returning null.

Visualiser:
VisualiserInput now wraps a DataInputStream around the socket. This provides the stream.readFully(buffer) function, which is a blocking read, removing the need for busy wait loops. Replaced the getBytes() function with getNextMessage() and getNextMessageBytes(). These read the next message from the socket, and return it as a message object and a byte array, respectively.
Changed the current heartbeat timeout to 10 seconds. Added some work-in-progress code to attempt to reconnect when connection is lost. It currently doesn't work. I think Fan-Wu was doing a proper implementation, however.
VisualiserInput also has a queue of received events. Currently not really used, but could be useful in the future. Events get added as they are read.
Changed VisualiserInputs main loop to use instanceOf instead of switch+case. Feedback wanted - are there any downsides to using this instanceOf method?

#story[778,782]
2017-05-08 03:29:33 +12:00
fjc40 466e22437b Visualiser. The nullptr issues relating to the XML data files appears to be fixed. Essentially, the StartController.startRaceNoScaling() function was being called as soon possible, before it was even ready - setRaceClock either hadn't been called or hadn't finished executing yet, so the StartController.raceClock member was null, causing crashes.
Also changed the while(visualiserInput.getRaceStatus() == null) loops to an if-then-return early block. They caused the program to freeze if the race data source wasn't sending any race status messages (currently, our mock doesn't send any once the race has finished).

#story[782]
2017-05-07 18:34:44 +12:00
fjc40 020c0329b0 Merge remote-tracking branch 'origin/TCPDisconnection' into submission 2017-05-07 16:55:07 +12:00
fjc40 83ce9b99d2 Mockoutput's main loop now pops messages off the message queue, rather than iterating over it like an array, and clearing it (this could have threading issues where the iteration starts (with e.g., 5 messages), as it is sending the messages another one is added, and then it ends up clearing the sent messages, and the unsent message.
Made a few quick fixes (to be tidied a bit later) to Mock.Race class. It now has this.startTime, instead of the AnimationTimers having their own starTime value. RaceStatus messages are now sent properly (still need a refactor though), so they actually send the race star time - this means that the visualizer using the mock data source displays the correct time instead of (midnight, jan 1, 1970).

Removed one of the constructors from RaceStatus - it allowed for constructing and sending essentially invalid RaceStatus messages, and simply wasn't needed.

Added a temporary title ("RaceVision - Team 7") to the visualiser - may be worth changing when we decide on a team name.

Fixed a bug with the order of operations in visualiser.StartController.countdownTimer(). Calling begin race before hiding panes caused them to never be hidden.

Mock.Event. Changed the scaleFactor to 5x for the time being - to easier testing of things like pre-race timers, countdowns, etc...

#story[778,782]
2017-05-07 15:52:34 +12:00
fjc40 01224c509a Added some comments to MockOutput. Also removed instance of RaceVisionByteEncoder, as it has no state, and the functions used are all static. 2017-05-07 14:43:11 +12:00
fjc40 3481a882de Fixed Team Oracle's boat name in mock data file.
#story[778]
2017-05-07 14:28:31 +12:00
David Wu 61ecdc2269 Merge branch 'submission' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into submission
# Conflicts:
#	visualiser/src/main/java/seng302/Controllers/MainController.java
#	visualiser/src/main/java/seng302/Controllers/StartController.java
#	visualiser/src/main/java/seng302/Model/Race.java
2017-05-06 20:23:01 +12:00
David Wu 61afe8d608 Created finish view to see when a race finishes.
-Implemented FinishController
-Fixed mock not sending Finish race status.

#Story[782]
2017-05-06 20:14:10 +12:00
cbt24 c038010bd2 Draws track for racing boats only to reduce information clutter.
- Add track point only when boat status is "Racing"

#story[782]
2017-05-06 19:22:20 +12:00
cbt24 f27dbc29b0 Added self-documenting RaceStatus boolean getters
- Deprecated RaceStatus.getRaceStatus

#story[782]
2017-05-06 19:06:37 +12:00
cbt24 cc824aa89a Removed unnecessary countdownTimer from Race in visualiser module
- Run method now calls simulateRace directly

#story[782]
2017-05-06 18:20:41 +12:00
cbt24 a6adfb4960 Refactored RaceClock to act as central source of time and duration information throughout visualiser.
- StartController and RaceController use same RaceClock instance
- RaceClock updates automatically as Runnable for consistent operation
- Duration between starting and current time is now an observable property of RaceClock

#story[782]
2017-05-06 18:02:48 +12:00
Fan-Wu Yang bdf215d0f1 TCP connection at the front menu will no longer bug out if the socket is bugged.
- Timeout set on connection socket so that the socket will return false after 5 seconds.
#story[782]
2017-05-06 16:55:12 +12:00
David Wu a95a0c2543 Added documentation for multiple classes.
#Story[782]
2017-05-06 16:39:15 +12:00
hba56 12e457824d fix for issue #5 gate lines
-removed drawing of lines between the marks as only the start and finish line should have a line drawn

 #story[782]
2017-05-06 16:31:40 +12:00
Fan-Wu Yang d52b09e74a Visualiser Closes All threads on exit now.
- Added override for exiting the Visualiser which closes all threads: such as the TCP connection.
#story[782]
2017-05-06 15:58:12 +12:00
Fan-Wu Yang a20dafea11 Annotations go on top and boundaries now update
- Fixed FPS and other annotations being hidden under the map
- Fixed boundaries not updating with the visualiser.
#story[782]
2017-05-06 15:46:38 +12:00
Fan-Wu Yang 982b47943a Fixed blocking issue
- Fixed byte stream error where it would reinitilise every run
#story[782]
2017-05-06 15:27:21 +12:00
Fan-Wu Yang b7f010a2fa Fixed Network While loops
- Removed while blocking loops and replaced them with return statements
#story[782]
2017-05-06 14:36:37 +12:00
Fan-Wu Yang 565b7adaa2 Merge remote-tracking branch 'origin/race-timer-fixes' into layeredCanvas
# Conflicts:
#	visualiser/src/main/java/seng302/Controllers/StartController.java
2017-05-04 16:55:01 +12:00
Fan-Wu Yang 862391d7ef Canvas Layer Created
- Canvas is created via layering.
- Resizable canvas is now a seperate abstract class
#story[782]
2017-05-04 16:54:06 +12:00
cbt24 349bd50094 Everything works, don't ask questions
#story[782]
2017-05-04 16:52:33 +12:00
Erika Savell 62db7f333c Frantically cherry-picking commit by commit
#story[778]
2017-05-04 16:33:07 +12:00
Erika Savell 8ed0ca5b4f Quick way of adding extra leg to mock data
- To be redundant when the mock feed pulls from a proper xml instead of having two parsers

#story[778]
2017-05-04 16:31:40 +12:00
Fan-Wu YangandErika Savell 284eb6d951 Added Test for AC35UnitConverter
- Added tests to make sure it was working properly
#story[782]
2017-05-04 16:30:42 +12:00
hba56andErika Savell 6888d0bddc fixed all java doc errors
#story[782]
2017-05-04 16:29:41 +12:00
hba56 e409c8752c Fix for now - Need to change 2017-05-04 14:56:54 +12:00
cbt24 89ba0f278d Fixed StartController countdown
- Removed obsolete timer related code
- Consistently use RaceClock throughout StartController

#story[782]
2017-05-04 14:16:14 +12:00
cbt24 17afd9f775 Merge remote-tracking branch 'origin/splitIntoTwoModules' into splitIntoTwoModules
# Conflicts:
#	visualiser/src/main/java/seng302/Controllers/StartController.java
2017-05-04 14:15:21 +12:00
cbt24 336a15d1a2 Fixed StartController countdown
- Removed obsolete timer related code
- Consistently use RaceClock throughout StartController

#story[782]
2017-05-04 14:11:00 +12:00
Erika Savell 288699b7c7 Merge branch 'splitIntoTwoModules' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into splitIntoTwoModules 2017-05-04 13:44:56 +12:00
Erika Savell 2dab427092 Quick way of adding extra leg to mock data
- To be redundant when the mock feed pulls from a proper xml instead of having two parsers

#story[778]
2017-05-04 13:44:44 +12:00
Fan-Wu Yang 037c09b059 Merge branch 'splitIntoTwoModules' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into splitIntoTwoModules 2017-05-04 13:42:28 +12:00
hba56 1f8941e37c Merge remote-tracking branch 'origin/splitIntoTwoModules' into splitIntoTwoModules 2017-05-04 13:41:14 +12:00
Fan-Wu Yang 6bbc2ac4be Merge branch 'splitIntoTwoModules' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into splitIntoTwoModules 2017-05-04 13:40:48 +12:00
hba56 ccd90b91d7 Merge remote-tracking branch 'origin/splitIntoTwoModules' into splitIntoTwoModules 2017-05-04 13:40:45 +12:00
Fan-Wu Yang bb57685faf Added Test for AC35UnitConverter
- Added tests to make sure it was working properly
#story[782]
2017-05-04 13:40:43 +12:00