#include <CigiIGCtrlV3_2.h>
Inheritance diagram for CigiIGCtrlV3_2:
Public Member Functions | |
CigiIGCtrlV3_2 () | |
virtual | ~CigiIGCtrlV3_2 () |
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) |
Cigi_uint32 | GetLastRcvdIGFrame (void) const |
int | SetLastRcvdIGFrame (const Cigi_uint32 LastRcvdIGFrameIn, bool bndchk=true) |
Definition at line 65 of file CigiIGCtrlV3_2.h.
CigiIGCtrlV3_2::CigiIGCtrlV3_2 | ( | ) |
Definition at line 68 of file CigiIGCtrlV3_2.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.
00069 { 00070 00071 PacketID = CIGI_IG_CTRL_PACKET_ID_V3_2; 00072 PacketSize = CIGI_IG_CTRL_PACKET_SIZE_V3_2; 00073 Version = 3; 00074 MinorVersion = 2; 00075 00076 BSwapEn = false; 00077 DatabaseID = 0; 00078 FrameCntr = 0; 00079 TimeStampV1 = 0; 00080 TimeStampV2 = 0.0f; 00081 TimeStampV3 = 0; 00082 ByteSwap = 0x8000; 00083 IGMode = Standby; 00084 TrackDeviceEn = Disable; 00085 BoresightTrackDevice = false; 00086 TimestampValid = false; 00087 SmoothingEn = false; 00088 LastRcvdIGFrame = 0; 00089 00090 }
CigiIGCtrlV3_2::~CigiIGCtrlV3_2 | ( | ) | [virtual] |
Cigi_uint32 CigiIGCtrlV3_2::GetLastRcvdIGFrame | ( | void | ) | const [inline] |
Gets the last received IG Frame id value
Definition at line 172 of file CigiIGCtrlV3_2.h.
00172 { return(LastRcvdIGFrame); }
Cigi_uint32 CigiIGCtrlV3_2::GetTimeStamp | ( | void | ) | const [inline] |
Gets the Timestamp value for V3
Definition at line 127 of file CigiIGCtrlV3_2.h.
00127 { return(TimeStampV3); }
bool CigiIGCtrlV3_2::GetTimeStampValid | ( | void | ) | const [inline] |
Gets the Timestamp valid flag for V3
Definition at line 148 of file CigiIGCtrlV3_2.h.
00148 { return(TimestampValid); }
int CigiIGCtrlV3_2::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 1
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. |
Implements CigiBaseIGCtrl.
Definition at line 108 of file CigiIGCtrlV3_2.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::TimeStampV3, and CigiBaseIGCtrl::TimestampValid.
00109 { 00110 PackPointer CDta; 00111 CigiVersionID PackingVer = *((CigiVersionID *)Spec); 00112 00113 CigiBaseIGCtrl *Data = ( CigiBaseIGCtrl *) Base; 00114 00115 if(PackingVer.GetCombinedCigiVersion() < 0x0302) 00116 PackingVer.SetCigiVersion(3,2); 00117 00118 CDta.c = Buff; 00119 00120 *CDta.c++ = PacketID; 00121 *CDta.c++ = PacketSize; 00122 *CDta.c++ = PackingVer.CigiMajorVersion; 00123 00124 *CDta.b++ = Data->DatabaseID; 00125 00126 Cigi_uint8 HDta = (PackingVer.CigiMinorVersion << 4) & 0xf0; 00127 HDta |= (Data->TimestampValid) ? 0x04 : 0; 00128 HDta |= (Cigi_uint8)(Data->IGMode & 0x03); 00129 00130 *CDta.c++ = HDta; 00131 *CDta.c++ = 0; 00132 *CDta.s++ = 0x8000; // Byte Swap value 00133 00134 *CDta.l++ = Data->FrameCntr; 00135 *CDta.l++ = Data->TimeStampV3; 00136 *CDta.l++ = Data->LastRcvdIGFrame; 00137 *CDta.l++ = 0; 00138 00139 return(PacketSize); 00140 00141 }
int CigiIGCtrlV3_2::SetFrameCntr | ( | const Cigi_uint32 | FrameCntrIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Frame Counter with bound checking control
FrameCntrIn | - Specifies the frame. | |
bndchk | - Enables (true) or disables (false) bounds checking |
Definition at line 113 of file CigiIGCtrlV3_2.h.
References CIGI_SUCCESS.
00114 { 00115 FrameCntr = FrameCntrIn; 00116 00117 return(CIGI_SUCCESS); 00118 }
int CigiIGCtrlV3_2::SetLastRcvdIGFrame | ( | const Cigi_uint32 | LastRcvdIGFrameIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the last received IG Frame with bound checking control
LastRcvdIGFrameIn | - Specifies the last received IG frame. | |
bndchk | - Enables (true) or disables (false) bounds checking |
Definition at line 182 of file CigiIGCtrlV3_2.h.
References CIGI_SUCCESS.
00183 { 00184 LastRcvdIGFrame = LastRcvdIGFrameIn; 00185 00186 return(CIGI_SUCCESS); 00187 }
int CigiIGCtrlV3_2::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.
TimeStamp | - Specifies the timestamp value. | |
bndchk | - Enables (true) or disables (false) bounds checking |
Definition at line 201 of file CigiIGCtrlV3_2.cpp.
References CIGI_SUCCESS, CigiBaseIGCtrl::TimeStampV1, CigiBaseIGCtrl::TimeStampV2, and CigiBaseIGCtrl::TimeStampV3.
00202 { 00203 00204 TimeStampV3 = TimeStamp; 00205 TimeStampV1 = TimeStampV3 / 10; 00206 TimeStampV2 = (float)TimeStampV1; 00207 00208 return(CIGI_SUCCESS); 00209 00210 }
int CigiIGCtrlV3_2::SetTimeStampValid | ( | const bool | TimeStampValidIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Timestamp valid flag for V3
TimeStampValidIn | - Sets or clears the Time Stamp Valid flag | |
bndchk | - Enables (true) or disables (false) bounds checking |
Definition at line 158 of file CigiIGCtrlV3_2.h.
References CIGI_SUCCESS.
00159 { 00160 TimestampValid = TimeStampValidIn; 00161 00162 return(CIGI_SUCCESS); 00163 }
int CigiIGCtrlV3_2::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 1
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. |
Implements CigiBaseIGCtrl.
Definition at line 147 of file CigiIGCtrlV3_2.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::TimeStampV1, CigiBaseIGCtrl::TimeStampV2, CigiBaseIGCtrl::TimeStampV3, and CigiBaseIGCtrl::TimestampValid.
00148 { 00149 00150 PackPointer CDta; 00151 00152 CDta.c = Buff; 00153 00154 CDta.c += 3; 00155 00156 DatabaseID = *CDta.b++; 00157 00158 Cigi_uint8 HDta = *CDta.c++; 00159 00160 IGMode = (IGModeGrp)(HDta & 0x03); 00161 TimestampValid = ((HDta & 0x04) != 0); 00162 00163 CDta.c++; 00164 00165 ByteSwap = *CDta.s++; 00166 BSwapEn = (ByteSwap == 0x0080); 00167 00168 00169 if(!BSwapEn) 00170 { 00171 FrameCntr = *CDta.l++; 00172 TimeStampV3 = *CDta.l++; 00173 LastRcvdIGFrame = *CDta.l++; 00174 } 00175 else 00176 { 00177 CigiSwap4(&FrameCntr, CDta.l++); 00178 CigiSwap4(&TimeStampV3, CDta.l++); 00179 CigiSwap4(&LastRcvdIGFrame, CDta.l++); 00180 } 00181 00182 TimeStampV1 = TimeStampV3 / 10; 00183 TimeStampV2 = (float)TimeStampV1; 00184 00185 00186 00187 return(CIGI_SUCCESS); 00188 00189 }