Index: trunk/ArchTOIPipe/Processors/nooppr.cc
===================================================================
--- trunk/ArchTOIPipe/Processors/nooppr.cc	(revision 1982)
+++ trunk/ArchTOIPipe/Processors/nooppr.cc	(revision 1994)
@@ -3,5 +3,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: nooppr.cc,v 1.9 2001-11-13 16:22:47 aubourg Exp $
+// $Id: nooppr.cc,v 1.10 2002-05-13 13:11:32 ansari Exp $
 
 #include <typeinfo>
@@ -14,4 +14,5 @@
 NoOpProcessor::NoOpProcessor(int wsz)
 {
+  if (wsz < 1) wsz = 1;
   wsize = wsz;
   totnscount = 0;
@@ -48,9 +49,17 @@
 
 
-  if (!checkInputTOIIndex(0)) {
+  if (!checkInputTOIIndex(0) && !checkInputTOIIndex(1) && 
+      !checkOutputTOIIndex(0) && !checkOutputTOIIndex(1) ) {
+    cerr << " NoOpProcessor::run() - No TOI connected! "
+	 << endl;
+    throw ParmError("NoOpProcessor::run() No TOI connected!");
+  }
+
+  if (!acceptnoinput && !checkInputTOIIndex(0)) {
     cerr << " NoOpProcessor::run() - Input TOI (in) not connected! "
 	 << endl;
     throw ParmError("NoOpProcessor::run() Input TOI (in) not connected!");
   }
+  bool fgin = checkInputTOIIndex(0);
   bool fgin2 = checkInputTOIIndex(1);
 
@@ -58,5 +67,5 @@
   bool fgout2 = checkOutputTOIIndex(1);
 
-  if (fgout2 && !fgin2) {
+  if (fgout2 && (!fgin2 && !acceptnoinput) ) {
     cerr << " NoOpProcessor::run() - out2 connected without in2!"
 	 << endl;
@@ -78,7 +87,13 @@
       vin = new double[wsize];
       vfg = new uint_8[wsize];
-      if (fgin2) {
+      for(i=0; i<wsize; i++) { 
+	vin[i] = defval; vfg[i] = defflag;
+      }
+      if (fgin2 || fgout2) {
 	vin2 = new double[wsize];
 	vfg2 = new uint_8[wsize];
+	for(i=0; i<wsize; i++) { 
+	  vin2[i] = defval; vfg2[i] = defflag;
+	}	
       }
     
@@ -86,40 +101,39 @@
       // 1er partie, on traite par paquets de wsize
       for(k=snb;k<=sne-wsize+1;k+=wsize) {
-	for(i=0; i<wsize; i++) { 
-	  getData(0, k+i, vin[i], vfg[i]);
-	  if (fgin2)
-	    getData(1, k+i, vin2[i], vfg2[i]);
-	}
+	if (fgin) 
+	  getData(0, k, wsize, vin, vfg);
+	if (fgin2)
+	  getData(1, k, wsize, vin2, vfg2);
 	totnbblock++;
-	for(i=0; i<wsize; i++) {
-	  if (fgout) 
-	    putData(0,k+i,vin[i],vfg[i]);
-	  if (fgout2)  
-	    putData(1, k+i, vin2[i], vfg2[i]);
-	}
+	if (fgout) 
+	  putData(0, k, wsize, vin, vfg);
+	if (fgout2)  
+	  putData(1, k, wsize, vin2, vfg2);
 	klast+=wsize;
 	totnscount+=wsize;
+	totnbblock++;
       }
     }
 
     // 2eme partie, on traite la fin du bloc d'echantillons si necessaire
-    double inval;
-    uint_8 inflg;
+    double inval = defval;;
+    uint_8 inflg = defflag;
+    double inval2 = defval;;
+    uint_8 inflg2 = defflag;
     if (klast < sne) 
       for(k=klast+1; k<=sne; k++) {
-	getData(0, k, inval, inflg);
+	if (fgin) 
+	  getData(0, k, inval, inflg);
 	if (fgout) putData(0, k, inval, inflg);
-	if (fgin2) { 
-	  getData(1, k, inval, inflg);
-	  if (fgout2) 
-	    putData(1, k, inval, inflg);
-	}
+	if (fgin2)  
+	  getData(1, k, inval2, inflg2);
+	if (fgout2) 
+	    putData(1, k, inval2, inflg2);
 	totnscount++;
       }
-
-    totnbblock++;
+    totnbblock++; 
 
     cout << " NoOpProcessor::run() - End of processing " 
-	 << " TotNbBlocks= " << totnbblock << endl;
+	 << " TotNbBlocks= " << totnbblock << " ProcSamples=" << totnscount << endl;
   }  // Bloc try 
 
Index: trunk/ArchTOIPipe/Processors/nooppr.h
===================================================================
--- trunk/ArchTOIPipe/Processors/nooppr.h	(revision 1982)
+++ trunk/ArchTOIPipe/Processors/nooppr.h	(revision 1994)
@@ -5,5 +5,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: nooppr.h,v 1.5 2001-11-13 16:22:47 aubourg Exp $
+// $Id: nooppr.h,v 1.6 2002-05-13 13:11:32 ansari Exp $
 
 
@@ -25,4 +25,7 @@
   inline int_8	ProcessedSampleCount() const { return totnscount; }
 
+  inline void   AcceptNoInput(double val=0., long flg=0)
+         { acceptnoinput = true; defval = val; defflag = flg; }
+
   virtual void  PrintStatus(::ostream & os) ; // const plus tard
 
@@ -33,4 +36,8 @@
   int_8 totnscount;   // Nombre total d'echantillon processe
   int wsize;         // Taille de fenetre de travail
+
+  bool acceptnoinput;
+  double defval;
+  long defflag;
 };
 
