|
WSF
|
Implementation of worker thread. More...
#include <WsfWeaponServer.hpp>


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 () |
| WsfTrack * | CreateATargetPoint (double aSimTime, WsfPlatform *aPlatformPtr, double aAtRangeNM=40.0) |
| WsfTrack * | CreateATargetPoint (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) |
| WsfSimulation & | GetSimulation () |
| bool | SetCommander (WsfPlatform *aPlatformPtr) |
| Public Member Functions inherited from WsfWeaponServerInput | |
| WsfWeaponServerInput () | |
| Public Member Functions inherited from WsfSimulationExtension | |
| WsfSimulationExtension () | |
| ~WsfSimulationExtension () override=default | |
| WsfSimulation & | GetSimulation () const |
| const WsfScenario & | GetScenario () 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 WsfWeaponServer * | Find (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, WsfStringId > | mWeaponNameMapTheirsToOurs |
| std::map< std::pair< WsfStringId, WsfStringId >, WsfStringId > | mPlatformStationToOurWeaponName |
| std::map< int, WsfStringId > | mWeaponEnumToWeaponType |
| 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< WsfStringId > | mOutgoingWeaponTypes |
| 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) |
Implementation of worker thread.
| typedef UtCallbackListN<void(WsfPlatform*, unsigned int, double, int, bool)> WsfWeaponServer::PostLaunchCallback |
| typedef UtCallbackListN<void(bool)> WsfWeaponServer::WeaponServerEnabledCallback |
| WsfWeaponServer::WsfWeaponServer | ( | WsfWeaponServerInput & | aScenario, |
| WsfSimulation * | aSimulationPtr, | ||
| WsfDisInterface * | aDisInterfacePtr ) |
Constructor and destructor.
References WsfSimulationExtension::GetScenario(), WsfSimulationExtension::WsfSimulation, and WsfWeaponServerInput::WsfWeaponServerInput().
Referenced by Find(), and GetWeaponTrackNumbers().
|
override |
|
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.
| WsfTrack * WsfWeaponServer::CreateATargetPoint | ( | double | aSimTime, |
| WsfPlatform * | aPlatformPtr, | ||
| double | aAtRangeNM = 40.0 ) |
| WsfTrack * WsfWeaponServer::CreateATargetPoint | ( | double | aSimTime, |
| WsfPlatform * | aPlatformPtr, | ||
| double | aPosNM, | ||
| double | aPosEM, | ||
| double | aPosDM ) |
| unsigned int WsfWeaponServer::DecimalToOctal | ( | unsigned int | aDecimalValue | ) |
Referenced by ProcessCommand().
|
static |
References WsfSimulation::FindExtension(), WsfSimulationExtension::WsfSimulation, and WsfWeaponServer().
Referenced by GetWeaponTrackNumbers().
| std::string WsfWeaponServer::GenerateCommand | ( | const WsfWeaponEngagement * | aEngagementPtr, |
| const WsfTrack * | aTrackPtr ) |
References WsfDisPlatform::GetEntityId(), WsfWeaponEngagement::GetFiringPlatform(), WsfWeaponEngagement::GetFiringPlatformIndex(), WsfWeaponEngagement::GetFiringPlatformName(), WsfObject::GetName(), WsfTrackId::GetOwningPlatformId(), WsfL16::ComputerProcessor::GetPlatformTrackNumber(), WsfMeasurement::GetSpatialDomain(), WsfWeaponEngagement::GetTargetPlatform(), WsfWeaponEngagement::GetTargetPlatformIndex(), WsfTrack::GetTrackId(), WsfObject::GetTypeId(), WsfWeaponEngagement::GetWeaponSystem(), WSF_SPATIAL_DOMAIN_LAND, and WSF_SPATIAL_DOMAIN_SURFACE.
Referenced by SendToOtherWeaponServer().
|
inline |
|
inline |
|
inline |
|
inline |
References WsfWeaponServerInput::mErrorString.
|
inline |
References WsfWeaponServerInput::mWarningString.
Referenced by UpdateAsServer().
|
inline |
|
inline |
| WsfSimulation & WsfWeaponServer::GetSimulation | ( | ) |
References WsfSimulationExtension::GetSimulation(), and WsfSimulationExtension::WsfSimulation.
Referenced by CreateATargetPoint(), CreateATargetPoint(), Initialize(), InitiateCallbacks(), PlatformDeleted(), and ProcessCommand().
|
inline |
References WsfWeaponServerInput::mWeaponNameMapTheirsToOurs.
|
inline |
References WsfWeaponServerInput::mWeaponServerIncluded.
| bool WsfWeaponServer::GetWeaponServerNumbers | ( | const size_t | weaponIndex, |
| unsigned int & | weaponTnumber, | ||
| unsigned int & | controllerTnumber ) |
Referenced by GetWeaponTrackNumbers().
|
inline |
|
static |
References Find(), GetWeaponServerNumbers(), WsfSimulationExtension::WsfSimulation, and WsfWeaponServer().
Referenced by Initialize().
|
overridevirtual |
Called from the main thread to initialize the thread.
Reimplemented from WsfSimulationExtension.
References WsfSimulation::FindExtension(), GetSimulation(), GetWeaponTrackNumbers(), InitiateCallbacks(), WsfWeaponServerInput::mHostTrue_ClientFalse, WsfWeaponServerInput::mOutGoingHostName, WsfWeaponServerInput::mOutGoingPort, WsfWeaponServerInput::mPort, WsfWeaponServerInput::mWeaponServerIncluded, SendToOtherWeaponServer(), WsfL16::Interface::SetWeaponTrackNumbersFunction(), and WsfObserver::WeaponPlatformPendingAdd().
| void WsfWeaponServer::InitiateCallbacks | ( | ) |
| bool WsfWeaponServer::IsConnected | ( | ) |
| void WsfWeaponServer::PlatformAdded | ( | double | aTime, |
| WsfPlatform * | aPlatformPtr ) |
References WsfWeaponEngagement::Find(), WsfDisPlatform::GetEntityId(), WsfPlatform::GetIndex(), WsfObject::GetName(), WsfDisPlatform::GetPlatform(), WsfWeaponServerInput::mDebugEnabled, WsfWeaponServerInput::mWarningString, PostLaunch, SetCommander(), and WsfDisPlatform::SetEntityId().
Referenced by InitiateCallbacks().
| void WsfWeaponServer::PlatformDeleted | ( | double | aTime, |
| WsfPlatform * | aPlatformPtr ) |
References WsfComponentList::RoleIterator< T >::AtEnd(), WsfWeaponEngagement::Find(), WsfPlatform::GetIndex(), GetSimulation(), and WsfSimulation::TurnPartOff().
Referenced by InitiateCallbacks().
| void WsfWeaponServer::PlatformInitialized | ( | double | aTime, |
| WsfPlatform * | aPlatformPtr ) |
References WsfWeaponEngagement::Find(), WsfWeaponEngagement::GetFiringPlatform(), WsfPlatform::GetSide(), WsfPlatform::GetSideId(), and WsfPlatform::SetSide().
Referenced by InitiateCallbacks().
| bool WsfWeaponServer::ProcessCommand | ( | const std::string & | command | ) |
References WsfComponentListT< COMPONENT_TYPE >::AddComponent(), WsfComponentList::RoleIterator< T >::AtEnd(), BY_DIS_ID, BY_LAT, BY_LOCATION, BY_LON, BY_NAME, BY_TAIL_NUMBER, cFREQ, cMID, cPOSD, cPOSE, cPOSN, CreateATargetPoint(), cVELD, cVELE, cVELN, DecimalToOctal(), WsfSimulation::DeletePlatform(), WsfWeapon::Fire(), WsfWeaponTypes::Get(), WsfAuxDataEnabled::GetAuxData(), wsf::Terrain::GetElevApprox(), WsfDisPlatform::GetEntityId(), WsfPlatform::GetIndex(), WsfObject::GetName(), WsfPlatform::GetNextTrackId(), WsfDisPlatform::GetPlatform(), WsfSimulation::GetPlatformByIndex(), WsfSimulation::GetPlatformByName(), WsfWeapon::GetQuantityRemaining(), WsfSimulationExtension::GetScenario(), WsfSimulation::GetSimTime(), GetSimulation(), WsfPlatform::GetTrackManager(), WsfTrack::Initialize(), WsfWeapon::Initialize(), wsf::Terrain::IsEnabled(), WsfUtil::MakeTrack(), WsfWeaponServerInput::mDebugEnabled, WsfWeaponServerInput::mErrorString, WsfWeaponServerInput::mPlatformStationToOurWeaponName, WsfWeaponServerInput::mWarningString, WsfWeaponServerInput::mWeaponNameMapTheirsToOurs, NO_IDENTIFIER, pos, WsfDisPlatform::ResetEntityId(), WsfTrack::Set3D(), WsfTrackManager::SetCurrentTarget(), WsfArticulatedPart::SetPlatform(), WsfTrack::SetPlatformOriginator(), WsfL16::Interface::SetPlatformTrackNumber(), WsfWeapon::SetQuantityRemaining(), WsfMeasurement::SetSpatialDomain(), settings(), simTime, WSF_SPATIAL_DOMAIN_AIR, and WSF_SPATIAL_DOMAIN_LAND.
Referenced by UpdateAsServer().
|
inline |
References WsfWeaponServerInput::mErrorString.
| void WsfWeaponServer::SendToOtherWeaponServer | ( | double | aSimTime, |
| WsfPlatform * | aPlatformPtr, | ||
| const WsfWeaponEngagement * | aEngagementPtr, | ||
| const WsfTrack * | aTrackPtr ) |
References GenerateCommand(), WsfObject::GetTypeId(), WsfWeaponEngagement::GetWeaponSystem(), WsfWeaponServerInput::mDebugEnabled, WsfWeaponServerInput::mOutGoingHostName, WsfWeaponServerInput::mOutGoingPort, WsfWeaponServerInput::mOutgoingWeaponTypes, and WsfPlatform::SetIsExternallyControlled().
Referenced by Initialize().
| 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().
|
inline |
References WsfSimulationExtension::WsfSimulation.
|
inline |
References WsfWeaponServerInput::mWeaponServerIncluded.
| void WsfWeaponServer::Update | ( | double | aSimTime | ) |
References UpdateAsServer().
| void WsfWeaponServer::UpdateAsServer | ( | ) |
References GetLastWarning(), WsfWeaponServerInput::mErrorString, WsfWeaponServerInput::mPort, and ProcessCommand().
Referenced by Update().
|
static |
|
static |
Referenced by PlatformAdded().
|
static |