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