WSF
WsfSpaceEventPipe.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 2018 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 WSFSPACEEVENTPIPE_HPP
13#define WSFSPACEEVENTPIPE_HPP
14
15#include "WsfEvent.hpp"
16#include "WsfEventPipe.hpp"
17
18class UtOrbitalElements;
20class WsfOrbitalEvent;
22
23namespace wsf
24{
25namespace space
26{
28{
29public:
30 static void RegisterEvents(WsfEventPipeExtension& aEventPipeExtension);
31 static void RegisterMessages(UtPackSerializer* aSerializerPtr);
32 explicit EventPipe(WsfEventPipeInterface* aEventPipeInterfacePtr);
33
34 void UpdateSubscriptions(const WsfEventPipeOptions& aNewCombinedOptions,
35 const WsfEventPipeOptions& aPreviousCombinedOptions) override;
36
37private:
38 void PlatformAdded(double aSimTime, WsfPlatform* aPlatformPtr);
39 void ManeuverBegin(double aSimTime, WsfSpaceMoverBase* aSpaceMoverPtr, const WsfOrbitalEvent& aManeuver);
40 void ManeuverEnd(double aSimTime, WsfSpaceMoverBase* aSpaceMover, const WsfOrbitalEvent& aManeuver);
41
42 void UpdateElements(double aSimTime, WsfSpaceMoverBase* aSpaceMover);
43 void OrbitalElementsUpdate(double aSimTime,
44 const WsfPlatform& aPlatform,
45 const UtOrbitalElements& aOrbitalElements,
46 bool aManeuver = true);
47
48 void Send(double aSimTime, const WsfPlatform& aPlatform, std::unique_ptr<WsfEventPipe::MsgBase> aMessagePtr)
49 {
50 mEventPipePtr->SendDependent(aSimTime, aPlatform, std::move(aMessagePtr));
51 }
52
53 class OrbitRedrawEvent : public WsfEvent
54 {
55 public:
56 OrbitRedrawEvent(wsf::space::EventPipe& aEventPipe, size_t aPlatformIndex)
57 : mEventPipe(aEventPipe)
58 , mPlatformIndex{aPlatformIndex}
59 {
60 }
61
62 ~OrbitRedrawEvent() override = default;
63
65
66 private:
67 wsf::space::EventPipe& mEventPipe;
68 size_t mPlatformIndex;
69 };
70
71 WsfSimulation* mSimulationPtr;
72 WsfEventPipeInterface* mEventPipePtr;
73
74 UtCallbackHolder mSpaceCallback;
75
76 int cSPACE;
77};
78
80{
81public:
82 static EventPipeInterface& Get(const WsfSimulation& aSimulation);
84 ~EventPipeInterface() override = default;
85
86 void AddedToSimulation() override;
87
88private:
89 std::unique_ptr<EventPipe> mEventPipePtr;
90};
91} // namespace space
92} // namespace wsf
93#endif
Definition UtPack.hpp:137
Scenario extension for event pipe. Reads the input file.
Definition WsfEventPipe.hpp:36
Definition WsfEventPipeInterface.hpp:87
Definition WsfEventPipeLogger.hpp:20
Definition WsfEventPipeOptions.hpp:23
Definition WsfEvent.hpp:29
virtual EventDisposition Execute()=0
EventDisposition
Definition WsfEvent.hpp:37
Definition WsfOrbitalEvent.hpp:50
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
WsfSimulationExtension()
Definition WsfSimulationExtension.cpp:23
friend class WsfSimulation
Definition WsfSimulationExtension.hpp:43
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfSpaceMoverBase.hpp:70
void AddedToSimulation() override
Definition WsfSpaceEventPipe.cpp:148
static EventPipeInterface & Get(const WsfSimulation &aSimulation)
Return a reference to the simulation extension.
Definition WsfSpaceEventPipe.cpp:136
EventPipeInterface()
Definition WsfSpaceEventPipe.cpp:142
~EventPipeInterface() override=default
Definition WsfSpaceEventPipe.hpp:28
static void RegisterEvents(WsfEventPipeExtension &aEventPipeExtension)
Definition WsfSpaceEventPipe.cpp:25
void UpdateSubscriptions(const WsfEventPipeOptions &aNewCombinedOptions, const WsfEventPipeOptions &aPreviousCombinedOptions) override
Definition WsfSpaceEventPipe.cpp:48
static void RegisterMessages(UtPackSerializer *aSerializerPtr)
A callback from WsfEventPipeInterface::AddedToSimulation to register our message types with the seria...
Definition WsfSpaceEventPipe.cpp:36
EventPipe(WsfEventPipeInterface *aEventPipeInterfacePtr)
Definition WsfSpaceEventPipe.cpp:41
Definition WsfAtmosphere.cpp:23
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved