source: Sophya/trunk/AddOn/TAcq/pciewrap.cc@ 3627

Last change on this file since 3627 was 3626, checked in by ansari, 16 years ago

Introduction numero d'ordre de remplissage, mask de recyclage,
et sequence de traitement procA/B/C dans le gestionnaire de
memoire - Reza 22/05/2009

File size: 1.3 KB
RevLine 
[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]11TestPCIWrapperNODMA::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]20TestPCIWrapperNODMA::~TestPCIWrapperNODMA()
[3537]21{
[3623]22 delete[] data_;
[3537]23}
24
[3623]25UInt32 TestPCIWrapperNODMA::TransferSize()
26{
27 return size_;
28}
[3537]29
[3623]30UInt64 TestPCIWrapperNODMA::TotTransferBytes()
31{
32 return tottransfer_;
33}
[3537]34
[3623]35Byte* 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();
[3625]46/*
[3623]47 for(UInt32 kk=0; kk<paq.DataSize(); kk++)
48 bp[kk] = (Byte)(sin(0.0345*kk)*78.+127.5);
[3625]49*/
[3626]50 UInt32 kkmax = paq.DataSize();
51 for(UInt32 kk=0; kk<kkmax; kk++)
[3625]52 bp[kk] = (Byte)(kk%200+20);
[3623]53 tottransfer_ += size_;
54 return data_;
[3537]55}
56
[3623]57void TestPCIWrapperNODMA::PrintStatus(ostream& os)
[3537]58{
[3623]59 os << "TestPCIWrapperNODMA::Status, FrameCounter=" << frame_counter_
60 << " TimeTag=" << timetag_ << endl;
61}
Note: See TracBrowser for help on using the repository browser.