Changeset 3883 in Sophya for trunk/AddOn/TAcq/racqueth.cc


Ignore:
Timestamp:
Sep 23, 2010, 7:59:29 PM (15 years ago)
Author:
ansari
Message:

1/ Correction bug de lecture ds BRMultiFitsReader et EthernetReader lorsque lecture avec SameFrameCounter etait demande
2/ Amelioration des impressions ds ces deux classes et ajout possibilite de controle du flag "SameFC" avec les classes de parametres BRParList et BRAnaParam
3/ Nouveaux datacard @ethrforcesamefc et @prtlev pour acquisition

Reza, 23/09/2010

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AddOn/TAcq/racqueth.cc

    r3764 r3883  
    433433      if (ReadNextAllFibers()) { fgok=false;  break; }
    434434      totnpaqrd_++;
     435      if ((prtlev_>0)&&(totnpaqrd_%prtmodulo_==0))  {
     436          cout << "EthernetReader: NbPaq/Link=" << totnpaqrd_ << " NSameFC="
     437               << totsamefc_ << " / NPaqFib0Read=" << totnpqrd_[0]
     438               << " FracSameFC=" << 100*totsamefc_/totnpqrd_[0] << " %" <<  endl;
     439      }
    435440    }
    436441
    437442    MoveToNextTarget();  // Pour faire traiter le dernier paquet si plein
    438443    MZoneManage(true);   // Nettoyage final
    439     usleep(50000);       // Attente de traitement du dernier paquet
    440     memgr_.Stop();        // Arret
    441444
    442445    cout << " ------------------  EthernetReader::run() END ----------------- " << endl;
    443446    ts.SetNow();
    444447    tm.SplitQ();
    445     cout << "  END reading TotNPaq/Link=" << totnpaqrd_ << " :"  << ts ;
    446     if (rdsamefc_) cout << " NSameFC=" << totsamefc_ << endl;
    447     else cout << endl;
     448    cout << "  END reading TotNPaq/Link=" << totnpaqrd_ << " :"  << ts << endl;
     449    cout << "... NbPaq/Link=" << totnpaqrd_ << " NSameFC="
     450         << totsamefc_ << " / NPaqLink[0]_Read=" << totnpqrd_[0]
     451         << " FracSameFC=" << 100*totsamefc_/totnpqrd_[0] << " %" << endl;
     452
    448453    for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++)  {
    449454      int perc=0;
     
    459464    cout << " ---------------------------------------------------------- " << endl;
    460465
     466    usleep(50000);       // Attente de traitement du dernier paquet
     467    memgr_.Stop();        // Arret
     468
    461469  }  // Fin du bloc try
    462470  catch (std::exception& exc) {
     
    480488    if (ReadNext(fib)) return true;  // probleme
    481489  }
    482   if (!rdsamefc_ || (memgr_.NbFibres()<2))  {
    483     totsamefc_++;  return false;  // c'est OK
    484   }
    485   uint_8 cfc=curfc_[0];
    486   bool fgsamefc=true;
    487   for(size_t fib=1; fib<memgr_.NbFibres(); fib++) {
    488     if (curfc_[fib]!=cfc) {
    489       fgsamefc=false;
    490       if (curfc_[fib] > cfc)  cfc=curfc_[fib];
    491     }
    492   }
    493   if (fgsamefc) {
    494     totsamefc_++;  return false;  // c'est OK  , same framecounter
    495   }
    496   else {  // else !fgsame
    497     for(uint_4 fib=0; fib<memgr_.NbFibres(); fib++) {
    498       while (curfc_[fib]<cfc) {
    499         if (ReadNext(fib)) return true;  // probleme
    500       }
    501     }
    502   }   // fin de  else !fgsame
    503   totsamefc_++;
    504   return false; // c'est OK
     490  if (!rdsamefc_ || (memgr_.NbFibres()<2))  {
     491    uint_8 cfc=curfc_[0];
     492    bool fgsamefc=true;
     493    for(size_t fib=1; fib<memgr_.NbFibres(); fib++) {
     494      if (curfc_[fib]!=cfc)   fgsamefc=false;
     495    }
     496    if (fgsamefc)  totsamefc_++; 
     497    return false;  // c'est OK
     498  }
     499  //  On va essayer de lire jusqu'a avoir same_frame_counter
     500  bool echec=true;
     501  while (echec) {
     502    uint_8 cfc=curfc_[0];
     503    bool fgsamefc=true;
     504    for(size_t fib=1; fib<memgr_.NbFibres(); fib++) {
     505      if (curfc_[fib]!=cfc) {
     506        fgsamefc=false;
     507        if (curfc_[fib] > cfc)  cfc=curfc_[fib];
     508      }
     509    }
     510    if (fgsamefc) {
     511      totsamefc_++;  echec=false; return false;  // c'est OK  , same framecounter
     512    }
     513    else {  // else !fgsame
     514      for(uint_4 fib=0; fib<memgr_.NbFibres(); fib++) {
     515        while (curfc_[fib]<cfc) {
     516          if (ReadNext(fib)) return true;  // probleme
     517        }
     518      }
     519    }   // fin de  else !fgsame
     520  }  // fin de while(echec): lecture jusqu'a same_frame_counter
     521
     522  return true; // probleme
    505523}
    506524
Note: See TracChangeset for help on using the changeset viewer.