Last change
on this file since 3623 was 3623, checked in by ansari, 16 years ago |
Modifications et ameliorations diverses pour programme acquisition/traitement multifibres
Reza 22/05/2009
1- Extension/amelioration classe BRPaquet et BRPaqChecker
2- Correction BUG dans RAcqMemZoneMgr bloquant l'utilisation a une seule zone memoire
3- Classe PCIEWrapper devenue virtuelle pure et introduction de la classe TestPCIWrapperNODMA
pour les smulations.
|
File size:
1.2 KB
|
Rev | Line | |
---|
[3537] | 1 | #include "pciewrap.h"
|
---|
[3623] | 2 | #include "brpaqu.h"
|
---|
[3537] | 3 |
|
---|
[3623] | 4 | #include "racqumem.h"
|
---|
| 5 |
|
---|
[3537] | 6 | #include <stdlib.h>
|
---|
| 7 | #include <stdio.h>
|
---|
| 8 | #include <math.h>
|
---|
| 9 | #include <iostream>
|
---|
| 10 |
|
---|
[3623] | 11 | TestPCIWrapperNODMA::TestPCIWrapperNODMA(UInt32 sz)
|
---|
| 12 | : PCIEWrapper() , size_(sz)
|
---|
[3537] | 13 | {
|
---|
[3623] | 14 | data_ = new Byte[size_];
|
---|
| 15 | frame_counter_ = 0;
|
---|
| 16 | timetag_ = 0;
|
---|
| 17 | tottransfer_ = 0;
|
---|
[3537] | 18 | }
|
---|
| 19 |
|
---|
[3623] | 20 | TestPCIWrapperNODMA::~TestPCIWrapperNODMA()
|
---|
[3537] | 21 | {
|
---|
[3623] | 22 | delete[] data_;
|
---|
[3537] | 23 | }
|
---|
| 24 |
|
---|
[3623] | 25 | UInt32 TestPCIWrapperNODMA::TransferSize()
|
---|
| 26 | {
|
---|
| 27 | return size_;
|
---|
| 28 | }
|
---|
[3537] | 29 |
|
---|
[3623] | 30 | UInt64 TestPCIWrapperNODMA::TotTransferBytes()
|
---|
| 31 | {
|
---|
| 32 | return tottransfer_;
|
---|
| 33 | }
|
---|
[3537] | 34 |
|
---|
[3623] | 35 | Byte* TestPCIWrapperNODMA::DoTransferData(int numbuff)
|
---|
[3537] | 36 | {
|
---|
[3623] | 37 | frame_counter_ ++;
|
---|
| 38 | timetag_ = frame_counter_ * size_ / 2;
|
---|
| 39 | BRPaquet paq(data_, size_);
|
---|
| 40 | paq.SetHDRMarker64(pchk_.HDRTag());
|
---|
| 41 | paq.SetTRLMarker64(pchk_.TRLTag());
|
---|
| 42 | paq.SetFrameCounter(frame_counter_);
|
---|
| 43 | paq.SetTimeTag(timetag_);
|
---|
| 44 | paq.SetPaqLen((UInt16)((size_ - BRHDRSIZE - BRTRLSIZE)/4));
|
---|
| 45 | Byte* bp = paq.Data1();
|
---|
| 46 | for(UInt32 kk=0; kk<paq.DataSize(); kk++)
|
---|
| 47 | bp[kk] = (Byte)(sin(0.0345*kk)*78.+127.5);
|
---|
| 48 | tottransfer_ += size_;
|
---|
| 49 | return data_;
|
---|
[3537] | 50 | }
|
---|
| 51 |
|
---|
[3623] | 52 | void TestPCIWrapperNODMA::PrintStatus(ostream& os)
|
---|
[3537] | 53 | {
|
---|
[3623] | 54 | os << "TestPCIWrapperNODMA::Status, FrameCounter=" << frame_counter_
|
---|
| 55 | << " TimeTag=" << timetag_ << endl;
|
---|
| 56 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.