Changeset 3909 in Sophya for trunk/AddOn/TAcq/pciewrap.cc
- Timestamp:
- Nov 21, 2010, 2:26:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/pciewrap.cc
r3683 r3909 12 12 using namespace SOPHYA; 13 13 14 //----------------------------------------------------------------------- 15 // Classe PCIEWrapperInterface ( virtuelle pure ) 16 //----------------------------------------------------------------------- 17 18 /* --Methode-- */ 19 PCIEWrapperInterface::PCIEWrapperInterface() 20 { 21 SetMaxWaitEndDMA(); 22 } 23 24 /* --Methode-- */ 25 PCIEWrapperInterface::~PCIEWrapperInterface() 26 { 27 } 28 29 /* --Methode-- */ 30 unsigned long PCIEWrapperInterface::SetMaxWaitEndDMA(unsigned int maxkwedma, unsigned int nretry) 31 { 32 if (maxkwedma>1) { maxwaitenddmaloop_=maxkwedma*1000; maxretryenddma_=nretry; } 33 return maxwaitenddmaloop_; 34 } 35 36 //------------------------------------------------------------------ 37 // Classe TestPCIWrapperNODMA : genere des paquets sans appel au DMA 38 //------------------------------------------------------------------ 14 39 /* --Methode-- */ 15 40 TestPCIWrapperNODMA::TestPCIWrapperNODMA(UInt32 sz, double lossrate) … … 23 48 timetag_ = 0; 24 49 tottransfer_ = 0; 25 lossrate_ = lossrate; 26 cout << " TestPCIWrapperNODMA(PaqSz=" << sz << ",LossRate=" << lossrate << ")" << endl; 50 if (lossrate<0.) lossrate=-lossrate; 51 max_frcount_=(UInt32)lossrate; 52 lossrate_ = lossrate-(double)max_frcount_; 53 if (lossrate_<1.e-9) lossrate_=0.; 54 cout << " TestPCIWrapperNODMA(PaqSz=" << sz << ",LossRate=" << lossrate 55 << " MaxFrameCount=" << max_frcount_ << ")" << endl; 27 56 } 28 57 … … 49 78 Byte* TestPCIWrapperNODMA::GetData() 50 79 { 51 if (lossrate_ > 1.e-19) { 80 if (frame_counter_>max_frcount_) return NULL; 81 if (lossrate_ > 1.e-9) { 52 82 UInt32 dfc = 1; 53 83 while (rg_.Flat01()<lossrate_) dfc++;
Note:
See TracChangeset
for help on using the changeset viewer.