CigiSOFV2 Class Reference

#include <CigiSOFV2.h>

Inheritance diagram for CigiSOFV2:

CigiBaseSOF CigiBasePacket List of all members.

Public Member Functions

 CigiSOFV2 ()
virtual ~CigiSOFV2 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)
Cigi_uint32 GetFrameCntr (void) const
int SetFrameCntr (const Cigi_uint32 FrameCntrIn, bool bndchk=true)
float GetTimeStamp (void) const
int SetTimeStamp (const float TimeStamp, bool bndchk=true)

Detailed Description

The class for the Start Of Frame packet for CIGI version 2

Definition at line 66 of file CigiSOFV2.h.


Constructor & Destructor Documentation

CigiSOFV2::CigiSOFV2 (  ) 

Definition at line 84 of file CigiSOFV2.cpp.

References CigiBaseSOF::BSwapEn, CigiBaseSOF::ByteSwap, CIGI_SOF_PACKET_ID_V2, CIGI_SOF_PACKET_SIZE_V2, CigiBaseSOF::DatabaseID, CigiBaseSOF::EarthRefModel, CigiBaseSOF::FrameCntr, CigiBaseSOF::IGMode, CigiBaseSOF::LastRcvdHostFrame, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseSOF::Standby, CigiBaseSOF::TimeStampV2, CigiBaseSOF::TimeStampV3, CigiBaseSOF::TimestampValid, CigiBasePacket::Version, and CigiBaseSOF::WGS84.

00085 {
00086 
00087    PacketID = CIGI_SOF_PACKET_ID_V2;
00088    PacketSize = CIGI_SOF_PACKET_SIZE_V2;
00089    Version = 2;
00090    MinorVersion = 0;
00091 
00092    BSwapEn = false;
00093    DatabaseID = 0;
00094    FrameCntr = 0;
00095    TimeStampV2 = 0.0f;
00096    TimeStampV3 = 0;
00097    ByteSwap = 0x8000;
00098    IGMode = Standby;
00099    TimestampValid = false;
00100    EarthRefModel = WGS84;
00101    LastRcvdHostFrame = 0;
00102 
00103 }

CigiSOFV2::~CigiSOFV2 (  )  [virtual]

Definition at line 108 of file CigiSOFV2.cpp.

00109 {
00110 
00111 }


Member Function Documentation

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

Gets the Frame Counter value

Returns:
Current frame this data represents

Reimplemented from CigiBaseSOF.

Definition at line 111 of file CigiSOFV2.h.

00111 { return(FrameCntr); }

float CigiSOFV2::GetTimeStamp ( void   )  const [inline]

Gets the V2 timestamp.

Returns:
The timestamp in microseconds.

Definition at line 136 of file CigiSOFV2.h.

00136 { return(TimeStampV2); }

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

The virtual Pack function for CIGI 1

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 CigiBaseSOF.

Definition at line 123 of file CigiSOFV2.cpp.

References PackPointerUnion::b, PackPointerUnion::c, CIGI_SCOPY4, CigiBaseSOF::DatabaseID, PackPointerUnion::f, CigiBaseSOF::FrameCntr, CigiBaseSOF::IGMode, CigiBaseSOF::IGStatus, PackPointerUnion::l, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseSOF::TimeStampV2, and CigiBasePacket::Version.

00124 {
00125    PackPointer CDta;
00126 
00127    CigiBaseSOF *Data = ( CigiBaseSOF *) Base;
00128 
00129 
00130    CDta.c = Buff;
00131 
00132    *CDta.c++ = PacketID;
00133    *CDta.c++ = PacketSize;
00134    *CDta.c++ = Version;
00135 
00136    *CDta.b++ = Data->DatabaseID;
00137    *CDta.c++ = Data->IGStatus;
00138 
00139    Cigi_uint8 HDta = (Cigi_uint8)((Data->IGMode << 6) & 0xc0);
00140 
00141    *CDta.c++ = HDta;
00142    *CDta.c++ = 0;
00143    *CDta.c++ = 0;
00144 
00145    CIGI_SCOPY4(CDta.l++, &Data->FrameCntr);
00146    CIGI_SCOPY4(CDta.f++, &Data->TimeStampV2);
00147 
00148 
00149    return(PacketSize);
00150 
00151 }

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

Sets the Frame Counter with bound checking control

Parameters:
FrameCntrIn - Specifies the frame.
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Reimplemented from CigiBaseSOF.

Definition at line 121 of file CigiSOFV2.h.

References CIGI_SUCCESS.

00122    {
00123       FrameCntr = FrameCntrIn;
00124       LastRcvdHostFrame = FrameCntrIn;
00125 
00126       return(CIGI_SUCCESS);
00127    }

int CigiSOFV2::SetTimeStamp ( const float  TimeStamp,
bool  bndchk = true 
)

Sets the timestamp V2 value with bound checking control.

Parameters:
TimeStamp - Specifies the timestamp in microseconds.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 200 of file CigiSOFV2.cpp.

References CIGI_SUCCESS, CigiBaseSOF::TimeStampV2, CigiBaseSOF::TimeStampV3, and CigiBaseSOF::TimestampValid.

00201 {
00202 
00203    TimeStampV2 = TimeStamp;
00204    TimeStampV3 = ((Cigi_uint32)TimeStampV2) / 10;
00205 
00206    TimestampValid = true;
00207 
00208    return(CIGI_SUCCESS);
00209 
00210 }

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

The virtual Unpack function for CIGI 1

Parameters:
Buff - A pointer to the current pack point.
Swap - Byte swapping required.
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 CigiBaseSOF.

Definition at line 157 of file CigiSOFV2.cpp.

References PackPointerUnion::b, PackPointerUnion::c, CIGI_SCOPY4, CIGI_SUCCESS, CigiBaseSOF::DatabaseID, PackPointerUnion::f, CigiBaseSOF::FrameCntr, CigiBaseSOF::IGMode, CigiBaseSOF::IGStatus, PackPointerUnion::l, CigiBaseSOF::LastRcvdHostFrame, PackPointerUnion::s, CigiBaseSOF::TimeStampV2, and CigiBaseSOF::TimeStampV3.

00158 {
00159 
00160    PackPointer CDta;
00161 
00162    CDta.c = Buff;
00163 
00164    CDta.c += 3;
00165 
00166    DatabaseID = *CDta.b++;
00167    IGStatus = *CDta.c++;
00168 
00169    Cigi_uint8 HDta = *CDta.c++;
00170 
00171    IGMode = (IGModeGrp)((HDta >> 6) & 0x03);
00172 
00173    CDta.s++;
00174 
00175    CIGI_SCOPY4(&FrameCntr,CDta.l++);
00176    CIGI_SCOPY4(&TimeStampV2,CDta.f++);
00177 
00178    TimeStampV3 = ((Cigi_uint32)TimeStampV2) / 10;
00179 
00180    LastRcvdHostFrame = FrameCntr;
00181 
00182    Swap = false;
00183 
00184    return(CIGI_SUCCESS);
00185 
00186 }


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