WSF
WsfEclipseReport.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2017 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFECLIPSEREPORT_HPP
13#define WSFECLIPSEREPORT_HPP
14
15#include "wsf_space_export.h"
16
17#include <list>
18#include <map>
19#include <string>
20#include <vector>
21
22#include "UtCalendar.hpp"
23#include "UtCallbackHolder.hpp"
24#include "WsfEvent.hpp"
28#include "WsfStringId.hpp"
29
30class UtInput;
31class WsfDateTime;
32class WsfOrbitalEvent;
33class WsfPlatform;
34class WsfSimuluation;
35
39{
40public:
42
44 {
45 double mStart;
46 double mEnd;
47 double mDuration;
48
50 : mStart(0.0)
51 , mEnd(0.0)
52 , mDuration(0.0)
53 {
54 }
55 };
56
57 using EclipseIntervalList = std::list<EclipseInterval>;
58
59 using EclipseMap = std::map<WsfStringId, EclipseIntervalList>;
60
63 std::string mFileName;
64 std::string mFormat;
65};
66
70class WSF_SPACE_EXPORT WsfEclipseReport : public WsfSimulationExtension, protected WsfEclipseReportData
71{
72public:
73 explicit WsfEclipseReport(const WsfEclipseReportData& aData);
74
75 bool Initialize() override;
76
77protected:
78 void PlatformInitializedHandler(double aSimTime, WsfPlatform* aPlatformPtr);
79 void SimulationCompleteHandler(double aSimTime);
80 friend class EclipseEvent;
81
82 class EclipseEvent : public WsfEvent
83 {
84 public:
91
92 EclipseEvent(Type aType, size_t aId, WsfEclipseReport& aReport, WsfSpaceMoverBase* aSpaceMoverPtr);
93
94 void SetType(Type aType) { mType = aType; }
95 WsfEvent::EventDisposition Execute() override;
96
97 private:
98 Type mType;
99 size_t mId;
100 WsfEclipseReport& mReport;
101 WsfSpaceMoverBase* mSpaceMoverPtr;
102 size_t mPlatformIndex;
103 };
104
105private:
106 std::string FormatDateTime(const double& aSimTime);
107
108 void InitiateEclipseEvent(double aSimTime, size_t aId, WsfSpaceMoverBase& aSpaceMover);
109
110 void OrbitalManeuverCompleted(double aSimTime, WsfSpaceMoverBase* aSpaceMoverPtr, const WsfOrbitalEvent& aManeuver);
111
112 UtCallbackHolder mCallbacks;
113 UtCalendar mSimulationCalendar;
114 std::map<WsfStringId, size_t> mPlatformToCurrentEventIdMap;
115};
116
119{
120public:
121 bool ProcessInput(UtInput& aInput) override;
122 void SimulationCreated(WsfSimulation& aSimulation) override;
123};
124#endif
The scenario extension used to configure the Eclipse reports object.
Definition WsfEclipseReport.hpp:119
void SimulationCreated(WsfSimulation &aSimulation) override
Definition WsfEclipseReport.cpp:248
bool ProcessInput(UtInput &aInput) override
Definition WsfEclipseReport.cpp:52
A singleton object used to maintain the start date and time of the simulation.
Definition WsfDateTime.hpp:34
std::string mFileName
Definition WsfEclipseReport.hpp:63
bool mReportAll
Definition WsfEclipseReport.hpp:61
std::string mFormat
Definition WsfEclipseReport.hpp:64
EclipseMap mEclipseMap
Definition WsfEclipseReport.hpp:62
std::list< EclipseInterval > EclipseIntervalList
Definition WsfEclipseReport.hpp:57
WsfEclipseReportData()
Definition WsfEclipseReport.cpp:35
std::map< WsfStringId, EclipseIntervalList > EclipseMap
Definition WsfEclipseReport.hpp:59
Definition WsfEclipseReport.hpp:83
Type
Definition WsfEclipseReport.hpp:86
@ cEXIT
Definition WsfEclipseReport.hpp:88
@ cEVALUATE
Definition WsfEclipseReport.hpp:89
@ cENTRY
Definition WsfEclipseReport.hpp:87
void SetType(Type aType)
Definition WsfEclipseReport.hpp:94
EclipseEvent(Type aType, size_t aId, WsfEclipseReport &aReport, WsfSpaceMoverBase *aSpaceMoverPtr)
Definition WsfEclipseReport.cpp:257
void PlatformInitializedHandler(double aSimTime, WsfPlatform *aPlatformPtr)
Definition WsfEclipseReport.cpp:113
WsfEclipseReport(const WsfEclipseReportData &aData)
Definition WsfEclipseReport.cpp:43
void SimulationCompleteHandler(double aSimTime)
Use the SimulationCompleted callaback to write detection inteval output to the specified file.
Definition WsfEclipseReport.cpp:127
WsfEvent()=default
EventDisposition
Definition WsfEvent.hpp:37
Definition WsfOrbitalEvent.hpp:50
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
WsfScenarioExtension()
Definition WsfScenarioExtension.cpp:21
WsfSimulationExtension()
Definition WsfSimulationExtension.cpp:23
virtual bool Initialize()
Definition WsfSimulationExtension.cpp:49
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfSpaceMoverBase.hpp:70
EclipseInterval()
Definition WsfEclipseReport.hpp:49
double mDuration
Definition WsfEclipseReport.hpp:47
double mEnd
Definition WsfEclipseReport.hpp:46
double mStart
Definition WsfEclipseReport.hpp:45
Copyrights Multiple, All Rights Reserved