WSF
WsfUCI_AMTI_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 WSFUCIRADARCOMPONENT_HPP
13#define WSFUCIRADARCOMPONENT_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_AMTI_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 // Framework methods.
58 WsfObject* Clone() const { return new UCI_AMTI_Component(*this); }
60
61 // Observer methods (TODO implement for uci messages)
63
64 virtual void OnSensorTrackInitiated(double aSimTime,
65 WsfSensor* aSensorPtr,
66 const WsfTrack& aTrack) override;
67
68 virtual void OnSensorTrackUpdated(double aSimTime,
69 WsfSensor* aSensorPtr,
70 const WsfTrack& aTrack) override;
71
72 // todo how to signify track drops?
73 //virtual void OnSensorTrackDropped(double aSimTime,
74 // WsfSensor* aSensorPtr,
75 // const WsfTrack& aTrack) override;
77
78 bool ReceiveMessage(double aSimTime,
79 const WsfMessage& aMessage) override;
80
81 virtual void OnSlewComplete(double aSimTime) override;
82
83
84 protected:
85
86 virtual void SetOwnerProducer(const ISM_OwnerProducerType& aOwnerType) override;
87
88 private:
89
90 void ClearActivities() override;
91
92 uci::type::AMTI_SubCapabilityEnum::EnumerationItem GetSubCapabilityEnum() const;
93
94 bool HandleCommandMessage(const UCI_AMTI_CommandMessage& aMessage);
95
96 bool HandleSettingsCommand(double aSimTime,
97 const UCI_AMTI_SettingsCommandMessage& aMessage);
98
99 bool HandleCapabilityCommand(double aSimTime,
100 const uci::type::AMTI_CapabilityCommandType& aCapabilityCommand);
101
102 bool HandleActivityCommand(double aSimTime,
103 const uci::type::AMTI_ActivityCommandType& aActivityCommand);
104
105 void SendActivityMessage(double aSimTime,
106 const uci::type::MessageStateEnum::EnumerationItem& aMessageState) override;
107
108 void SendCapabilityMessage(double aSimTime,
109 const uci::type::MessageStateEnum::EnumerationItem& aMessageState) override;
110
111 void SendCapabilityStatusMessage(double aSimTime,
112 const uci::type::MessageStateEnum::EnumerationItem& aMessageState) override;
113
114 void UpdateAllMessages() override;
115
116 void SetAllCapabilitiesAvailability(const uci::type::CapabilityAvailabilityEnum::EnumerationItem& aAvailability) override;
117
118 std::unique_ptr<UCI_AMTI_ActivityMessage> mActivityMessagePtr;
119 std::unique_ptr<UCI_AMTI_CapabilityMessage> mCapabilityMessagePtr;
120 std::unique_ptr<UCI_AMTI_CapabilityStatusMessage> mCapabilityStatusMessagePtr;
121};
122
123} // namespace wsf
124
125enum
126{
128};
129
131
132#endif
#define WSF_DECLARE_COMPONENT_ROLE_TYPE(TYPE, ROLE)
Definition WsfComponentRoles.hpp:44
@ cWSF_COMPONENT_UCI_AMTI
Definition WsfUCI_AMTI_Component.hpp:127
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_AMTI_Component.hpp:39
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_AMTI_Component.cpp:212
virtual ~UCI_AMTI_Component()
Definition WsfUCI_AMTI_Component.cpp:47
const int * GetComponentRoles() const override
Definition WsfUCI_AMTI_Component.cpp:188
void * QueryInterface(int aRole) override
Definition WsfUCI_AMTI_Component.cpp:577
bool ReceiveMessage(double aSimTime, const WsfMessage &aMessage) override
Definition WsfUCI_AMTI_Component.cpp:533
WsfObject * Clone() const
Definition WsfUCI_AMTI_Component.hpp:58
virtual void OnSlewComplete(double aSimTime) override
Definition WsfUCI_AMTI_Component.cpp:565
virtual void SetOwnerProducer(const ISM_OwnerProducerType &aOwnerType) override
Definition WsfUCI_AMTI_Component.cpp:225
UCI_AMTI_Component(WsfScenario &aScenario)
Definition WsfUCI_AMTI_Component.cpp:34
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_AMTI_Component.cpp:199
bool InjectConditionally(double aSimTime, WsfPlatform &aPlatform) override
Definition WsfUCI_AMTI_Component.cpp:138
WsfComponent * CloneComponent() const override
Definition WsfUCI_AMTI_Component.cpp:571
bool Initialize2(double aSimTime) override
Definition WsfUCI_AMTI_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