Changeset 1994 in Sophya for trunk/ArchTOIPipe/Processors
- Timestamp:
- May 13, 2002, 3:11:32 PM (23 years ago)
- Location:
- trunk/ArchTOIPipe/Processors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Processors/nooppr.cc
r1762 r1994 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: nooppr.cc,v 1. 9 2001-11-13 16:22:47 aubourgExp $5 // $Id: nooppr.cc,v 1.10 2002-05-13 13:11:32 ansari Exp $ 6 6 7 7 #include <typeinfo> … … 14 14 NoOpProcessor::NoOpProcessor(int wsz) 15 15 { 16 if (wsz < 1) wsz = 1; 16 17 wsize = wsz; 17 18 totnscount = 0; … … 48 49 49 50 50 if (!checkInputTOIIndex(0)) { 51 if (!checkInputTOIIndex(0) && !checkInputTOIIndex(1) && 52 !checkOutputTOIIndex(0) && !checkOutputTOIIndex(1) ) { 53 cerr << " NoOpProcessor::run() - No TOI connected! " 54 << endl; 55 throw ParmError("NoOpProcessor::run() No TOI connected!"); 56 } 57 58 if (!acceptnoinput && !checkInputTOIIndex(0)) { 51 59 cerr << " NoOpProcessor::run() - Input TOI (in) not connected! " 52 60 << endl; 53 61 throw ParmError("NoOpProcessor::run() Input TOI (in) not connected!"); 54 62 } 63 bool fgin = checkInputTOIIndex(0); 55 64 bool fgin2 = checkInputTOIIndex(1); 56 65 … … 58 67 bool fgout2 = checkOutputTOIIndex(1); 59 68 60 if (fgout2 && !fgin2) {69 if (fgout2 && (!fgin2 && !acceptnoinput) ) { 61 70 cerr << " NoOpProcessor::run() - out2 connected without in2!" 62 71 << endl; … … 78 87 vin = new double[wsize]; 79 88 vfg = new uint_8[wsize]; 80 if (fgin2) { 89 for(i=0; i<wsize; i++) { 90 vin[i] = defval; vfg[i] = defflag; 91 } 92 if (fgin2 || fgout2) { 81 93 vin2 = new double[wsize]; 82 94 vfg2 = new uint_8[wsize]; 95 for(i=0; i<wsize; i++) { 96 vin2[i] = defval; vfg2[i] = defflag; 97 } 83 98 } 84 99 … … 86 101 // 1er partie, on traite par paquets de wsize 87 102 for(k=snb;k<=sne-wsize+1;k+=wsize) { 88 for(i=0; i<wsize; i++) { 89 getData(0, k+i, vin[i], vfg[i]); 90 if (fgin2) 91 getData(1, k+i, vin2[i], vfg2[i]); 92 } 103 if (fgin) 104 getData(0, k, wsize, vin, vfg); 105 if (fgin2) 106 getData(1, k, wsize, vin2, vfg2); 93 107 totnbblock++; 94 for(i=0; i<wsize; i++) { 95 if (fgout) 96 putData(0,k+i,vin[i],vfg[i]); 97 if (fgout2) 98 putData(1, k+i, vin2[i], vfg2[i]); 99 } 108 if (fgout) 109 putData(0, k, wsize, vin, vfg); 110 if (fgout2) 111 putData(1, k, wsize, vin2, vfg2); 100 112 klast+=wsize; 101 113 totnscount+=wsize; 114 totnbblock++; 102 115 } 103 116 } 104 117 105 118 // 2eme partie, on traite la fin du bloc d'echantillons si necessaire 106 double inval; 107 uint_8 inflg; 119 double inval = defval;; 120 uint_8 inflg = defflag; 121 double inval2 = defval;; 122 uint_8 inflg2 = defflag; 108 123 if (klast < sne) 109 124 for(k=klast+1; k<=sne; k++) { 110 getData(0, k, inval, inflg); 125 if (fgin) 126 getData(0, k, inval, inflg); 111 127 if (fgout) putData(0, k, inval, inflg); 112 if (fgin2) { 113 getData(1, k, inval, inflg); 114 if (fgout2) 115 putData(1, k, inval, inflg); 116 } 128 if (fgin2) 129 getData(1, k, inval2, inflg2); 130 if (fgout2) 131 putData(1, k, inval2, inflg2); 117 132 totnscount++; 118 133 } 119 120 totnbblock++; 134 totnbblock++; 121 135 122 136 cout << " NoOpProcessor::run() - End of processing " 123 << " TotNbBlocks= " << totnbblock << endl;137 << " TotNbBlocks= " << totnbblock << " ProcSamples=" << totnscount << endl; 124 138 } // Bloc try 125 139 -
trunk/ArchTOIPipe/Processors/nooppr.h
r1762 r1994 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: nooppr.h,v 1. 5 2001-11-13 16:22:47 aubourgExp $7 // $Id: nooppr.h,v 1.6 2002-05-13 13:11:32 ansari Exp $ 8 8 9 9 … … 25 25 inline int_8 ProcessedSampleCount() const { return totnscount; } 26 26 27 inline void AcceptNoInput(double val=0., long flg=0) 28 { acceptnoinput = true; defval = val; defflag = flg; } 29 27 30 virtual void PrintStatus(::ostream & os) ; // const plus tard 28 31 … … 33 36 int_8 totnscount; // Nombre total d'echantillon processe 34 37 int wsize; // Taille de fenetre de travail 38 39 bool acceptnoinput; 40 double defval; 41 long defflag; 35 42 }; 36 43
Note:
See TracChangeset
for help on using the changeset viewer.