#include <CigiIGCtrlV2.h>
Inheritance diagram for CigiIGCtrlV2:
Public Member Functions | |
CigiIGCtrlV2 () | |
virtual | ~CigiIGCtrlV2 () |
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) |
float | GetTimeStamp (void) const |
int | SetTimeStamp (const float TimeStamp, bool bndchk=true) |
TrackDeviceEnGrp | GetTrackDeviceEn (void) const |
int | SetTrackDeviceEn (const TrackDeviceEnGrp TrackDeviceEnIn, bool bndchk=true) |
bool | GetBoresightTrackDevice (void) const |
int | SetBoresightTrackDevice (const bool BoresightTrackDeviceIn, bool bndchk=true) |
Definition at line 66 of file CigiIGCtrlV2.h.
CigiIGCtrlV2::CigiIGCtrlV2 | ( | ) |
Definition at line 88 of file CigiIGCtrlV2.cpp.
References CigiBaseIGCtrl::BoresightTrackDevice, CigiBaseIGCtrl::BSwapEn, CigiBaseIGCtrl::ByteSwap, CIGI_IG_CTRL_PACKET_ID_V2, CIGI_IG_CTRL_PACKET_SIZE_V2, 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.
00089 { 00090 00091 PacketID = CIGI_IG_CTRL_PACKET_ID_V2; 00092 PacketSize = CIGI_IG_CTRL_PACKET_SIZE_V2; 00093 Version = 2; 00094 MinorVersion = 0; 00095 00096 BSwapEn = false; 00097 DatabaseID = 0; 00098 FrameCntr = 0; 00099 TimeStampV1 = 0; 00100 TimeStampV2 = 0.0f; 00101 TimeStampV3 = 0; 00102 ByteSwap = 0x8000; 00103 IGMode = Standby; 00104 TrackDeviceEn = Disable; 00105 BoresightTrackDevice = false; 00106 TimestampValid = false; 00107 SmoothingEn = false; 00108 LastRcvdIGFrame = 0; 00109 00110 }
CigiIGCtrlV2::~CigiIGCtrlV2 | ( | ) | [virtual] |
bool CigiIGCtrlV2::GetBoresightTrackDevice | ( | void | ) | const [inline] |
Gets the Boresight Tracking Device flag for V2
Definition at line 168 of file CigiIGCtrlV2.h.
00168 { return(BoresightTrackDevice); }
float CigiIGCtrlV2::GetTimeStamp | ( | void | ) | const [inline] |
Gets the Timestamp value for V2
Definition at line 129 of file CigiIGCtrlV2.h.
00129 { return(TimeStampV2); }
TrackDeviceEnGrp CigiIGCtrlV2::GetTrackDeviceEn | ( | void | ) | const [inline] |
Gets the Tracking Device Enable flag for V2
Definition at line 149 of file CigiIGCtrlV2.h.
00149 { return(TrackDeviceEn); }
int CigiIGCtrlV2::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 130 of file CigiIGCtrlV2.cpp.
References PackPointerUnion::b, CigiBaseIGCtrl::BoresightTrackDevice, PackPointerUnion::c, CIGI_SCOPY4, CigiBaseIGCtrl::DatabaseID, PackPointerUnion::f, CigiBaseIGCtrl::FrameCntr, CigiBaseIGCtrl::IGMode, PackPointerUnion::l, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseIGCtrl::TimeStampV2, CigiBaseIGCtrl::TrackDeviceEn, and CigiBasePacket::Version.
00131 { 00132 PackPointer CDta; 00133 00134 CigiBaseIGCtrl *Data = ( CigiBaseIGCtrl *) Base; 00135 00136 00137 CDta.c = Buff; 00138 00139 *CDta.c++ = PacketID; 00140 *CDta.c++ = PacketSize; 00141 *CDta.c++ = Version; 00142 00143 *CDta.b++ = Data->DatabaseID; 00144 00145 Cigi_uint8 HDta = (Data->BoresightTrackDevice) ? 0x10 : 0; 00146 HDta |= (Cigi_uint8)((Data->TrackDeviceEn << 5) & 0x20); 00147 HDta |= (Cigi_uint8)((Data->IGMode << 6) & 0xc0); 00148 00149 *CDta.c++ = HDta; 00150 *CDta.c++ = 0; 00151 *CDta.c++ = 0; 00152 *CDta.c++ = 0; 00153 00154 CIGI_SCOPY4(CDta.l++, &Data->FrameCntr); 00155 CIGI_SCOPY4(CDta.f++, &Data->TimeStampV2); 00156 00157 return(PacketSize); 00158 00159 }
int CigiIGCtrlV2::SetBoresightTrackDevice | ( | const bool | BoresightTrackDeviceIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Boresight Tracking Device flag for V2.
BoresightTrackDeviceIn | - Specifies the Boresight Tracking Device command. | |
bndchk | - Enables (true) or disables (false) bounds checking |
Definition at line 179 of file CigiIGCtrlV2.h.
References CIGI_SUCCESS.
00181 { 00182 BoresightTrackDevice = BoresightTrackDeviceIn; 00183 00184 return(CIGI_SUCCESS); 00185 00186 }
int CigiIGCtrlV2::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 114 of file CigiIGCtrlV2.h.
References CIGI_SUCCESS.
00115 { 00116 FrameCntr = FrameCntrIn; 00117 LastRcvdIGFrame = FrameCntrIn; 00118 00119 return(CIGI_SUCCESS); 00120 }
int CigiIGCtrlV2::SetTimeStamp | ( | const float | TimeStamp, | |
bool | bndchk = true | |||
) |
Sets the Timestamp value for V2.
This also converts to and sets the V1 and V3 timestamp values.
TimeStamp | - Specifies the timestamp value. | |
bndchk | - Enables (true) or disables (false) bounds checking |
Definition at line 207 of file CigiIGCtrlV2.cpp.
References CIGI_SUCCESS, CigiBaseIGCtrl::TimeStampV1, CigiBaseIGCtrl::TimeStampV2, CigiBaseIGCtrl::TimeStampV3, and CigiBaseIGCtrl::TimestampValid.
00208 { 00209 00210 TimeStampV2 = TimeStamp; 00211 TimeStampV1 = (Cigi_uint32)TimeStamp; 00212 TimeStampV3 = TimeStampV1 / 10; 00213 00214 TimestampValid = true; 00215 00216 return(CIGI_SUCCESS); 00217 00218 }
int CigiIGCtrlV2::SetTrackDeviceEn | ( | const TrackDeviceEnGrp | TrackDeviceEnIn, | |
bool | bndchk = true | |||
) |
Sets the Tracking Device Enable flag for V2.
TrackDeviceEnIn | - Specifies the Tracking Device Enable flag. | |
bndchk | - Enables (true) or disables (false) bounds checking |
Definition at line 224 of file CigiIGCtrlV2.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseIGCtrl::TrackDeviceEn.
00225 { 00226 00227 #ifndef CIGI_NO_BND_CHK 00228 if(bndchk && ((TrackDeviceEnIn < 0)||(TrackDeviceEnIn > 1))) 00229 { 00230 #ifndef CIGI_NO_EXCEPT 00231 throw CigiValueOutOfRangeException("TrackDeviceEn",TrackDeviceEnIn,0,1); 00232 #endif 00233 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00234 } 00235 #endif 00236 00237 TrackDeviceEn = TrackDeviceEnIn; 00238 00239 return(CIGI_SUCCESS); 00240 00241 }
int CigiIGCtrlV2::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 165 of file CigiIGCtrlV2.cpp.
References PackPointerUnion::b, CigiBaseIGCtrl::BoresightTrackDevice, PackPointerUnion::c, CIGI_SCOPY4, CIGI_SUCCESS, CigiBaseIGCtrl::DatabaseID, PackPointerUnion::f, CigiBaseIGCtrl::FrameCntr, CigiBaseIGCtrl::IGMode, PackPointerUnion::l, CigiBaseIGCtrl::LastRcvdIGFrame, CigiBaseIGCtrl::TimeStampV1, CigiBaseIGCtrl::TimeStampV2, CigiBaseIGCtrl::TimeStampV3, and CigiBaseIGCtrl::TrackDeviceEn.
00166 { 00167 00168 PackPointer CDta; 00169 00170 CDta.c = Buff; 00171 00172 CDta.c += 3; 00173 00174 DatabaseID = *CDta.b++; 00175 Cigi_uint8 HDta = *CDta.c; 00176 00177 IGMode = (IGModeGrp)((HDta >> 6) & 0x03); 00178 TrackDeviceEn = (TrackDeviceEnGrp)((HDta >> 5) & 0x01); 00179 BoresightTrackDevice = ((HDta & 0x10) != 0); 00180 00181 CDta.l++; 00182 00183 CIGI_SCOPY4(&FrameCntr,CDta.l++); 00184 CIGI_SCOPY4(&TimeStampV2,CDta.f++); 00185 00186 TimeStampV1 = (Cigi_uint32)TimeStampV2; 00187 TimeStampV3 = TimeStampV1 / 10; 00188 00189 LastRcvdIGFrame = FrameCntr; 00190 00191 Swap = false; 00192 00193 return(CIGI_SUCCESS); 00194 00195 }