CigiSOFV3_2 Class Reference

#include <CigiSOFV3_2.h>

Inheritance diagram for CigiSOFV3_2:

CigiBaseSOF CigiBasePacket List of all members.

Public Member Functions

 CigiSOFV3_2 ()
virtual ~CigiSOFV3_2 ()
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)
Cigi_uint32 GetTimeStamp (void) const
int SetTimeStamp (const Cigi_uint32 TimeStamp, bool bndchk=true)
bool GetTimeStampValid (void) const
int SetTimeStampValid (const bool TimeStampValidIn, bool bndchk=true)
EarthRefModelGrp GetEarthRefModel (void) const
int SetEarthRefModel (const EarthRefModelGrp EarthRefModelIn, bool bndchk=true)
Cigi_uint32 GetLastRcvdHostFrame (void) const
int SetLastRcvdHostFrame (const Cigi_uint32 LastRcvdHostFrameIn, bool bndchk=true)

Detailed Description

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

Definition at line 60 of file CigiSOFV3_2.h.


Constructor & Destructor Documentation

CigiSOFV3_2::CigiSOFV3_2 (  ) 

Definition at line 75 of file CigiSOFV3_2.cpp.

References CigiBaseSOF::BSwapEn, CigiBaseSOF::ByteSwap, CIGI_SOF_PACKET_ID_V3_2, CIGI_SOF_PACKET_SIZE_V3_2, 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.

00076 {
00077 
00078    PacketID = CIGI_SOF_PACKET_ID_V3_2;
00079    PacketSize = CIGI_SOF_PACKET_SIZE_V3_2;
00080    Version = 3;
00081    MinorVersion = 2;
00082 
00083    BSwapEn = false;
00084    DatabaseID = 0;
00085    FrameCntr = 0;
00086    TimeStampV2 = 0.0f;
00087    TimeStampV3 = 0;
00088    ByteSwap = 0x8000;
00089    IGMode = Standby;
00090    TimestampValid = false;
00091    EarthRefModel = WGS84;
00092    LastRcvdHostFrame = 0;
00093 
00094 }

CigiSOFV3_2::~CigiSOFV3_2 (  )  [virtual]

Definition at line 99 of file CigiSOFV3_2.cpp.

00100 {
00101 
00102 }


Member Function Documentation

EarthRefModelGrp CigiSOFV3_2::GetEarthRefModel ( void   )  const [inline]

Gets the earth reference model indicator.

Returns:
The earth reference model indicator.
0 - WGS84.
1 - System defined.

Definition at line 178 of file CigiSOFV3_2.h.

00178 { return(EarthRefModel); }

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

Gets the Frame Counter value

Returns:
Current frame this data represents

Reimplemented from CigiBaseSOF.

Definition at line 105 of file CigiSOFV3_2.h.

00105 { return(FrameCntr); }

Cigi_uint32 CigiSOFV3_2::GetLastRcvdHostFrame ( void   )  const [inline]

Gets the last received host frame id value

Returns:
last received host frame

Definition at line 200 of file CigiSOFV3_2.h.

00200 { return(LastRcvdHostFrame); }

Cigi_uint32 CigiSOFV3_2::GetTimeStamp ( void   )  const [inline]

Gets the V3 timestamp.

Returns:
The timestamp count in 10 microseconds increments.

Definition at line 129 of file CigiSOFV3_2.h.

00129 { return(TimeStampV3); }

bool CigiSOFV3_2::GetTimeStampValid ( void   )  const [inline]

Gets the timestamp valid flag.

Returns:
The timestamp valid flag.

Definition at line 149 of file CigiSOFV3_2.h.

00149 { return(TimestampValid); }

int CigiSOFV3_2::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 115 of file CigiSOFV3_2.cpp.

References PackPointerUnion::b, PackPointerUnion::c, CigiVersionID::CigiMajorVersion, CigiVersionID::CigiMinorVersion, CigiBaseSOF::DatabaseID, CigiBaseSOF::EarthRefModel, CigiBaseSOF::FrameCntr, CigiVersionID::GetCombinedCigiVersion(), CigiBaseSOF::IGMode, CigiBaseSOF::IGStatus, PackPointerUnion::l, CigiBaseSOF::LastRcvdHostFrame, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiVersionID::SetCigiVersion(), CigiBaseSOF::TimeStampV3, and CigiBaseSOF::TimestampValid.

00116 {
00117    PackPointer CDta;
00118    CigiVersionID PackingVer = *((CigiVersionID *)Spec);
00119 
00120    CigiBaseSOF *Data = ( CigiBaseSOF *) Base;
00121 
00122    if(PackingVer.GetCombinedCigiVersion() < 0x0302)
00123       PackingVer.SetCigiVersion(3,2);
00124 
00125    CDta.c = Buff;
00126 
00127    *CDta.c++ = PacketID;
00128    *CDta.c++ = PacketSize;
00129    *CDta.c++ = PackingVer.CigiMajorVersion;
00130 
00131    *CDta.b++ = Data->DatabaseID;
00132    *CDta.c++ = Data->IGStatus;
00133 
00134    Cigi_uint8 HDta = (PackingVer.CigiMinorVersion << 4) & 0xf0;
00135    HDta |= (Data->TimestampValid) ? 0x04 : 0;
00136    HDta |= (Cigi_uint8)(Data->IGMode & 0x03);
00137    HDta |= (Cigi_uint8)((Data->EarthRefModel << 3) & 0x08);
00138 
00139    *CDta.c++ = HDta;
00140 
00141    *CDta.s++ = 0x8000;  // Byte Swap
00142    *CDta.l++ = Data->FrameCntr;
00143    *CDta.l++ = Data->TimeStampV3;
00144    *CDta.l++ = Data->LastRcvdHostFrame;
00145    *CDta.l++ = 0;
00146 
00147 
00148    return(PacketSize);
00149 
00150 }

int CigiSOFV3_2::SetEarthRefModel ( const EarthRefModelGrp  EarthRefModelIn,
bool  bndchk = true 
)

Sets the earth reference model indicator with bound checking control.

Parameters:
EarthRefModelIn - Specifies the earth reference model is valid for use.
0 - WGS84.
1 - System defined.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 223 of file CigiSOFV3_2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseSOF::EarthRefModel.

00225 {
00226 
00227 #ifndef CIGI_NO_BND_CHK
00228    if(bndchk && ((EarthRefModelIn < 0)||(EarthRefModelIn > 1)))
00229    {
00230 #ifndef CIGI_NO_EXCEPT
00231       throw CigiValueOutOfRangeException("EarthRefModel",EarthRefModelIn,0,1);
00232 #endif
00233       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00234    }
00235 #endif
00236 
00237    EarthRefModel = EarthRefModelIn;
00238 
00239    return(CIGI_SUCCESS);
00240 
00241 }

int CigiSOFV3_2::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 115 of file CigiSOFV3_2.h.

References CIGI_SUCCESS.

00116    {
00117       FrameCntr = FrameCntrIn;
00118 
00119       return(CIGI_SUCCESS);
00120    }

int CigiSOFV3_2::SetLastRcvdHostFrame ( const Cigi_uint32  LastRcvdHostFrameIn,
bool  bndchk = true 
) [inline]

Sets the last received host frame with bound checking control

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

Definition at line 210 of file CigiSOFV3_2.h.

References CIGI_SUCCESS.

00211    {
00212       LastRcvdHostFrame = LastRcvdHostFrameIn;
00213 
00214       return(CIGI_SUCCESS);
00215    }

int CigiSOFV3_2::SetTimeStamp ( const Cigi_uint32  TimeStamp,
bool  bndchk = true 
)

Sets the timestamp V3 value with bound checking control.

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

Definition at line 210 of file CigiSOFV3_2.cpp.

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

00211 {
00212 
00213    TimeStampV3 = TimeStamp;
00214    TimeStampV2 = ((float)TimeStampV3) * 10.0f;
00215 
00216    return(CIGI_SUCCESS);
00217 
00218 }

int CigiSOFV3_2::SetTimeStampValid ( const bool  TimeStampValidIn,
bool  bndchk = true 
) [inline]

Sets the timestamp valid flag with bound checking control.

Parameters:
TimeStampValidIn - Specifies whether the timestamp is valid for use.
true - Timestamp is valid.
false - Timestamp is not valid.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 162 of file CigiSOFV3_2.h.

References CIGI_SUCCESS.

00163    {
00164       TimestampValid = TimeStampValidIn;
00165 
00166       return(CIGI_SUCCESS);
00167    }

int CigiSOFV3_2::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 156 of file CigiSOFV3_2.cpp.

References PackPointerUnion::b, CigiBaseSOF::BSwapEn, CigiBaseSOF::ByteSwap, PackPointerUnion::c, CIGI_SUCCESS, CigiSwap4(), CigiBaseSOF::DatabaseID, CigiBaseSOF::EarthRefModel, CigiBaseSOF::FrameCntr, CigiBaseSOF::IGMode, CigiBaseSOF::IGStatus, PackPointerUnion::l, CigiBaseSOF::LastRcvdHostFrame, PackPointerUnion::s, CigiBaseSOF::TimeStampV2, CigiBaseSOF::TimeStampV3, and CigiBaseSOF::TimestampValid.

00157 {
00158 
00159    PackPointer CDta;
00160 
00161    CDta.c = Buff;
00162 
00163    CDta.c += 3;
00164 
00165    DatabaseID = *CDta.b++;
00166    IGStatus = *CDta.c++;
00167 
00168    Cigi_uint8 HDta = *CDta.c++;
00169 
00170    IGMode = (IGModeGrp)(HDta & 0x03);
00171    EarthRefModel = (EarthRefModelGrp)((HDta >> 3) & 0x01);
00172    TimestampValid = ((HDta & 0x04) != 0);
00173 
00174    ByteSwap = *CDta.s++;
00175 
00176    BSwapEn = (ByteSwap == 0x0080);
00177 
00178    if(!BSwapEn)
00179    {
00180       FrameCntr = *CDta.l++;
00181       TimeStampV3 = *CDta.l++;
00182       LastRcvdHostFrame = *CDta.l++;
00183    }
00184    else
00185    {
00186       CigiSwap4(&FrameCntr,CDta.l++);
00187       CigiSwap4(&TimeStampV3,CDta.l++);
00188       CigiSwap4(&LastRcvdHostFrame,CDta.l++);
00189    }
00190 
00191    TimeStampV2 = ((float)TimeStampV3) * 10.0f;
00192 
00193 
00194    return(CIGI_SUCCESS);
00195 
00196 }


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