CigiSensorXRespV3 Class Reference

#include <CigiSensorXRespV3.h>

Inheritance diagram for CigiSensorXRespV3:

CigiBaseSensorResp CigiBasePacket List of all members.

Public Member Functions

 CigiSensorXRespV3 ()
virtual ~CigiSensorXRespV3 ()
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 SetViewID (const Cigi_uint16 ViewIDIn, bool bndchk=true)
Cigi_uint16 GetViewID (void) const
int SetEntityTgt (const bool EntityTgtIn, bool bndchk=true)
bool GetEntityTgt (void) const
int SetEntityID (const Cigi_uint16 EntityIDIn, bool bndchk=true)
Cigi_uint16 GetEntityID (void) const
int SetFrameCntr (const Cigi_uint32 FrameCntrIn, bool bndchk=true)
Cigi_uint32 GetFrameCntr (void) const
int SetTrackPntLat (const double TrackPntLatIn, bool bndchk=true)
double GetTrackPntLat (void) const
int SetTrackPntLon (const double TrackPntLonIn, bool bndchk=true)
double GetTrackPntLon (void) const
int SetTrackPntAlt (const double TrackPntAltIn, bool bndchk=true)
double GetTrackPntAlt (void) const

Detailed Description

Definition at line 57 of file CigiSensorXRespV3.h.


Constructor & Destructor Documentation

CigiSensorXRespV3::CigiSensorXRespV3 (  ) 

General Constructor

Definition at line 67 of file CigiSensorXRespV3.cpp.

References CIGI_SENSOR_XRESP_PACKET_ID_V3, CIGI_SENSOR_XRESP_PACKET_SIZE_V3, CigiBaseSensorResp::EntityID, CigiBaseSensorResp::EntityTgt, CigiBaseSensorResp::FrameCntr, CigiBaseSensorResp::GateSzX, CigiBaseSensorResp::GateSzY, CigiBaseSensorResp::GateXoff, CigiBaseSensorResp::GateYoff, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseSensorResp::Searching, CigiBaseSensorResp::SensorID, CigiBaseSensorResp::SensorStat, CigiBaseSensorResp::TrackPntAlt, CigiBaseSensorResp::TrackPntLat, CigiBaseSensorResp::TrackPntLon, CigiBasePacket::Version, and CigiBaseSensorResp::ViewID.

00068 {
00069 
00070    PacketID = CIGI_SENSOR_XRESP_PACKET_ID_V3;
00071    PacketSize = CIGI_SENSOR_XRESP_PACKET_SIZE_V3;
00072    Version = 3;
00073    MinorVersion = 0;
00074 
00075    ViewID = 0;
00076    SensorID = 0;
00077    SensorStat = Searching;
00078    EntityTgt = false;
00079    EntityID = 0;
00080    GateSzX = 0;
00081    GateSzY = 0;
00082    GateXoff = 0.0;
00083    GateYoff = 0.0;
00084    FrameCntr = 0;
00085    TrackPntLat = 0.0;
00086    TrackPntLon = 0.0;
00087    TrackPntAlt = 0.0;
00088 
00089 }

CigiSensorXRespV3::~CigiSensorXRespV3 (  )  [virtual]

General Destructor

Definition at line 94 of file CigiSensorXRespV3.cpp.

00095 {
00096 
00097 }


Member Function Documentation

int CigiSensorXRespV3::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 CigiBaseSensorResp.

Definition at line 201 of file CigiSensorXRespV3.cpp.

References CIGI_SENSOR_RESP_PACKET_ID_V2, CIGI_SENSOR_XRESP_PACKET_ID_V3, CIGI_SUCCESS, CigiVersionID::CigiMajorVersion, CigiCnvtInfoType::CigiCnvtInfoStruct::CnvtPacketID, CigiCnvtInfoType::CigiCnvtInfoStruct::ProcID, and CigiProcessType::ProcStd.

00203 {
00204    CnvtInfo.ProcID = CigiProcessType::ProcStd;
00205 
00206    // Note: CIGI_SENSOR_RESP_PACKET_ID_V1 &
00207    // CIGI_SENSOR_RESP_PACKET_ID_V2 are the same
00208    if(CnvtVersion.CigiMajorVersion < 3)
00209       CnvtInfo.CnvtPacketID = CIGI_SENSOR_RESP_PACKET_ID_V2;
00210    else
00211       CnvtInfo.CnvtPacketID = CIGI_SENSOR_XRESP_PACKET_ID_V3;
00212 
00213    return(CIGI_SUCCESS);
00214 }

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

Gets the EntityID value.

Returns:
the current EntityID.

Definition at line 181 of file CigiSensorXRespV3.h.

00181 { return(EntityID); }

bool CigiSensorXRespV3::GetEntityTgt ( void   )  const [inline]

Gets the EntityTgt value.

Returns:
the current EntityTgt.

Definition at line 160 of file CigiSensorXRespV3.h.

00160 { return(EntityTgt); }

Cigi_uint32 CigiSensorXRespV3::GetFrameCntr ( void   )  const [inline]

Gets the FrameCntr value.

Returns:
the current FrameCntr.

Definition at line 202 of file CigiSensorXRespV3.h.

00202 { return(FrameCntr); }

double CigiSensorXRespV3::GetTrackPntAlt ( void   )  const [inline]

Gets the TrackPntAlt value.

Returns:
the current TrackPntAlt.

Definition at line 257 of file CigiSensorXRespV3.h.

00257 { return(TrackPntAlt); }

double CigiSensorXRespV3::GetTrackPntLat ( void   )  const [inline]

Gets the TrackPntLat value.

Returns:
the current TrackPntLat.

Definition at line 219 of file CigiSensorXRespV3.h.

00219 { return(TrackPntLat); }

double CigiSensorXRespV3::GetTrackPntLon ( void   )  const [inline]

Gets the TrackPntLon value.

Returns:
the current TrackPntLon.

Definition at line 236 of file CigiSensorXRespV3.h.

00236 { return(TrackPntLon); }

Cigi_uint16 CigiSensorXRespV3::GetViewID ( void   )  const [inline]

Gets the ViewID value.

Returns:
the current ViewID.

Definition at line 139 of file CigiSensorXRespV3.h.

00139 { return(ViewID); }

int CigiSensorXRespV3::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 CigiBaseSensorResp.

Definition at line 106 of file CigiSensorXRespV3.cpp.

References PackPointerUnion::c, PackPointerUnion::d, CigiBaseSensorResp::EntityID, CigiBaseSensorResp::EntityTgt, PackPointerUnion::f, CigiBaseSensorResp::FrameCntr, CigiBaseSensorResp::GateSzX, CigiBaseSensorResp::GateSzY, CigiBaseSensorResp::GateXoff, CigiBaseSensorResp::GateYoff, PackPointerUnion::l, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiBaseSensorResp::SensorID, CigiBaseSensorResp::SensorStat, CigiBaseSensorResp::TrackPntAlt, CigiBaseSensorResp::TrackPntLat, CigiBaseSensorResp::TrackPntLon, and CigiBaseSensorResp::ViewID.

00107 {
00108    PackPointer CDta;
00109 
00110    CigiBaseSensorResp * Data = ( CigiBaseSensorResp *)Base;
00111 
00112    CDta.c = Buff;
00113 
00114    *CDta.c++ = PacketID;
00115    *CDta.c++ = PacketSize;
00116 
00117    *CDta.s++ = Data->ViewID;
00118    *CDta.c++ = Data->SensorID;
00119 
00120    Cigi_uint8 HDta = (Data->EntityTgt) ? 0x04 : 0x00;
00121    HDta |= (Cigi_uint8)(Data->SensorStat & 0x03);
00122    *CDta.c++ = HDta;
00123 
00124    *CDta.s++ = Data->EntityID;
00125    *CDta.s++ = Data->GateSzX;
00126    *CDta.s++ = Data->GateSzY;
00127    *CDta.f++ = Data->GateXoff;
00128    *CDta.f++ = Data->GateYoff;
00129    *CDta.l++ = Data->FrameCntr;
00130    *CDta.d++ = Data->TrackPntLat;
00131    *CDta.d++ = Data->TrackPntLon;
00132    *CDta.d++ = Data->TrackPntAlt;
00133 
00134    return(PacketSize);
00135 
00136 }

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

Sets the EntityID with bound checking control

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

Definition at line 172 of file CigiSensorXRespV3.h.

References CIGI_SUCCESS.

00173    {
00174       EntityID = EntityIDIn;
00175       return(CIGI_SUCCESS);
00176    }

int CigiSensorXRespV3::SetEntityTgt ( const bool  EntityTgtIn,
bool  bndchk = true 
) [inline]

Sets the EntityTgt with bound checking control

Parameters:
EntityTgtIn - True if the tracked point is an 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 151 of file CigiSensorXRespV3.h.

References CIGI_SUCCESS.

00152    {
00153       EntityTgt = EntityTgtIn;
00154       return(CIGI_SUCCESS);
00155    }

int CigiSensorXRespV3::SetFrameCntr ( const Cigi_uint32  FrameCntrIn,
bool  bndchk = true 
) [inline]

Sets the FrameCntr with bound checking control

Parameters:
FrameCntrIn - Frame counter value
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 CigiSensorXRespV3.h.

References CIGI_SUCCESS.

00194    {
00195       FrameCntr = FrameCntrIn;
00196       return(CIGI_SUCCESS);
00197    }

int CigiSensorXRespV3::SetTrackPntAlt ( const double  TrackPntAltIn,
bool  bndchk = true 
) [inline]

Sets the TrackPntAlt with bound checking control

Parameters:
TrackPntAltIn - Tracked point's altitude
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 248 of file CigiSensorXRespV3.h.

References CIGI_SUCCESS.

00249    {
00250       TrackPntAlt = TrackPntAltIn;
00251       return(CIGI_SUCCESS);
00252    }

int CigiSensorXRespV3::SetTrackPntLat ( const double  TrackPntLatIn,
bool  bndchk = true 
)

Sets the TrackPntLat with bound checking control

Parameters:
TrackPntLatIn - Tracked point's Latitude
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 228 of file CigiSensorXRespV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseSensorResp::TrackPntLat.

00229 {
00230 
00231 #ifndef CIGI_NO_BND_CHK
00232    if(bndchk && ((TrackPntLatIn < -90.0)||(TrackPntLatIn > 90.0)))
00233    {
00234 #ifndef CIGI_NO_EXCEPT
00235       throw CigiValueOutOfRangeException("TrackPntLat",(double)TrackPntLatIn,-90.0,90.0);
00236 #endif
00237       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00238    }
00239 #endif
00240 
00241    TrackPntLat = TrackPntLatIn;
00242    return(CIGI_SUCCESS);
00243 
00244 }

int CigiSensorXRespV3::SetTrackPntLon ( const double  TrackPntLonIn,
bool  bndchk = true 
)

Sets the TrackPntLon with bound checking control

Parameters:
TrackPntLonIn - Tracked point's Longitude
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 250 of file CigiSensorXRespV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseSensorResp::TrackPntLon.

00251 {
00252 
00253 #ifndef CIGI_NO_BND_CHK
00254    if(bndchk && ((TrackPntLonIn < -180.0)||(TrackPntLonIn > 180.0)))
00255    {
00256 #ifndef CIGI_NO_EXCEPT
00257       throw CigiValueOutOfRangeException("TrackPntLon",(double)TrackPntLonIn,-180.0,180.0);
00258 #endif
00259       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00260    }
00261 #endif
00262 
00263    TrackPntLon = TrackPntLonIn;
00264    return(CIGI_SUCCESS);
00265 
00266 }

int CigiSensorXRespV3::SetViewID ( const Cigi_uint16  ViewIDIn,
bool  bndchk = true 
) [inline]

Sets the ViewID with bound checking control

Parameters:
ViewIDIn - View ID
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 130 of file CigiSensorXRespV3.h.

References CIGI_SUCCESS.

00131    {
00132       ViewID = ViewIDIn;
00133       return(CIGI_SUCCESS);
00134    }

int CigiSensorXRespV3::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 CigiBaseSensorResp.

Definition at line 141 of file CigiSensorXRespV3.cpp.

References PackPointerUnion::c, CigiSwap2(), CigiSwap4(), CigiSwap8(), PackPointerUnion::d, CigiBaseSensorResp::EntityID, CigiBaseSensorResp::EntityTgt, PackPointerUnion::f, CigiBaseSensorResp::FrameCntr, CigiBaseSensorResp::GateSzX, CigiBaseSensorResp::GateSzY, CigiBaseSensorResp::GateXoff, CigiBaseSensorResp::GateYoff, PackPointerUnion::l, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiBaseSensorResp::SensorID, CigiBaseSensorResp::SensorStat, CigiBaseSensorResp::TrackPntAlt, CigiBaseSensorResp::TrackPntLat, CigiBaseSensorResp::TrackPntLon, and CigiBaseSensorResp::ViewID.

00142 {
00143    PackPointer CDta;
00144 
00145    CDta.c = Buff;
00146 
00147    CDta.c += 2;  // Step over packet id and size
00148 
00149    if(!Swap)
00150    {
00151       ViewID = *CDta.s++;
00152       SensorID = *CDta.c++;
00153 
00154       Cigi_uint8 HDta = *CDta.c++;
00155       SensorStat = (SensorStatGrp)(HDta & 0x03);
00156       EntityTgt = ((HDta & 0x04) != 0);
00157 
00158       EntityID = *CDta.s++;
00159       GateSzX = *CDta.s++;
00160       GateSzY = *CDta.s++;
00161       GateXoff = *CDta.f++;
00162       GateYoff = *CDta.f++;
00163       FrameCntr = *CDta.l++;
00164       TrackPntLat = *CDta.d++;
00165       TrackPntLon = *CDta.d++;
00166       TrackPntAlt = *CDta.d++;
00167    }
00168    else
00169    {
00170       CigiSwap2(&ViewID, CDta.s++);
00171       SensorID = *CDta.c++;
00172 
00173       Cigi_uint8 HDta = *CDta.c++;
00174       SensorStat = (SensorStatGrp)(HDta & 0x03);
00175       EntityTgt = ((HDta & 0x04) != 0);
00176 
00177       CigiSwap2(&EntityID, CDta.s++);
00178       CigiSwap2(&GateSzX, CDta.s++);
00179       CigiSwap2(&GateSzY, CDta.s++);
00180       CigiSwap4(&GateXoff, CDta.f++);
00181       CigiSwap4(&GateYoff, CDta.f++);
00182       CigiSwap4(&FrameCntr, CDta.l++);
00183       CigiSwap8(&TrackPntLat, CDta.d++);
00184       CigiSwap8(&TrackPntLon, CDta.d++);
00185       CigiSwap8(&TrackPntAlt, CDta.d++);
00186    }
00187 
00188    return(PacketSize);
00189 
00190 }


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