open-dis-cpp
UaPdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/EventID.h>
5 #include <dis6/ShaftRPMs.h>
6 #include <dis6/ApaData.h>
7 #include <dis6/AcousticEmitterSystemData.h>
8 #include <vector>
9 #include <dis6/DistributedEmissionsFamilyPdu.h>
10 #include <dis6/utils/DataStream.h>
11 #include <dis6/opendis6_export.h>
12 
13 
14 namespace DIS
15 {
16 // Section 5.3.7.3. Information about underwater acoustic emmissions. This requires manual cleanup. The beam data records should ALL be a the finish, rather than attached to each emitter system. UNFINISHED
17 
18 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
19 //
20 // @author DMcG, jkg
21 
22 class OPENDIS6_EXPORT UaPdu : public DistributedEmissionsFamilyPdu
23 {
24 protected:
27 
30 
33 
35  char _pad;
36 
38  unsigned short _passiveParameterIndex;
39 
42 
44  unsigned char _numberOfShafts;
45 
47  unsigned char _numberOfAPAs;
48 
50  unsigned char _numberOfUAEmitterSystems;
51 
53  std::vector<ShaftRPMs> _shaftRPMs;
54 
56  std::vector<ApaData> _apaData;
57 
58  std::vector<AcousticEmitterSystemData> _emitterSystems;
59 
60 
61  public:
62  UaPdu();
63  virtual ~UaPdu();
64 
65  virtual void marshal(DataStream& dataStream) const;
66  virtual void unmarshal(DataStream& dataStream);
67 
68  EntityID& getEmittingEntityID();
69  const EntityID& getEmittingEntityID() const;
70  void setEmittingEntityID(const EntityID &pX);
71 
72  EventID& getEventID();
73  const EventID& getEventID() const;
74  void setEventID(const EventID &pX);
75 
76  char getStateChangeIndicator() const;
77  void setStateChangeIndicator(char pX);
78 
79  char getPad() const;
80  void setPad(char pX);
81 
82  unsigned short getPassiveParameterIndex() const;
83  void setPassiveParameterIndex(unsigned short pX);
84 
85  unsigned char getPropulsionPlantConfiguration() const;
86  void setPropulsionPlantConfiguration(unsigned char pX);
87 
88  unsigned char getNumberOfShafts() const;
89 
90  unsigned char getNumberOfAPAs() const;
91 
92  unsigned char getNumberOfUAEmitterSystems() const;
93 
94  std::vector<ShaftRPMs>& getShaftRPMs();
95  const std::vector<ShaftRPMs>& getShaftRPMs() const;
96  void setShaftRPMs(const std::vector<ShaftRPMs>& pX);
97 
98  std::vector<ApaData>& getApaData();
99  const std::vector<ApaData>& getApaData() const;
100  void setApaData(const std::vector<ApaData>& pX);
101 
102  std::vector<AcousticEmitterSystemData>& getEmitterSystems();
103  const std::vector<AcousticEmitterSystemData>& getEmitterSystems() const;
104  void setEmitterSystems(const std::vector<AcousticEmitterSystemData>& pX);
105 
106 
107 virtual int getMarshalledSize() const;
108 
109  bool operator ==(const UaPdu& rhs) const;
110 };
111 }
112 
113 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
114 // Redistribution and use in source and binary forms, with or without
115 // modification, are permitted provided that the following conditions
116 // are met:
117 //
118 // * Redistributions of source code must retain the above copyright
119 // notice, this list of conditions and the following disclaimer.
120 // * Redistributions in binary form must reproduce the above copyright
121 // notice, this list of conditions and the following disclaimer
122 // in the documentation and/or other materials provided with the
123 // distribution.
124 // * Neither the names of the Naval Postgraduate School (NPS)
125 // Modeling Virtual Environments and Simulation (MOVES) Institute
126 // (http://www.nps.edu and http://www.MovesInstitute.org)
127 // nor the names of its contributors may be used to endorse or
128 // promote products derived from this software without specific
129 // prior written permission.
130 //
131 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
132 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
133 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
134 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
135 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
136 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
137 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
138 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
139 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
140 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
141 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
142 // POSSIBILITY OF SUCH DAMAGE.
unsigned short _passiveParameterIndex
This field indicates which database record (or file) shall be used in the definition of passive signa...
Definition: UaPdu.h:38
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
unsigned char _propulsionPlantConfiguration
This field shall specify the entity propulsion plant configuration.
Definition: UaPdu.h:41
char _pad
padding
Definition: UaPdu.h:35
EventID _eventID
ID of event.
Definition: UaPdu.h:29
Definition: UaPdu.h:22
a class to support managing a network buffer.
Definition: DataStream.h:28
unsigned char _numberOfAPAs
This field shall indicate the number of APAs described in the current UA PDU.
Definition: UaPdu.h:47
std::vector< ApaData > _apaData
apaData
Definition: UaPdu.h:56
Definition: EventID.h:15
EntityID _emittingEntityID
ID of the entity that is the source of the emission.
Definition: UaPdu.h:26
Definition: EntityID.h:15
std::vector< ShaftRPMs > _shaftRPMs
shaft RPM values
Definition: UaPdu.h:53
unsigned char _numberOfShafts
This field shall represent the number of shafts on a platform.
Definition: UaPdu.h:44
char _stateChangeIndicator
This field shall be used to indicate whether the data in the UA PDU represent a state update or data ...
Definition: UaPdu.h:32
unsigned char _numberOfUAEmitterSystems
This field shall specify the number of UA emitter systems being described in the current UA PDU...
Definition: UaPdu.h:50
Definition: DistributedEmissionsFamilyPdu.h:16