#include <CigiCompCtrlV3_3.h>
Inheritance diagram for CigiCompCtrlV3_3:
Public Member Functions | |
CigiCompCtrlV3_3 () | |
virtual | ~CigiCompCtrlV3_3 () |
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 | SetInstanceID (const Cigi_uint16 InstanceIDIn, bool bndchk=true) |
Cigi_uint16 | GetInstanceID (void) const |
int | SetCompState (const Cigi_uint8 CompStateIn, bool bndchk=true) |
Cigi_uint8 | GetCompState (void) |
int | SetCompClassV3 (const CompClassV3Grp CompClassV3In, bool bndchk=true) |
CompClassV3Grp | GetCompClassV3 (void) const |
int | SetCompData (const Cigi_uint8 CompDataIn, const unsigned int Word, const BytePos Pos, bool bndchk=true) |
int | SetCompData (const Cigi_int8 CompDataIn, const unsigned int Word, const BytePos Pos, bool bndchk=true) |
int | SetCompData (const Cigi_uint16 CompDataIn, const unsigned int Word, const HalfWordPos Pos, bool bndchk=true) |
int | SetCompData (const Cigi_int16 CompDataIn, const unsigned int Word, const HalfWordPos Pos, bool bndchk=true) |
int | SetCompData (const Cigi_uint32 CompDataIn, const unsigned int Word, bool bndchk=true) |
int | SetCompData (const Cigi_int32 CompDataIn, const unsigned int Word, bool bndchk=true) |
int | SetCompData (const float CompDataIn, const unsigned int Word, bool bndchk=true) |
int | SetCompData (const Cigi_uint64 CompDataIn, const unsigned int Pos, bool bndchk=true) |
int | SetCompData (const double CompDataIn, const unsigned int Pos, bool bndchk=true) |
Cigi_uint8 | GetUCharCompData (const unsigned int Word, const BytePos Pos) |
Cigi_int8 | GetCharCompData (const unsigned int Word, const BytePos Pos) |
Cigi_uint16 | GetUShortCompData (const unsigned int Word, const HalfWordPos Pos) |
Cigi_int16 | GetShortCompData (const unsigned int Word, const HalfWordPos Pos) |
Cigi_uint32 | GetULongCompData (const unsigned int Word) |
Cigi_int32 | GetLongCompData (const unsigned int Word) |
float | GetFloatCompData (const unsigned int Word) |
Cigi_uint64 | GetI64CompData (const unsigned int Pos) |
double | GetDoubleCompData (const unsigned int Pos) |
Static Protected Attributes | |
static const int | CompClassCnvtSz = 16 |
static const CompAssocGrp | CompClassV3xV1 [CompClassCnvtSz] |
static const CompClassV2Grp | CompClassV3xV2 [CompClassCnvtSz] |
Definition at line 77 of file CigiCompCtrlV3_3.h.
CigiCompCtrlV3_3::CigiCompCtrlV3_3 | ( | ) |
General Constructor
Definition at line 109 of file CigiCompCtrlV3_3.cpp.
References CIGI_COMP_CTRL_PACKET_ID_V3_3, CIGI_COMP_CTRL_PACKET_SIZE_V3_3, CigiBaseCompCtrl::CompAssoc, CigiBaseCompCtrl::CompClassV2, CigiBaseCompCtrl::CompClassV3, CigiBaseCompCtrl::CompData, CigiBaseCompCtrl::CompID, CigiBaseCompCtrl::CompState, CigiBaseCompCtrl::Entity, CigiBaseCompCtrl::EntityID, CigiBaseCompCtrl::EntityV2, CigiBaseCompCtrl::EntityV3, CigiBaseCompCtrl::InstanceID, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBasePacket::Version, and CigiBaseCompCtrl::ViewID.
00110 { 00111 00112 PacketID = CIGI_COMP_CTRL_PACKET_ID_V3_3; 00113 PacketSize = CIGI_COMP_CTRL_PACKET_SIZE_V3_3; 00114 Version = 3; 00115 MinorVersion = 3; 00116 00117 CompID = 0; 00118 InstanceID = 0; 00119 EntityID = 0; 00120 ViewID = 0; 00121 CompState = 0; 00122 CompAssoc = CigiBaseCompCtrl::Entity; 00123 CompClassV2 = CigiBaseCompCtrl::EntityV2; 00124 CompClassV3 = CigiBaseCompCtrl::EntityV3; 00125 CompData[0] = 0; 00126 CompData[1] = 0; 00127 CompData[2] = 0; 00128 CompData[3] = 0; 00129 CompData[4] = 0; 00130 CompData[5] = 0; 00131 00132 }
CigiCompCtrlV3_3::~CigiCompCtrlV3_3 | ( | ) | [virtual] |
Gets the specified CompData
Word | - The word position | |
Pos | - The byte position |
Definition at line 728 of file CigiCompCtrlV3_3.cpp.
References CigiBaseCompCtrl::CompData.
00730 { 00731 union { 00732 Cigi_int8 sc; 00733 Cigi_uint8 uc; 00734 } tDta; 00735 00736 int Err = 0; 00737 00738 if(Word > 5) 00739 Err = 1; 00740 else if((Pos < 0) || (Pos > 3)) 00741 Err = 2; 00742 00743 if(Err != 0) 00744 { 00745 #ifndef CIGI_NO_EXCEPT 00746 if(Err == 1) 00747 throw CigiValueOutOfRangeException("Word",Word,0,1); 00748 else 00749 throw CigiValueOutOfRangeException("Pos",Pos,0,3); 00750 #endif 00751 00752 tDta.uc = 0; 00753 } 00754 else 00755 tDta.uc = (Cigi_uint8)((CompData[Word] >> (Pos * 8)) & 0x000000ff); 00756 00757 return(tDta.sc); 00758 }
int CigiCompCtrlV3_3::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 |
Implements CigiBaseCompCtrl.
Definition at line 245 of file CigiCompCtrlV3_3.cpp.
References CIGI_COMP_CTRL_PACKET_ID_V1, CIGI_COMP_CTRL_PACKET_ID_V2, CIGI_COMP_CTRL_PACKET_ID_V3, CIGI_COMP_CTRL_PACKET_ID_V3_3, CIGI_SUCCESS, CigiVersionID::CigiMajorVersion, CigiVersionID::CigiMinorVersion, CigiCnvtInfoType::CigiCnvtInfoStruct::CnvtPacketID, CigiBaseCompCtrl::CompAssoc, CigiBaseCompCtrl::CompClassV2, CigiBaseCompCtrl::CompClassV3, CigiBaseCompCtrl::Entity, CigiBaseCompCtrl::EntityV2, CigiBaseCompCtrl::EntityV3, CigiCnvtInfoType::CigiCnvtInfoStruct::ProcID, CigiBaseCompCtrl::SystemV2, CigiBaseCompCtrl::SystemV3, CigiProcessType::TwoPassCnvtProcNone, CigiProcessType::TwoPassCnvtProcStd, and CigiBaseCompCtrl::View.
00247 { 00248 // Do not convert unless a conversion is found 00249 CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcNone; 00250 CnvtInfo.CnvtPacketID = 0; 00251 00252 if(CnvtVersion.CigiMajorVersion == 3) 00253 { 00254 // All Component control packets from version 3 and above 00255 // use the same packet id number 00256 00257 if(CnvtVersion.CigiMinorVersion < 3) 00258 { 00259 if((CompClassV3 >= EntityV3)&&(CompClassV3 <= SystemV3)) 00260 { 00261 CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd; 00262 CnvtInfo.CnvtPacketID = CIGI_COMP_CTRL_PACKET_ID_V3; 00263 } 00264 } 00265 else 00266 { 00267 CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd; 00268 CnvtInfo.CnvtPacketID = CIGI_COMP_CTRL_PACKET_ID_V3_3; 00269 } 00270 } 00271 else if(CnvtVersion.CigiMajorVersion == 2) 00272 { 00273 if((CompClassV2 >= EntityV2)&&(CompClassV2 <= SystemV2)) 00274 { 00275 CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd; 00276 CnvtInfo.CnvtPacketID = CIGI_COMP_CTRL_PACKET_ID_V2; 00277 } 00278 } 00279 else if(CnvtVersion.CigiMajorVersion == 1) 00280 { 00281 if((CompAssoc >= Entity)&&(CompAssoc <= View)) 00282 { 00283 CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd; 00284 CnvtInfo.CnvtPacketID = CIGI_COMP_CTRL_PACKET_ID_V1; 00285 } 00286 } 00287 else 00288 { 00289 // All Component control packets from version 3 and above 00290 // use the same packet id number 00291 CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd; 00292 CnvtInfo.CnvtPacketID = CIGI_COMP_CTRL_PACKET_ID_V3_3; 00293 } 00294 00295 return(CIGI_SUCCESS); 00296 }
CompClassV3Grp CigiCompCtrlV3_3::GetCompClassV3 | ( | void | ) | const [inline] |
Gets the CompClassV3 value.
Definition at line 215 of file CigiCompCtrlV3_3.h.
00215 { return(CompClassV3); }
Cigi_uint8 CigiCompCtrlV3_3::GetCompState | ( | void | ) | [inline] |
Gets the CompState value.
Definition at line 180 of file CigiCompCtrlV3_3.h.
00181 { 00182 Cigi_uint8 V3State = (Cigi_uint8)((CompState > 0x00ff) ? 0xff : CompState); 00183 return(V3State); 00184 }
double CigiCompCtrlV3_3::GetDoubleCompData | ( | const unsigned int | Pos | ) |
Gets the specified CompData
Pos | - The double word position |
Definition at line 946 of file CigiCompCtrlV3_3.cpp.
References _I64_CONST_, and CigiBaseCompCtrl::CompData.
00947 { 00948 00949 Cigi_uint64 tDta; 00950 00951 union DtaXfer { 00952 Cigi_uint64 i; 00953 double d; 00954 } XDta; 00955 00956 if(Pos > 2) 00957 { 00958 #ifndef CIGI_NO_EXCEPT 00959 throw CigiValueOutOfRangeException("Pos",Pos,0,0); 00960 #endif 00961 00962 tDta = 0; 00963 } 00964 else 00965 { 00966 00967 int Word = Pos * 2; 00968 Cigi_uint64 tDtah = (Cigi_uint64)(CompData[Word++]); 00969 tDtah = (tDtah << 32) & _I64_CONST_(0xffffffff00000000); 00970 00971 Cigi_uint64 tDtal = (Cigi_uint64)(CompData[Word]); 00972 tDtal &= _I64_CONST_(0x00000000ffffffff); 00973 00974 tDta = tDtah | tDtal; 00975 00976 XDta.i = tDta; 00977 } 00978 00979 return(XDta.d); 00980 }
float CigiCompCtrlV3_3::GetFloatCompData | ( | const unsigned int | Word | ) |
Gets the specified CompData
Word | - The word position |
Definition at line 885 of file CigiCompCtrlV3_3.cpp.
References CigiBaseCompCtrl::CompData.
00886 { 00887 00888 union { 00889 float f32; 00890 Cigi_uint32 u32; 00891 } tDta; 00892 00893 if(Word > 5) 00894 { 00895 #ifndef CIGI_NO_EXCEPT 00896 throw CigiValueOutOfRangeException("Word",Word,0,1); 00897 #endif 00898 00899 tDta.u32 = 0; 00900 } 00901 else 00902 tDta.u32 = (Cigi_uint32)(CompData[Word]); 00903 00904 return(tDta.f32); 00905 }
Cigi_uint64 CigiCompCtrlV3_3::GetI64CompData | ( | const unsigned int | Pos | ) |
Gets the specified CompData
Pos | - The double word position |
Definition at line 912 of file CigiCompCtrlV3_3.cpp.
References _I64_CONST_, and CigiBaseCompCtrl::CompData.
00913 { 00914 00915 Cigi_uint64 tDta; 00916 00917 if(Pos > 2) 00918 { 00919 #ifndef CIGI_NO_EXCEPT 00920 throw CigiValueOutOfRangeException("Pos",Pos,0,0); 00921 #endif 00922 00923 tDta = 0; 00924 } 00925 else 00926 { 00927 int Word = Pos * 2; 00928 Cigi_uint64 tDtah = (Cigi_uint64)(CompData[Word++]); 00929 tDtah = (tDtah << 32) & _I64_CONST_(0xffffffff00000000); 00930 00931 Cigi_uint64 tDtal = (Cigi_uint64)(CompData[Word]); 00932 tDtal &= _I64_CONST_(0x00000000ffffffff); 00933 00934 tDta = tDtah | tDtal; 00935 } 00936 00937 00938 return(tDta); 00939 }
Cigi_uint16 CigiCompCtrlV3_3::GetInstanceID | ( | void | ) | const [inline] |
Gets the InstanceID value.
Definition at line 159 of file CigiCompCtrlV3_3.h.
00159 { return(InstanceID); }
Cigi_int32 CigiCompCtrlV3_3::GetLongCompData | ( | const unsigned int | Word | ) |
Gets the specified CompData
Word | - The word position |
Definition at line 858 of file CigiCompCtrlV3_3.cpp.
References CigiBaseCompCtrl::CompData.
00859 { 00860 00861 union { 00862 Cigi_int32 s32; 00863 Cigi_uint32 u32; 00864 } tDta; 00865 00866 if(Word > 5) 00867 { 00868 #ifndef CIGI_NO_EXCEPT 00869 throw CigiValueOutOfRangeException("Word",Word,0,1); 00870 #endif 00871 00872 tDta.u32 = 0; 00873 } 00874 else 00875 tDta.u32 = (Cigi_uint32)(CompData[Word]); 00876 00877 return(tDta.s32); 00878 }
Cigi_int16 CigiCompCtrlV3_3::GetShortCompData | ( | const unsigned int | Word, | |
const HalfWordPos | Pos | |||
) |
Gets the specified CompData
Word | - The word position | |
Pos | - The half word position |
Definition at line 797 of file CigiCompCtrlV3_3.cpp.
References CigiBaseCompCtrl::CompData.
00799 { 00800 union { 00801 Cigi_int16 s16; 00802 Cigi_uint16 u16; 00803 } tDta; 00804 00805 int Err = 0; 00806 00807 if(Word > 5) 00808 Err = 1; 00809 else if((Pos < 0) || (Pos > 1)) 00810 Err = 2; 00811 00812 if(Err != 0) 00813 { 00814 #ifndef CIGI_NO_EXCEPT 00815 if(Err == 1) 00816 throw CigiValueOutOfRangeException("Word",Word,0,1); 00817 else 00818 throw CigiValueOutOfRangeException("Pos",Pos,0,1); 00819 #endif 00820 00821 tDta.u16 = 0; 00822 } 00823 else 00824 tDta.u16 = (Cigi_uint16)((CompData[Word] >> (Pos * 16)) & 0x0000ffff); 00825 00826 return(tDta.s16); 00827 }
Cigi_uint8 CigiCompCtrlV3_3::GetUCharCompData | ( | const unsigned int | Word, | |
const BytePos | Pos | |||
) |
Gets the specified CompData
Word | - The word position | |
Pos | - The byte position |
Definition at line 694 of file CigiCompCtrlV3_3.cpp.
References CigiBaseCompCtrl::CompData.
00696 { 00697 00698 Cigi_uint8 tDta; 00699 00700 int Err = 0; 00701 00702 if(Word > 5) 00703 Err = 1; 00704 else if((Pos < 0) || (Pos > 3)) 00705 Err = 2; 00706 00707 if(Err != 0) 00708 { 00709 #ifndef CIGI_NO_EXCEPT 00710 if(Err == 1) 00711 throw CigiValueOutOfRangeException("Word",Word,0,1); 00712 else 00713 throw CigiValueOutOfRangeException("Pos",Pos,0,3); 00714 #endif 00715 00716 tDta = 0; 00717 } 00718 else 00719 tDta = (Cigi_uint8)((CompData[Word] >> (Pos * 8)) & 0x000000ff); 00720 00721 return(tDta); 00722 }
Cigi_uint32 CigiCompCtrlV3_3::GetULongCompData | ( | const unsigned int | Word | ) |
Gets the specified CompData
Word | - The word position |
Definition at line 833 of file CigiCompCtrlV3_3.cpp.
References CigiBaseCompCtrl::CompData.
00834 { 00835 00836 Cigi_uint32 tDta; 00837 00838 00839 if(Word > 5) 00840 { 00841 #ifndef CIGI_NO_EXCEPT 00842 throw CigiValueOutOfRangeException("Word",Word,0,1); 00843 #endif 00844 00845 tDta = 0; 00846 } 00847 else 00848 tDta = CompData[Word]; 00849 00850 return(tDta); 00851 }
Cigi_uint16 CigiCompCtrlV3_3::GetUShortCompData | ( | const unsigned int | Word, | |
const HalfWordPos | Pos | |||
) |
Gets the specified CompData
Word | - The word position | |
Pos | - The half word position |
Definition at line 764 of file CigiCompCtrlV3_3.cpp.
References CigiBaseCompCtrl::CompData.
00766 { 00767 Cigi_uint16 tDta; 00768 00769 int Err = 0; 00770 00771 if(Word > 5) 00772 Err = 1; 00773 else if((Pos < 0) || (Pos > 1)) 00774 Err = 2; 00775 00776 if(Err != 0) 00777 { 00778 #ifndef CIGI_NO_EXCEPT 00779 if(Err == 1) 00780 throw CigiValueOutOfRangeException("Word",Word,0,1); 00781 else 00782 throw CigiValueOutOfRangeException("Pos",Pos,0,1); 00783 #endif 00784 00785 tDta = 0; 00786 } 00787 else 00788 tDta = (Cigi_uint16)((CompData[Word] >> (Pos * 16)) & 0x0000ffff); 00789 00790 return(tDta); 00791 }
int CigiCompCtrlV3_3::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 3
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 CigiBaseCompCtrl.
Definition at line 149 of file CigiCompCtrlV3_3.cpp.
References PackPointerUnion::c, CigiBaseCompCtrl::CompClassV3, CigiBaseCompCtrl::CompData, CigiBaseCompCtrl::CompID, CigiBaseCompCtrl::CompState, CigiBaseCompCtrl::InstanceID, PackPointerUnion::l, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, and PackPointerUnion::s.
00150 { 00151 PackPointer CDta; 00152 00153 CigiBaseCompCtrl * Data = ( CigiBaseCompCtrl *)Base; 00154 00155 CDta.c = Buff; 00156 00157 *CDta.c++ = PacketID; 00158 *CDta.c++ = PacketSize; 00159 00160 *CDta.s++ = Data->CompID; 00161 *CDta.s++ = Data->InstanceID; 00162 00163 *CDta.c++ = Data->CompClassV3 & 0x3f; 00164 00165 *CDta.c++ = (Cigi_uint8)((Data->CompState > 0x00ff) ? 00166 0x00ff : Data->CompState); 00167 00168 *CDta.l++ = Data->CompData[0]; 00169 *CDta.l++ = Data->CompData[1]; 00170 *CDta.l++ = Data->CompData[2]; 00171 *CDta.l++ = Data->CompData[3]; 00172 *CDta.l++ = Data->CompData[4]; 00173 *CDta.l++ = Data->CompData[5]; 00174 00175 return(PacketSize); 00176 00177 }
int CigiCompCtrlV3_3::SetCompClassV3 | ( | const CompClassV3Grp | CompClassV3In, | |
bool | bndchk = true | |||
) |
Sets the CompClassV3 with bound checking control
CompClassV3In | - EntityV3=0 ViewV3=1 ViewGrpV3=2 SensorV3=3 RegionalSeaSurfaceV3=4 RegionalTerrainSurfaceV3=5 RegionalLayeredWeatherV3=6 GlobalSeaSurfaceV3=7 GlobalTerrainSurfaceV3=8 GlobalLayeredWeatherV3=9 AtmosphereV3=10 CelestialSphereV3=11 EventV3=12 SystemV3=13 | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 308 of file CigiCompCtrlV3_3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, CigiBaseCompCtrl::CompAssoc, CigiBaseCompCtrl::CompClassV2, CigiBaseCompCtrl::CompClassV3, CompClassV3xV1, and CompClassV3xV2.
00309 { 00310 00311 #ifndef CIGI_NO_BND_CHK 00312 if(bndchk && ((CompClassV3In < 0)||(CompClassV3In > 15))) 00313 { 00314 #ifndef CIGI_NO_EXCEPT 00315 throw CigiValueOutOfRangeException("CompClassV3",(CompClassV3Grp)CompClassV3In,0,15); 00316 #endif 00317 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00318 } 00319 #endif 00320 00321 CompClassV3 = CompClassV3In; 00322 00323 CompAssoc = CompClassV3xV1[CompClassV3]; 00324 CompClassV2 = CompClassV3xV2[CompClassV3]; 00325 00326 return(CIGI_SUCCESS); 00327 00328 }
int CigiCompCtrlV3_3::SetCompData | ( | const double | CompDataIn, | |
const unsigned int | Pos, | |||
bool | bndchk = true | |||
) |
Sets the specified CompData with bound checking control
CompDataIn | - The byte data | |
Pos | - The double word position | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 651 of file CigiCompCtrlV3_3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.
00654 { 00655 00656 if(Pos > 2) 00657 { 00658 #ifndef CIGI_NO_BND_CHK 00659 if(bndchk) 00660 { 00661 #ifndef CIGI_NO_EXCEPT 00662 throw CigiValueOutOfRangeException("Pos",Pos,0,0); 00663 #endif 00664 } 00665 #endif 00666 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00667 } 00668 00669 union DtaXfer { 00670 Cigi_uint64 i; 00671 double d; 00672 } XDta; 00673 00674 XDta.d = CompDataIn; 00675 00676 int Word = Pos * 2; 00677 00678 CompData[Word++] = (Cigi_uint32)((XDta.i >> 32) & 0x00000000ffffffff); 00679 CompData[Word] = (Cigi_uint32)(XDta.i & 0x00000000ffffffff); 00680 00681 00682 return(CIGI_SUCCESS); 00683 }
int CigiCompCtrlV3_3::SetCompData | ( | const Cigi_uint64 | CompDataIn, | |
const unsigned int | Pos, | |||
bool | bndchk = true | |||
) |
Sets the specified CompData with bound checking control
CompDataIn | - The byte data | |
Pos | - The double word position | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 620 of file CigiCompCtrlV3_3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.
00623 { 00624 00625 if(Pos > 2) 00626 { 00627 #ifndef CIGI_NO_BND_CHK 00628 if(bndchk) 00629 { 00630 #ifndef CIGI_NO_EXCEPT 00631 throw CigiValueOutOfRangeException("Pos",Pos,0,0); 00632 #endif 00633 } 00634 #endif 00635 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00636 } 00637 00638 00639 int Word = Pos * 2; 00640 00641 CompData[Word++] = (Cigi_uint32)((CompDataIn >> 32) & 0x00000000ffffffff); 00642 CompData[Word] = (Cigi_uint32)(CompDataIn & 0x00000000ffffffff); 00643 00644 return(CIGI_SUCCESS); 00645 }
int CigiCompCtrlV3_3::SetCompData | ( | const float | CompDataIn, | |
const unsigned int | Word, | |||
bool | bndchk = true | |||
) |
Sets the specified CompData with bound checking control
CompDataIn | - The byte data | |
Word | - The word position | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 586 of file CigiCompCtrlV3_3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.
00589 { 00590 00591 if(Word > 5) 00592 { 00593 #ifndef CIGI_NO_BND_CHK 00594 if(bndchk) 00595 { 00596 #ifndef CIGI_NO_EXCEPT 00597 throw CigiValueOutOfRangeException("Word",Word,0,1); 00598 #endif 00599 } 00600 #endif 00601 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00602 } 00603 00604 00605 union DtaXfer { 00606 Cigi_uint32 lDta; 00607 float fDta; 00608 } XDta; 00609 00610 XDta.fDta = CompDataIn; 00611 CompData[Word] = XDta.lDta; 00612 00613 return(CIGI_SUCCESS); 00614 }
int CigiCompCtrlV3_3::SetCompData | ( | const Cigi_int32 | CompDataIn, | |
const unsigned int | Word, | |||
bool | bndchk = true | |||
) |
Sets the specified CompData with bound checking control
CompDataIn | - The byte data | |
Word | - The word position | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 552 of file CigiCompCtrlV3_3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.
00555 { 00556 00557 union { 00558 Cigi_int32 s32; 00559 Cigi_uint32 u32; 00560 } tDta; 00561 00562 if(Word > 5) 00563 { 00564 #ifndef CIGI_NO_BND_CHK 00565 if(bndchk) 00566 { 00567 #ifndef CIGI_NO_EXCEPT 00568 throw CigiValueOutOfRangeException("Word",Word,0,1); 00569 #endif 00570 } 00571 #endif 00572 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00573 } 00574 00575 00576 tDta.s32 = CompDataIn; 00577 CompData[Word] = (Cigi_uint32)tDta.u32; 00578 00579 return(CIGI_SUCCESS); 00580 }
int CigiCompCtrlV3_3::SetCompData | ( | const Cigi_uint32 | CompDataIn, | |
const unsigned int | Word, | |||
bool | bndchk = true | |||
) |
Sets the specified CompData with bound checking control
CompDataIn | - The byte data | |
Word | - The word position | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 524 of file CigiCompCtrlV3_3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.
00527 { 00528 00529 if(Word > 5) 00530 { 00531 #ifndef CIGI_NO_BND_CHK 00532 if(bndchk) 00533 { 00534 #ifndef CIGI_NO_EXCEPT 00535 throw CigiValueOutOfRangeException("Word",Word,0,1); 00536 #endif 00537 } 00538 #endif 00539 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00540 } 00541 00542 00543 CompData[Word] = CompDataIn; 00544 00545 return(CIGI_SUCCESS); 00546 }
int CigiCompCtrlV3_3::SetCompData | ( | const Cigi_int16 | CompDataIn, | |
const unsigned int | Word, | |||
const HalfWordPos | Pos, | |||
bool | bndchk = true | |||
) |
Sets the specified CompData with bound checking control
CompDataIn | - The byte data | |
Word | - The word position | |
Pos | - The half word position | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 474 of file CigiCompCtrlV3_3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.
00478 { 00479 00480 union { 00481 Cigi_int16 s16; 00482 Cigi_uint16 u16; 00483 } sxfer; 00484 00485 int Err = 0; 00486 00487 if(Word > 5) 00488 Err = 1; 00489 else if((Pos < 0) || (Pos > 1)) 00490 Err = 2; 00491 00492 if(Err != 0) 00493 { 00494 #ifndef CIGI_NO_BND_CHK 00495 if(bndchk) 00496 { 00497 #ifndef CIGI_NO_EXCEPT 00498 if(Err == 1) 00499 throw CigiValueOutOfRangeException("Word",Word,0,1); 00500 else 00501 throw CigiValueOutOfRangeException("Pos",Pos,0,3); 00502 #endif 00503 } 00504 #endif 00505 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00506 } 00507 00508 00509 int bitPos = Pos * 16; 00510 00511 sxfer.s16 = CompDataIn; 00512 Cigi_uint32 tDta = (Cigi_uint32)sxfer.u16; 00513 00514 CompData[Word] &= ~(0x0000ffff << bitPos); 00515 CompData[Word] |= ((tDta & 0x0000ffff) << bitPos); 00516 00517 return(CIGI_SUCCESS); 00518 }
int CigiCompCtrlV3_3::SetCompData | ( | const Cigi_uint16 | CompDataIn, | |
const unsigned int | Word, | |||
const HalfWordPos | Pos, | |||
bool | bndchk = true | |||
) |
Sets the specified CompData with bound checking control
CompDataIn | - The byte data | |
Word | - The word position | |
Pos | - The half word position | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 430 of file CigiCompCtrlV3_3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.
00434 { 00435 00436 int Err = 0; 00437 00438 if(Word > 5) 00439 Err = 1; 00440 else if((Pos < 0) || (Pos > 1)) 00441 Err = 2; 00442 00443 if(Err != 0) 00444 { 00445 #ifndef CIGI_NO_BND_CHK 00446 if(bndchk) 00447 { 00448 #ifndef CIGI_NO_EXCEPT 00449 if(Err == 1) 00450 throw CigiValueOutOfRangeException("Word",Word,0,1); 00451 else 00452 throw CigiValueOutOfRangeException("Pos",Pos,0,3); 00453 #endif 00454 } 00455 #endif 00456 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00457 } 00458 00459 00460 int bitPos = Pos * 16; 00461 00462 Cigi_uint32 tDta = (Cigi_uint32)CompDataIn; 00463 00464 CompData[Word] &= ~(0x0000ffff << bitPos); 00465 CompData[Word] |= ((tDta & 0x0000ffff) << bitPos); 00466 00467 return(CIGI_SUCCESS); 00468 }
int CigiCompCtrlV3_3::SetCompData | ( | const Cigi_int8 | CompDataIn, | |
const unsigned int | Word, | |||
const BytePos | Pos, | |||
bool | bndchk = true | |||
) |
Sets the specified CompData with bound checking control
CompDataIn | - The byte data | |
Word | - The word position | |
Pos | - The byte position | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 380 of file CigiCompCtrlV3_3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.
00384 { 00385 00386 union { 00387 Cigi_int8 sc; 00388 Cigi_uint8 uc; 00389 } cxfer; 00390 00391 int Err = 0; 00392 00393 if(Word > 5) 00394 Err = 1; 00395 else if((Pos < 0) || (Pos > 3)) 00396 Err = 2; 00397 00398 if(Err != 0) 00399 { 00400 #ifndef CIGI_NO_BND_CHK 00401 if(bndchk) 00402 { 00403 #ifndef CIGI_NO_EXCEPT 00404 if(Err == 1) 00405 throw CigiValueOutOfRangeException("Word",Word,0,1); 00406 else 00407 throw CigiValueOutOfRangeException("Pos",Pos,0,3); 00408 #endif 00409 } 00410 #endif 00411 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00412 } 00413 00414 00415 int bitPos = Pos * 8; 00416 00417 cxfer.sc = CompDataIn; 00418 Cigi_uint32 tDta = (Cigi_uint32)cxfer.uc; 00419 00420 CompData[Word] &= ~(0x000000ff << bitPos); 00421 CompData[Word] |= ((tDta & 0x000000ff) << bitPos); 00422 00423 return(CIGI_SUCCESS); 00424 }
int CigiCompCtrlV3_3::SetCompData | ( | const Cigi_uint8 | CompDataIn, | |
const unsigned int | Word, | |||
const BytePos | Pos, | |||
bool | bndchk = true | |||
) |
Sets the specified CompData with bound checking control
CompDataIn | - The byte data | |
Word | - The word position | |
Pos | - The byte position | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 336 of file CigiCompCtrlV3_3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCompCtrl::CompData.
00340 { 00341 00342 int Err = 0; 00343 00344 if(Word > 5) 00345 Err = 1; 00346 else if((Pos < 0) || (Pos > 3)) 00347 Err = 2; 00348 00349 if(Err != 0) 00350 { 00351 #ifndef CIGI_NO_BND_CHK 00352 if(bndchk) 00353 { 00354 #ifndef CIGI_NO_EXCEPT 00355 if(Err == 1) 00356 throw CigiValueOutOfRangeException("Word",Word,0,1); 00357 else 00358 throw CigiValueOutOfRangeException("Pos",Pos,0,3); 00359 #endif 00360 } 00361 #endif 00362 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00363 } 00364 00365 00366 int bitPos = Pos * 8; 00367 00368 Cigi_uint32 tDta = (Cigi_uint32)CompDataIn; 00369 00370 CompData[Word] &= ~(0x000000ff << bitPos); 00371 CompData[Word] |= ((tDta & 0x000000ff) << bitPos); 00372 00373 return(CIGI_SUCCESS); 00374 }
int CigiCompCtrlV3_3::SetCompState | ( | const Cigi_uint8 | CompStateIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the CompState with bound checking control
CompStateIn | - Component state value | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 171 of file CigiCompCtrlV3_3.h.
References CIGI_SUCCESS.
00172 { 00173 CompState = (Cigi_uint16) CompStateIn; 00174 return(CIGI_SUCCESS); 00175 }
int CigiCompCtrlV3_3::SetInstanceID | ( | const Cigi_uint16 | InstanceIDIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the InstanceID with bound checking control
InstanceIDIn | - | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 150 of file CigiCompCtrlV3_3.h.
References CIGI_SUCCESS.
00151 { 00152 InstanceID = InstanceIDIn; 00153 return(CIGI_SUCCESS); 00154 }
int CigiCompCtrlV3_3::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 3
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 CigiBaseCompCtrl.
Definition at line 182 of file CigiCompCtrlV3_3.cpp.
References PackPointerUnion::c, CigiSwap2(), CigiSwap4(), CigiBaseCompCtrl::CompAssoc, CigiBaseCompCtrl::CompClassV2, CigiBaseCompCtrl::CompClassV3, CompClassV3xV1, CompClassV3xV2, CigiBaseCompCtrl::CompData, CigiBaseCompCtrl::CompID, CigiBaseCompCtrl::CompState, CigiBaseCompCtrl::EntityV3, CigiBaseCompCtrl::InstanceID, PackPointerUnion::l, CigiBaseCompCtrl::NoCnvtV1, CigiBaseCompCtrl::NoCnvtV2, CigiBasePacket::PacketSize, PackPointerUnion::s, and CigiBaseCompCtrl::SymbolV3_3.
00183 { 00184 PackPointer CDta; 00185 00186 CDta.c = Buff; 00187 00188 CDta.c += 2; // Step over packet id and size 00189 00190 if(!Swap) 00191 { 00192 CompID = *CDta.s++; 00193 InstanceID = *CDta.s++; 00194 00195 CompClassV3 = (CompClassV3Grp)(*CDta.c++ & 0x3f); 00196 00197 CompState = (Cigi_uint16)*CDta.c++; 00198 00199 CompData[0] = *CDta.l++; 00200 CompData[1] = *CDta.l++; 00201 CompData[2] = *CDta.l++; 00202 CompData[3] = *CDta.l++; 00203 CompData[4] = *CDta.l++; 00204 CompData[5] = *CDta.l++; 00205 } 00206 else 00207 { 00208 CigiSwap2(&CompID, CDta.s++); 00209 CigiSwap2(&InstanceID, CDta.s++); 00210 00211 CompClassV3 = (CompClassV3Grp)(*CDta.c++ & 0x0f); 00212 00213 CompState = (Cigi_uint16)*CDta.c++; 00214 00215 CigiSwap4(&CompData[0], CDta.l++); 00216 CigiSwap4(&CompData[1], CDta.l++); 00217 CigiSwap4(&CompData[2], CDta.l++); 00218 CigiSwap4(&CompData[3], CDta.l++); 00219 CigiSwap4(&CompData[4], CDta.l++); 00220 CigiSwap4(&CompData[5], CDta.l++); 00221 } 00222 00223 00224 if((CompClassV3 >= CigiBaseCompCtrl::EntityV3) && 00225 (CompClassV3 <= CigiBaseCompCtrl::SymbolV3_3)) 00226 { 00227 CompAssoc = CompClassV3xV1[CompClassV3]; 00228 CompClassV2 = CompClassV3xV2[CompClassV3]; 00229 } 00230 else 00231 { 00232 CompAssoc = NoCnvtV1; 00233 CompClassV2 = NoCnvtV2; 00234 } 00235 00236 00237 return(PacketSize); 00238 00239 }
const int CigiCompCtrlV3_3::CompClassCnvtSz = 16 [static, protected] |
Definition at line 414 of file CigiCompCtrlV3_3.h.
const CigiBaseCompCtrl::CompAssocGrp CigiCompCtrlV3_3::CompClassV3xV1 [static, protected] |
Initial value:
{ Entity, View, NoCnvtV1, NoCnvtV1, NoCnvtV1, NoCnvtV1, NoCnvtV1, NoCnvtV1, NoCnvtV1, NoCnvtV1, Environment, Environment, NoCnvtV1, NoCnvtV1, NoCnvtV1, NoCnvtV1 }
Definition at line 415 of file CigiCompCtrlV3_3.h.
Referenced by SetCompClassV3(), and Unpack().
const CigiBaseCompCtrl::CompClassV2Grp CigiCompCtrlV3_3::CompClassV3xV2 [static, protected] |
Initial value:
{ EntityV2, ViewV2, ViewGrpV2, SensorV2, NoCnvtV2, NoCnvtV2, NoCnvtV2, NoCnvtV2, NoCnvtV2, NoCnvtV2, EnvironmentV2, EnvironmentV2, NoCnvtV2, SystemV2, NoCnvtV2, NoCnvtV2 }
Definition at line 416 of file CigiCompCtrlV3_3.h.
Referenced by SetCompClassV3(), and Unpack().