1 /*********************************************************************
2 Copyright 2013 Karl Jones
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
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.
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.
25 For Further Information Please Contact me at
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
30 #include "./VectoringNozzleSystem.h"
33 using namespace DATA_TYPE
;
34 using namespace ENUMS
;
36 //////////////////////////////////////////////////////////////////////////
38 //////////////////////////////////////////////////////////////////////////
40 VectoringNozzleSystem::VectoringNozzleSystem() :
46 //////////////////////////////////////////////////////////////////////////
48 VectoringNozzleSystem::VectoringNozzleSystem( KDataStream
& stream
)
53 //////////////////////////////////////////////////////////////////////////
55 VectoringNozzleSystem::VectoringNozzleSystem( KFLOAT32 HorizontalDeflectionAngle
, KFLOAT32 VerticalDeflectionAngle
) :
56 m_f32HDeflAngle( HorizontalDeflectionAngle
),
57 m_f32VDeflAngle( VerticalDeflectionAngle
)
61 //////////////////////////////////////////////////////////////////////////
63 VectoringNozzleSystem::~VectoringNozzleSystem()
67 //////////////////////////////////////////////////////////////////////////
69 void VectoringNozzleSystem::SetHorizontalDeflectionAngle( KFLOAT32 HDA
)
71 m_f32HDeflAngle
= HDA
;
74 //////////////////////////////////////////////////////////////////////////
76 KFLOAT32
VectoringNozzleSystem::GetHorizontalDeflectionAngle() const
78 return m_f32HDeflAngle
;
81 //////////////////////////////////////////////////////////////////////////
83 void VectoringNozzleSystem::SetVerticalDeflectionAngle( KFLOAT32 VDA
)
85 m_f32VDeflAngle
= VDA
;
88 //////////////////////////////////////////////////////////////////////////
90 KFLOAT32
VectoringNozzleSystem::GetVerticalDeflectionAngle() const
92 return m_f32VDeflAngle
;
95 //////////////////////////////////////////////////////////////////////////
97 KString
VectoringNozzleSystem::GetAsString() const
101 ss
<< "Vectoring Nozzle System:"
102 << "\n\tHorizontal Deflection Angle: " << m_f32HDeflAngle
103 << "\n\tVertical Deflection Angle: " << m_f32VDeflAngle
109 //////////////////////////////////////////////////////////////////////////
111 void VectoringNozzleSystem::Decode( KDataStream
& stream
)
113 if( stream
.GetBufferSize() < VECTORING_NOZZLE_SYSTEM_SIZE
)throw KException( __FUNCTION__
, NOT_ENOUGH_DATA_IN_BUFFER
);
115 stream
>> m_f32HDeflAngle
119 //////////////////////////////////////////////////////////////////////////
121 KDataStream
VectoringNozzleSystem::Encode() const
125 VectoringNozzleSystem::Encode( stream
);
130 //////////////////////////////////////////////////////////////////////////
132 void VectoringNozzleSystem::Encode( KDataStream
& stream
) const
134 stream
<< m_f32HDeflAngle
138 //////////////////////////////////////////////////////////////////////////
140 KBOOL
VectoringNozzleSystem::operator == ( const VectoringNozzleSystem
& Value
) const
142 if( m_f32HDeflAngle
!= Value
.m_f32HDeflAngle
) return false;
143 if( m_f32VDeflAngle
!= Value
.m_f32VDeflAngle
) return false;
147 //////////////////////////////////////////////////////////////////////////
149 KBOOL
VectoringNozzleSystem::operator != ( const VectoringNozzleSystem
& Value
) const
151 return !( *this == Value
);
154 //////////////////////////////////////////////////////////////////////////