KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Mode5InterrogatorStatus.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: Mode5InterrogatorStatus
32  DIS: (7) 1278.1 - 2012
33  created: 30/09/2013
34  author: Karl Jones
35 
36  purpose: Provides Mode 5 interrogator information.
37  Knowledge of AIMS 03-1000A, and specific interrogator model specifications are
38  required to properly implement these fields.
39 
40  Size: 8 bits / 1 octet
41 *********************************************************************/
42 
43 #pragma once
44 
45 #include "./DataTypeBase.h"
46 
47 namespace KDIS {
48 namespace DATA_TYPE {
49 
51 {
52 protected:
53 
54  union
55  {
56  struct
57  {
58  KUINT8 m_ui8IffMis : 3;
59  KUINT8 m_ui8MsgFrmt : 1;
60  KUINT8 m_ui8Padding : 1;
61  KUINT8 m_ui8OnOff : 1;
62  KUINT8 m_ui8Dmg : 1;
63  KUINT8 m_ui8MalFnc : 1;
64  };
66  } m_StatusUnion;
67 
68 public:
69 
70  static const KUINT16 MODE_5_INTERROGATOR_STATUS_SIZE = 1;
71 
73 
74  Mode5InterrogatorStatus( KDataStream & stream ) throw( KException );
75 
77  KBOOL OnOffStatus, KBOOL Damaged, KBOOL Malfunction );
78 
79  virtual ~Mode5InterrogatorStatus();
80 
81  //************************************
82  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorStatus::SetIFFMission
83  // KDIS::DATA_TYPE::Mode5InterrogatorStatus::GetIFFMIssion
84  //!Description: 3 bit enum field used to identify the IFF mission of this Mode 5 interrogator.
85  //! Refer to AIMS 03-1000A to determine the applicable IFF mission.
86  // Parameter: KUINT8 IFFM - Exception thrown if greater than 7.
87  //************************************
88  void SetIFFMission( KUINT8 IFFM ) throw( KException );
89  KUINT8 GetIFFMIssion() const;
90 
91  //************************************
92  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorStatus::SetMode5MessageFormat
93  // KDIS::DATA_TYPE::Mode5InterrogatorStatus::GetMode5MessageFormat
94  //!Description: Indicates whether the Mode 5 Message Formats record is a Capability or
95  //! an Active Interrogation.
96  // Parameter: KDIS::DATA_TYPE::ENUMS::Mode5MessageFormat MF
97  //************************************
98  void SetMode5MessageFormat( KDIS::DATA_TYPE::ENUMS::Mode5MessageFormat MF );
99  KDIS::DATA_TYPE::ENUMS::Mode5MessageFormat GetMode5MessageFormat() const;
100 
101  //************************************
102  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorStatus::SetOnOffStatus
103  // KDIS::DATA_TYPE::Mode5InterrogatorStatus::GetOnOffStatus
104  //!Description: Indicates whether the Mode 5 interrogation capability is On(true) or Off (false).
105  // Parameter: KBOOL OOS
106  //************************************
107  void SetOnOffStatus( KBOOL OOS );
108  KBOOL GetOnOffStatus() const;
109 
110  //************************************
111  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorStatus::SetDamaged
112  // KDIS::DATA_TYPE::Mode5InterrogatorStatus::IsDamaged
113  //!Description: Indicate whether there is damage to the Mode 5 interrogation capability.
114  // Parameter: KBOOL D - Damaged(true) / not damaged(false).
115  //************************************
116  void SetDamaged( KBOOL D );
117  KBOOL IsDamaged() const;
118 
119  //************************************
120  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorStatus::SetMalfunction
121  // KDIS::DATA_TYPE::Mode5InterrogatorStatus::HasMalfunction
122  //!Description: Indicate whether there is a malfunction of the Mode 5 interrogation capability.
123  // Parameter: KBOOL M - Malfunction(true) / No Malfunction(false).
124  //************************************
125  void SetMalfunction( KBOOL M );
126  KBOOL HasMalfunction() const;
127 
128  //************************************
129  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorStatus::GetAsString
130  //!Description: Returns a string representation
131  //************************************
132  virtual KString GetAsString() const;
133 
134  //************************************
135  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorStatus::Decode
136  //!Description: Convert From Network Data.
137  // Parameter: KDataStream & stream
138  //************************************
139  virtual void Decode( KDataStream & stream ) throw( KException );
140 
141  //************************************
142  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorStatus::Encode
143  //!Description: Convert To Network Data.
144  // Parameter: KDataStream & stream
145  //************************************
146  virtual KDataStream Encode() const;
147  virtual void Encode( KDataStream & stream ) const;
148 
149  KBOOL operator == ( const Mode5InterrogatorStatus & Value ) const;
150  KBOOL operator != ( const Mode5InterrogatorStatus & Value ) const;
151 };
152 
153 } // END namespace DATA_TYPE
154 } // END namespace KDIS
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
Definition: Mode5InterrogatorStatus.h:50
std::string KString
Definition: KDefines.h:116
Mode5MessageFormat
Definition: EnumIFF.h:94
unsigned char KUINT8
Definition: KDefines.h:99
KUINT8 m_ui8Status
Definition: Mode5InterrogatorStatus.h:65
#define KDIS_EXPORT
Definition: KDefines.h:82