diff --git a/data/scene/osirisrex/osirisrex/osirisrex.mission b/data/scene/osirisrex/osirisrex/osirisrex.mission index 32ca56acad..b8381c35f8 100644 --- a/data/scene/osirisrex/osirisrex/osirisrex.mission +++ b/data/scene/osirisrex/osirisrex/osirisrex.mission @@ -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" } }, diff --git a/modules/newhorizons/util/missionmanager.cpp b/modules/newhorizons/util/missionmanager.cpp index ab980bfe32..7ff1f855d3 100644 --- a/modules/newhorizons/util/missionmanager.cpp +++ b/modules/newhorizons/util/missionmanager.cpp @@ -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(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 diff --git a/modules/newhorizons/util/missionmanager.h b/modules/newhorizons/util/missionmanager.h index 3bc6fc3e0f..cc8d9929cb 100644 --- a/modules/newhorizons/util/missionmanager.h +++ b/modules/newhorizons/util/missionmanager.h @@ -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 _subphases; };