KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Underwater_Acoustic_PDU.h
Go to the documentation of this file.
1 /*********************************************************************
2 Copyright 2013 Karl Jones
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7 
8 1. Redistributions of source code must retain the above copyright notice, this
9  list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation
12  and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 
25 For Further Information Please Contact me at
26 Karljj1@yahoo.com
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
29 
30 /********************************************************************
31  class: Underwater_Acoustic_PDU
32  DIS: (6) 1278.1A - 1998
33  created: 2008/10/19
34  author: Karl Jones
35 
36  purpose: Contains infomation about under water acoustic emissions
37  Size: 272 bits / 34 octets - min size
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./../Header.h"
43 #include "./../../DataTypes/EntityIdentifier.h"
44 #include "./../../DataTypes/EmissionSystem.h"
45 #include "./../../DataTypes/Shaft.h"
46 #include "./../../DataTypes/APA.h"
47 #include "./../../DataTypes/UnderwaterAcousticEmitterSystem.h"
48 #include <vector>
49 
50 namespace KDIS {
51 namespace PDU {
52 
54 {
55 protected:
56 
58 
60 
62 
64 
66 
68 
70 
72 
74 
75  std::vector<KDIS::DATA_TYPE::Shaft> m_vShafts;
76 
77  std::vector<KDIS::DATA_TYPE::APA> m_vAPA;
78 
79  std::vector<KDIS::DATA_TYPE::UnderwaterAcousticEmitterSystem> m_vUAES;
80 
81 public:
82 
83  static const KUINT16 UNDERWATER_ACOUSTIC_PDU_SIZE = 34; // Min Size
84 
86 
87  Underwater_Acoustic_PDU( KDataStream & stream ) throw( KException );
88 
89  Underwater_Acoustic_PDU( const Header & H, KDataStream & stream ) throw( KException );
90 
91  virtual ~Underwater_Acoustic_PDU();
92 
93  //************************************
94  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::SetEmittingEntityID
95  // KDIS::PDU::Underwater_Acoustic_PDU::GetEmittingEntityID
96  //!Description: Emitting Entity ID
97  // Parameter: const EntityIdentifier & ID
98  //************************************
99  void SetEmittingEntityID ( const KDIS::DATA_TYPE::EntityIdentifier & ID );
100  const KDIS::DATA_TYPE::EntityIdentifier & GetEmittingEntityID() const;
101  KDIS::DATA_TYPE::EntityIdentifier & GetEmittingEntityID();
102 
103  //************************************
104  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::SetEventID
105  // KDIS::PDU::Underwater_Acoustic_PDU::GetEventID
106  //!Description: Event ID. For associated events.
107  // Parameter: const EntityIdentifier & ID
108  //************************************
109  void SetEventID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
110  const KDIS::DATA_TYPE::EntityIdentifier & GetEventID() const;
111  KDIS::DATA_TYPE::EntityIdentifier & GetEventID();
112 
113  //************************************
114  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::SetStateUpdateIndicator
115  // KDIS::PDU::Underwater_Acoustic_PDU::GetStateUpdateIndicator
116  //!Description: Indicates if the data contained in the PDU represents a state update or
117  //! just data that has changed since issuance of the last Electromagnetic Emission
118  //! PDU.
119  // Parameter: StateUpdateIndicator SUI
120  //************************************
121  void SetStateUpdateIndicator( KDIS::DATA_TYPE::ENUMS::StateUpdateIndicator SUI );
122  KDIS::DATA_TYPE::ENUMS::StateUpdateIndicator GetStateUpdateIndicator() const;
123 
124  //************************************
125  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::SetPassiveParameterIndex
126  // KDIS::PDU::Underwater_Acoustic_PDU::GetPassiveParameterIndex
127  //!Description: Indicates which database record ( or file ) shall
128  //! be used in the definition of passive signature (unintentional)
129  //! emissions of the entity. The indicated record/file shall
130  //! define all noise generated as a function of propulsion plant
131  //! configuration and associated auxiliaries.
132  //! E.G parameter indexex identifying a file in a common
133  //! acoustic database (CADB) would be used here.
134  // Parameter: PassiveParameterIndex PPI
135  //************************************
136  void SetPassiveParameterIndex( KDIS::DATA_TYPE::ENUMS::PassiveParameterIndex PPI );
137  KDIS::DATA_TYPE::ENUMS::PassiveParameterIndex GetPassiveParameterIndex() const;
138 
139  //************************************
140  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::SetPropulsionPlantConfiguration
141  // KDIS::PDU::Underwater_Acoustic_PDU::GetPropulsionPlantConfiguration
142  //!Description: Used to determine the passive signature
143  //! characteristics of an entity
144  // Parameter: PropulsionPlantConfiguration PPC
145  //************************************
146  void SetPropulsionPlantConfiguration( KDIS::DATA_TYPE::ENUMS::PropulsionPlantConfiguration PPC );
147  KDIS::DATA_TYPE::ENUMS::PropulsionPlantConfiguration GetPropulsionPlantConfiguration() const;
148 
149  //************************************
150  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::GetNumberOfShafts
151  //!Description: Returns number of shafts on platform
152  //************************************
153  KUINT8 GetNumberOfShafts() const;
154 
155  //************************************
156  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::GetNumberOfAPA
157  //!Description: Returns number of APA.
158  //************************************
159  KUINT8 GetNumberOfAPA() const;
160 
161  //************************************
162  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::GetNumberOfUAEmitterSystems
163  //!Description: Returns number of UA emitter systems.
164  //************************************
165  KUINT8 GetNumberOfUAEmitterSystems() const;
166 
167  //************************************
168  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::AddShaft
169  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::SetShafts
170  // KDIS::PDU::Underwater_Acoustic_PDU::GetShafts
171  //!Description: Shafts belonging to the platform.
172  // Parameter: const vector<Shaft> & S
173  //************************************
174  void AddShaft( const KDIS::DATA_TYPE::Shaft & S );
175  void SetShafts( const std::vector<KDIS::DATA_TYPE::Shaft> & S );
176  const std::vector<KDIS::DATA_TYPE::Shaft> & GetShafts() const;
177 
178  //************************************
179  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::AddAPA
180  // KDIS::PDU::Underwater_Acoustic_PDU::SetAPA
181  // KDIS::PDU::Underwater_Acoustic_PDU::GetAPA
182  //!Description: Additional Passive Activity ( APA )
183  // Parameter: const APA & A, const vector<APA> & A
184  //************************************
185  void AddAPA( const KDIS::DATA_TYPE::APA & A );
186  void SetAPA( const std::vector<KDIS::DATA_TYPE::APA> & A );
187  const std::vector<KDIS::DATA_TYPE::APA> & GetAPA() const;
188 
189  //************************************
190  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::AddUnderwaterAcousticEmitterSystem
191  // KDIS::PDU::Underwater_Acoustic_PDU::SetUnderwaterAcousticEmitterSystem
192  // KDIS::PDU::Underwater_Acoustic_PDU::GetUnderwaterAcousticEmitterSystem
193  //!Description: Adds a system to the platform.
194  // Parameter: const UnderwaterAcousticEmitterSystem & UAES, const vector<UnderwaterAcousticEmitterSystem> & UAES
195  //************************************
196  void AddUnderwaterAcousticEmitterSystem( const KDIS::DATA_TYPE::UnderwaterAcousticEmitterSystem & UAES );
197  void SetUnderwaterAcousticEmitterSystem( const std::vector<KDIS::DATA_TYPE::UnderwaterAcousticEmitterSystem> & UAES );
198  const std::vector<KDIS::DATA_TYPE::UnderwaterAcousticEmitterSystem> & GetUnderwaterAcousticEmitterSystem() const;
199 
200  //************************************
201  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::GetAsString
202  //!Description: Returns a string representation of the PDU.
203  //************************************
204  virtual KString GetAsString() const;
205 
206  //************************************
207  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::Decode
208  //!Description: Convert From Network Data.
209  // Parameter: KDataStream & stream
210  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
211  //************************************
212  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
213 
214  //************************************
215  // FullName: KDIS::PDU::Underwater_Acoustic_PDU::Encode
216  //!Description: Convert To Network Data.
217  // Parameter: KDataStream & stream
218  //************************************
219  virtual KDataStream Encode() const;
220  virtual void Encode( KDataStream & stream ) const;
221 
222  KBOOL operator == ( const Underwater_Acoustic_PDU & Value ) const;
223  KBOOL operator != ( const Underwater_Acoustic_PDU & Value ) const;
224 };
225 
226 } // END namespace PDU
227 } // END namespace KDIS
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT8 m_ui8Padding1
Definition: Underwater_Acoustic_PDU.h:63
Definition: UnderwaterAcousticEmitterSystem.h:49
KUINT8 m_ui8NumEmitterSys
Definition: Underwater_Acoustic_PDU.h:73
KDIS::DATA_TYPE::EntityIdentifier m_EventID
Definition: Underwater_Acoustic_PDU.h:59
KUINT8 m_ui8StateUpdateIndicator
Definition: Underwater_Acoustic_PDU.h:61
Definition: KDefines.h:182
Definition: KDataStream.h:48
bool KBOOL
Definition: KDefines.h:119
KUINT8 m_ui8PropPlantConfig
Definition: Underwater_Acoustic_PDU.h:67
std::vector< KDIS::DATA_TYPE::APA > m_vAPA
Definition: Underwater_Acoustic_PDU.h:77
KUINT16 m_ui16PassiveParamIndex
Definition: Underwater_Acoustic_PDU.h:65
std::string KString
Definition: KDefines.h:116
KDIS::DATA_TYPE::EntityIdentifier m_EmittingEntityID
Definition: Underwater_Acoustic_PDU.h:57
Definition: Underwater_Acoustic_PDU.h:53
Definition: EntityIdentifier.h:49
PropulsionPlantConfiguration
Definition: EnumEmitter.h:1392
PassiveParameterIndex
Definition: EnumEmitter.h:1348
KUINT8 m_ui8NumShafts
Definition: Underwater_Acoustic_PDU.h:69
Definition: Shaft.h:46
Definition: Header7.h:142
unsigned char KUINT8
Definition: KDefines.h:99
StateUpdateIndicator
Definition: EnumEmitter.h:1307
std::vector< KDIS::DATA_TYPE::UnderwaterAcousticEmitterSystem > m_vUAES
Definition: Underwater_Acoustic_PDU.h:79
KUINT8 m_ui8NumAPA
Definition: Underwater_Acoustic_PDU.h:71
std::vector< KDIS::DATA_TYPE::Shaft > m_vShafts
Definition: Underwater_Acoustic_PDU.h:75
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: APA.h:46