KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Mode5TransponderStatus.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: Mode5TransponderStatus
32  DIS: (7) 1278.1 - 2012
33  created: 3/03/2014
34  author: Karl Jones
35 
36  purpose:
37 
38  Size: 16 bits / 2 octet
39 *********************************************************************/
40 
41 #pragma once
42 
43 #include "./DataTypeBase.h"
44 
45 namespace KDIS {
46 namespace DATA_TYPE {
47 
49 {
50 protected:
51 
52  union
53  {
54  struct
55  {
56  KUINT16 m_ui16Reply : 4;
57  KUINT16 m_ui16LineTst : 1;
58  KUINT16 m_ui16AntennaSel : 2;
59  KUINT16 m_ui16CryptoCtrl : 1;
60  KUINT16 m_ui16LatLonAltSrc : 1;
61  KUINT16 m_ui16LocErrs : 1;
62  KUINT16 m_ui16PlatfrmTyp : 1;
63  KUINT16 m_ui16LvlSel : 1;
64  KUINT16 m_ui16Padding : 1;
65  KUINT16 m_ui16OnOff : 1;
66  KUINT16 m_ui16Dmg : 1;
67  KUINT16 m_ui16MalFnc : 1;
68  };
70 
71  } m_StatusUnion;
72 
73 public:
74 
75  static const KUINT16 MODE_5_TRANSPONDER_STATUS_SIZE = 2;
76 
78 
79  Mode5TransponderStatus( KDataStream & stream ) throw( KException );
80 
82  KBOOL LocationIncluded, KBOOL LocationErrorIncluded, KDIS::DATA_TYPE::ENUMS::PlatformType PT, KBOOL Lvl2Included,
83  KBOOL Status, KBOOL Dmg, KBOOL Malfnc );
84 
85  virtual ~Mode5TransponderStatus();
86 
87  //************************************
88  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetReply
89  // KDIS::DATA_TYPE::Mode5TransponderStatus::GetReply
90  //!Description: Specifies the validity of a reply that would be transmitted
91  //! by a Mode 5 transponder if interrogated.
92  // Parameter: KDIS::DATA_TYPE::ENUMS::Mode5Reply R
93  //************************************
94  void SetReply( KDIS::DATA_TYPE::ENUMS::Mode5Reply R );
95  KDIS::DATA_TYPE::ENUMS::Mode5Reply GetReply() const;
96 
97  //************************************
98  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetLineTestInProgress
99  // KDIS::DATA_TYPE::Mode5TransponderStatus::IsLineTestInProgress
100  //!Description: Indicates whether a line test is in progress(true) or not(false).
101  // Parameter: KBOOL LT
102  //************************************
103  void SetLineTestInProgress( KBOOL LT );
104  KBOOL IsLineTestInProgress() const;
105 
106  //************************************
107  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetAntennaSelection
108  // KDIS::DATA_TYPE::Mode5TransponderStatus::GetAntennaSelection
109  //!Description: The present Mode 5 transponder antenna selection.
110  // Parameter: KDIS::DATA_TYPE::ENUMS::AntennaSelection AS
111  //************************************
112  void SetAntennaSelection( KDIS::DATA_TYPE::ENUMS::AntennaSelection AS );
113  KDIS::DATA_TYPE::ENUMS::AntennaSelection GetAntennaSelection() const;
114 
115  //************************************
116  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetCryptoControlPresent
117  // KDIS::DATA_TYPE::Mode5TransponderStatus::IsCryptoControlPresent
118  //!Description: Indicate whether the Crypto Control IFF Data record is
119  //! included to indicate that pseudo crypto control is present.
120  // Parameter: KBOOL CC
121  //************************************
122  void SetCryptoControlPresent( KBOOL CC );
123  KBOOL IsCryptoControlPresent() const;
124 
125  //************************************
126  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetLocationRecordPresent
127  // KDIS::DATA_TYPE::Mode5TransponderStatus::IsLocationRecordPresent
128  //!Description: Indicates the source of Mode 5 latitude, longitude, and altitude information.
129  //! Set to Compute Locally (false) or to Mode 5 Transponder Location IFF
130  //! Record Present (true).
131  // Parameter: KBOOL LRP
132  //************************************
133  void SetLocationRecordPresent( KBOOL LRP );
134  KBOOL IsLocationRecordPresent() const;
135 
136  //************************************
137  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetLocationErrorRecordPresent
138  // KDIS::DATA_TYPE::Mode5TransponderStatus::IsLocationErrorRecordPresent
139  //!Description: Indicates whether there are location errors associated with Mode 5 latitude,
140  //! longitude, or altitude.
141  //! Set to No Location Errors (false) or to Transponder Location Error IFF Data
142  //! Record Present(true).
143  // Parameter: KBOOL LERP
144  //************************************
145  void SetLocationErrorRecordPresent( KBOOL LERP );
146  KBOOL IsLocationErrorRecordPresent() const;
147 
148  //************************************
149  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetPlatformType
150  // KDIS::DATA_TYPE::Mode5TransponderStatus::GetPlatformType
151  //!Description: Indicate the type of platform (air or ground) that is associated
152  //! this Mode 5 transponder.
153  //! Set as follows:
154  //! 1) Ground Vehicle (0) if the Entity Type record, Domain field is
155  //! Land (1) regardless of whether the entity is actually a land vehicle or
156  // some other type of land platform.
157  // 2) Air Vehicle (1) if the Entity Type record, Domain field is Air (2)
158  // regardless of whether the entity is actually an aircraft or some other
159  // type of air platform (e.g., a blimp).
160  // Parameter: PlatformType PT
161  //************************************
162  void SetPlatformType( KDIS::DATA_TYPE::ENUMS::PlatformType PT );
163  KDIS::DATA_TYPE::ENUMS::PlatformType GetPlatformType() const;
164 
165  //************************************
166  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetMode5Level2Included
167  // KDIS::DATA_TYPE::Mode5TransponderStatus::IsMode5Level2Included
168  //!Description: Indicates whether Mode 5 Level 1 (false) or Mode 5 Level 2 (true) is
169  //! currently selected for this Mode 5 transponder. (The Level 2 selection
170  //! includes both Level 1 and Level 2 message formats.)
171  // Parameter: KBOOL M
172  //************************************
173  void SetMode5Level2Included( KBOOL M );
174  KBOOL IsMode5Level2Included() const;
175 
176  //************************************
177  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetStatus
178  // KDIS::DATA_TYPE::Mode5TransponderStatus::GetStatus
179  //!Description: Indicates whether the Mode 5 transponder is On (true or Off (false).
180  // Parameter: KBOOL S
181  //************************************
182  void SetStatus( KBOOL S );
183  KBOOL GetStatus() const;
184 
185  //************************************
186  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetDamaged
187  // KDIS::DATA_TYPE::Mode5TransponderStatus::IsDamaged
188  //!Description: Indicates whether there is damage to the Mode 5 transponder.
189  // Parameter: KBOOL S
190  //************************************
191  void SetDamaged( KBOOL D );
192  KBOOL IsDamaged() const;
193 
194  //************************************
195  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::SetMalfunctioning
196  // KDIS::DATA_TYPE::Mode5TransponderStatus::IsMalfunctioning
197  //!Description: Indicates whether there is damage to the Mode 5 transponder.
198  // Parameter: KBOOL M
199  //************************************
200  void SetMalfunctioning( KBOOL M );
201  KBOOL IsMalfunctioning() const;
202 
203  //************************************
204  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::GetAsString
205  //!Description: Returns a string representation
206  //************************************
207  virtual KString GetAsString() const;
208 
209  //************************************
210  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::Decode
211  //!Description: Convert From Network Data.
212  // Parameter: KDataStream & stream
213  //************************************
214  virtual void Decode( KDataStream & stream ) throw( KException );
215 
216  //************************************
217  // FullName: KDIS::DATA_TYPE::Mode5TransponderStatus::Encode
218  //!Description: Convert To Network Data.
219  // Parameter: KDataStream & stream
220  //************************************
221  virtual KDataStream Encode() const;
222  virtual void Encode( KDataStream & stream ) const;
223 
224  KBOOL operator == ( const Mode5TransponderStatus & Value ) const;
225  KBOOL operator != ( const Mode5TransponderStatus & Value ) const;
226 };
227 
228 } // END namespace DATA_TYPE
229 } // END namespace KDIS
Mode5Reply
Definition: EnumIFF.h:113
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
PlatformType
Definition: EnumIFF.h:154
Definition: Mode5TransponderStatus.h:48
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
KUINT16 m_ui16Status
Definition: Mode5TransponderStatus.h:69
AntennaSelection
Definition: EnumIFF.h:133
#define KDIS_EXPORT
Definition: KDefines.h:82