WSF
WsfUCI_IRST_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_IRST_COMPONENT_HPP
13#define WSFUCI_IRST_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 "WsfDateTime.hpp"
25#include "WsfSensor.hpp"
26#include "WsfPlatform.hpp"
27
29#include "WsfUCI_Messages.hpp"
30
31#include "WsfProcessor.hpp"
32
33namespace wsf
34{
35
39{
40 public:
41
44 virtual ~UCI_IRST_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_IRST_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 void OnSlewComplete(double aSimTime) override;
73
74 bool ProcessMessage(double aSimTime,
75 const WsfMessage& aMessage) override;
76
77 // todo how to signify track drops?
78 //virtual void OnSensorTrackDropped(double aSimTime,
79 // WsfSensor* aSensorPtr,
80 // const WsfTrack& aTrack) override;
82
83 protected:
84
85 virtual void SetOwnerProducer(const ISM_OwnerProducerType& aOwnerType) override;
86
87 private:
88
89 void ClearActivities() override;
90
91 bool HandleCommandMessage(double aSimTime,
92 const UCI_POST_CommandMessage& aMessage);
93
94 bool HandleCapabilityCommand(double aSimTime,
95 const uci::type::POST_CapabilityCommandType& aCapabilityCommand);
96
97 bool HandleActivityCommand(double aSimTime,
98 const uci::type::POST_ActivityCommandType& aActivityCommand);
99
100 void SendActivityMessage(double aSimTime,
101 const uci::type::MessageStateEnum::EnumerationItem& aMessageState) override;
102
103 void SendCapabilityMessage(double aSimTime,
104 const uci::type::MessageStateEnum::EnumerationItem& aMessageState) override;
105
106 void SendCapabilityStatusMessage(double aSimTime,
107 const uci::type::MessageStateEnum::EnumerationItem& aMessageState) override;
108
109 void UpdateAllMessages() override;
110
111 void SetAllCapabilitiesAvailability(const uci::type::CapabilityAvailabilityEnum::EnumerationItem& aAvailability) override;
112
113 bool HandleSettingsCommand(double aSimTime,
114 const UCI_POST_SettingsCommandMessage& aMessage);
115
116 std::unique_ptr<UCI_POST_ActivityMessage> mActivityMessagePtr;
117 std::unique_ptr<UCI_POST_CapabilityMessage> mCapabilityMessagePtr;
118 std::unique_ptr<UCI_POST_CapabilityStatusMessage> mCapabilityStatusMessagePtr;
119
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_IRST
Definition WsfUCI_IRST_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_IRST_Component.hpp:39
virtual void SetOwnerProducer(const ISM_OwnerProducerType &aOwnerType) override
Definition WsfUCI_IRST_Component.cpp:232
WsfObject * Clone() const
Definition WsfUCI_IRST_Component.hpp:58
virtual ~UCI_IRST_Component()
Definition WsfUCI_IRST_Component.cpp:61
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_IRST_Component.cpp:217
bool InjectConditionally(double aSimTime, WsfPlatform &aPlatform) override
Definition WsfUCI_IRST_Component.cpp:167
const int * GetComponentRoles() const override
Definition WsfUCI_IRST_Component.cpp:195
void * QueryInterface(int aRole) override
Definition WsfUCI_IRST_Component.cpp:649
UCI_IRST_Component(WsfScenario &aScenario)
Definition WsfUCI_IRST_Component.cpp:48
bool ProcessMessage(double aSimTime, const WsfMessage &aMessage) override
Definition WsfUCI_IRST_Component.cpp:480
void OnSlewComplete(double aSimTime) override
Definition WsfUCI_IRST_Component.cpp:227
bool Initialize2(double aSimTime) override
Definition WsfUCI_IRST_Component.cpp:66
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_IRST_Component.cpp:206
WsfComponent * CloneComponent() const override
Definition WsfUCI_IRST_Component.cpp:643
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