mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-08 04:31:08 -06:00
Add mission description
This commit is contained in:
@@ -4,7 +4,7 @@ return {
|
||||
-- One phase per line. A little messy bracket-wise, but easy to overview the data
|
||||
Phases = {
|
||||
{ Name = "Pre Launch", Phases = {
|
||||
{ Name = "Planning", TimeRange = { Start = "2016 SEP 06 23:05:05", End = "2016 SEP 07 23:05:00" } },
|
||||
{ Name = "Planning", TimeRange = { Start = "2016 SEP 06 23:05:05", End = "2016 SEP 07 23:05:00" }, Description = "Gonna do some planning yea"},
|
||||
{ Name = "Pre check", TimeRange = { Start = "2016 SEP 07 23:05:05", End = "2016 SEP 08 23:00:00" } },
|
||||
{ Name = "Last minute check", Phases = {
|
||||
{ Name = "Check 1", TimeRange = { Start = "2016 SEP 08 23:00:05", End = "2016 SEP 08 23:02:00" } },
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace {
|
||||
const std::string _loggerCat = "MissionPhaseSequencer";
|
||||
|
||||
const std::string KEY_PHASE_NAME = "Name";
|
||||
const std::string KEY_PHASE_DESCRIPTION = "Description";
|
||||
const std::string KEY_PHASE_SUBPHASES = "Phases";
|
||||
const std::string KEY_TIME_RANGE = "TimeRange";
|
||||
}
|
||||
@@ -50,6 +51,11 @@ MissionPhase::MissionPhase(const ghoul::Dictionary& dict) {
|
||||
};
|
||||
|
||||
_name = dict.value<std::string>(KEY_PHASE_NAME);
|
||||
if (!dict.getValue(KEY_PHASE_DESCRIPTION, _description)) {
|
||||
// If no description specified, just init to empty string
|
||||
_description = "";
|
||||
}
|
||||
|
||||
ghoul::Dictionary childDicts;
|
||||
if (dict.getValue(KEY_PHASE_SUBPHASES, childDicts)) {
|
||||
// This is a nested mission phase
|
||||
|
||||
@@ -45,12 +45,14 @@ namespace openspace {
|
||||
*/
|
||||
class MissionPhase {
|
||||
public:
|
||||
MissionPhase() {};
|
||||
MissionPhase() : _name(""), _description("") {};
|
||||
MissionPhase(const ghoul::Dictionary& dict);
|
||||
|
||||
const std::string& name() const { return _name; }
|
||||
|
||||
const TimeRange timeRange() const { return _timeRange; };
|
||||
const TimeRange& timeRange() const { return _timeRange; };
|
||||
|
||||
const std::string& description() const { return _description; };
|
||||
|
||||
/**
|
||||
* Returns all subphases sorted by start time
|
||||
@@ -65,6 +67,7 @@ public:
|
||||
protected:
|
||||
|
||||
std::string _name;
|
||||
std::string _description;
|
||||
TimeRange _timeRange;
|
||||
std::vector<MissionPhase> _subphases;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user