Ignore:
Timestamp:
May 6, 2001, 5:52:35 PM (24 years ago)
Author:
ansari
Message:

transformation de NoOpProcessor en double entree - Reza 6/5/2001

File:
1 edited

Legend:

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

    r1487 r1488  
    1818     << " NoOpProcessor::PrintStatus() - WindowSize="
    1919     << WSize() << endl;
     20  os << " Total number of processed samples= " << ProcessedSampleCount()
     21     << endl;
    2022  TOIProcessor::PrintStatus(os);
    2123  os << " ------------------------------------------------------ " << endl;
     
    2527  cout << "NoOpProcessor::init" << endl;
    2628  declareInput("in");
     29  declareInput("in2");
    2730  declareOutput("out");
    28   declareOutput("incopie");
     31  declareOutput("out2");
    2932  name = "NoOpProcessor";
    3033  //  upExtra = 1;
     
    3740  int sne = getMaxIn();
    3841
    39   bool fgout = checkOutputTOIIndex(0);
    40   bool fgincopie = checkOutputTOIIndex(1);
    4142
    4243  if (!checkInputTOIIndex(0)) {
     
    4546    throw ParmError("NoOpProcessor::run() Input TOI (in) not connected!");
    4647  }
     48  bool fgin2 = checkInputTOIIndex(1);
    4749
     50  bool fgout = checkOutputTOIIndex(0);
     51  bool fgout2 = checkOutputTOIIndex(1);
    4852
     53  if (fgout2 && !fgin2) {
     54    cerr << " NoOpProcessor::run() - out2 connected without in2!"
     55         << endl;
     56    throw ParmError("NoOpProcessor::run() out2 connected without in2!");
     57  }
    4958  cout << " NoOpProcessor::run() SNRange=" << snb << " - " << sne << endl;
    5059 
    5160  double * vin = NULL;
    52   double * vout = NULL;
     61  double * vin2 = NULL;
    5362  int_8 * vfg = NULL;
     63  int_8 * vfg2 = NULL;
    5464  try {
    5565    // Le debut
    5666    int k,i,klast;
    57     int nks = 0;
    5867    klast = snb-1;
    5968    int totnbblock = 0;
     
    6170    if (wsize > 1) {
    6271      vin = new double[wsize];
    63       vout = new double[wsize];
    6472      vfg = new int_8[wsize];
     73      if (fgin2) {
     74        vin2 = new double[wsize];
     75        vfg2 = new int_8[wsize];
     76      }
    6577   
    6678      // Boucle sur les sampleNum
    6779      // 1er partie, on traite par paquets de wsize
    6880      for(k=snb;k<=sne-wsize+1;k+=wsize) {
    69         for(i=0; i<wsize; i++)
     81        for(i=0; i<wsize; i++) {
    7082          getData(0, k+i, vin[i], vfg[i]);
     83          if (fgin2)
     84            getData(1, k+i, vin2[i], vfg2[i]);
     85        }
    7186        totnbblock++;
    7287        for(i=0; i<wsize; i++) {
    7388          if (fgout)
    74             putData(0,k+i,vout[i],vfg[i]);
    75           if (fgincopie
    76             putData(1, k+i, vin[i], vfg[i]);
     89            putData(0,k+i,vin[i],vfg[i]);
     90          if (fgout2
     91            putData(1, k+i, vin2[i], vfg2[i]);
    7792        }
     93        klast+=wsize;
    7894      }
    79       klast+=wsize;
    8095      totnscount+=wsize;
    8196    }
     
    88103        getData(0, k, inval, inflg);
    89104        if (fgout) putData(0, k, inval, inflg);
    90         if (fgincopie)
    91           putData(1, k, inval, inflg);
     105        if (fgin2) {
     106          getData(1, k, inval, inflg);
     107          if (fgout2)
     108            putData(1, k, inval, inflg);
     109        }
    92110        totnscount++;
    93111      }
     
    105123
    106124  if (vin) delete[] vin;
    107   if (vout) delete[] vout;
    108125  if (vfg) delete[] vfg; 
     126  if (vin2) delete[] vin2;
     127  if (vfg2) delete[] vfg2; 
    109128
    110129}
Note: See TracChangeset for help on using the changeset viewer.