CigiIGCtrlV3_3 Class Reference

#include <CigiIGCtrlV3_3.h>

Inheritance diagram for CigiIGCtrlV3_3:

CigiBaseIGCtrl CigiBasePacket List of all members.

Public Member Functions

 CigiIGCtrlV3_3 ()
virtual ~CigiIGCtrlV3_3 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)
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)
bool GetSmoothingEn (void) const
int SetSmoothingEn (const bool SmoothingEnabled, bool bndchk=true)
Cigi_uint32 GetLastRcvdIGFrame (void) const
int SetLastRcvdIGFrame (const Cigi_uint32 LastRcvdIGFrameIn, bool bndchk=true)

Detailed Description

The class for the IG Control packet for CIGI version 3

Definition at line 55 of file CigiIGCtrlV3_3.h.


Constructor & Destructor Documentation

CigiIGCtrlV3_3::CigiIGCtrlV3_3 (  ) 

Definition at line 57 of file CigiIGCtrlV3_3.cpp.

References CigiBaseIGCtrl::BoresightTrackDevice, CigiBaseIGCtrl::BSwapEn, CigiBaseIGCtrl::ByteSwap, CIGI_IG_CTRL_PACKET_ID_V3_2, CIGI_IG_CTRL_PACKET_SIZE_V3_2, CigiBaseIGCtrl::DatabaseID, CigiBaseIGCtrl::Disable, CigiBaseIGCtrl::FrameCntr, CigiBaseIGCtrl::IGMode, CigiBaseIGCtrl::LastRcvdIGFrame, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseIGCtrl::SmoothingEn, CigiBaseIGCtrl::Standby, CigiBaseIGCtrl::TimeStampV1, CigiBaseIGCtrl::TimeStampV2, CigiBaseIGCtrl::TimeStampV3, CigiBaseIGCtrl::TimestampValid, CigiBaseIGCtrl::TrackDeviceEn, and CigiBasePacket::Version.

00058 {
00059 
00060    PacketID = CIGI_IG_CTRL_PACKET_ID_V3_2;
00061    PacketSize = CIGI_IG_CTRL_PACKET_SIZE_V3_2;
00062    Version = 3;
00063    MinorVersion = 3;
00064 
00065    BSwapEn = false;
00066    DatabaseID = 0;
00067    FrameCntr = 0;
00068    TimeStampV1 = 0;
00069    TimeStampV2 = 0.0f;
00070    TimeStampV3 = 0;
00071    ByteSwap = 0x8000;
00072    IGMode = Standby;
00073    TrackDeviceEn = Disable;
00074    BoresightTrackDevice = false;
00075    TimestampValid = false;
00076    SmoothingEn = false;
00077    LastRcvdIGFrame = 0;
00078 
00079 }

CigiIGCtrlV3_3::~CigiIGCtrlV3_3 (  )  [virtual]

Definition at line 84 of file CigiIGCtrlV3_3.cpp.

00085 {
00086 
00087 }


Member Function Documentation

Cigi_uint32 CigiIGCtrlV3_3::GetLastRcvdIGFrame ( void   )  const [inline]

Gets the last received IG Frame id value

Returns:
Current last received IG Frame

Definition at line 188 of file CigiIGCtrlV3_3.h.

00188 { return(LastRcvdIGFrame); }

bool CigiIGCtrlV3_3::GetSmoothingEn ( void   )  const [inline]

Gets the Smoothing Enabled flag for V3.3

Returns:
Smoothing Enabled flag

Definition at line 163 of file CigiIGCtrlV3_3.h.

00163 { return(SmoothingEn); }

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

Gets the Timestamp value for V3

Returns:
TimeStampV2 The timestamp value

Definition at line 117 of file CigiIGCtrlV3_3.h.

00117 { return(TimeStampV3); }

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

Gets the Timestamp valid flag for V3

Returns:
TimestampValid - The timestamp valid flag

Definition at line 138 of file CigiIGCtrlV3_3.h.

00138 { return(TimestampValid); }

int CigiIGCtrlV3_3::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 CigiBaseIGCtrl.

Definition at line 97 of file CigiIGCtrlV3_3.cpp.

References PackPointerUnion::b, PackPointerUnion::c, CigiVersionID::CigiMajorVersion, CigiVersionID::CigiMinorVersion, CigiBaseIGCtrl::DatabaseID, CigiBaseIGCtrl::FrameCntr, CigiVersionID::GetCombinedCigiVersion(), CigiBaseIGCtrl::IGMode, PackPointerUnion::l, CigiBaseIGCtrl::LastRcvdIGFrame, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiVersionID::SetCigiVersion(), CigiBaseIGCtrl::SmoothingEn, CigiBaseIGCtrl::TimeStampV3, and CigiBaseIGCtrl::TimestampValid.

00098 {
00099    PackPointer CDta;
00100    CigiVersionID PackingVer = *((CigiVersionID *)Spec);
00101 
00102    CigiBaseIGCtrl *Data = ( CigiBaseIGCtrl *) Base;
00103 
00104    if(PackingVer.GetCombinedCigiVersion() < 0x0303)
00105       PackingVer.SetCigiVersion(3,3);
00106 
00107    CDta.c = Buff;
00108 
00109    *CDta.c++ = PacketID;
00110    *CDta.c++ = PacketSize;
00111    *CDta.c++ = PackingVer.CigiMajorVersion;
00112 
00113    *CDta.b++ = Data->DatabaseID;
00114 
00115    Cigi_uint8 HDta = (PackingVer.CigiMinorVersion << 4) & 0xf0;
00116    HDta |= (Data->SmoothingEn) ? 0x08 : 0;
00117    HDta |= (Data->TimestampValid) ? 0x04 : 0;
00118    HDta |= (Cigi_uint8)(Data->IGMode & 0x03);
00119 
00120    *CDta.c++ = HDta;
00121    *CDta.c++ = 0;
00122    *CDta.s++ = 0x8000;  // Byte Swap value
00123 
00124    *CDta.l++ = Data->FrameCntr;
00125    *CDta.l++ = Data->TimeStampV3;
00126    *CDta.l++ = Data->LastRcvdIGFrame;
00127    *CDta.l++ = 0;
00128 
00129    return(PacketSize);
00130 
00131 }

int CigiIGCtrlV3_3::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

Definition at line 103 of file CigiIGCtrlV3_3.h.

References CIGI_SUCCESS.

00104    {
00105       FrameCntr = FrameCntrIn;
00106 
00107       return(CIGI_SUCCESS);
00108    }

int CigiIGCtrlV3_3::SetLastRcvdIGFrame ( const Cigi_uint32  LastRcvdIGFrameIn,
bool  bndchk = true 
) [inline]

Sets the last received IG Frame with bound checking control

Parameters:
LastRcvdIGFrameIn - Specifies the last received IG 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 198 of file CigiIGCtrlV3_3.h.

References CIGI_SUCCESS.

00199    {
00200       LastRcvdIGFrame = LastRcvdIGFrameIn;
00201 
00202       return(CIGI_SUCCESS);
00203    }

int CigiIGCtrlV3_3::SetSmoothingEn ( const bool  SmoothingEnabled,
bool  bndchk = true 
) [inline]

Enables or Disables motion smoothing.

Parameters:
SmoothingEnabled - Enables (true) or disables (false) Extrapolation or Interpolation motion smoothing
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 CigiIGCtrlV3_3.h.

References CIGI_SUCCESS.

00175    {
00176       SmoothingEn = SmoothingEnabled;
00177 
00178       return(CIGI_SUCCESS);
00179    }

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

Sets the Timestamp value for V2.
This also converts to and sets the V1 and V2 timestamp values.

Parameters:
TimeStamp - Specifies the timestamp 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 192 of file CigiIGCtrlV3_3.cpp.

References CIGI_SUCCESS, CigiBaseIGCtrl::TimeStampV1, CigiBaseIGCtrl::TimeStampV2, and CigiBaseIGCtrl::TimeStampV3.

00193 {
00194 
00195    TimeStampV3 = TimeStamp;
00196    TimeStampV1 = TimeStampV3 / 10;
00197    TimeStampV2 = (float)TimeStampV1;
00198 
00199    return(CIGI_SUCCESS);
00200 
00201 }

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

Sets the Timestamp valid flag for V3

Parameters:
TimeStampValidIn - Sets or clears the Time Stamp Valid flag
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 148 of file CigiIGCtrlV3_3.h.

References CIGI_SUCCESS.

00149    {
00150       TimestampValid = TimeStampValidIn;
00151 
00152       return(CIGI_SUCCESS);
00153    }

int CigiIGCtrlV3_3::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 CigiBaseIGCtrl.

Definition at line 137 of file CigiIGCtrlV3_3.cpp.

References PackPointerUnion::b, CigiBaseIGCtrl::BSwapEn, CigiBaseIGCtrl::ByteSwap, PackPointerUnion::c, CIGI_SUCCESS, CigiSwap4(), CigiBaseIGCtrl::DatabaseID, CigiBaseIGCtrl::FrameCntr, CigiBaseIGCtrl::IGMode, PackPointerUnion::l, CigiBaseIGCtrl::LastRcvdIGFrame, PackPointerUnion::s, CigiBaseIGCtrl::SmoothingEn, CigiBaseIGCtrl::TimeStampV1, CigiBaseIGCtrl::TimeStampV2, CigiBaseIGCtrl::TimeStampV3, and CigiBaseIGCtrl::TimestampValid.

00138 {
00139 
00140    PackPointer CDta;
00141 
00142    CDta.c = Buff;
00143 
00144    CDta.c += 3;
00145 
00146    DatabaseID = *CDta.b++;
00147 
00148    Cigi_uint8 HDta = *CDta.c++;
00149 
00150    IGMode = (IGModeGrp)(HDta & 0x03);
00151    TimestampValid = ((HDta & 0x04) != 0);
00152    SmoothingEn = ((HDta & 0x08) != 0);
00153 
00154    CDta.c++;
00155 
00156    ByteSwap = *CDta.s++;
00157    BSwapEn = (ByteSwap == 0x0080);
00158 
00159 
00160    if(!BSwapEn)
00161    {
00162       FrameCntr = *CDta.l++;
00163       TimeStampV3 = *CDta.l++;
00164       LastRcvdIGFrame = *CDta.l++;
00165    }
00166    else
00167    {
00168       CigiSwap4(&FrameCntr, CDta.l++);
00169       CigiSwap4(&TimeStampV3, CDta.l++);
00170       CigiSwap4(&LastRcvdIGFrame, CDta.l++);
00171    }
00172 
00173    TimeStampV1 = TimeStampV3 / 10;
00174    TimeStampV2 = (float)TimeStampV1;
00175 
00176 
00177 
00178    return(CIGI_SUCCESS);
00179 
00180 }


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