#include <CigiHatRespV2.h>
Inheritance diagram for CigiHatRespV2:
Public Member Functions | |
CigiHatRespV2 () | |
virtual | ~CigiHatRespV2 () |
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 62 of file CigiHatRespV2.h.
CigiHatRespV2::CigiHatRespV2 | ( | ) |
General Constructor
Definition at line 90 of file CigiHatRespV2.cpp.
References CIGI_HAT_RESP_PACKET_ID_V2, CIGI_HAT_RESP_PACKET_SIZE_V2, 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_V2; 00094 PacketSize = CIGI_HAT_RESP_PACKET_SIZE_V2; 00095 Version = 2; 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 }
CigiHatRespV2::~CigiHatRespV2 | ( | ) | [virtual] |
int CigiHatRespV2::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 211 of file CigiHatRespV2.cpp.
References CIGI_HAT_HOT_RESP_PACKET_ID_V3, CIGI_SUCCESS, CigiCnvtInfoType::CigiCnvtInfoStruct::CnvtPacketID, CigiCnvtInfoType::CigiCnvtInfoStruct::ProcID, and CigiProcessType::ProcStd.
00213 { 00214 CnvtInfo.ProcID = CigiProcessType::ProcStd; 00215 00216 // Note: All HAT and HAT/HOT resp have the same ID 00217 CnvtInfo.CnvtPacketID = CIGI_HAT_HOT_RESP_PACKET_ID_V3; 00218 00219 return(CIGI_SUCCESS); 00220 }
double CigiHatRespV2::GetHat | ( | void | ) | const [inline] |
Gets the Hat value.
Definition at line 145 of file CigiHatRespV2.h.
00145 { return(Hat); }
Cigi_uint32 CigiHatRespV2::GetMaterial | ( | void | ) | const [inline] |
Gets the Material value.
Definition at line 166 of file CigiHatRespV2.h.
00166 { return(Material); }
int CigiHatRespV2::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 2
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 CigiHatRespV2.cpp.
References PackPointerUnion::c, CIGI_HAT_RESP_PACKET_SIZE_V2, CIGI_SCOPY2, CIGI_SCOPY4, CIGI_SCOPY8, PackPointerUnion::d, 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 double tHat; 00145 00146 if(Data->Valid && Data->VldHat) 00147 { 00148 *CDta.c++ = 0x80; 00149 *CDta.c++ = 0; 00150 *CDta.s++ = 0; 00151 tHat = Data->Hat; 00152 } 00153 else 00154 { 00155 *CDta.l++ = 0; 00156 tHat = 0.0; 00157 } 00158 00159 *CDta.l++ = 0; 00160 00161 CIGI_SCOPY4(CDta.l++, &Data->Material); 00162 CIGI_SCOPY8(CDta.d++, &tHat); 00163 00164 00165 memcpy(Buff,tBuf,CIGI_HAT_RESP_PACKET_SIZE_V2); 00166 00167 return(PacketSize); 00168 00169 }
int CigiHatRespV2::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 135 of file CigiHatRespV2.h.
References CIGI_SUCCESS.
00136 { 00137 Hat = HatIn; 00138 VldHat = true; 00139 return(CIGI_SUCCESS); 00140 }
int CigiHatRespV2::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 157 of file CigiHatRespV2.h.
References CIGI_SUCCESS.
00158 { 00159 Material = MaterialIn; 00160 return(CIGI_SUCCESS); 00161 }
int CigiHatRespV2::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 2
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 174 of file CigiHatRespV2.cpp.
References PackPointerUnion::c, CIGI_HAT_RESP_PACKET_SIZE_V2, CIGI_SCOPY2, CIGI_SCOPY4, CIGI_SCOPY8, PackPointerUnion::d, CigiBaseHatHotResp::Hat, CigiBaseHatHotResp::HatHotID, CigiBaseHatHotResp::HostFrame, CigiBaseHatHotResp::Hot, PackPointerUnion::l, CigiBaseHatHotResp::Material, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiBaseHatHotResp::Valid, CigiBaseHatHotResp::VldHat, and CigiBaseHatHotResp::VldHot.
00175 { 00176 double DBuf[6]; 00177 00178 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00179 00180 PackPointer CDta; 00181 00182 memcpy(tBuf,Buff,CIGI_HAT_RESP_PACKET_SIZE_V2); 00183 00184 CDta.d = DBuf; 00185 00186 CDta.c += 2; // Step over packet id and size 00187 00188 CIGI_SCOPY2(&HatHotID, CDta.s++); 00189 00190 Valid = (*CDta.l++ != 0); 00191 00192 CDta.l++; 00193 00194 CIGI_SCOPY4(&Material, CDta.l++); 00195 CIGI_SCOPY8(&Hat, CDta.d++); 00196 00197 Hot = 0.0; 00198 VldHat = Valid; 00199 VldHot = false; 00200 00201 HostFrame = 0; 00202 00203 return(PacketSize); 00204 00205 }