UCI-UAVForge / GroundStation

8 stars 20 forks source link

Implement loading and saving capabilities for FlightPath and Mission classes #101

Closed JordanD2 closed 7 years ago

JordanD2 commented 8 years ago

The FlightPath and Mission classes need the ability to interact with database files by loading and saving.

logicxd commented 8 years ago

I just wanted to input that from our previous work on the SQL, each database file represents 1 file. I'm not sure if it's possible to create multiple files from one database, but it might be easiest to just create multiple databases with each representing it's own file.

First mission:

Second mission:

In directory:

JordanD2 commented 8 years ago

@logicxd Yes, multiple files each with one database sounds good. So your example is exactly how we would do it if there were two missions being loaded.

One design idea to keep in mind here though is that FlightPath and Mission objects are first and foremost data structures to be used internally by the ground station application. That's why I think it's best for them to have distinct save and load methods (or possibly a constructor for loading). That way we can create and manipulate the data structures independent of the database. For example: I could load a FlightPlan from "mission1.dat", make 20 changes to it in the Mission Planner, then save it back into "mission1.dat". To do this, I will only need to interact with the database once when I load from the file and once when I save the changes.

JordanD2 commented 8 years ago

Update for you guys. I just merged my local branch where I added load constructors and save methods for FlightPlan and Mission objects. There are a bunch of todo labels that should make it much easier for you guys to interface with the existing code. Let me know if there are any questions.

logicxd commented 8 years ago

@JordanDickson I made a mock-up of the diagram. Each line is a column. Annnd I might be not be getting database files that you want. Let me know. The diagram is not tested. Changes can be made. @Farbod909 @fa01

FlightPath Diagram1.pdf

JordanD2 commented 8 years ago

Yes, those tables look exactly like what I had in mind. I think the second option where the two files are merged will be better.

JordanD2 commented 7 years ago

Closed by #154