#include <CigiHatRespV1.h>
Inheritance diagram for CigiHatRespV1:
Public Member Functions | |
CigiHatRespV1 () | |
virtual | ~CigiHatRespV1 () |
virtual int | Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const |
virtual int | Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec) |
virtual int | GetCnvt (CigiVersionID &CnvtVersion, CigiCnvtInfoType::Type &CnvtInfo) |
int | SetHat (const double HatIn, bool bndchk=true) |
double | GetHat (void) const |
int | SetMaterial (const Cigi_uint32 MaterialIn, bool bndchk=true) |
Cigi_uint32 | GetMaterial (void) const |
Definition at line 61 of file CigiHatRespV1.h.
CigiHatRespV1::CigiHatRespV1 | ( | ) |
General Constructor
Definition at line 90 of file CigiHatRespV1.cpp.
References CIGI_HAT_RESP_PACKET_ID_V1, CIGI_HAT_RESP_PACKET_SIZE_V1, CigiBaseHatHotResp::Hat, CigiBaseHatHotResp::HAT, CigiBaseHatHotResp::HatHotID, CigiBaseHatHotResp::HostFrame, CigiBaseHatHotResp::Hot, CigiBaseHatHotResp::Material, CigiBasePacket::MinorVersion, CigiBaseHatHotResp::NormAz, CigiBaseHatHotResp::NormEl, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseHatHotResp::ReqType, CigiBaseHatHotResp::Valid, CigiBasePacket::Version, CigiBaseHatHotResp::VldHat, and CigiBaseHatHotResp::VldHot.
00091 { 00092 00093 PacketID = CIGI_HAT_RESP_PACKET_ID_V1; 00094 PacketSize = CIGI_HAT_RESP_PACKET_SIZE_V1; 00095 Version = 1; 00096 MinorVersion = 0; 00097 00098 HatHotID = 0; 00099 Valid = false; 00100 ReqType = HAT; 00101 HostFrame = 0; 00102 Hat = 0.0; 00103 Hot = 0.0; 00104 Material = 0; 00105 NormAz = 0.0; 00106 NormEl = 0.0; 00107 VldHat = false; 00108 VldHot = false; 00109 00110 }
CigiHatRespV1::~CigiHatRespV1 | ( | ) | [virtual] |
int CigiHatRespV1::GetCnvt | ( | CigiVersionID & | CnvtVersion, | |
CigiCnvtInfoType::Type & | CnvtInfo | |||
) | [virtual] |
A virtual Conversion Information function. This function provides conversion information for this packet.
CnvtVersion | - The CIGI version to which this packet is being converted. | |
CnvtInfo | - The information needed for conversion |
Reimplemented from CigiBasePacket.
Definition at line 212 of file CigiHatRespV1.cpp.
References CIGI_HAT_HOT_RESP_PACKET_ID_V3, CIGI_SUCCESS, CigiCnvtInfoType::CigiCnvtInfoStruct::CnvtPacketID, CigiCnvtInfoType::CigiCnvtInfoStruct::ProcID, and CigiProcessType::ProcStd.
00214 { 00215 CnvtInfo.ProcID = CigiProcessType::ProcStd; 00216 00217 // Note: All HAT and HAT/HOT resp have the same ID 00218 CnvtInfo.CnvtPacketID = CIGI_HAT_HOT_RESP_PACKET_ID_V3; 00219 00220 return(CIGI_SUCCESS); 00221 }
double CigiHatRespV1::GetHat | ( | void | ) | const [inline] |
Gets the Hat value.
Definition at line 144 of file CigiHatRespV1.h.
00144 { return(Hat); }
Cigi_uint32 CigiHatRespV1::GetMaterial | ( | void | ) | const [inline] |
Gets the Material value.
Definition at line 165 of file CigiHatRespV1.h.
00165 { return(Material); }
int CigiHatRespV1::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 CigiBaseHatHotResp.
Definition at line 127 of file CigiHatRespV1.cpp.
References PackPointerUnion::c, CIGI_HAT_RESP_PACKET_SIZE_V1, CIGI_SCOPY2, CIGI_SCOPY4, PackPointerUnion::d, PackPointerUnion::f, CigiBaseHatHotResp::Hat, CigiBaseHatHotResp::HatHotID, PackPointerUnion::l, CigiBaseHatHotResp::Material, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiBaseHatHotResp::Valid, and CigiBaseHatHotResp::VldHat.
00128 { 00129 double DBuf[6]; 00130 00131 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00132 00133 PackPointer CDta; 00134 00135 CigiBaseHatHotResp * Data = ( CigiBaseHatHotResp *)Base; 00136 00137 CDta.d = DBuf; 00138 00139 *CDta.c++ = PacketID; 00140 *CDta.c++ = PacketSize; 00141 00142 CIGI_SCOPY2(CDta.s++, &Data->HatHotID); 00143 00144 float tHat; 00145 00146 if(Data->Valid && Data->VldHat) 00147 { 00148 *CDta.c++ = 0x80; 00149 *CDta.c++ = 0; 00150 *CDta.s++ = 0; 00151 tHat = (float)Data->Hat; 00152 } 00153 else 00154 { 00155 *CDta.l++ = 0; 00156 tHat = 0.0f; 00157 } 00158 00159 CIGI_SCOPY4(CDta.l++, &Data->Material); 00160 CIGI_SCOPY4(CDta.f++, &tHat); 00161 00162 memcpy(Buff,tBuf,CIGI_HAT_RESP_PACKET_SIZE_V1); 00163 00164 return(PacketSize); 00165 00166 }
int CigiHatRespV1::SetHat | ( | const double | HatIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Hat with bound checking control
HatIn | - The Hat result data. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 134 of file CigiHatRespV1.h.
References CIGI_SUCCESS.
00135 { 00136 Hat = HatIn; 00137 VldHat = true; 00138 return(CIGI_SUCCESS); 00139 }
int CigiHatRespV1::SetMaterial | ( | const Cigi_uint32 | MaterialIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Material with bound checking control
MaterialIn | - The material code of the test point | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 156 of file CigiHatRespV1.h.
References CIGI_SUCCESS.
00157 { 00158 Material = MaterialIn; 00159 return(CIGI_SUCCESS); 00160 }
int CigiHatRespV1::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 CigiBaseHatHotResp.
Definition at line 171 of file CigiHatRespV1.cpp.
References PackPointerUnion::c, CIGI_HAT_RESP_PACKET_SIZE_V1, CIGI_SCOPY2, CIGI_SCOPY4, PackPointerUnion::d, PackPointerUnion::f, CigiBaseHatHotResp::Hat, CigiBaseHatHotResp::HatHotID, CigiBaseHatHotResp::HostFrame, CigiBaseHatHotResp::Hot, PackPointerUnion::l, CigiBaseHatHotResp::Material, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiBaseHatHotResp::Valid, CigiBaseHatHotResp::VldHat, and CigiBaseHatHotResp::VldHot.
00172 { 00173 double DBuf[6]; 00174 00175 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00176 00177 PackPointer CDta; 00178 00179 memcpy(tBuf,Buff,CIGI_HAT_RESP_PACKET_SIZE_V1); 00180 00181 CDta.d = DBuf; 00182 00183 CDta.c += 2; // Step over packet id and size 00184 00185 CIGI_SCOPY2(&HatHotID, CDta.s++); 00186 00187 Valid = (*CDta.c++ != 0); 00188 00189 CDta.c += 3; 00190 00191 CIGI_SCOPY4(&Material, CDta.l++); 00192 00193 float tHat; 00194 CIGI_SCOPY4(&tHat, CDta.f++); 00195 Hat = (double) tHat; 00196 00197 Hot = 0.0; 00198 00199 VldHat = Valid; 00200 VldHot = false; 00201 00202 HostFrame = 0; 00203 00204 return(PacketSize); 00205 00206 }