Changeset 1994 in Sophya for trunk/ArchTOIPipe/Processors


Ignore:
Timestamp:
May 13, 2002, 3:11:32 PM (23 years ago)
Author:
ansari
Message:

1/ Ajout classe CGT (Compagnie Generale des Tuyaux) - Assistance a l'assemblage
des TOIProcessors .
2/ Corrections mineures ds FitsTOIReader, correction de smkmflib

Reza 13/5/2002

Location:
trunk/ArchTOIPipe/Processors
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Processors/nooppr.cc

    r1762 r1994  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: nooppr.cc,v 1.9 2001-11-13 16:22:47 aubourg Exp $
     5// $Id: nooppr.cc,v 1.10 2002-05-13 13:11:32 ansari Exp $
    66
    77#include <typeinfo>
     
    1414NoOpProcessor::NoOpProcessor(int wsz)
    1515{
     16  if (wsz < 1) wsz = 1;
    1617  wsize = wsz;
    1718  totnscount = 0;
     
    4849
    4950
    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)) {
    5159    cerr << " NoOpProcessor::run() - Input TOI (in) not connected! "
    5260         << endl;
    5361    throw ParmError("NoOpProcessor::run() Input TOI (in) not connected!");
    5462  }
     63  bool fgin = checkInputTOIIndex(0);
    5564  bool fgin2 = checkInputTOIIndex(1);
    5665
     
    5867  bool fgout2 = checkOutputTOIIndex(1);
    5968
    60   if (fgout2 && !fgin2) {
     69  if (fgout2 && (!fgin2 && !acceptnoinput) ) {
    6170    cerr << " NoOpProcessor::run() - out2 connected without in2!"
    6271         << endl;
     
    7887      vin = new double[wsize];
    7988      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) {
    8193        vin2 = new double[wsize];
    8294        vfg2 = new uint_8[wsize];
     95        for(i=0; i<wsize; i++) {
     96          vin2[i] = defval; vfg2[i] = defflag;
     97        }       
    8398      }
    8499   
     
    86101      // 1er partie, on traite par paquets de wsize
    87102      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);
    93107        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);
    100112        klast+=wsize;
    101113        totnscount+=wsize;
     114        totnbblock++;
    102115      }
    103116    }
    104117
    105118    // 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;
    108123    if (klast < sne)
    109124      for(k=klast+1; k<=sne; k++) {
    110         getData(0, k, inval, inflg);
     125        if (fgin)
     126          getData(0, k, inval, inflg);
    111127        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);
    117132        totnscount++;
    118133      }
    119 
    120     totnbblock++;
     134    totnbblock++;
    121135
    122136    cout << " NoOpProcessor::run() - End of processing "
    123          << " TotNbBlocks= " << totnbblock << endl;
     137         << " TotNbBlocks= " << totnbblock << " ProcSamples=" << totnscount << endl;
    124138  }  // Bloc try
    125139
  • trunk/ArchTOIPipe/Processors/nooppr.h

    r1762 r1994  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: nooppr.h,v 1.5 2001-11-13 16:22:47 aubourg Exp $
     7// $Id: nooppr.h,v 1.6 2002-05-13 13:11:32 ansari Exp $
    88
    99
     
    2525  inline int_8  ProcessedSampleCount() const { return totnscount; }
    2626
     27  inline void   AcceptNoInput(double val=0., long flg=0)
     28         { acceptnoinput = true; defval = val; defflag = flg; }
     29
    2730  virtual void  PrintStatus(::ostream & os) ; // const plus tard
    2831
     
    3336  int_8 totnscount;   // Nombre total d'echantillon processe
    3437  int wsize;         // Taille de fenetre de travail
     38
     39  bool acceptnoinput;
     40  double defval;
     41  long defflag;
    3542};
    3643
Note: See TracChangeset for help on using the changeset viewer.