CigiHatHotReqV3 Class Reference

#include <CigiHatHotReqV3.h>

Inheritance diagram for CigiHatHotReqV3:

CigiBaseHatHotReq CigiBasePacket List of all members.

Public Member Functions

 CigiHatHotReqV3 ()
virtual ~CigiHatHotReqV3 ()
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 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 62 of file CigiHatHotReqV3.h.


Constructor & Destructor Documentation

CigiHatHotReqV3::CigiHatHotReqV3 (  ) 

General Constructor

Definition at line 77 of file CigiHatHotReqV3.cpp.

References CigiBaseHatHotReq::AltOrZoff, CIGI_HAT_HOT_REQ_PACKET_ID_V3, CIGI_HAT_HOT_REQ_PACKET_SIZE_V3, 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.

00078 {
00079 
00080    PacketID = CIGI_HAT_HOT_REQ_PACKET_ID_V3;
00081    PacketSize = CIGI_HAT_HOT_REQ_PACKET_SIZE_V3;
00082    Version = 3;
00083    MinorVersion = 0;
00084 
00085    HatHotID = 0;
00086    ReqType = HAT;
00087    SrcCoordSys = Geodetic;
00088    UpdatePeriod = 0;
00089    EntityID = 0;
00090    LatOrXoff = 0.0;
00091    LonOrYoff = 0.0;
00092    AltOrZoff = 0.0;
00093    IsValidV1or2 = true;
00094 
00095 }

CigiHatHotReqV3::~CigiHatHotReqV3 (  )  [virtual]

General Destructor

Definition at line 100 of file CigiHatHotReqV3.cpp.

00101 {
00102 
00103 }


Member Function Documentation

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

Gets the Alt value.

Returns:
the current Alt.

Definition at line 250 of file CigiHatHotReqV3.h.

00250 { return(AltOrZoff); }

int CigiHatHotReqV3::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 194 of file CigiHatHotReqV3.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.

00196 {
00197    CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd;
00198 
00199    switch(CnvtVersion.CigiMajorVersion)
00200    {
00201    case 1:
00202       CnvtInfo.CnvtPacketID = CIGI_HAT_REQ_PACKET_ID_V1;
00203       break;
00204    case 2:
00205       if(ReqType == CigiBaseHatHotReq::HAT)
00206          CnvtInfo.CnvtPacketID = CIGI_HAT_REQ_PACKET_ID_V2;
00207       else
00208          CnvtInfo.CnvtPacketID = CIGI_HOT_REQ_PACKET_ID_V2;
00209       break;
00210    default:
00211       // The Packet ID for all V3 HatHotReq are the same ID
00212       CnvtInfo.CnvtPacketID = CIGI_HAT_HOT_REQ_PACKET_ID_V3;
00213       break;
00214    }
00215 
00216    return(CIGI_SUCCESS);
00217 }

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

Gets the EntityID value.

Returns:
the current EntityID.

Definition at line 183 of file CigiHatHotReqV3.h.

00183 { return(EntityID); }

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

Gets the ReqType value.

Returns:
the current ReqType.

Definition at line 143 of file CigiHatHotReqV3.h.

00143 { return(ReqType); }

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

Gets the SrcCoordSys value.

Returns:
the current SrcCoordSys.

Definition at line 162 of file CigiHatHotReqV3.h.

00162 { return(SrcCoordSys); }

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

Gets the Xoff value.

Returns:
the current Xoff.

Definition at line 206 of file CigiHatHotReqV3.h.

00206 { return(LatOrXoff); }

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

Gets the Yoff value.

Returns:
the current Yoff.

Definition at line 229 of file CigiHatHotReqV3.h.

00229 { return(LonOrYoff); }

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

Gets the Zoff value.

Returns:
the current Zoff.

Definition at line 273 of file CigiHatHotReqV3.h.

00273 { return(AltOrZoff); }

int CigiHatHotReqV3::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 112 of file CigiHatHotReqV3.cpp.

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

00113 {
00114    PackPointer CDta;
00115 
00116    CigiBaseHatHotReq * Data = ( CigiBaseHatHotReq *)Base;
00117 
00118    CDta.c = Buff;
00119 
00120    *CDta.c++ = PacketID;
00121    *CDta.c++ = PacketSize;
00122 
00123    *CDta.s++ = Data->HatHotID;
00124 
00125    Cigi_uint8 HDta = (Cigi_uint8)(Data->ReqType & 0x03);
00126    HDta |= (Cigi_uint8)((Data->SrcCoordSys << 2) & 0x04);
00127    *CDta.c++ = HDta;
00128 
00129    *CDta.c++ = 0;
00130 
00131    *CDta.s++ = Data->EntityID;
00132    *CDta.d++ = Data->LatOrXoff;
00133    *CDta.d++ = Data->LonOrYoff;
00134    *CDta.d++ = Data->AltOrZoff;
00135 
00136    return(PacketSize);
00137 
00138 }

int CigiHatHotReqV3::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 241 of file CigiHatHotReqV3.h.

References CIGI_SUCCESS.

00242    {
00243       AltOrZoff = AltIn;
00244       return(CIGI_SUCCESS);
00245    }

int CigiHatHotReqV3::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 174 of file CigiHatHotReqV3.h.

References CIGI_SUCCESS.

00175    {
00176       EntityID = EntityIDIn;
00177       return(CIGI_SUCCESS);
00178    }

int CigiHatHotReqV3::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 229 of file CigiHatHotReqV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseHatHotReq::ReqType.

00230 {
00231 
00232 #ifndef CIGI_NO_BND_CHK
00233    if(bndchk && ((ReqTypeIn < 0)||(ReqTypeIn > 2)))
00234    {
00235 #ifndef CIGI_NO_EXCEPT
00236       throw CigiValueOutOfRangeException("ReqType",(ReqTypeGrp)ReqTypeIn,0,2);
00237 #endif
00238       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00239    }
00240 #endif
00241 
00242    ReqType = ReqTypeIn;
00243    return(CIGI_SUCCESS);
00244 
00245 }

int CigiHatHotReqV3::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 251 of file CigiHatHotReqV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseHatHotReq::SrcCoordSys.

00252 {
00253 
00254 #ifndef CIGI_NO_BND_CHK
00255    if(bndchk && ((SrcCoordSysIn < 0)||(SrcCoordSysIn > 1)))
00256    {
00257 #ifndef CIGI_NO_EXCEPT
00258       throw CigiValueOutOfRangeException("SrcCoordSys",(CoordSysGrp)SrcCoordSysIn,0,1);
00259 #endif
00260       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00261    }
00262 #endif
00263 
00264    SrcCoordSys = SrcCoordSysIn;
00265    return(CIGI_SUCCESS);
00266 
00267 }

int CigiHatHotReqV3::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 197 of file CigiHatHotReqV3.h.

References CIGI_SUCCESS.

00198    {
00199       LatOrXoff = XoffIn;
00200       return(CIGI_SUCCESS);
00201    }

int CigiHatHotReqV3::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 220 of file CigiHatHotReqV3.h.

References CIGI_SUCCESS.

00221    {
00222       LonOrYoff = YoffIn;
00223       return(CIGI_SUCCESS);
00224    }

int CigiHatHotReqV3::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 264 of file CigiHatHotReqV3.h.

References CIGI_SUCCESS.

00265    {
00266       AltOrZoff = ZoffIn;
00267       return(CIGI_SUCCESS);
00268    }

int CigiHatHotReqV3::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 143 of file CigiHatHotReqV3.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.

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


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