WSF
WsfUCI_ESM_Component.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI//REL TO USA ONLY
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2019 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 WSFUCI_ESM_COMPONENT_HPP
13#define WSFUCI_ESM_COMPONENT_HPP
14
15#include "wsf_oms_uci_export.h"
16
17#include <iostream>
18#include <string>
19
20#include "uci/base/AbstractServiceBusConnection.h"
21#include "uci/type/POST_CapabilityType.h"
22
23#include "UtMemory.hpp"
24#include "WsfSensor.hpp"
25#include "WsfPlatform.hpp"
26
28#include "WsfUCI_Messages.hpp"
30
31#include "WsfProcessor.hpp"
32
33namespace wsf
34{
35
39{
40 public:
41
44 virtual ~UCI_ESM_Component();
45
47
48 bool Initialize2(double aSimTime) override;
49 const int* GetComponentRoles() const override;
50 WsfComponent* CloneComponent() const override;
51 void* QueryInterface(int aRole) override;
52 bool InjectConditionally(double aSimTime,
53 WsfPlatform& aPlatform) override;
55
56 uci::type::ESM_SubCapabilityEnum::EnumerationItem GetSubCapabilityEnum() const;
57
58 // Framework methods.
60 WsfObject* Clone() const { return new UCI_ESM_Component(*this); }
62
63 // Observer methods (TODO implement for uci messages)
65
66 virtual void OnSensorTrackInitiated(double aSimTime,
67 WsfSensor* aSensorPtr,
68 const WsfTrack& aTrack) override;
69
70 virtual void OnSensorTrackUpdated(double aSimTime,
71 WsfSensor* aSensorPtr,
72 const WsfTrack& aTrack) override;
73
74 void OnSlewComplete(double aSimTime) override;
75
76 // todo how to signify track drops?
77 //virtual void OnSensorTrackDropped(double aSimTime,
78 // WsfSensor* aSensorPtr,
79 // const WsfTrack& aTrack) override;
81
82 bool ReceiveMessage(double aSimTime,
83 const WsfMessage& aMessage) override;
84
85 protected:
86
87 virtual void SetOwnerProducer(const ISM_OwnerProducerType& aOwnerType) override;
88
89 private:
90
91 void ClearActivities() override;
92
93 bool HandleCommandMessage(const UCI_ESM_CommandMessage& aMessage);
94
95 bool HandleCapabilityCommand(double aSimTime,
96 const uci::type::ESM_CapabilityCommandType& aCapabilityCommand);
97
98 bool HandleActivityCommand(double aSimTime,
99 const uci::type::ESM_ActivityCommandType& aActivityCommand);
100
101 void SendActivityMessage(double aSimTime,
102 const uci::type::MessageStateEnum::EnumerationItem& aMessageState) override;
103
104 void SendCapabilityMessage(double aSimTime,
105 const uci::type::MessageStateEnum::EnumerationItem& aMessageState) override;
106
107 void SendCapabilityStatusMessage(double aSimTime,
108 const uci::type::MessageStateEnum::EnumerationItem& aMessageState) override;
109
110 void UpdateAllMessages() override;
111
112 void SetAllCapabilitiesAvailability(const uci::type::CapabilityAvailabilityEnum::EnumerationItem& aAvailability) override;
113
114 bool HandleSettingsCommand(double aSimTime,
115 const UCI_ESM_SettingsCommandMessage& aMessage);
116
117 std::unique_ptr<UCI_ESM_ActivityMessage> mActivityMessagePtr;
118 std::unique_ptr<UCI_ESM_CapabilityMessage> mCapabilityMessagePtr;
119 std::unique_ptr<UCI_ESM_CapabilityStatusMessage> mCapabilityStatusMessagePtr;
120};
121
122} // namespace wsf
123
124enum
125{
127};
128
130
131#endif
#define WSF_DECLARE_COMPONENT_ROLE_TYPE(TYPE, ROLE)
Definition WsfComponentRoles.hpp:44
@ cWSF_COMPONENT_UCI_ESM
Definition WsfUCI_ESM_Component.hpp:126
Definition WsfComponent.hpp:39
A base class for messages sent among simulation communication objects, processors and sensors.
Definition WsfMessage.hpp:33
Definition WsfObject.hpp:40
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfSensor.hpp:92
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Definition WsfUCI_ESM_Component.hpp:39
virtual void OnSensorTrackInitiated(double aSimTime, WsfSensor *aSensorPtr, const WsfTrack &aTrack) override
Called after initial sensor track formation by a sensor (similar to Observer::SensorTrackInitiated).
Definition WsfUCI_ESM_Component.cpp:171
bool ReceiveMessage(double aSimTime, const WsfMessage &aMessage) override
Definition WsfUCI_ESM_Component.cpp:452
bool InjectConditionally(double aSimTime, WsfPlatform &aPlatform) override
Definition WsfUCI_ESM_Component.cpp:126
virtual void SetOwnerProducer(const ISM_OwnerProducerType &aOwnerType) override
Definition WsfUCI_ESM_Component.cpp:478
WsfObject * Clone() const
Definition WsfUCI_ESM_Component.hpp:60
const int * GetComponentRoles() const override
Definition WsfUCI_ESM_Component.cpp:160
WsfComponent * CloneComponent() const override
Definition WsfUCI_ESM_Component.cpp:561
UCI_ESM_Component(WsfScenario &aScenario)
Definition WsfUCI_ESM_Component.cpp:34
virtual ~UCI_ESM_Component()
Definition WsfUCI_ESM_Component.cpp:47
virtual void OnSensorTrackUpdated(double aSimTime, WsfSensor *aSensorPtr, const WsfTrack &aTrack) override
Called after each subsequent update of sensor track by a sensor (similar to Observer::SensorTrackUpda...
Definition WsfUCI_ESM_Component.cpp:181
void * QueryInterface(int aRole) override
Definition WsfUCI_ESM_Component.cpp:567
uci::type::ESM_SubCapabilityEnum::EnumerationItem GetSubCapabilityEnum() const
Definition WsfUCI_ESM_Component.cpp:155
void OnSlewComplete(double aSimTime) override
Definition WsfUCI_ESM_Component.cpp:554
bool Initialize2(double aSimTime) override
Definition WsfUCI_ESM_Component.cpp:52
virtual void ClearActivities()=0
virtual void UpdateAllMessages() override
Definition WsfUCI_SensorComponent.cpp:235
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved