Index: trunk/AddOn/TAcq/brbaseproc.cc
===================================================================
--- trunk/AddOn/TAcq/brbaseproc.cc	(revision 3955)
+++ trunk/AddOn/TAcq/brbaseproc.cc	(revision 3979)
@@ -96,59 +96,71 @@
     cout << "BRBaseProcessor[" << bpnom_ << "," << bpid_ << "]::run() - Starting " << " NFibers=" 
 	 << memgr_.NbFibres() << endl;	
+    if (fgproctimewin_) cout << " BRBaseProcessor...TimeWindow Start=" << tmstart_ << " End=" << tmend_ << endl;
 
     size_t paqsz=memgr_.PaqSize();
     size_t procpaqsz=memgr_.ProcPaqSize();
+
+    double tstartdays = tmstart_.ToDays(); 
+    double tenddays = tmend_.ToDays(); 
+
     bool fgrun=true;
     while (fgrun) {
       if (stop_) break;
       if (memgr_.GetRunState() == MemZR_Stopped) break;
-      int mid = memgr_.FindMemZoneId(mmact_);  // (MemZA_ProcA);
-      //      Byte* buffg = memgr_.GetMemZone(mid);
+      mid_ = memgr_.FindMemZoneId(mmact_);  // (MemZA_ProcA);
+      //      Byte* buffg = memgr_.GetMemZone(mid_);
       //      if (buffg == NULL) {
-      if (mid < 0) {
+      if (mid_ < 0) {
 	cout << "BRBaseProcessor[" << bpnom_ << "," << bpid_ << "]::run()/ERROR FindMemZoneId(" 
-	     << (int)mmact_ << ") ->" << mid << ") -> NULL" << endl;
+	     << (int)mmact_ << ") ->" << mid_ << ") -> NULL" << endl;
 	setRC(7);      fgrun=false;		
 	break;	
       }
-      cts_=memgr_.GetAuxData(mid)->FillTime();   // get associated date/time (DATEOBS)
+      cts_=memgr_.GetAuxData(mid_)->FillTime();   // get associated date/time (DATEOBS)
       for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) {
-	fbuff_[fib] = memgr_.GetMemZone(mid,fib);
+	fbuff_[fib] = memgr_.GetMemZone(mid_,fib);
 	if (fbuff_[fib] == NULL) { // cela ne devrait pas arriver 
 	  cout << "BRBaseProcessor[" << bpnom_ << "," << bpid_ << "]::run()/ERROR memgr.GetMemZone(" 
-	       << mid << "," << fib << ") -> NULL" << endl;
+	       << mid_ << "," << fib << ") -> NULL" << endl;
 	  setRC(9);	  fgrun=false;		
 	  break;
 	}
-	if ((procpaqsz>0)&&((fprocbuff_[fib]=memgr_.GetProcMemZone(mid,fib))==NULL)) {   // cela ne devrait pas arriver non plus
+	if ((procpaqsz>0)&&((fprocbuff_[fib]=memgr_.GetProcMemZone(mid_,fib))==NULL)) {   // cela ne devrait pas arriver non plus
 	  cout << "BRBaseProcessor[" << bpnom_ << "," << bpid_ << "]::run()/ERROR memgr.GetProcMemZone(" 
-	       << mid << "," << fib << ") -> NULL" << endl;
+	       << mid_ << "," << fib << ") -> NULL" << endl;
 	  setRC(9);	  fgrun=false;		
 	  break;
 	}
       }
-      for(size_t jp=0; jp<memgr_.NbPaquets(); jp++) {   // boucle sur les paquets d'une zone  
-	fgokallfibers_=true;
-	for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) {
-	  vpaq_[fib].Set(fbuff_[fib]+jp*paqsz);
-	  vfgok_[fib]=vpchk_[fib].Check(vpaq_[fib],curfc_[fib]);
-	  if (!vfgok_[fib])  fgokallfibers_=false;
-	  if (procpaqsz>0)    vprocpaq_[fib] = fprocbuff_[fib]+jp*procpaqsz;
-	}
-	//--- Traitement 
-	int rcp=0;
-	if (fgokallfibers_)  {
-	  if (totprocnpaq_==0) {
-	    for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++)  {
-	      fcfirst_[fib]=curfc_[fib];
-	      ttfirst_[fib]=vpaq_[fib].TimeTag();
+
+      // On ne traite les paquets que si pas de fenetre en temps ou tmstart_ <= FillTime() <= tmend_
+      double ftmdays = memgr_.GetAuxData(mid_)->FillTime().ToDays();
+      if ((!fgproctimewin_) || ( (ftmdays<=tenddays)&&(ftmdays>=tstartdays) ) ) {
+
+	for(size_t jp=0; jp<memgr_.NbPaquets(); jp++) {   // boucle sur les paquets d'une zone  
+	  fgokallfibers_=true;
+	  for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) {
+	    vpaq_[fib].Set(fbuff_[fib]+jp*paqsz);
+	    vfgok_[fib]=vpchk_[fib].Check(vpaq_[fib],curfc_[fib]);
+	    if (!vfgok_[fib])  fgokallfibers_=false;
+	    if (procpaqsz>0)    vprocpaq_[fib] = fprocbuff_[fib]+jp*procpaqsz;
+	  }
+	  //--- Traitement 
+	  int rcp=0;
+	  if (fgokallfibers_)  {
+	    if (totprocnpaq_==0) {
+	      for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++)  {
+		fcfirst_[fib]=curfc_[fib];
+		ttfirst_[fib]=vpaq_[fib].TimeTag();
+	      }
 	    }
+	    rcp=Process();
+	    totprocnpaq_++;
 	  }
-	  rcp=Process();
-	  totprocnpaq_++;
-	}
-	//	if (rcp != 0)   { fgrun=false; break; }
-      }  // Fin de boucle sur les paquets 
-      memgr_.FreeMemZone(mid, mmsta_);   // (MemZS_ProcA);
+	  //	if (rcp != 0)   { fgrun=false; break; }
+	}  // Fin de boucle sur les paquets
+      }  // Fin de test pour fenetre en temps de traitement des paquets 
+ 
+      memgr_.FreeMemZone(mid_, mmsta_);   // (MemZS_ProcA);
     } // Fin de boucle sur les zones a traiter 
     //------------------------------------
@@ -198,4 +210,8 @@
     for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++)   
       cout << getCurTimeTagSeconds(fib) << "," ;
+    if (prtlev_<4) return 0;
+    cout << " ... FileSequenceNumber[0..." << memgr_.NbFibres()-1 << "]=" ;
+    for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++)   
+      cout << memgr_.GetAuxData(mid_)->FileSequenceNumber(fib) << ",";
     cout << endl;
   }
