| [3683] | 1 | #ifndef  BRBASEPROC_H_SEEN
 | 
|---|
 | 2 | #define  BRBASEPROC_H_SEEN
 | 
|---|
 | 3 | 
 | 
|---|
 | 4 | //----------------------------------------------------------------
 | 
|---|
 | 5 | // Projet BAORadio - (C) LAL/IRFU  2008-2010
 | 
|---|
 | 6 | // Classes de threads de traitememt donnees BAORadio 
 | 
|---|
 | 7 | //----------------------------------------------------------------
 | 
|---|
 | 8 | 
 | 
|---|
 | 9 | 
 | 
|---|
 | 10 | #include "racqumem.h"
 | 
|---|
 | 11 | #include <string>
 | 
|---|
 | 12 | #include <vector>
 | 
|---|
 | 13 | #include <iostream>
 | 
|---|
 | 14 | 
 | 
|---|
 | 15 | #include "brpaqu.h"
 | 
|---|
| [3909] | 16 | #include "timestamp.h"  // include SOPHYA
 | 
|---|
| [3683] | 17 | 
 | 
|---|
 | 18 | using namespace std;
 | 
|---|
 | 19 | 
 | 
|---|
 | 20 | //---------------------------------------------------------------------
 | 
|---|
 | 21 | // Classe de base pour l'analyse donnees (paquets acquisition) BAORadio 
 | 
|---|
 | 22 | // Les classes de traitement des paquets BAORadio peuvent heriter de 
 | 
|---|
 | 23 | // cette classe de base BRBaseProcessor en redefinissant la methode Process()
 | 
|---|
 | 24 | //---------------------------------------------------------------------
 | 
|---|
 | 25 | class BRBaseProcessor : public SOPHYA::ZThread {
 | 
|---|
 | 26 | public: 
 | 
|---|
| [3774] | 27 |   BRBaseProcessor(RAcqMemZoneMgr& memgr, MemZaction mmact=MemZA_ProcA);
 | 
|---|
 | 28 |   
 | 
|---|
 | 29 |   MemZStatus SetMemZAction(MemZaction mmact=MemZA_ProcA);
 | 
|---|
| [3703] | 30 | 
 | 
|---|
| [3683] | 31 |   virtual void run();
 | 
|---|
 | 32 |   inline void Stop();
 | 
|---|
 | 33 |   inline void STOP() { stop_ = true; }  
 | 
|---|
| [3703] | 34 | 
 | 
|---|
| [3778] | 35 |   inline void setNameId(const char* nom, int id) 
 | 
|---|
 | 36 |   { bpnom_=nom;   bpid_=id;  }
 | 
|---|
 | 37 |   inline void setNameId(string nom, int id) 
 | 
|---|
 | 38 |   { bpnom_=nom;   bpid_=id;  }
 | 
|---|
 | 39 | 
 | 
|---|
| [3683] | 40 | protected:
 | 
|---|
| [3703] | 41 |   // Methode devant etre redefinie pour effectuer le traitement - appele pour chaque trigger  
 | 
|---|
 | 42 |   virtual int Process();  // renvoie 0 si OK, sinon, arret traitement 
 | 
|---|
 | 43 | 
 | 
|---|
| [3683] | 44 |   RAcqMemZoneMgr& memgr_;
 | 
|---|
| [3774] | 45 |   MemZaction mmact_;    // Definition de l'action sur les paquets (defaut=MemZA_ProcA)
 | 
|---|
 | 46 |   MemZStatus mmsta_;    // Statut associe a mmact_ (defaut=MemZS_ProcA)
 | 
|---|
| [3696] | 47 |   bool stop_;
 | 
|---|
 | 48 |   vector<Byte*> fbuff_;      // Vecteur de pointeur de zone memoire pour chaque fibre 
 | 
|---|
| [3872] | 49 |   vector<Byte*> fprocbuff_;   // Vecteur de pointeur de proc_zone_mem pour chaque fibre 
 | 
|---|
| [3683] | 50 |   vector<BRPaquet> vpaq_;   // Vecteur de BRPaquet pour chaque fibre
 | 
|---|
| [3872] | 51 |   vector<Byte*> vprocpaq_;  // Vecteur de pointeur de zone memoire pour donnees traitees de chaque paquet/fibre 
 | 
|---|
| [3694] | 52 |   vector<BRPaqChecker> vpchk_;
 | 
|---|
| [3683] | 53 |   vector<uint_8> vfgok_;    // Vecteur de flag si paquet OK pour chaque fibre
 | 
|---|
 | 54 |   vector<uint_8> curfc_;    // Vecteur de numero de FrameCounter pour chaque fibre
 | 
|---|
| [3696] | 55 |   vector<uint_8> fcfirst_;  // 
 | 
|---|
 | 56 |   vector<uint_8> ttfirst_;
 | 
|---|
| [3683] | 57 |   bool fgokallfibers_;      // true -> paquets for all fibers OK
 | 
|---|
| [3694] | 58 | 
 | 
|---|
| [3683] | 59 |   uint_8 totprocnpaq_; 
 | 
|---|
| [3909] | 60 |   SOPHYA::TimeStamp cts_;   // current time stamp, get from MemZoneMgr
 | 
|---|
| [3778] | 61 | 
 | 
|---|
 | 62 |   string bpnom_;    // nom du processeur
 | 
|---|
 | 63 |   int bpid_;        // numero d'identificateur 
 | 
|---|
| [3683] | 64 | };
 | 
|---|
 | 65 | 
 | 
|---|
 | 66 | 
 | 
|---|
 | 67 | 
 | 
|---|
 | 68 | #endif
 | 
|---|