WSF
WsfLASER_CommXmtrComponent.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 WSFLASER_COMMXMTRCOMPONENT_HPP
13#define WSFLASER_COMMXMTRCOMPONENT_HPP
14
15#include <memory>
16
19
24{
25public:
29
31
32 WsfComponent* CloneComponent() const override;
34
36
37 bool PreInitialize(double aSimTime) override;
38 bool Initialize(double aSimTime) override;
39 bool ProcessInput(UtInput& aInput) override;
41
44 double GetPointingTransmission() const { return mPointingTransmissionFactor; }
45
47 double GetDataRate() const { return mModulationPtr->GetDataRate(); }
48
50 double GetDutyCycle() const { return mModulationPtr->GetDutyCycle(); }
51
53 {
54 public:
62
63 Modulation();
64 ~Modulation() = default;
65
66 bool ProcessInput(UtInput& aInput);
67 bool Initialize(WsfEM_Xmtr& aXmtr);
68
70 double GetDataRate() const { return mDataRate; }
71
73 double GetDutyCycle() const { return mDutyCycle; }
74
76 double GetSlotDuration() const { return mSlotDuration; }
77
79 void SetType(Type aType) { mType = aType; }
80
82 void SetPPM_Order(unsigned aPPM_Order) { mPPM_Order = aPPM_Order; }
83
85 const std::string& GetTypeName() const { return mTypeName; }
86
87 private:
88 Type mType;
89 std::string mTypeName;
90 double mSlotDuration;
91 double mDataRate;
92 double mDutyCycle;
93 unsigned mPPM_Order;
94
95 using TypesMap = std::map<std::string, Type>;
96 static const TypesMap sTypesMap;
97 };
98
99 Modulation& GetModulation() { return *mModulationPtr; }
100
101private:
102 double mPointingTransmissionFactor;
103 double mAveragePower;
104 std::unique_ptr<Modulation> mModulationPtr;
105};
106
108
109#endif
#define WSF_DECLARE_COMPONENT_ROLE_TYPE(TYPE, ROLE)
Definition WsfComponentRoles.hpp:44
@ cWSF_COMPONENT_LASER_XMTR
LASER extension for WsfEM_Xmtr.
Definition WsfMilComponentRoles.hpp:36
Definition WsfComponent.hpp:39
Definition WsfEM_Xmtr.hpp:55
Definition WsfLASER_CommXmtrComponent.hpp:53
double GetDutyCycle() const
Return the duty cycle (time the laser is on).
Definition WsfLASER_CommXmtrComponent.hpp:73
Type
Definition WsfLASER_CommXmtrComponent.hpp:56
@ cDPSK
Definition WsfLASER_CommXmtrComponent.hpp:60
@ cUNDEFINED
Definition WsfLASER_CommXmtrComponent.hpp:57
@ cOOK
Definition WsfLASER_CommXmtrComponent.hpp:58
@ cPPM
Definition WsfLASER_CommXmtrComponent.hpp:59
bool ProcessInput(UtInput &aInput)
Definition WsfLASER_CommXmtrComponent.cpp:131
Modulation()
Definition WsfLASER_CommXmtrComponent.cpp:119
const std::string & GetTypeName() const
Get the name associated with the modulation type.
Definition WsfLASER_CommXmtrComponent.hpp:85
void SetPPM_Order(unsigned aPPM_Order)
Set the PPM order (2, 4, 8, etc.) if the selected type was cPPM.
Definition WsfLASER_CommXmtrComponent.hpp:82
void SetType(Type aType)
Set type modulation type.
Definition WsfLASER_CommXmtrComponent.hpp:79
bool Initialize(WsfEM_Xmtr &aXmtr)
Definition WsfLASER_CommXmtrComponent.cpp:177
double GetSlotDuration() const
Return the slot duration (time between bit intervals).
Definition WsfLASER_CommXmtrComponent.hpp:76
double GetDataRate() const
Return the data rate associated with the modulation parameters.
Definition WsfLASER_CommXmtrComponent.hpp:70
Definition WsfLASER_CommXmtrComponent.hpp:24
double GetDataRate() const
Return the data rate of this comm device (pass-through from Modulation).
Definition WsfLASER_CommXmtrComponent.hpp:47
bool PreInitialize(double aSimTime) override
Definition WsfLASER_CommXmtrComponent.cpp:56
bool ProcessInput(UtInput &aInput) override
Definition WsfLASER_CommXmtrComponent.cpp:80
WsfLASER_CommXmtrComponent()
Definition WsfLASER_CommXmtrComponent.cpp:33
double GetDutyCycle() const
Return the duty cycle (time the laser is on; pass-through from Modulation).
Definition WsfLASER_CommXmtrComponent.hpp:50
WsfLASER_CommXmtrComponent & operator=(const WsfLASER_CommXmtrComponent &)=delete
bool Initialize(double aSimTime) override
Definition WsfLASER_CommXmtrComponent.cpp:63
Modulation & GetModulation()
Definition WsfLASER_CommXmtrComponent.hpp:99
double GetPointingTransmission() const
Definition WsfLASER_CommXmtrComponent.hpp:44
WsfComponent * CloneComponent() const override
Definition WsfLASER_CommXmtrComponent.cpp:50
WsfLASER_XmtrComponent()
Definition WsfLASER_XmtrComponent.cpp:32
Copyrights Multiple, All Rights Reserved