CigiHatHotReqV3_2 Class Reference

#include <CigiHatHotReqV3_2.h>

Inheritance diagram for CigiHatHotReqV3_2:

CigiBaseHatHotReq CigiBasePacket List of all members.

Public Member Functions

 CigiHatHotReqV3_2 ()
virtual ~CigiHatHotReqV3_2 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)
virtual int GetCnvt (CigiVersionID &CnvtVersion, CigiCnvtInfoType::Type &CnvtInfo)
int SetReqType (const ReqTypeGrp ReqTypeIn, bool bndchk=true)
ReqTypeGrp GetReqType (void) const
int SetSrcCoordSys (const CoordSysGrp SrcCoordSysIn, bool bndchk=true)
CoordSysGrp GetSrcCoordSys (void) const
int SetUpdatePeriod (const Cigi_uint8 UpdatePeriodIn, bool bndchk=true)
Cigi_uint8 GetUpdatePeriod (void) const
int SetEntityID (const Cigi_uint16 EntityIDIn, bool bndchk=true)
Cigi_uint16 GetEntityID (void) const
int SetXoff (const double XoffIn, bool bndchk=true)
double GetXoff (void) const
int SetYoff (const double YoffIn, bool bndchk=true)
double GetYoff (void) const
int SetAlt (const double AltIn, bool bndchk=true)
double GetAlt (void) const
int SetZoff (const double ZoffIn, bool bndchk=true)
double GetZoff (void) const

Detailed Description

Definition at line 56 of file CigiHatHotReqV3_2.h.


Constructor & Destructor Documentation

CigiHatHotReqV3_2::CigiHatHotReqV3_2 (  ) 

General Constructor

Definition at line 68 of file CigiHatHotReqV3_2.cpp.

References CigiBaseHatHotReq::AltOrZoff, CIGI_HAT_HOT_REQ_PACKET_ID_V3_2, CIGI_HAT_HOT_REQ_PACKET_SIZE_V3_2, CigiBaseHatHotReq::EntityID, CigiBaseHatHotReq::Geodetic, CigiBaseHatHotReq::HAT, CigiBaseHatHotReq::HatHotID, CigiBaseHatHotReq::IsValidV1or2, CigiBaseHatHotReq::LatOrXoff, CigiBaseHatHotReq::LonOrYoff, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseHatHotReq::ReqType, CigiBaseHatHotReq::SrcCoordSys, CigiBaseHatHotReq::UpdatePeriod, and CigiBasePacket::Version.

00069 {
00070 
00071    PacketID = CIGI_HAT_HOT_REQ_PACKET_ID_V3_2;
00072    PacketSize = CIGI_HAT_HOT_REQ_PACKET_SIZE_V3_2;
00073    Version = 3;
00074    MinorVersion = 2;
00075 
00076    HatHotID = 0;
00077    ReqType = HAT;
00078    SrcCoordSys = Geodetic;
00079    UpdatePeriod = 0;
00080    EntityID = 0;
00081    LatOrXoff = 0.0;
00082    LonOrYoff = 0.0;
00083    AltOrZoff = 0.0;
00084    IsValidV1or2 = true;
00085 
00086 }

CigiHatHotReqV3_2::~CigiHatHotReqV3_2 (  )  [virtual]

General Destructor

Definition at line 91 of file CigiHatHotReqV3_2.cpp.

00092 {
00093 
00094 }


Member Function Documentation

double CigiHatHotReqV3_2::GetAlt ( void   )  const [inline]

Gets the Alt value.

Returns:
the current Alt.

Definition at line 269 of file CigiHatHotReqV3_2.h.

00269 { return(AltOrZoff); }

int CigiHatHotReqV3_2::GetCnvt ( CigiVersionID CnvtVersion,
CigiCnvtInfoType::Type CnvtInfo 
) [virtual]

A virtual Conversion Information function. This function provides conversion information for this packet.

Parameters:
CnvtVersion - The CIGI version to which this packet is being converted.
CnvtInfo - The information needed for conversion
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Reimplemented from CigiBasePacket.

Definition at line 183 of file CigiHatHotReqV3_2.cpp.

References CIGI_HAT_HOT_REQ_PACKET_ID_V3, CIGI_HAT_REQ_PACKET_ID_V1, CIGI_HAT_REQ_PACKET_ID_V2, CIGI_HOT_REQ_PACKET_ID_V2, CIGI_SUCCESS, CigiVersionID::CigiMajorVersion, CigiCnvtInfoType::CigiCnvtInfoStruct::CnvtPacketID, CigiBaseHatHotReq::HAT, CigiCnvtInfoType::CigiCnvtInfoStruct::ProcID, CigiBaseHatHotReq::ReqType, and CigiProcessType::TwoPassCnvtProcStd.

00185 {
00186    CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd;
00187 
00188    switch(CnvtVersion.CigiMajorVersion)
00189    {
00190    case 1:
00191       CnvtInfo.CnvtPacketID = CIGI_HAT_REQ_PACKET_ID_V1;
00192       break;
00193    case 2:
00194       if(ReqType == CigiBaseHatHotReq::HAT)
00195          CnvtInfo.CnvtPacketID = CIGI_HAT_REQ_PACKET_ID_V2;
00196       else
00197          CnvtInfo.CnvtPacketID = CIGI_HOT_REQ_PACKET_ID_V2;
00198       break;
00199    default:
00200       // The Packet ID for all V3 HatHotReq are the same ID
00201       CnvtInfo.CnvtPacketID = CIGI_HAT_HOT_REQ_PACKET_ID_V3;
00202       break;
00203    }
00204 
00205    return(CIGI_SUCCESS);
00206 }

Cigi_uint16 CigiHatHotReqV3_2::GetEntityID ( void   )  const [inline]

Gets the EntityID value.

Returns:
the current EntityID.

Definition at line 202 of file CigiHatHotReqV3_2.h.

00202 { return(EntityID); }

ReqTypeGrp CigiHatHotReqV3_2::GetReqType ( void   )  const [inline]

Gets the ReqType value.

Returns:
the current ReqType.

Definition at line 137 of file CigiHatHotReqV3_2.h.

00137 { return(ReqType); }

CoordSysGrp CigiHatHotReqV3_2::GetSrcCoordSys ( void   )  const [inline]

Gets the SrcCoordSys value.

Returns:
the current SrcCoordSys.

Definition at line 156 of file CigiHatHotReqV3_2.h.

00156 { return(SrcCoordSys); }

Cigi_uint8 CigiHatHotReqV3_2::GetUpdatePeriod ( void   )  const [inline]

Gets the Update Period value.

Returns:
The number of frames between each hat/hot response from the IG. If zero - the IG should only respond with one hat/hot response.

Definition at line 181 of file CigiHatHotReqV3_2.h.

00181 { return(UpdatePeriod); }

double CigiHatHotReqV3_2::GetXoff ( void   )  const [inline]

Gets the Xoff value.

Returns:
the current Xoff.

Definition at line 225 of file CigiHatHotReqV3_2.h.

00225 { return(LatOrXoff); }

double CigiHatHotReqV3_2::GetYoff ( void   )  const [inline]

Gets the Yoff value.

Returns:
the current Yoff.

Definition at line 248 of file CigiHatHotReqV3_2.h.

00248 { return(LonOrYoff); }

double CigiHatHotReqV3_2::GetZoff ( void   )  const [inline]

Gets the Zoff value.

Returns:
the current Zoff.

Definition at line 292 of file CigiHatHotReqV3_2.h.

00292 { return(AltOrZoff); }

int CigiHatHotReqV3_2::Pack ( CigiBasePacket Base,
Cigi_uint8 Buff,
void *  Spec 
) const [virtual]

The virtual Pack function for CIGI 3

Parameters:
Base - A pointer to the instance of the packet to be packed. (Downcast to CigiBasePacket)
Buff - A pointer to the current pack point.
Spec - A pointer to special data - This is not used in this class.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseHatHotReq.

Definition at line 103 of file CigiHatHotReqV3_2.cpp.

References CigiBaseHatHotReq::AltOrZoff, PackPointerUnion::c, PackPointerUnion::d, CigiBaseHatHotReq::EntityID, CigiBaseHatHotReq::HatHotID, CigiBaseHatHotReq::LatOrXoff, CigiBaseHatHotReq::LonOrYoff, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseHatHotReq::ReqType, PackPointerUnion::s, CigiBaseHatHotReq::SrcCoordSys, and CigiBaseHatHotReq::UpdatePeriod.

00104 {
00105    PackPointer CDta;
00106 
00107    CigiBaseHatHotReq * Data = ( CigiBaseHatHotReq *)Base;
00108 
00109    CDta.c = Buff;
00110 
00111    *CDta.c++ = PacketID;
00112    *CDta.c++ = PacketSize;
00113 
00114    *CDta.s++ = Data->HatHotID;
00115 
00116    Cigi_uint8 HDta = (Cigi_uint8)(Data->ReqType & 0x03);
00117    HDta |= (Cigi_uint8)((Data->SrcCoordSys << 2) & 0x04);
00118    *CDta.c++ = HDta;
00119 
00120    *CDta.c++ = Data->UpdatePeriod;
00121 
00122    *CDta.s++ = Data->EntityID;
00123    *CDta.d++ = Data->LatOrXoff;
00124    *CDta.d++ = Data->LonOrYoff;
00125    *CDta.d++ = Data->AltOrZoff;
00126 
00127    return(PacketSize);
00128 
00129 }

int CigiHatHotReqV3_2::SetAlt ( const double  AltIn,
bool  bndchk = true 
) [inline]

Sets the Alt with bound checking control

Parameters:
AltIn - The altitude of the request point
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 260 of file CigiHatHotReqV3_2.h.

References CIGI_SUCCESS.

00261    {
00262       AltOrZoff = AltIn;
00263       return(CIGI_SUCCESS);
00264    }

int CigiHatHotReqV3_2::SetEntityID ( const Cigi_uint16  EntityIDIn,
bool  bndchk = true 
) [inline]

Sets the EntityID with bound checking control

Parameters:
EntityIDIn - The ID of the Origin Entity
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 193 of file CigiHatHotReqV3_2.h.

References CIGI_SUCCESS.

00194    {
00195       EntityID = EntityIDIn;
00196       return(CIGI_SUCCESS);
00197    }

int CigiHatHotReqV3_2::SetReqType ( const ReqTypeGrp  ReqTypeIn,
bool  bndchk = true 
)

Sets the ReqType with bound checking control

Parameters:
ReqTypeIn - The type of request and response desired
HAT=0
HOT=1
Extended=2
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 218 of file CigiHatHotReqV3_2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseHatHotReq::ReqType.

00219 {
00220 
00221 #ifndef CIGI_NO_BND_CHK
00222    if(bndchk && ((ReqTypeIn < 0)||(ReqTypeIn > 2)))
00223    {
00224 #ifndef CIGI_NO_EXCEPT
00225       throw CigiValueOutOfRangeException("ReqType",(ReqTypeGrp)ReqTypeIn,0,2);
00226 #endif
00227       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00228    }
00229 #endif
00230 
00231    ReqType = ReqTypeIn;
00232    return(CIGI_SUCCESS);
00233 
00234 }

int CigiHatHotReqV3_2::SetSrcCoordSys ( const CoordSysGrp  SrcCoordSysIn,
bool  bndchk = true 
)

Sets the SrcCoordSys with bound checking control

Parameters:
SrcCoordSysIn - The Coordinate system of the point data
Geodetic=0
Entity=1
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 240 of file CigiHatHotReqV3_2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseHatHotReq::SrcCoordSys.

00241 {
00242 
00243 #ifndef CIGI_NO_BND_CHK
00244    if(bndchk && ((SrcCoordSysIn < 0)||(SrcCoordSysIn > 1)))
00245    {
00246 #ifndef CIGI_NO_EXCEPT
00247       throw CigiValueOutOfRangeException("SrcCoordSys",(CoordSysGrp)SrcCoordSysIn,0,1);
00248 #endif
00249       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00250    }
00251 #endif
00252 
00253    SrcCoordSys = SrcCoordSysIn;
00254    return(CIGI_SUCCESS);
00255 
00256 }

int CigiHatHotReqV3_2::SetUpdatePeriod ( const Cigi_uint8  UpdatePeriodIn,
bool  bndchk = true 
) [inline]

Sets the UpdatePeriod with bound checking control

Parameters:
UpdatePeriodIn - The number of frames between each hat/hot response from the IG. If zero - the IG should only respond with one hat/hot response.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 170 of file CigiHatHotReqV3_2.h.

References CIGI_SUCCESS.

00171    {
00172       UpdatePeriod = UpdatePeriodIn;
00173       return(CIGI_SUCCESS);
00174    }

int CigiHatHotReqV3_2::SetXoff ( const double  XoffIn,
bool  bndchk = true 
) [inline]

Sets the Xoff with bound checking control

Parameters:
XoffIn - The position of the request point specified as an offset along the X axis of the origin entity and measured from the origin of that entity.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 216 of file CigiHatHotReqV3_2.h.

References CIGI_SUCCESS.

00217    {
00218       LatOrXoff = XoffIn;
00219       return(CIGI_SUCCESS);
00220    }

int CigiHatHotReqV3_2::SetYoff ( const double  YoffIn,
bool  bndchk = true 
) [inline]

Sets the Yoff with bound checking control

Parameters:
YoffIn - The position of the request point specified as an offset along the Y axis of the origin entity and measured from the origin of that entity.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 239 of file CigiHatHotReqV3_2.h.

References CIGI_SUCCESS.

00240    {
00241       LonOrYoff = YoffIn;
00242       return(CIGI_SUCCESS);
00243    }

int CigiHatHotReqV3_2::SetZoff ( const double  ZoffIn,
bool  bndchk = true 
) [inline]

Sets the Zoff with bound checking control

Parameters:
ZoffIn - The position of the request point specified as an offset along the Z axis of the origin entity and measured from the origin of that entity.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 283 of file CigiHatHotReqV3_2.h.

References CIGI_SUCCESS.

00284    {
00285       AltOrZoff = ZoffIn;
00286       return(CIGI_SUCCESS);
00287    }

int CigiHatHotReqV3_2::Unpack ( Cigi_uint8 Buff,
bool  Swap,
void *  Spec 
) [virtual]

The virtual Unpack function for CIGI 3

Parameters:
Buff - A pointer to the current pack point.
Swap - N/A for V1 & V2
Spec - A pointer to special data - This is not used in this class.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseHatHotReq.

Definition at line 134 of file CigiHatHotReqV3_2.cpp.

References CigiBaseHatHotReq::AltOrZoff, PackPointerUnion::c, CigiSwap2(), CigiSwap8(), PackPointerUnion::d, CigiBaseHatHotReq::EntityID, CigiBaseHatHotReq::Geodetic, CigiBaseHatHotReq::HatHotID, CigiBaseHatHotReq::IsValidV1or2, CigiBaseHatHotReq::LatOrXoff, CigiBaseHatHotReq::LonOrYoff, CigiBasePacket::PacketSize, CigiBaseHatHotReq::ReqType, PackPointerUnion::s, CigiBaseHatHotReq::SrcCoordSys, and CigiBaseHatHotReq::UpdatePeriod.

00135 {
00136    PackPointer CDta;
00137 
00138    CDta.c = Buff;
00139 
00140    CDta.c += 2;  // Step over packet id and size
00141 
00142    if(!Swap)
00143    {
00144       HatHotID = *CDta.s++;
00145 
00146       Cigi_uint8 HDta = *CDta.c++;
00147       ReqType = (ReqTypeGrp)(HDta & 0x03);
00148       SrcCoordSys = (CoordSysGrp)((HDta >> 2) & 0x01);
00149 
00150       UpdatePeriod = *CDta.c++;
00151 
00152       EntityID = *CDta.s++;
00153       LatOrXoff = *CDta.d++;
00154       LonOrYoff = *CDta.d++;
00155       AltOrZoff = *CDta.d++;
00156    }
00157    else
00158    {
00159       CigiSwap2(&HatHotID, CDta.s++);
00160 
00161       Cigi_uint8 HDta = *CDta.c++;
00162       ReqType = (ReqTypeGrp)(HDta & 0x03);
00163       SrcCoordSys = (CoordSysGrp)((HDta >> 2) & 0x01);
00164 
00165       UpdatePeriod = *CDta.c++;
00166 
00167       CigiSwap2(&EntityID, CDta.s++);
00168       CigiSwap8(&LatOrXoff, CDta.d++);
00169       CigiSwap8(&LonOrYoff, CDta.d++);
00170       CigiSwap8(&AltOrZoff, CDta.d++);
00171    }
00172 
00173    IsValidV1or2 = (SrcCoordSys == Geodetic);
00174 
00175    return(PacketSize);
00176 
00177 }


The documentation for this class was generated from the following files:
Generated on Wed Apr 29 09:00:08 2009 for CCL by  doxygen 1.4.7