WSF
WsfXIO_ObjectInfoLoadHelpers.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 2003-2015 The Boeing 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 WSFXIO_OBJECTINFOLOADHELPERS_HPP
13#define WSFXIO_OBJECTINFOLOADHELPERS_HPP
14
19//
21
22namespace
23{
25template<typename T>
26void Load_ModedPart(WsfXIO_Simulation& aXIO_Simulation, WsfXIO_ModedPartInfo& aInfo, T& aPart)
27{
28 WsfXIO_ObjectInfoLoad::Load_ArticulatedPart(aXIO_Simulation, aInfo, aPart); // Load base class
29 aInfo.mCurrentModeName = aPart.GetCurrentModeName();
30 for (size_t i = 0; i < aPart.GetModeCount(); ++i)
31 {
32 aInfo.mModeNames.push_back(WsfStringId(aPart.GetModeName(i)));
33 if (aPart.GetModeEntry(i) && aPart.GetModeEntry(i)->IsSelected())
34 {
35 aInfo.mSelectedModeNames.push_back(WsfStringId(aPart.GetModeName(i)));
36 }
37 }
38 if (aInfo.mSelectedModeNames.empty())
39 {
40 aInfo.mSelectedModeNames.push_back(WsfStringId(aPart.GetCurrentModeName()));
41 }
42}
43
45template<typename PART>
46void Load_Transmitters(WsfXIO_Simulation& aXIO_Simulation, PART& aPart, std::vector<WsfXIO_EM_XmtrInfo*>& aXmtrInfos)
47{
48 aXmtrInfos.resize(aPart.GetEM_XmtrCount());
49 for (unsigned int i = 0; i < aPart.GetEM_XmtrCount(); ++i)
50 {
51 WsfEM_Xmtr& xmtr = aPart.GetEM_Xmtr(i);
53 WsfXIO_ObjectInfoLoad::Load_EM_Xmtr(aXIO_Simulation, *infoPtr, xmtr);
54 aXmtrInfos[i] = infoPtr;
55 }
56}
57
59template<typename PART>
60void Load_Receivers(WsfXIO_Simulation& aXIO_Simulation, PART& aPart, std::vector<WsfXIO_EM_RcvrInfo*>& aRcvrInfos)
61{
62 aRcvrInfos.resize(aPart.GetEM_RcvrCount());
63 for (unsigned int i = 0; i < aPart.GetEM_RcvrCount(); ++i)
64 {
65 WsfEM_Rcvr& rcvr = aPart.GetEM_Rcvr(i);
67 WsfXIO_ObjectInfoLoad::Load_EM_Rcvr(aXIO_Simulation, *infoPtr, rcvr);
68 aRcvrInfos[i] = infoPtr;
69 }
70}
71} // namespace
72
73#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfEM_Rcvr.hpp:68
Definition WsfEM_Xmtr.hpp:55
XIO representation of a WsfEM_Rcvr.
Definition WsfXIO_ObjectInfo.hpp:138
XIO representation of a WsfEM_Xmtr.
Definition WsfXIO_ObjectInfo.hpp:158
Contains information about a part which contains modes (sensor).
Definition WsfXIO_ObjectInfo.hpp:356
std::vector< WsfStringId > mSelectedModeNames
Definition WsfXIO_ObjectInfo.hpp:377
WsfStringId mCurrentModeName
Definition WsfXIO_ObjectInfo.hpp:378
std::vector< WsfStringId > mModeNames
Definition WsfXIO_ObjectInfo.hpp:376
Definition WsfXIO_Simulation.hpp:49
WSF_EXPORT void Load_EM_Rcvr(WsfXIO_Simulation &aXIO_Simulation, WsfXIO_EM_RcvrInfo &aInfo, const WsfEM_Rcvr &aRcvr)
Definition WsfXIO_ObjectInfoLoad.cpp:142
WSF_EXPORT void Load_ArticulatedPart(WsfXIO_Simulation &aXIO_Simulation, WsfXIO_ArticulatedPartInfo &aInfo, const WsfArticulatedPart &aPart)
Definition WsfXIO_ObjectInfoLoad.cpp:191
WSF_EXPORT void Load_EM_Xmtr(WsfXIO_Simulation &aXIO_Simulation, WsfXIO_EM_XmtrInfo &aInfo, const WsfEM_Xmtr &aXmtr)
Definition WsfXIO_ObjectInfoLoad.cpp:105
Copyrights Multiple, All Rights Reserved