Changeset 3659 in Sophya for trunk/AddOn/TAcq/brpaqu.h
- Timestamp:
- Oct 19, 2009, 3:43:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/brpaqu.h
r3658 r3659 31 31 explicit TwoByteComplex(double re, double im) { val_[0] = re; val_[1] = im; } 32 32 33 inline Byte& realB() { return val_[0]; } 34 inline Byte& imagB() { return val_[1]; } 35 36 inline SByte realSB() { return ((SByte*)val_)[0]; } 37 inline SByte imagSB() { return ((SByte*)val_)[1]; } 38 39 inline int realI() { return ((SByte*)val_)[0]; } 40 inline int imagI() { return ((SByte*)val_)[1]; } 41 42 inline double realD() { return ((SByte*)val_)[0]; } 43 inline double imagD() { return ((SByte*)val_)[1]; } 44 45 Byte val_[2]; 33 inline SByte& realB() { return val_[0]; } 34 inline SByte& imagB() { return val_[1]; } 35 36 inline int realI() { return (int)(val_)[0]; } 37 inline int imagI() { return (int)(val_)[1]; } 38 39 inline double realD() { return (double)(val_)[0]; } 40 inline double imagD() { return (double)(val_)[1]; } 41 42 SByte val_[2]; 46 43 }; 47 44 … … 127 124 inline Byte* Header() { return dst_+OFFSET; } 128 125 inline Byte* Trailer() { return (dst_+sz_-BRTRLSIZE+OFFSET); } 129 126 127 // Acces aux differentes zone de donnees en signed byte (-127 ... 127), donnees FFT 128 inline SByte* BeginS() { return (SByte*)(dst_+OFFSET); } 129 inline SByte* Data1S() { return (SByte*)(dst_+BRHDRSIZE+OFFSET); } 130 inline SByte* Data2S() { return (SByte*)(dst_+BRHDRSIZE+(DataSize()/2)+OFFSET); } 131 132 // Acces aux differentes zone de donnees en TwoByteComplex pour donnees FFT 133 inline int DataSizeC() { return (sz_-(BRHDRSIZE+BRTRLSIZE))/2; } 134 inline TwoByteComplex* BeginC() { return (TwoByteComplex*)(dst_+OFFSET); } 135 inline TwoByteComplex* Data1C() { return (TwoByteComplex*)(dst_+BRHDRSIZE+OFFSET); } 136 inline TwoByteComplex* Data2C() { return (TwoByteComplex*)(dst_+BRHDRSIZE+(DataSize()/2)+OFFSET); } 137 130 138 // Valeurs differentes zones HDR/TRL 131 139 inline UInt32 HDRMarker() {return *((UInt32*)(dst_+OFFSET));} … … 167 175 168 176 // fonction appelee par le constructeur pour reordonner les donnees FFT 169 static void ReorderFFTData( Byte* src,Byte* dst, int sz);170 static void ReorderFFTData32( Byte* src,Byte* dst, int sz);171 static void ReorderFFTDataNoSwap( Byte* src,Byte* dst, int sz);177 static void ReorderFFTData(SByte* src, SByte* dst, int sz); 178 static void ReorderFFTData32(SByte* src, SByte* dst, int sz); 179 static void ReorderFFTDataNoSwap(SByte* src, SByte* dst, int sz); 172 180 static const char* FmtConvToString(BRDataFmtConv fgswap); 173 181 // protected: … … 184 192 class BRPaqChecker { 185 193 public: 194 // if cktrl==true, check header AND trailer, ==false check header only 186 195 BRPaqChecker(bool cktrl=true, int maxprt=0); 187 196 ~BRPaqChecker(); … … 194 203 195 204 // Verifie le paquet, renvoie true si OK 196 bool Check(BRPaquet& paq); 205 bool Check(BRPaquet& paq, UInt64& numframe); 206 inline bool Check(BRPaquet& paq) { UInt64 nf; return Check(paq, nf); } 207 197 208 // Imprime le compte de paquets ... 198 209 ostream & Print(ostream& os) const; 199 210 inline ostream & Print() const { return Print(cout); } 200 211 201 unsigned long long totnframes; // Nombre totale de frames/paquets traites 202 unsigned long long nframeok; // Nombre totale de frames/paquets avec HDR/TRL OK 203 unsigned long long lostframes; // Nombre totale de frames/paquets perdus 204 unsigned int frclst; // derniere valeur du frame-counter 212 // Acces aux differents compteurs 213 inline UInt64 NbPaqTotal() { return totnframes; } 214 inline UInt64 NbPaqOK() { return nframeok; } 215 inline UInt64 NbPaqLost() { return lostframes; } 216 inline UInt64 NbGaps() { return cnt_saut; } 217 inline UInt64 LastFrameNum() { return lastframenum; } 218 219 protected: 220 UInt64 totnframes; // Nombre totale de frames/paquets traites 221 UInt64 nframeok; // Nombre totale de frames/paquets avec HDR/TRL OK 222 UInt64 lostframes; // Nombre totale de frames/paquets perdus 223 UInt16 frclst; // derniere valeur du frame-counter 224 UInt64 lastframenum; // Dernier numero de frame(=frame-counter, sans modulo 65535) 205 225 206 226 bool cktrl_; // Verifie aussi le trailer si true 207 unsigned intcnt_saut; // Nb de fois ou DeltaFrameCounter>1208 unsigned int maxprt_;// Nb maxi de print paquets perdus / probleme227 UInt64 cnt_saut; // Nb de fois ou DeltaFrameCounter>1 228 UInt32 maxprt_; // Nb maxi de print paquets perdus / probleme 209 229 210 230 UInt64 hdrtag_; … … 212 232 }; 213 233 214 // Definition de l'operator << overloading - Appel de Prin ()234 // Definition de l'operator << overloading - Appel de Print() 215 235 inline ostream& operator << (ostream& s, BRPaqChecker const & chk) 216 236 { return chk.Print(s); }
Note:
See TracChangeset
for help on using the changeset viewer.