WSF
WsfWeaponServer Class Reference

Implementation of worker thread. More...

#include <WsfWeaponServer.hpp>

Inheritance diagram for WsfWeaponServer:
Collaboration diagram for WsfWeaponServer:

Classes

struct  LARInputType
struct  LAROutputType
struct  MissileIdType
struct  InitVariablesType
struct  UmbilicalVariablesType
struct  LaunchVariablesType
struct  TelemetryVariablesType
struct  LaunchMessageType
class  UniqueWeaponKey

Public Types

enum  IdentifierType {
  NO_IDENTIFIER = 0x00 , BY_NAME = 0x01 , BY_DIS_ID = 0x02 , BY_TAIL_NUMBER = 0x08 ,
  BY_LAT = 0x10 , BY_LON = 0x20 , BY_LOCATION = 0x30
}
enum  ValidityType {
  cNO_IDENTIFIER = 0x00 , cFREQ = 0x01 , cMID = 0x02 , cPOSN = 0x04 ,
  cPOSE = 0x08 , cPOSD = 0x10 , cVELN = 0x20 , cVELE = 0x40 ,
  cVELD = 0x80
}
typedef UtCallbackListN< void(WsfPlatform *, unsigned int, double, int, bool)> PostLaunchCallback
typedef UtCallbackListN< void(bool)> WeaponServerEnabledCallback

Public Member Functions

 WsfWeaponServer (WsfWeaponServerInput &aScenario, WsfSimulation *aSimulationPtr, WsfDisInterface *aDisInterfacePtr)
 Constructor and destructor.
 ~WsfWeaponServer () override
bool Initialize () override
 Called from the main thread to initialize the thread.
void AddedToSimulation () override
void Update (double aSimTime)
void UpdateAsServer ()
bool IsConnected ()
bool ProcessCommand (const std::string &command)
std::string GenerateCommand (const WsfWeaponEngagement *aEngagementPtr, const WsfTrack *aTrackPtr)
std::string GetLastError ()
std::string GetLastWarning ()
double GetCurrentFrequency ()
int GetCurrentId ()
WsfTrackCreateATargetPoint (double aSimTime, WsfPlatform *aPlatformPtr, double aAtRangeNM=40.0)
WsfTrackCreateATargetPoint (double aSimTime, WsfPlatform *aPlatformPtr, double aPosNM, double aPosEM, double aPosDM)
unsigned int DecimalToOctal (unsigned int aDecimalValue)
void SendToOtherWeaponServer (double aSimTime, WsfPlatform *aPlatformPtr, const WsfWeaponEngagement *aEngagementPtr, const WsfTrack *aTrackPtr)
bool GetWeaponServerNumbers (const size_t weaponIndex, unsigned int &weaponTnumber, unsigned int &controllerTnumber)
void PlatformAdded (double aTime, WsfPlatform *aPlatformPtr)
void PlatformDeleted (double aTime, WsfPlatform *aPlatformPtr)
void PlatformInitialized (double aTime, WsfPlatform *aPlatformPtr)
void RetrieveErrorMessage (std::string &aErrorString)
bool GetWeaponServerIncluded () const
void SetWeaponServerIncluded (bool aBool)
void InitiateCallbacks ()
std::map< UniqueWeaponKey, size_t > * GetPlatformIndexMap ()
std::map< size_t, unsigned int > * GetWeaponTrackNumberMap ()
std::map< size_t, unsigned int > * GetControllerTrackNumberMap ()
std::map< WsfStringId, WsfStringId > * GetWeaponNameMap ()
std::map< std::pair< WsfStringId, WsfStringId >, WsfStringId > * GetPlatformStationToOurWeaponNameMap ()
void SetSimulation (WsfSimulation *aSimulationPtr)
WsfSimulationGetSimulation ()
bool SetCommander (WsfPlatform *aPlatformPtr)
Public Member Functions inherited from WsfWeaponServerInput
 WsfWeaponServerInput ()
Public Member Functions inherited from WsfSimulationExtension
 WsfSimulationExtension ()
 ~WsfSimulationExtension () override=default
WsfSimulationGetSimulation () const
const WsfScenarioGetScenario () const
virtual bool PrepareExtension ()
virtual bool PlatformsInitialized ()
virtual void PendingStart ()
virtual void Start ()
virtual void Complete (double aSimTime)
Public Member Functions inherited from WsfExtension
virtual ~WsfExtension ()=default
const std::string & GetExtensionName () const

Static Public Member Functions

static WsfWeaponServerFind (const WsfSimulation &aSimulation)
static void GetWeaponTrackNumbers (WsfSimulation &aSimulation, size_t aWeaponPlatformIndex, unsigned int &aWeaponTrackNumber, unsigned int &aControllerTrackNumber)
static void __private_SetSim (WsfSimulationExtension &aExtension, WsfSimulation *aSimPtr)

Static Public Attributes

static PostLaunchCallback PostLaunch
static WeaponServerEnabledCallback WeaponServerEnabled
static std::function< unsigned int(WsfPlatform &)> GetControllerTrackNumber

Additional Inherited Members

Public Attributes inherited from WsfWeaponServerInput
std::map< WsfStringId, WsfStringIdmWeaponNameMapTheirsToOurs
std::map< std::pair< WsfStringId, WsfStringId >, WsfStringIdmPlatformStationToOurWeaponName
std::map< int, WsfStringIdmWeaponEnumToWeaponType
std::map< unsigned int, DisEntityId > mTrackNumberToDisEntityIdMap
bool mHostTrue_ClientFalse
bool mWeaponServerIncluded
bool mDebugEnabled
std::string mErrorString
std::string mWarningString
std::string mOutGoingHostName
unsigned int mOutGoingPort
std::list< WsfStringIdmOutgoingWeaponTypes
unsigned int mPort
std::string mHostName
double mTestRMax
double mTestRMaxTOF
double mTestRNe
double mTestRNeTOF
double mTestRMin
double mTestRMinTOF
double mRpiMultiplier
unsigned int mLarMsgTypeIdIn
unsigned int mLarMsgTypeIdOut
bool mUseTestLARData
bool mDebugSetData
Protected Member Functions inherited from WsfExtension
void InitializeExtensionName (const std::string &aName)

Detailed Description

Implementation of worker thread.

Member Typedef Documentation

◆ PostLaunchCallback

typedef UtCallbackListN<void(WsfPlatform*, unsigned int, double, int, bool)> WsfWeaponServer::PostLaunchCallback

◆ WeaponServerEnabledCallback

typedef UtCallbackListN<void(bool)> WsfWeaponServer::WeaponServerEnabledCallback

Member Enumeration Documentation

◆ IdentifierType

Enumerator
NO_IDENTIFIER 
BY_NAME 
BY_DIS_ID 
BY_TAIL_NUMBER 
BY_LAT 
BY_LON 
BY_LOCATION 

◆ ValidityType

Enumerator
cNO_IDENTIFIER 
cFREQ 
cMID 
cPOSN 
cPOSE 
cPOSD 
cVELN 
cVELE 
cVELD 

Constructor & Destructor Documentation

◆ WsfWeaponServer()

WsfWeaponServer::WsfWeaponServer ( WsfWeaponServerInput & aScenario,
WsfSimulation * aSimulationPtr,
WsfDisInterface * aDisInterfacePtr )

◆ ~WsfWeaponServer()

WsfWeaponServer::~WsfWeaponServer ( )
override

Member Function Documentation

◆ AddedToSimulation()

void WsfWeaponServer::AddedToSimulation ( )
overridevirtual

Called in response to WsfSimulation::RegisterExtension. The extension has now been registered in the simulation.

Reimplemented from WsfSimulationExtension.

References WsfWeaponServerInput::mHostTrue_ClientFalse, and WsfWeaponServerInput::mWeaponServerIncluded.

◆ CreateATargetPoint() [1/2]

◆ CreateATargetPoint() [2/2]

WsfTrack * WsfWeaponServer::CreateATargetPoint ( double aSimTime,
WsfPlatform * aPlatformPtr,
double aPosNM,
double aPosEM,
double aPosDM )

◆ DecimalToOctal()

unsigned int WsfWeaponServer::DecimalToOctal ( unsigned int aDecimalValue)

Referenced by ProcessCommand().

◆ Find()

WsfWeaponServer * WsfWeaponServer::Find ( const WsfSimulation & aSimulation)
static

◆ GenerateCommand()

◆ GetControllerTrackNumberMap()

std::map< size_t, unsigned int > * WsfWeaponServer::GetControllerTrackNumberMap ( )
inline

◆ GetCurrentFrequency()

double WsfWeaponServer::GetCurrentFrequency ( )
inline

◆ GetCurrentId()

int WsfWeaponServer::GetCurrentId ( )
inline

◆ GetLastError()

std::string WsfWeaponServer::GetLastError ( )
inline

◆ GetLastWarning()

std::string WsfWeaponServer::GetLastWarning ( )
inline

◆ GetPlatformIndexMap()

std::map< UniqueWeaponKey, size_t > * WsfWeaponServer::GetPlatformIndexMap ( )
inline

◆ GetPlatformStationToOurWeaponNameMap()

std::map< std::pair< WsfStringId, WsfStringId >, WsfStringId > * WsfWeaponServer::GetPlatformStationToOurWeaponNameMap ( )
inline

◆ GetSimulation()

◆ GetWeaponNameMap()

std::map< WsfStringId, WsfStringId > * WsfWeaponServer::GetWeaponNameMap ( )
inline

◆ GetWeaponServerIncluded()

bool WsfWeaponServer::GetWeaponServerIncluded ( ) const
inline

◆ GetWeaponServerNumbers()

bool WsfWeaponServer::GetWeaponServerNumbers ( const size_t weaponIndex,
unsigned int & weaponTnumber,
unsigned int & controllerTnumber )

Referenced by GetWeaponTrackNumbers().

◆ GetWeaponTrackNumberMap()

std::map< size_t, unsigned int > * WsfWeaponServer::GetWeaponTrackNumberMap ( )
inline

◆ GetWeaponTrackNumbers()

void WsfWeaponServer::GetWeaponTrackNumbers ( WsfSimulation & aSimulation,
size_t aWeaponPlatformIndex,
unsigned int & aWeaponTrackNumber,
unsigned int & aControllerTrackNumber )
static

◆ Initialize()

◆ InitiateCallbacks()

◆ IsConnected()

bool WsfWeaponServer::IsConnected ( )

◆ PlatformAdded()

◆ PlatformDeleted()

void WsfWeaponServer::PlatformDeleted ( double aTime,
WsfPlatform * aPlatformPtr )

◆ PlatformInitialized()

void WsfWeaponServer::PlatformInitialized ( double aTime,
WsfPlatform * aPlatformPtr )

◆ ProcessCommand()

bool WsfWeaponServer::ProcessCommand ( const std::string & command)

◆ RetrieveErrorMessage()

void WsfWeaponServer::RetrieveErrorMessage ( std::string & aErrorString)
inline

◆ SendToOtherWeaponServer()

◆ SetCommander()

bool WsfWeaponServer::SetCommander ( WsfPlatform * aPlatformPtr)

Set commander on weapon, first look for the CTRL_TRACK_NUM platform, if not set, then use firing platform aPlatformPtr Weapon platform pointer returns 'true' if commander platform found

References WsfWeaponEngagement::Find(), WsfComponentList::GetComponent(), WsfL16::Interface::GetControllerFromTrackNumber(), WsfCommandChain::GetDefaultNameId(), WsfWeaponEngagement::GetFiringPlatform(), WsfDisPlatform::GetPlatform(), WsfPlatform::GetSimulation(), WsfWeaponServerInput::mTrackNumberToDisEntityIdMap, and WsfCommandChain::SetCommander().

Referenced by PlatformAdded().

◆ SetSimulation()

void WsfWeaponServer::SetSimulation ( WsfSimulation * aSimulationPtr)
inline

◆ SetWeaponServerIncluded()

void WsfWeaponServer::SetWeaponServerIncluded ( bool aBool)
inline

◆ Update()

void WsfWeaponServer::Update ( double aSimTime)

References UpdateAsServer().

◆ UpdateAsServer()

void WsfWeaponServer::UpdateAsServer ( )

Member Data Documentation

◆ GetControllerTrackNumber

std::function<unsigned int(WsfPlatform&)> WsfWeaponServer::GetControllerTrackNumber
static

◆ PostLaunch

WsfWeaponServer::PostLaunchCallback WsfWeaponServer::PostLaunch
static

Referenced by PlatformAdded().

◆ WeaponServerEnabled

WeaponServerEnabledCallback WsfWeaponServer::WeaponServerEnabled
static

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved