KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PropulsionSystem.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: PropulsionSystem
32  created: 2009/01/15
33  author: Karl Jones
34 
35  purpose: Contains infomation describin the propulsion system
36  of the entity.
37  size: 64 bits / 8 octets
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./DataTypeBase.h"
43 
44 namespace KDIS {
45 namespace DATA_TYPE {
46 
48 {
49 protected:
50 
52 
54 
55 public:
56 
57  static const KUINT16 PROPULSION_SYSTEM_SIZE = 8;
58 
60 
61  PropulsionSystem( KDataStream & stream ) throw( KException );
62 
63  PropulsionSystem( KFLOAT32 PowerSetting, KFLOAT32 EngineRPM );
64 
65  virtual ~PropulsionSystem();
66 
67  //************************************
68  // FullName: KDIS::DATA_TYPE::PropulsionSystem::SetPowerSetting
69  // KDIS::DATA_TYPE::PropulsionSystem::GetPowerSetting
70  //!Description: The power settings after any response lags have been incorprated.
71  // Parameter: KFLOAT32 PS, PowerSetting PS
72  //************************************
73  void SetPowerSetting( KFLOAT32 PS );
74  void SetPowerSetting( KDIS::DATA_TYPE::ENUMS::PowerSettingAircraft PS );
75  void SetPowerSetting( KDIS::DATA_TYPE::ENUMS::PowerSettingHelicopter PS );
77  KFLOAT32 GetPowerSetting() const;
78 
79  //************************************
80  // FullName: KDIS::DATA_TYPE::PropulsionSystem::SetEngineRPM
81  // KDIS::DATA_TYPE::PropulsionSystem::GetEngineRPM
82  //!Description: Current engine speed in RPM
83  // Parameter: KFLOAT32 RPM, void
84  //************************************
85  void SetEngineRPM( KFLOAT32 RPM );
86  KFLOAT32 GetEngineRPM() const;
87 
88  //************************************
89  // FullName: KDIS::DATA_TYPE::PropulsionSystem::GetAsString
90  //!Description: Returns a string representation
91  //************************************
92  virtual KString GetAsString() const;
93 
94  //************************************
95  // FullName: KDIS::DATA_TYPE::PropulsionSystem::Decode
96  //!Description: Convert From Network Data.
97  // Parameter: KDataStream & stream
98  //************************************
99  virtual void Decode( KDataStream & stream ) throw( KException );
100 
101  //************************************
102  // FullName: KDIS::DATA_TYPE::PropulsionSystem::Encode
103  //!Description: Convert To Network Data.
104  // Parameter: KDataStream & stream
105  //************************************
106  virtual KDataStream Encode() const;
107  virtual void Encode( KDataStream & stream ) const;
108 
109  KBOOL operator == ( const PropulsionSystem & Value ) const;
110  KBOOL operator != ( const PropulsionSystem & Value ) const;
111 };
112 
113 } // END namespace DATA_TYPES
114 } // END namespace KDIS
115 
PowerSettingAircraft
Definition: EnumEmitter.h:1509
KFLOAT32 m_f32EngineRPM
Definition: PropulsionSystem.h:53
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: PropulsionSystem.h:47
float KFLOAT32
Definition: KDefines.h:113
ActiveEmissionParameterIndex
Definition: EnumEmitter.h:1469
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
PowerSettingHelicopter
Definition: EnumEmitter.h:1523
#define KDIS_EXPORT
Definition: KDefines.h:82
KFLOAT32 m_f32PowerSetting
Definition: PropulsionSystem.h:51