CigiHotRespV2 Class Reference

#include <CigiHotRespV2.h>

Inheritance diagram for CigiHotRespV2:

CigiBaseHatHotResp CigiBasePacket List of all members.

Public Member Functions

 CigiHotRespV2 ()
virtual ~CigiHotRespV2 ()
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 SetHot (const double HotIn, bool bndchk=true)
double GetHot (void) const
int SetMaterial (const Cigi_uint32 MaterialIn, bool bndchk=true)
Cigi_uint32 GetMaterial (void) const

Detailed Description

Definition at line 62 of file CigiHotRespV2.h.


Constructor & Destructor Documentation

CigiHotRespV2::CigiHotRespV2 (  ) 

General Constructor

Definition at line 90 of file CigiHotRespV2.cpp.

References CIGI_HOT_RESP_PACKET_ID_V2, CIGI_HOT_RESP_PACKET_SIZE_V2, CigiBaseHatHotResp::Hat, CigiBaseHatHotResp::HatHotID, CigiBaseHatHotResp::HostFrame, CigiBaseHatHotResp::Hot, 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_HOT_RESP_PACKET_ID_V2;
00094    PacketSize = CIGI_HOT_RESP_PACKET_SIZE_V2;
00095    Version = 2;
00096    MinorVersion = 0;
00097 
00098    HatHotID = 0;
00099    Valid = false;
00100    ReqType = HOT;
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 }

CigiHotRespV2::~CigiHotRespV2 (  )  [virtual]

General Destructor

Definition at line 115 of file CigiHotRespV2.cpp.

00116 {
00117 
00118 }


Member Function Documentation

int CigiHotRespV2::GetCnvt ( CigiVersionID CnvtVersion,
CigiCnvtInfoType::Type CnvtInfo 
) [virtual]

A virtual Conversion Information function. This function provides conversion information for this packet.

Parameters:
CnvtVersion - The CIGI version to which this packet is being converted.
CnvtInfo - The information needed for conversion
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Reimplemented from CigiBasePacket.

Definition at line 211 of file CigiHotRespV2.cpp.

References CIGI_HAT_HOT_RESP_PACKET_ID_V3, CIGI_HAT_RESP_PACKET_ID_V1, CIGI_HOT_RESP_PACKET_ID_V2, CIGI_SUCCESS, CigiVersionID::CigiMajorVersion, CigiCnvtInfoType::CigiCnvtInfoStruct::CnvtPacketID, CigiCnvtInfoType::CigiCnvtInfoStruct::ProcID, and CigiProcessType::ProcStd.

00213 {
00214    CnvtInfo.ProcID = CigiProcessType::ProcStd;
00215 
00216    switch(CnvtVersion.CigiMajorVersion)
00217    {
00218    case 1:
00219       // Note:  This does not provide a good conversion
00220       // This actually ends up being a HOT; however,
00221       // there is no way of actually providing a HAT.
00222       CnvtInfo.CnvtPacketID = CIGI_HAT_RESP_PACKET_ID_V1;
00223       break;
00224    case 2:
00225       CnvtInfo.CnvtPacketID = CIGI_HOT_RESP_PACKET_ID_V2;
00226       break;
00227    default:
00228       // The Packet ID for all V3 HatHotReq are the same ID
00229       CnvtInfo.CnvtPacketID = CIGI_HAT_HOT_RESP_PACKET_ID_V3;
00230       break;
00231    }
00232 
00233    return(CIGI_SUCCESS);
00234 }

double CigiHotRespV2::GetHot ( void   )  const [inline]

Gets the Hot value.

Returns:
the current Hot.

Definition at line 145 of file CigiHotRespV2.h.

00145 { return(Hot); }

Cigi_uint32 CigiHotRespV2::GetMaterial ( void   )  const [inline]

Gets the Material value.

Returns:
the current Material.

Definition at line 166 of file CigiHotRespV2.h.

00166 { return(Material); }

int CigiHotRespV2::Pack ( CigiBasePacket Base,
Cigi_uint8 Buff,
void *  Spec 
) const [virtual]

The virtual Pack function for CIGI 2

Parameters:
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.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseHatHotResp.

Definition at line 127 of file CigiHotRespV2.cpp.

References PackPointerUnion::c, CIGI_HOT_RESP_PACKET_SIZE_V2, CIGI_SCOPY2, CIGI_SCOPY4, CIGI_SCOPY8, PackPointerUnion::d, CigiBaseHatHotResp::HatHotID, CigiBaseHatHotResp::Hot, PackPointerUnion::l, CigiBaseHatHotResp::Material, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiBaseHatHotResp::Valid, and CigiBaseHatHotResp::VldHot.

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 tHot;
00145 
00146    if(Data->Valid && Data->VldHot)
00147    {
00148       *CDta.c++ = 0x80;
00149       *CDta.c++ = 0;
00150       *CDta.s++ = 0;
00151       tHot = Data->Hot;
00152    }
00153    else
00154    {
00155       *CDta.l++ = 0;
00156       tHot = 0.0;
00157    }
00158 
00159    *CDta.l++ = 0;
00160 
00161    CIGI_SCOPY4(CDta.l++, &Data->Material);
00162    CIGI_SCOPY8(CDta.d++, &tHot);
00163 
00164    memcpy(Buff,tBuf,CIGI_HOT_RESP_PACKET_SIZE_V2);
00165 
00166    return(PacketSize);
00167 
00168 }

int CigiHotRespV2::SetHot ( const double  HotIn,
bool  bndchk = true 
) [inline]

Sets the Hot with bound checking control

Parameters:
HotIn - The Hot result data.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 135 of file CigiHotRespV2.h.

References CIGI_SUCCESS.

00136    {
00137       Hot = HotIn;
00138       VldHot = true;
00139       return(CIGI_SUCCESS);
00140    }

int CigiHotRespV2::SetMaterial ( const Cigi_uint32  MaterialIn,
bool  bndchk = true 
) [inline]

Sets the Material with bound checking control

Parameters:
MaterialIn - The material code of the test point
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 157 of file CigiHotRespV2.h.

References CIGI_SUCCESS.

00158    {
00159       Material = MaterialIn;
00160       return(CIGI_SUCCESS);
00161    }

int CigiHotRespV2::Unpack ( Cigi_uint8 Buff,
bool  Swap,
void *  Spec 
) [virtual]

The virtual Unpack function for CIGI 2

Parameters:
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.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseHatHotResp.

Definition at line 173 of file CigiHotRespV2.cpp.

References PackPointerUnion::c, CIGI_HOT_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.

00174 {
00175    double DBuf[6];
00176 
00177    Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf;
00178 
00179    PackPointer CDta;
00180 
00181    memcpy(tBuf,Buff,CIGI_HOT_RESP_PACKET_SIZE_V2);
00182 
00183    CDta.d = DBuf;
00184 
00185    CDta.c += 2;  // Step over packet id and size
00186 
00187    CIGI_SCOPY2(&HatHotID, CDta.s++);
00188 
00189    Valid = (*CDta.l++ != 0);
00190 
00191    CDta.l++;
00192 
00193    CIGI_SCOPY4(&Material, CDta.l++);
00194    CIGI_SCOPY8(&Hot, CDta.d++);
00195 
00196    Hat = 0.0;
00197 
00198    VldHat = Valid;
00199    VldHot = false;
00200 
00201    HostFrame = 0;
00202 
00203    return(PacketSize);
00204 
00205 }


The documentation for this class was generated from the following files:
Generated on Wed Apr 29 09:00:08 2009 for CCL by  doxygen 1.4.7