00001
00069 #define _EXPORT_CCL_
00070
00071 #include "CigiCompCtrlV2.h"
00072 #include "CigiSwapping.h"
00073 #include "CigiExceptions.h"
00074
00075 #include <memory.h>
00076
00077
00078 #ifdef CIGI_LITTLE_ENDIAN
00079 #define CIGI_SCOPY2 CigiSwap2
00080 #define CIGI_SCOPY4 CigiSwap4
00081 #define CIGI_SCOPY8 CigiSwap8
00082 #else
00083 #define CIGI_SCOPY2 CigiCopy2
00084 #define CIGI_SCOPY4 CigiCopy4
00085 #define CIGI_SCOPY8 CigiCopy8
00086 #endif
00087
00088
00089
00090
00091 const CigiBaseCompCtrl::CompAssocGrp CigiCompCtrlV2::CompClassV2xV1[CigiCompCtrlV2::CompClassCnvtSz] =
00092 {
00093 Entity,
00094 Environment,
00095 View,
00096 NoCnvtV1,
00097 NoCnvtV1,
00098 NoCnvtV1
00099 };
00100
00101 const CigiBaseCompCtrl::CompClassV3Grp CigiCompCtrlV2::CompClassV2xV3[CigiCompCtrlV2::CompClassCnvtSz] =
00102 {
00103 EntityV3,
00104 AtmosphereV3,
00105 ViewV3,
00106 ViewGrpV3,
00107 SensorV3,
00108 SystemV3
00109 };
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 CigiCompCtrlV2::CigiCompCtrlV2()
00121 {
00122
00123 PacketID = CIGI_COMP_CTRL_PACKET_ID_V2;
00124 PacketSize = CIGI_COMP_CTRL_PACKET_SIZE_V2;
00125 Version = 2;
00126 MinorVersion = 0;
00127
00128 CompID = 0;
00129 InstanceID = 0;
00130 EntityID = 0;
00131 ViewID = 0;
00132 CompState = 0;
00133 CompAssoc = CigiBaseCompCtrl::Entity;
00134 CompClassV2 = CigiBaseCompCtrl::EntityV2;
00135 CompClassV3 = CigiBaseCompCtrl::EntityV3;
00136 CompData[0] = 0;
00137 CompData[1] = 0;
00138 CompData[2] = 0;
00139 CompData[3] = 0;
00140 CompData[4] = 0;
00141 CompData[5] = 0;
00142
00143 }
00144
00145
00146
00147
00148 CigiCompCtrlV2::~CigiCompCtrlV2()
00149 {
00150
00151 }
00152
00153
00154
00155
00156
00157
00158
00159
00160 int CigiCompCtrlV2::Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const
00161 {
00162 double DBuf[6];
00163
00164 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf;
00165
00166 PackPointer CDta;
00167
00168 CigiBaseCompCtrl * Data = ( CigiBaseCompCtrl *)Base;
00169
00170 CDta.d = DBuf;
00171
00172 *CDta.c++ = PacketID;
00173 *CDta.c++ = PacketSize;
00174
00175 CIGI_SCOPY2(CDta.s++, &Data->InstanceID);
00176 *CDta.c++ = Data->CompClassV2;
00177
00178 *CDta.c++ = 0;
00179 *CDta.s++ = 0;
00180
00181 CIGI_SCOPY2(CDta.s++, &Data->CompID);
00182 CIGI_SCOPY2(CDta.s++, &Data->CompState);
00183 CIGI_SCOPY4(CDta.l++, &Data->CompData[0]);
00184 CIGI_SCOPY4(CDta.l++, &Data->CompData[1]);
00185
00186
00187 memcpy(Buff,tBuf,CIGI_COMP_CTRL_PACKET_SIZE_V2);
00188
00189 return(PacketSize);
00190
00191 }
00192
00193
00194
00195
00196 int CigiCompCtrlV2::Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec)
00197 {
00198 double DBuf[6];
00199
00200 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf;
00201
00202 PackPointer CDta;
00203
00204 memcpy(tBuf,Buff,CIGI_COMP_CTRL_PACKET_SIZE_V2);
00205
00206 CDta.d = DBuf;
00207
00208 CDta.c += 2;
00209
00210
00211 CIGI_SCOPY2(&InstanceID, CDta.s++);
00212 CompClassV2 = (CompClassV2Grp)*CDta.c++;
00213
00214 CDta.c += 3;
00215
00216 CIGI_SCOPY2(&CompID, CDta.s++);
00217 CIGI_SCOPY2(&CompState, CDta.s++);
00218 CIGI_SCOPY4(&CompData[0], CDta.l++);
00219 CIGI_SCOPY4(&CompData[1], CDta.l++);
00220
00221
00222 if((CompClassV2 >= CigiBaseCompCtrl::EntityV2) &&
00223 (CompClassV2 <= CigiBaseCompCtrl::SystemV2))
00224 {
00225 CompAssoc = CompClassV2xV1[CompClassV2];
00226 CompClassV3 = CompClassV2xV3[CompClassV2];
00227 }
00228 else
00229 {
00230 CompAssoc = CigiBaseCompCtrl::NoCnvtV1;
00231 CompClassV3 = CigiBaseCompCtrl::NoCnvtV3;
00232 }
00233
00234
00235 return(PacketSize);
00236
00237 }
00238
00239
00240
00241
00242
00243 int CigiCompCtrlV2::GetCnvt(CigiVersionID &CnvtVersion,
00244 CigiCnvtInfoType::Type &CnvtInfo)
00245 {
00246
00247 if(CnvtVersion.CigiMajorVersion == 2)
00248 {
00249 CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd;
00250 CnvtInfo.CnvtPacketID = CIGI_COMP_CTRL_PACKET_ID_V2;
00251 }
00252 else if(CnvtVersion.CigiMajorVersion == 1)
00253 {
00254 if((CompAssoc >= Entity)&&(CompAssoc <= View))
00255 {
00256 CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd;
00257 CnvtInfo.CnvtPacketID = CIGI_COMP_CTRL_PACKET_ID_V1;
00258 }
00259 else
00260 {
00261 CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcNone;
00262 CnvtInfo.CnvtPacketID = 0;
00263 }
00264 }
00265 else
00266 {
00267 CnvtInfo.ProcID = CigiProcessType::TwoPassCnvtProcStd;
00268 CnvtInfo.CnvtPacketID = CIGI_SHORT_COMP_CTRL_PACKET_ID_V3;
00269 }
00270
00271 return(CIGI_SUCCESS);
00272
00273 }
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285 int CigiCompCtrlV2::SetCompClassV2(const CompClassV2Grp CompClassV2In, bool bndchk)
00286 {
00287
00288 #ifndef CIGI_NO_BND_CHK
00289 if(bndchk && ((CompClassV2In < 0)||(CompClassV2In > 5)))
00290 {
00291 #ifndef CIGI_NO_EXCEPT
00292 throw CigiValueOutOfRangeException("CompClassV2",(CompClassV2Grp)CompClassV2In,0,5);
00293 #endif
00294 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00295 }
00296 #endif
00297
00298 CompClassV2 = CompClassV2In;
00299
00300
00301 CompAssoc = CompClassV2xV1[CompClassV2];
00302 CompClassV3 = CompClassV2xV3[CompClassV2];
00303
00304
00305 return(CIGI_SUCCESS);
00306
00307 }
00308
00309
00310
00311
00312
00313
00314 int CigiCompCtrlV2::SetCompData(const Cigi_uint8 CompDataIn,
00315 const unsigned int Word,
00316 const BytePos Pos,
00317 bool bndchk)
00318 {
00319
00320 int Err = 0;
00321
00322 if(Word > 1)
00323 Err = 1;
00324 else if((Pos < 0) || (Pos > 3))
00325 Err = 2;
00326
00327 if(Err != 0)
00328 {
00329 #ifndef CIGI_NO_BND_CHK
00330 if(bndchk)
00331 {
00332 #ifndef CIGI_NO_EXCEPT
00333 if(Err == 1)
00334 throw CigiValueOutOfRangeException("Word",Word,0,1);
00335 else
00336 throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00337 #endif
00338 }
00339 #endif
00340 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00341 }
00342
00343
00344 int bitPos = Pos * 8;
00345
00346 Cigi_uint32 tDta = (Cigi_uint32)CompDataIn;
00347
00348 CompData[Word] &= ~(0x000000ff << bitPos);
00349 CompData[Word] |= ((tDta & 0x000000ff) << bitPos);
00350
00351 return(CIGI_SUCCESS);
00352 }
00353
00354
00355
00356
00357
00358 int CigiCompCtrlV2::SetCompData(const Cigi_int8 CompDataIn,
00359 const unsigned int Word,
00360 const BytePos Pos,
00361 bool bndchk)
00362 {
00363
00364 union {
00365 Cigi_int8 sc;
00366 Cigi_uint8 uc;
00367 } cxfer;
00368
00369 int Err = 0;
00370
00371 if(Word > 1)
00372 Err = 1;
00373 else if((Pos < 0) || (Pos > 3))
00374 Err = 2;
00375
00376 if(Err != 0)
00377 {
00378 #ifndef CIGI_NO_BND_CHK
00379 if(bndchk)
00380 {
00381 #ifndef CIGI_NO_EXCEPT
00382 if(Err == 1)
00383 throw CigiValueOutOfRangeException("Word",Word,0,1);
00384 else
00385 throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00386 #endif
00387 }
00388 #endif
00389 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00390 }
00391
00392
00393 int bitPos = Pos * 8;
00394
00395 cxfer.sc = CompDataIn;
00396 Cigi_uint32 tDta = (Cigi_uint32)cxfer.uc;
00397
00398 CompData[Word] &= ~(0x000000ff << bitPos);
00399 CompData[Word] |= ((tDta & 0x000000ff) << bitPos);
00400
00401 return(CIGI_SUCCESS);
00402 }
00403
00404
00405
00406
00407
00408 int CigiCompCtrlV2::SetCompData(const Cigi_uint16 CompDataIn,
00409 const unsigned int Word,
00410 const HalfWordPos Pos,
00411 bool bndchk)
00412 {
00413
00414 int Err = 0;
00415
00416 if(Word > 1)
00417 Err = 1;
00418 else if((Pos < 0) || (Pos > 1))
00419 Err = 2;
00420
00421 if(Err != 0)
00422 {
00423 #ifndef CIGI_NO_BND_CHK
00424 if(bndchk)
00425 {
00426 #ifndef CIGI_NO_EXCEPT
00427 if(Err == 1)
00428 throw CigiValueOutOfRangeException("Word",Word,0,1);
00429 else
00430 throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00431 #endif
00432 }
00433 #endif
00434 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00435 }
00436
00437
00438 int bitPos = Pos * 16;
00439
00440 Cigi_uint32 tDta = (Cigi_uint32)CompDataIn;
00441
00442 CompData[Word] &= ~(0x0000ffff << bitPos);
00443 CompData[Word] |= ((tDta & 0x0000ffff) << bitPos);
00444
00445 return(CIGI_SUCCESS);
00446 }
00447
00448
00449
00450
00451
00452 int CigiCompCtrlV2::SetCompData(const Cigi_int16 CompDataIn,
00453 const unsigned int Word,
00454 const HalfWordPos Pos,
00455 bool bndchk)
00456 {
00457
00458 union {
00459 Cigi_int16 s16;
00460 Cigi_uint16 u16;
00461 } sxfer;
00462
00463 int Err = 0;
00464
00465 if(Word > 1)
00466 Err = 1;
00467 else if((Pos < 0) || (Pos > 1))
00468 Err = 2;
00469
00470 if(Err != 0)
00471 {
00472 #ifndef CIGI_NO_BND_CHK
00473 if(bndchk)
00474 {
00475 #ifndef CIGI_NO_EXCEPT
00476 if(Err == 1)
00477 throw CigiValueOutOfRangeException("Word",Word,0,1);
00478 else
00479 throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00480 #endif
00481 }
00482 #endif
00483 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00484 }
00485
00486
00487 int bitPos = Pos * 16;
00488
00489 sxfer.s16 = CompDataIn;
00490 Cigi_uint32 tDta = (Cigi_uint32)sxfer.u16;
00491
00492 CompData[Word] &= ~(0x0000ffff << bitPos);
00493 CompData[Word] |= ((tDta & 0x0000ffff) << bitPos);
00494
00495 return(CIGI_SUCCESS);
00496 }
00497
00498
00499
00500
00501
00502 int CigiCompCtrlV2::SetCompData(const Cigi_uint32 CompDataIn,
00503 const unsigned int Word,
00504 bool bndchk)
00505 {
00506
00507 if(Word > 1)
00508 {
00509 #ifndef CIGI_NO_BND_CHK
00510 if(bndchk)
00511 {
00512 #ifndef CIGI_NO_EXCEPT
00513 throw CigiValueOutOfRangeException("Word",Word,0,1);
00514 #endif
00515 }
00516 #endif
00517 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00518 }
00519
00520
00521 CompData[Word] = CompDataIn;
00522
00523 return(CIGI_SUCCESS);
00524 }
00525
00526
00527
00528
00529
00530 int CigiCompCtrlV2::SetCompData(const Cigi_int32 CompDataIn,
00531 const unsigned int Word,
00532 bool bndchk)
00533 {
00534
00535 union {
00536 Cigi_uint32 u32;
00537 Cigi_int32 s32;
00538 } tDta;
00539
00540 if(Word > 1)
00541 {
00542 #ifndef CIGI_NO_BND_CHK
00543 if(bndchk)
00544 {
00545 #ifndef CIGI_NO_EXCEPT
00546 throw CigiValueOutOfRangeException("Word",Word,0,1);
00547 #endif
00548 }
00549 #endif
00550 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00551 }
00552
00553
00554 tDta.s32 = CompDataIn;
00555 CompData[Word] = (Cigi_uint32)tDta.u32;
00556
00557 return(CIGI_SUCCESS);
00558 }
00559
00560
00561
00562
00563
00564 int CigiCompCtrlV2::SetCompData(const float CompDataIn,
00565 const unsigned int Word,
00566 bool bndchk)
00567 {
00568
00569 if(Word > 1)
00570 {
00571 #ifndef CIGI_NO_BND_CHK
00572 if(bndchk)
00573 {
00574 #ifndef CIGI_NO_EXCEPT
00575 throw CigiValueOutOfRangeException("Word",Word,0,1);
00576 #endif
00577 }
00578 #endif
00579 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00580 }
00581
00582
00583 union DtaXfer {
00584 Cigi_uint32 lDta;
00585 float fDta;
00586 } XDta;
00587
00588 XDta.fDta = CompDataIn;
00589 CompData[Word] = XDta.lDta;
00590
00591 return(CIGI_SUCCESS);
00592 }
00593
00594
00595
00596
00597
00598 int CigiCompCtrlV2::SetCompData(const Cigi_uint64 CompDataIn,
00599 const unsigned int Pos,
00600 bool bndchk)
00601 {
00602
00603 if(Pos > 0)
00604 {
00605 #ifndef CIGI_NO_BND_CHK
00606 if(bndchk)
00607 {
00608 #ifndef CIGI_NO_EXCEPT
00609 throw CigiValueOutOfRangeException("Pos",Pos,0,0);
00610 #endif
00611 }
00612 #endif
00613 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00614 }
00615
00616
00617 int Word = Pos * 2;
00618
00619 CompData[Word++] = (Cigi_uint32)((CompDataIn >> 32) & 0x00000000ffffffff);
00620 CompData[Word] = (Cigi_uint32)(CompDataIn & 0x00000000ffffffff);
00621
00622 return(CIGI_SUCCESS);
00623 }
00624
00625
00626
00627
00628
00629 int CigiCompCtrlV2::SetCompData(const double CompDataIn,
00630 const unsigned int Pos,
00631 bool bndchk)
00632 {
00633
00634 if(Pos > 0)
00635 {
00636 #ifndef CIGI_NO_BND_CHK
00637 if(bndchk)
00638 {
00639 #ifndef CIGI_NO_EXCEPT
00640 throw CigiValueOutOfRangeException("Pos",Pos,0,0);
00641 #endif
00642 }
00643 #endif
00644 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00645 }
00646
00647 union DtaXfer {
00648 Cigi_uint64 i;
00649 double d;
00650 } XDta;
00651
00652 XDta.d = CompDataIn;
00653
00654 int Word = Pos * 2;
00655
00656 CompData[Word++] = (Cigi_uint32)((XDta.i >> 32) & 0x00000000ffffffff);
00657 CompData[Word] = (Cigi_uint32)(XDta.i & 0x00000000ffffffff);
00658
00659
00660 return(CIGI_SUCCESS);
00661 }
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672 Cigi_uint8 CigiCompCtrlV2::GetUCharCompData(const unsigned int Word,
00673 const BytePos Pos)
00674 {
00675
00676 Cigi_uint8 tDta;
00677
00678 int Err = 0;
00679
00680 if(Word > 1)
00681 Err = 1;
00682 else if((Pos < 0) || (Pos > 3))
00683 Err = 2;
00684
00685 if(Err != 0)
00686 {
00687 #ifndef CIGI_NO_EXCEPT
00688 if(Err == 1)
00689 throw CigiValueOutOfRangeException("Word",Word,0,1);
00690 else
00691 throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00692 #endif
00693
00694 tDta = 0;
00695 }
00696 else
00697 tDta = (Cigi_uint8)((CompData[Word] >> (Pos * 8)) & 0x000000ff);
00698
00699 return(tDta);
00700 }
00701
00702
00703
00704
00705
00706 Cigi_int8 CigiCompCtrlV2::GetCharCompData(const unsigned int Word,
00707 const BytePos Pos)
00708 {
00709 union {
00710 Cigi_int8 sc;
00711 Cigi_uint8 uc;
00712 } tDta;
00713
00714 int Err = 0;
00715
00716 if(Word > 1)
00717 Err = 1;
00718 else if((Pos < 0) || (Pos > 3))
00719 Err = 2;
00720
00721 if(Err != 0)
00722 {
00723 #ifndef CIGI_NO_EXCEPT
00724 if(Err == 1)
00725 throw CigiValueOutOfRangeException("Word",Word,0,1);
00726 else
00727 throw CigiValueOutOfRangeException("Pos",Pos,0,3);
00728 #endif
00729
00730 tDta.uc = 0;
00731 }
00732 else
00733 tDta.uc = (Cigi_uint8)((CompData[Word] >> (Pos * 8)) & 0x000000ff);
00734
00735 return(tDta.sc);
00736 }
00737
00738
00739
00740
00741
00742 Cigi_uint16 CigiCompCtrlV2::GetUShortCompData(const unsigned int Word,
00743 const HalfWordPos Pos)
00744 {
00745 Cigi_uint16 tDta;
00746
00747 int Err = 0;
00748
00749 if(Word > 1)
00750 Err = 1;
00751 else if((Pos < 0) || (Pos > 1))
00752 Err = 2;
00753
00754 if(Err != 0)
00755 {
00756 #ifndef CIGI_NO_EXCEPT
00757 if(Err == 1)
00758 throw CigiValueOutOfRangeException("Word",Word,0,1);
00759 else
00760 throw CigiValueOutOfRangeException("Pos",Pos,0,1);
00761 #endif
00762
00763 tDta = 0;
00764 }
00765 else
00766 tDta = (Cigi_uint16)((CompData[Word] >> (Pos * 16)) & 0x0000ffff);
00767
00768 return(tDta);
00769 }
00770
00771
00772
00773
00774
00775 Cigi_int16 CigiCompCtrlV2::GetShortCompData(const unsigned int Word,
00776 const HalfWordPos Pos)
00777 {
00778 union {
00779 Cigi_int16 s16;
00780 Cigi_uint16 u16;
00781 } tDta;
00782
00783 int Err = 0;
00784
00785 if(Word > 1)
00786 Err = 1;
00787 else if((Pos < 0) || (Pos > 1))
00788 Err = 2;
00789
00790 if(Err != 0)
00791 {
00792 #ifndef CIGI_NO_EXCEPT
00793 if(Err == 1)
00794 throw CigiValueOutOfRangeException("Word",Word,0,1);
00795 else
00796 throw CigiValueOutOfRangeException("Pos",Pos,0,1);
00797 #endif
00798
00799 tDta.u16 = 0;
00800 }
00801 else
00802 tDta.u16 = (Cigi_uint16)((CompData[Word] >> (Pos * 16)) & 0x0000ffff);
00803
00804 return(tDta.s16);
00805 }
00806
00807
00808
00809
00810
00811 Cigi_uint32 CigiCompCtrlV2::GetULongCompData(const unsigned int Word)
00812 {
00813
00814 Cigi_uint32 tDta;
00815
00816
00817 if(Word > 1)
00818 {
00819 #ifndef CIGI_NO_EXCEPT
00820 throw CigiValueOutOfRangeException("Word",Word,0,1);
00821 #endif
00822
00823 tDta = 0;
00824 }
00825 else
00826 tDta = CompData[Word];
00827
00828 return(tDta);
00829 }
00830
00831
00832
00833
00834
00835
00836 Cigi_int32 CigiCompCtrlV2::GetLongCompData(const unsigned int Word)
00837 {
00838
00839 union {
00840 Cigi_int32 s32;
00841 Cigi_uint32 u32;
00842 } tDta;
00843
00844 if(Word > 1)
00845 {
00846 #ifndef CIGI_NO_EXCEPT
00847 throw CigiValueOutOfRangeException("Word",Word,0,1);
00848 #endif
00849
00850 tDta.u32 = 0;
00851 }
00852 else
00853 tDta.u32 = (Cigi_uint32)(CompData[Word]);
00854
00855 return(tDta.s32);
00856 }
00857
00858
00859
00860
00861
00862
00863 float CigiCompCtrlV2::GetFloatCompData(const unsigned int Word)
00864 {
00865
00866 union {
00867 float f32;
00868 Cigi_uint32 u32;
00869 } tDta;
00870
00871 if(Word > 1)
00872 {
00873 #ifndef CIGI_NO_EXCEPT
00874 throw CigiValueOutOfRangeException("Word",Word,0,1);
00875 #endif
00876
00877 tDta.u32 = 0;
00878 }
00879 else
00880 tDta.u32 = (Cigi_uint32)(CompData[Word]);
00881
00882 return(tDta.f32);
00883 }
00884
00885
00886
00887
00888
00889
00890 Cigi_uint64 CigiCompCtrlV2::GetI64CompData(const unsigned int Pos)
00891 {
00892
00893 Cigi_uint64 tDta;
00894
00895 if(Pos > 0)
00896 {
00897 #ifndef CIGI_NO_EXCEPT
00898 throw CigiValueOutOfRangeException("Pos",Pos,0,0);
00899 #endif
00900
00901 tDta = 0;
00902 }
00903 else
00904 {
00905 int Word = Pos * 2;
00906 Cigi_uint64 tDtah = (Cigi_uint64)(CompData[Word++]);
00907 tDtah = (tDtah << 32) & _I64_CONST_(0xffffffff00000000);
00908
00909 Cigi_uint64 tDtal = (Cigi_uint64)(CompData[Word]);
00910 tDtal &= _I64_CONST_(0x00000000ffffffff);
00911
00912 tDta = tDtah | tDtal;
00913 }
00914
00915
00916 return(tDta);
00917 }
00918
00919
00920
00921
00922
00923
00924 double CigiCompCtrlV2::GetDoubleCompData(const unsigned int Pos)
00925 {
00926
00927 union DtaXfer {
00928 Cigi_uint64 i;
00929 double d;
00930 } XDta;
00931
00932 if(Pos > 1)
00933 {
00934 #ifndef CIGI_NO_EXCEPT
00935 throw CigiValueOutOfRangeException("Pos",Pos,0,0);
00936 #endif
00937
00938 }
00939 else
00940 {
00941
00942 int Word = Pos * 2;
00943 Cigi_uint64 tDtah = (Cigi_uint64)(CompData[Word++]);
00944 tDtah = (tDtah << 32) & _I64_CONST_(0xffffffff00000000);
00945
00946 Cigi_uint64 tDtal = (Cigi_uint64)(CompData[Word]);
00947 tDtal &= _I64_CONST_(0x00000000ffffffff);
00948
00949 XDta.i = tDtah | tDtal;
00950
00951 }
00952
00953 return(XDta.d);
00954 }
00955
00956
00957