#include <CigiRateCtrlV1.h>
Inheritance diagram for CigiRateCtrlV1:
Public Member Functions | |
CigiRateCtrlV1 () | |
virtual | ~CigiRateCtrlV1 () |
virtual int | Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const |
virtual int | Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec) |
int | SetArtPartID (const Cigi_int8 ArtPartIDIn, bool bndchk=true) |
Cigi_int8 | GetArtPartID (void) const |
Definition at line 58 of file CigiRateCtrlV1.h.
CigiRateCtrlV1::CigiRateCtrlV1 | ( | ) |
General Constructor
Definition at line 85 of file CigiRateCtrlV1.cpp.
References CigiBaseRateCtrl::ApplyToArtPart, CigiBaseRateCtrl::ArtPartIDV1, CigiBaseRateCtrl::ArtPartIDV3, CIGI_RATE_CTRL_PACKET_ID_V1, CIGI_RATE_CTRL_PACKET_SIZE_V1, CigiBaseRateCtrl::CoordSys, CigiBaseRateCtrl::EntityID, CigiBaseRateCtrl::Local, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseRateCtrl::PitchRate, CigiBaseRateCtrl::RollRate, CigiBasePacket::Version, CigiBaseRateCtrl::XRate, CigiBaseRateCtrl::YawRate, CigiBaseRateCtrl::YRate, and CigiBaseRateCtrl::ZRate.
00086 { 00087 00088 PacketID = CIGI_RATE_CTRL_PACKET_ID_V1; 00089 PacketSize = CIGI_RATE_CTRL_PACKET_SIZE_V1; 00090 Version = 1; 00091 MinorVersion = 0; 00092 00093 EntityID = 0; 00094 ArtPartIDV1 = 0; 00095 ArtPartIDV3 = 0; 00096 ApplyToArtPart = false; 00097 CoordSys = Local; 00098 XRate = 0.0; 00099 YRate = 0.0; 00100 ZRate = 0.0; 00101 RollRate = 0.0; 00102 PitchRate = 0.0; 00103 YawRate = 0.0; 00104 00105 }
CigiRateCtrlV1::~CigiRateCtrlV1 | ( | ) | [virtual] |
Cigi_int8 CigiRateCtrlV1::GetArtPartID | ( | void | ) | const [inline] |
Gets the ArtPartIDV1 value.
Definition at line 122 of file CigiRateCtrlV1.h.
00122 { return(ArtPartIDV1); }
int CigiRateCtrlV1::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 CigiBaseRateCtrl.
Definition at line 122 of file CigiRateCtrlV1.cpp.
References CigiBaseRateCtrl::ArtPartIDV1, PackPointerUnion::c, CIGI_RATE_CTRL_PACKET_SIZE_V1, CIGI_SCOPY2, CIGI_SCOPY4, PackPointerUnion::d, CigiBaseRateCtrl::EntityID, PackPointerUnion::f, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseRateCtrl::PitchRate, CigiBaseRateCtrl::RollRate, PackPointerUnion::s, CigiBaseRateCtrl::XRate, CigiBaseRateCtrl::YawRate, CigiBaseRateCtrl::YRate, and CigiBaseRateCtrl::ZRate.
00123 { 00124 double DBuf[6]; 00125 00126 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00127 00128 PackPointer CDta; 00129 00130 CigiBaseRateCtrl * Data = ( CigiBaseRateCtrl *)Base; 00131 00132 CDta.d = DBuf; 00133 00134 *CDta.c++ = PacketID; 00135 *CDta.c++ = PacketSize; 00136 00137 CIGI_SCOPY2(CDta.s++, &Data->EntityID); 00138 *CDta.c++ = Data->ArtPartIDV1; 00139 00140 *CDta.c++ = 0; 00141 *CDta.s++ = 0; 00142 00143 CIGI_SCOPY4(CDta.f++, &Data->XRate); 00144 CIGI_SCOPY4(CDta.f++, &Data->YRate); 00145 CIGI_SCOPY4(CDta.f++, &Data->ZRate); 00146 CIGI_SCOPY4(CDta.f++, &Data->RollRate); 00147 CIGI_SCOPY4(CDta.f++, &Data->PitchRate); 00148 CIGI_SCOPY4(CDta.f++, &Data->YawRate); 00149 00150 memcpy(Buff,tBuf,CIGI_RATE_CTRL_PACKET_SIZE_V1); 00151 00152 return(PacketSize); 00153 00154 }
int CigiRateCtrlV1::SetArtPartID | ( | const Cigi_int8 | ArtPartIDIn, | |
bool | bndchk = true | |||
) |
Sets the ArtPartIDV1 with bound checking control
ArtPartIDIn | - Specifies the art part to which this packet's data is applied. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 226 of file CigiRateCtrlV1.cpp.
References CigiBaseRateCtrl::ApplyToArtPart, CigiBaseRateCtrl::ArtPartIDV1, CigiBaseRateCtrl::ArtPartIDV3, and CIGI_SUCCESS.
00227 { 00228 union ArtPartConv 00229 { 00230 Cigi_uint8 uc; 00231 Cigi_int8 c; 00232 } ArtC; 00233 00234 ArtPartIDV1 = ArtPartIDIn; 00235 00236 if(ArtPartIDV1 == -1) 00237 { 00238 00239 ApplyToArtPart = false; 00240 00241 ArtPartIDV3 = 0; 00242 00243 } 00244 else 00245 { 00246 00247 ApplyToArtPart = true; 00248 00249 ArtC.c = ArtPartIDV1; 00250 ArtPartIDV3 = ArtC.uc; 00251 00252 00253 } 00254 00255 return(CIGI_SUCCESS); 00256 }
int CigiRateCtrlV1::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 | - N/A for V1 & V2 | |
Spec | - A pointer to special data - This is not used in this class. |
Implements CigiBaseRateCtrl.
Definition at line 159 of file CigiRateCtrlV1.cpp.
References CigiBaseRateCtrl::ApplyToArtPart, CigiBaseRateCtrl::ArtPartIDV1, CigiBaseRateCtrl::ArtPartIDV3, PackPointerUnion::c, CIGI_RATE_CTRL_PACKET_SIZE_V1, CIGI_SCOPY2, CIGI_SCOPY4, CigiBaseRateCtrl::CoordSys, PackPointerUnion::d, CigiBaseRateCtrl::EntityID, PackPointerUnion::f, CigiBaseRateCtrl::Local, CigiBasePacket::PacketSize, CigiBaseRateCtrl::PitchRate, CigiBaseRateCtrl::RollRate, PackPointerUnion::s, CigiBaseRateCtrl::XRate, CigiBaseRateCtrl::YawRate, CigiBaseRateCtrl::YRate, and CigiBaseRateCtrl::ZRate.
00160 { 00161 double DBuf[6]; 00162 00163 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00164 00165 union ArtPartConv 00166 { 00167 Cigi_uint8 uc; 00168 Cigi_int8 c; 00169 } ArtC; 00170 00171 PackPointer CDta; 00172 00173 memcpy(tBuf,Buff,CIGI_RATE_CTRL_PACKET_SIZE_V1); 00174 00175 CDta.d = DBuf; 00176 00177 CDta.c += 2; // Step over packet id and size 00178 00179 CIGI_SCOPY2(&EntityID, CDta.s++); 00180 ArtPartIDV1 = *CDta.c++; 00181 00182 CDta.c += 3; 00183 00184 CIGI_SCOPY4(&XRate, CDta.f++); 00185 CIGI_SCOPY4(&YRate, CDta.f++); 00186 CIGI_SCOPY4(&ZRate, CDta.f++); 00187 CIGI_SCOPY4(&RollRate, CDta.f++); 00188 CIGI_SCOPY4(&PitchRate, CDta.f++); 00189 CIGI_SCOPY4(&YawRate, CDta.f++); 00190 00191 if(ArtPartIDV1 == -1) 00192 { 00193 00194 ApplyToArtPart = false; 00195 00196 ArtPartIDV3 = 0; 00197 00198 } 00199 else 00200 { 00201 00202 ApplyToArtPart = true; 00203 00204 ArtC.c = ArtPartIDV1; 00205 ArtPartIDV3 = ArtC.uc; 00206 00207 00208 } 00209 00210 CoordSys = Local; 00211 00212 return(PacketSize); 00213 00214 }