Index: /trunk/ArchTOIPipe/Kernel/toimanager.cc
===================================================================
--- /trunk/ArchTOIPipe/Kernel/toimanager.cc	(revision 1698)
+++ /trunk/ArchTOIPipe/Kernel/toimanager.cc	(revision 1699)
@@ -1,14 +1,11 @@
 #include "toimanager.h"
+#include <unistd.h>
 #include <limits.h>
 #include <pthread.h>
 #include <iostream.h>
 
-#ifndef MAXINT
-#define MAXINT 2147483647
-#endif
-
 TOIManager::TOIManager() {
   reqBegin = 0;
-  reqEnd = MAXINT;
+  reqEnd = LONG_MAX;
 }
 
@@ -20,14 +17,14 @@
 }
 
-void TOIManager::setRequestedSample(int begin, int end) {
+void TOIManager::setRequestedSample(long begin, long end) {
   reqBegin = begin;
   reqEnd   = end;
 }
 
-int TOIManager::getRequestedBegin() {
+long TOIManager::getRequestedBegin() {
   return reqBegin;
 }
 
-int TOIManager::getRequestedEnd() {
+long TOIManager::getRequestedEnd() {
   return reqEnd;
 }
@@ -96,10 +93,10 @@
     processed_samples = ProcessedSampleCount();
     if ( (processed_samples-last_sample_count > dns_print) || 
-         (processed_samples > total_sample_count-10) ) {
+	 (processed_samples > total_sample_count-10) ) {
       last_sample_count = processed_samples;
       if (nb_dns_print == 0) cout << "\n";
       nb_dns_print++;
       cout << ">>> " << _msg << ": ProcessedSampleCount()= " << last_sample_count 
-           << " Frac done = " << processed_samples*100/total_sample_count << " %" << endl;
+	   << " Frac done = " << processed_samples*100/total_sample_count << " %" << endl;
       if (last_sample_count > total_sample_count-10)  alldone = true;
       nb_sleep = 0;
@@ -107,6 +104,6 @@
     else if ((nb_sleep+1)%5 == 0) 
       cout << "> " << _msg << ": ProcSamples()= " <<  processed_samples 
-           << " Done = " << " %" << processed_samples*100/total_sample_count
-           << " NbSleep(1) = " << nb_sleep << endl;
+	   << " Done = " << " %" << processed_samples*100/total_sample_count
+	   << " NbSleep(1) = " << nb_sleep << endl;
     
     sleep(1);  nb_sleep++;
Index: /trunk/ArchTOIPipe/Kernel/toimanager.h
===================================================================
--- /trunk/ArchTOIPipe/Kernel/toimanager.h	(revision 1698)
+++ /trunk/ArchTOIPipe/Kernel/toimanager.h	(revision 1699)
@@ -12,7 +12,7 @@
 public:
   static TOIManager* getManager();
-  void setRequestedSample(int begin, int end);
-  int getRequestedBegin();
-  int getRequestedEnd();
+  void setRequestedSample(long begin, long end);
+  long getRequestedBegin();
+  long getRequestedEnd();
   void addThread(pthread_t*);
   void joinAll();
@@ -27,4 +27,5 @@
 };
 
+
 // -----------------------------------------------------------------
 //    Classe pour affichage de l'avancement des TOIProcessors 
@@ -34,7 +35,7 @@
 class RzProcSampleCounter {
 public:
-  RzProcSampleCounter();
+                RzProcSampleCounter();
   virtual       ~RzProcSampleCounter();
-  virtual long  ProcessedSampleCount() = 0;
+  virtual long	ProcessedSampleCount() = 0;
   virtual long  PrintStats();
   inline int &  PrintRate(int pr) { return _rate; } 
@@ -48,7 +49,7 @@
 class ProcSampleCounter : public RzProcSampleCounter {
 public:
-  ProcSampleCounter(const T & t) { _t = &t; } 
-  virtual long  ProcessedSampleCount()
-  { return _t->ProcessedSampleCount(); }
+                ProcSampleCounter(const T & t) { _t = &t; } 
+  virtual long	ProcessedSampleCount()
+                      { return _t->ProcessedSampleCount(); }
 protected:
   const T * _t;
@@ -56,3 +57,2 @@
 
 #endif
-
Index: /trunk/ArchTOIPipe/Kernel/toisegment.cc
===================================================================
--- /trunk/ArchTOIPipe/Kernel/toisegment.cc	(revision 1698)
+++ /trunk/ArchTOIPipe/Kernel/toisegment.cc	(revision 1699)
@@ -28,4 +28,10 @@
 
 TOISegmented::TOISegmented(string nm, int bufsz, int maxseg) {
+  master = new MasterView(bufsz, maxseg);
+  setName(nm);
+}
+
+TOISegmented::TOISegmented(char* cnm, int bufsz, int maxseg) {
+  string nm = cnm;
   master = new MasterView(bufsz, maxseg);
   setName(nm);
Index: /trunk/ArchTOIPipe/Kernel/toisegment.h
===================================================================
--- /trunk/ArchTOIPipe/Kernel/toisegment.h	(revision 1698)
+++ /trunk/ArchTOIPipe/Kernel/toisegment.h	(revision 1699)
@@ -20,4 +20,5 @@
   TOISegmented(int bufsz=256, int maxseg=20);
   TOISegmented(string nm, int bufsz=256, int maxseg=20);
+  TOISegmented(char* cnm, int bufsz=256, int maxseg=20);
   ~TOISegmented();
 
Index: /trunk/ArchTOIPipe/SMakefile
===================================================================
--- /trunk/ArchTOIPipe/SMakefile	(revision 1698)
+++ /trunk/ArchTOIPipe/SMakefile	(revision 1699)
@@ -13,4 +13,5 @@
             $(AOBJ)toi.o $(AOBJ)toimanager.o $(AOBJ)toiprocessor.o $(AOBJ)genwproc.o \
             $(AOBJ)toisqfilter.o $(AOBJ)toiregwindow.o $(AOBJ)toiseqbuff.o \
+            $(AOBJ)toisegment.o \
             $(AOBJ)simtoipr.o $(AOBJ)map2toi.o $(AOBJ)toi2map.o $(AOBJ)nooppr.o
 EXEOLIST := $(AOBJ)fits2asc.o $(AOBJ)tsttoi.o $(AOBJ)tsttoi2.o $(AOBJ)simtst.o \
@@ -24,5 +25,5 @@
 INCLIST := asciitoiwtr.h fitstoirdr.h fitstoiwtr.h toi.h config.h conf.h \
            toiprocessor.h genwproc.h toimanager.h toiseqbuff.h toiregwindow.h \
-           simtoipr.h map2toi.h toi2map.h nooppr.h
+           simtoipr.h map2toi.h toi2map.h nooppr.h toisegment.h
 
 all : $(EXELIST) 
@@ -144,2 +145,3 @@
 $(AOBJ)toi2map.o: toi2map.cc toi2map.h 
 $(AOBJ)nooppr.o: nooppr.cc nooppr.h 
+$(AOBJ)toisegment.o: toisegment.cc toiprocessor.h config.h conf.h toi.h
Index: /trunk/ArchTOIPipe/TestPipes/tstdemopipe.cc
===================================================================
--- /trunk/ArchTOIPipe/TestPipes/tstdemopipe.cc	(revision 1698)
+++ /trunk/ArchTOIPipe/TestPipes/tstdemopipe.cc	(revision 1699)
@@ -82,5 +82,5 @@
 #include "fitstoiwtr.h"
 #include "toimanager.h"
-#include "toiseqbuff.h"
+#include "toisegment.h"
 #include "sophyainit.h"
 
@@ -247,5 +247,5 @@
 
  // tuyau bolo10 pour entree processeur
- TOISeqBuffered * bolo10 = new TOISeqBuffered("tuyau_bolo_10",taille);
+ TOISegmented * bolo10 = new TOISegmented("tuyau_bolo_10",taille);
  // connection a la colonne correspondante du lecteur fits
  rfits1.addOutput("boloMuV_10",bolo10);
@@ -257,5 +257,5 @@
 
  // tuyau bolo20 pour entree processeur (idem cf au dessus)
- TOISeqBuffered * bolo20 = new TOISeqBuffered("tuyau_bolo_20",taille);
+ TOISegmented * bolo20 = new TOISegmented("tuyau_bolo_20",taille);
  rfits1.addOutput("boloMuV_20",bolo20);
  demo.addInput("entree_bolo_2",bolo20);
@@ -264,5 +264,5 @@
 
  // tuyau bolo30 pour entree processeur (idem cf au dessus)
- TOISeqBuffered * bolo30 = new TOISeqBuffered("tuyau_bolo_30",taille);
+ TOISegmented * bolo30 = new TOISegmented("tuyau_bolo_30",taille);
  rfits2.addOutput("boloMuV_30",bolo30);
  demo.addInput("entree_bolo_3",bolo30);
@@ -271,5 +271,5 @@
 
  // tuyau bolosum pour sortie processeur
- TOISeqBuffered * bolosum = new TOISeqBuffered("tuyau_bolo_sum",taille);
+ TOISegmented * bolosum = new TOISegmented("tuyau_bolo_sum",taille);
  demo.addOutput("sortie_bolo_sum",bolosum);
  writeflag = true;
@@ -277,5 +277,5 @@
 
  // tuyau bolomul pour sortie processeur
- TOISeqBuffered * bolomul = new TOISeqBuffered("tuyau_bolo_mul",taille);
+ TOISegmented * bolomul = new TOISegmented("tuyau_bolo_mul",taille);
  demo.addOutput("sortie_bolo_mul",bolomul);
  writeflag = true;
@@ -289,5 +289,5 @@
  cout<<"----- FITSWriterTOI::PrintStatus() : -----"<<endl;
  wfits.PrintStatus(cout);  
- cout<<"----- TOISeqBuffered::PrintStatus() : -----"<<endl;
+ cout<<"----- TOISegmented::PrintStatus() : -----"<<endl;
  bolo10->PrintStatus(cout);  
  bolo20->PrintStatus(cout);  
@@ -306,15 +306,15 @@
 
  //  Affichage de l'avancement des TOIProcessors (optionnel)
- ProcSampleCounter<FITSTOIReader> statr(rfits1);
- statr.InfoMessage() = "tstdemopipe/Info rfits1";
- statr.PrintStats();
-
- ProcSampleCounter<FITSTOIWriter> statw(wfits);
- statw.InfoMessage() = "tstdemopipe/Info wfits";
- statw.PrintStats();
-
- ProcSampleCounter<DemoPipe> statp(demo);
- statp.InfoMessage() = "tstdemopipe/Info DemoPipe";
- statp.PrintStats();
+ // ProcSampleCounter<FITSTOIReader> statr(rfits1);
+ // statr.InfoMessage() = "tstdemopipe/Info rfits1";
+ // statr.PrintStats();
+
+ // ProcSampleCounter<FITSTOIWriter> statw(wfits);
+ // statw.InfoMessage() = "tstdemopipe/Info wfits";
+ // statw.PrintStats();
+
+ // ProcSampleCounter<DemoPipe> statp(demo);
+ // statp.InfoMessage() = "tstdemopipe/Info DemoPipe";
+ // statp.PrintStats();
 
  // Gestion de la re-connection des threads
@@ -346,5 +346,5 @@
 void crefits(void)
 {
- const int nro = 50000;
+ const int nro = 500000;
  const int sn1 = 100001;
  const int sn2 = 100001+100;
