Commit Graph
113 Commits
Author SHA1 Message Date
Erika Savell 081a7d5666 Attempting to solve boats not apearing problem
- Appears to be becaus elat and long are getting switched somewhere

#story[881]
2017-05-10 22:23:49 +12:00
Erika Savell ffa3d530ae Event takes string and sets time of race
- RaceXmlReaders can handle strings now
- Not working with visualiser, gps coords may be worng

#story[881]
2017-05-10 21:46:24 +12:00
cbt24 91b1773703 Commented out obsolete tests, may be useful if refactored.
#story[881]
2017-05-10 17:02:25 +12:00
cbt24 f31a987787 Reads BoatDataSource into StreamedCourseXMLReader so the latter can function as a single source of static information for the race.
- Mock.StreamedCourseXMLReader populates participant and mark list from BoatDataSource
- Added CompoundMarker class to accommodate Mark data from Boat XML
- Had to check for Yacht type in Visualiser.BoatXMLReader
- Added a missing coordinate value to raceTest.xml
- Marker class still exists due to large number of tests, which should be transitioned to CompoundMark
- IMPORTANT: race is no longer functional

#story[881]
2017-05-10 16:56:21 +12:00
cbt24 9902cec688 Added tests for BoatXMLReader
- Verifies correct operation on boat and mark reading from boatTest.xml

#story[782]
2017-05-10 14:23:33 +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
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
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 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 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
David Wu a95a0c2543 Added documentation for multiple classes.
#Story[782]
2017-05-06 16:39:15 +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
hba56andErika Savell 6888d0bddc fixed all java doc errors
#story[782]
2017-05-04 16:29:41 +12:00
David Wu 545ef7aa7f Fix lobby not entering race when race status is "started".
-Race was previously stuck in lobby screen when race status was not 2.

#Story[782]
2017-05-04 13:36:39 +12:00
Erika Savell 5ebd4251e2 Merge branch 'splitIntoTwoModules' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into splitIntoTwoModules 2017-05-04 12:50:42 +12:00
Erika Savell c3ee3ec9e2 Added new lines to the other two xml creators
#story[778]
2017-05-04 12:50:30 +12:00
David Wu bf12f77796 Set it so the lobby view switches to race view depending on the race status passed in by the mock.
-Removed start button in lobby as it should be automatic.
-TODO: Synchronize the times across the whole race as they do not matching.

#Story[782]
2017-05-04 12:48:17 +12:00
David Wu b60b4b257f Remove start button from StartController.
#story[778]
2017-05-04 12:41:14 +12:00
Erika Savell 311cd99457 Added newlines to xml created by mock
#story[778]
2017-05-04 12:39:46 +12:00
Erika Savell eb58581e83 Fixed velocity issues with mock data
-Was accidentally sending scaled velocity

#story[778]
2017-05-04 10:16:10 +12:00
Erika Savell b9901a252a Moved speed conversion to BoatMessage class
#story[778]
2017-05-03 21:01:30 +12:00
Erika Savell 7c59632c41 Fixes to get race running
- Had an incorrect if else statement that was preventing race from running

#story[778]
2017-05-03 20:48:37 +12:00
Erika Savell d2e08fa8e1 Added boat velocity to information provided by mock
#story[778]
2017-05-03 20:36:43 +12:00
Erika Savell 08f203a0f8 Added race statuses for before the race has started. 3 min -> 1 min is warning, 1 min -> 0 min is preparatory.
-Boat locations (spread across start line) are also broad casted

#story[778]
2017-05-02 20:13:39 +12:00
Erika Savell 049f0f7331 Changed main loop so boats are looped through with a different starting boat
-This was necessary because one boat (the last one to be processed) would lag and jump, as sometimes there was not enough time for all location messages to be sent before the next lot were added.
- The solution was to add a boatOffset, which means while the boats are still  processed with3 coming after 2 coming after 1 etc, the loop starts with boat 0, then the next run through it wiull start with boat 1 and so on.

-This eliminated the lag (or at least spread it evenly across all the boats)

#story[778]
2017-05-02 19:50:12 +12:00
Erika Savell 42ad1f78fc Added heading to boatlocation messages
#story[778]
2017-05-02 19:21:43 +12:00
Erika Savell f2e0eec212 Fixed date time parsing problem
#story[778]
2017-05-02 16:50:09 +12:00
Erika Savell 7d1f4209e4 Got mock data being used by visualiser.
- Issue with zonedTimeDate not parsing
- Fixed race crashing once one boat finished

#story[778]
2017-05-01 20:56:46 +12:00
Erika Savell 63ee51d938 Fixed compoundMarkID typo that was causing a parse int exception
- All that was needed was capitalizing the D in ID in the parser

#story[782]
2017-05-01 20:19:07 +12:00
Erika Savell 060db182a8 Minor tweaks to get streaming from mock working
- Key point there being boats, raceand regatta xml files are being read from mock

#story[778]
2017-05-01 18:35:39 +12:00
Erika Savell 185c65e54d Editing MockOutput to send actual generated boat/race/regatta xmls
- Was previously sending from a static source file

#story[778]
2017-05-01 18:15:36 +12:00
hba56 8bbea28cab refactored the boat message to not use boats
#story[778]
2017-05-01 17:35:30 +12:00
Joseph Gardner 9eefbbd7fa Merge remote-tracking branch 'origin/splitIntoTwoModules' into splitIntoTwoModules 2017-05-01 16:51:48 +12:00
Joseph Gardner 8117e11ff2 Merge branch 'NetworkedVisualiser' into splitIntoTwoModules
# Conflicts:
#	visualiser/src/main/java/seng302/VisualiserInput.java
2017-05-01 16:51:03 +12:00
David Wu 4811b7f4ea Merge remote-tracking branch 'origin/splitIntoTwoModules' into splitIntoTwoModules
# Conflicts:
#	mock/src/test/java/seng302/Model/RaceTest.java
2017-05-01 16:39:26 +12:00
David Wu 0bfc9a5a39 Added test for race dnf in Race class.
-Unable to test animation timer.

#story[778]
2017-05-01 16:37:55 +12:00
Erika Savell 9acd519d7b Removed the rest of the shared model classes needed by mock
#story[778]
2017-05-01 15:49:07 +12:00
cbt24 ccbe467090 Synchronised GUI with VisualiserInput thread.
- Made StreamedCourse extend Observable
- Initialised StartController after data pulled from network
- Moved VisualiserInput to visualiser module
- Deleted Networking subpackage from visualiser module

#story[782]
2017-05-01 15:21:12 +12:00
Erika Savell 3f748bfdb6 Removed BoatInRace from shared model, refactored
#story[778]
2017-05-01 15:06:56 +12:00
Erika Savell 7e569b59b7 Commenting out tests just to get CI working, will investigate on different branch
#story[778]
2017-04-30 21:26:57 +12:00
Erika Savell 2320675b7e Fixing build
#story[778]
2017-04-30 21:23:52 +12:00
Erika Savell 0126d29524 Fixing some of the SharedModel/seng302 import conflicts
-Am really not liking the SharedModel structure, think reverting back to original structure is worth discussing

story[778]
2017-04-30 21:21:09 +12:00