Changeset 3883 in Sophya for trunk/AddOn/TAcq/brfitsrd.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/brfitsrd.cc

    r3700 r3883  
    7878         << " signalII.fits IMin=" << imin_ << " IMax=" << imax_ << " IStep=" << istep_ << endl;
    7979
     80    uint_8  prtcnt=0;
    8081    Byte* nextpaq=NULL;
    8182    bool fgok=true;
     
    9596      }
    9697      if (ReadNextAllFibers()) { fgok=false;  break; }
     98      prtcnt++;
     99      if ((prtlev_>0)&&(prtcnt%prtmodulo_==0))  {
     100          cout << "BRMultiFitsReader: NbPaqMFRead=" << prtcnt << " NSameFC="
     101               << totsamefc_ << " / NPaqFib0Read=" << totnpqrd_[0]
     102               << " FracSameFC=" << 100*totsamefc_/totnpqrd_[0] << " %" <<  endl;
     103      }
    97104    }
    98105
    99106    MoveToNextTarget();  // Pour faire traiter le dernier paquet si plein
    100107    MZoneManage(true);   // Nettoyage final
    101     usleep(50000);       // Attente de traitement du dernier paquet
    102     memgr_.Stop();        // Arret
    103108
    104109    cout << " ------------------  BRMultiFitsReader::run() END ----------------- " << endl;
    105110    ts.SetNow();
    106111    tm.SplitQ();
    107     cout << "  END reading : " << ts ;
    108     if (rdsamefc_) cout << " NSameFC=" << totsamefc_ << endl;
    109     else cout << endl;
     112    cout << "BRMultiFitsReader::run():  END reading : " << ts << endl;
     113    cout << "... NbPaqMFRead=" << prtcnt << " NSameFC="
     114         << totsamefc_ << " / NPaqFib0Read=" << totnpqrd_[0]
     115         << " FracSameFC=" << 100*totsamefc_/totnpqrd_[0] << " %" << endl;
     116
    110117    for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++)  {
    111118      int perc=0;
     
    121128    cout << " ---------------------------------------------------------- " << endl;
    122129
     130    usleep(50000);       // Attente de traitement du dernier paquet
     131    memgr_.Stop();        // Arret
     132
    123133  }  // Fin du bloc try
    124134  catch (std::exception& exc) {
     
    142152    if (ReadNext(fib)) return true;  // probleme
    143153  }
    144   if (!rdsamefc_ || (memgr_.NbFibres()<2))  {
    145     totsamefc_++;  return false;  // c'est OK
    146   }
    147   uint_8 cfc=curfc_[0];
    148   bool fgsamefc=true;
    149   for(size_t fib=1; fib<memgr_.NbFibres(); fib++) {
    150     if (curfc_[fib]!=cfc) {
    151       fgsamefc=false;
    152       if (curfc_[fib] > cfc)  cfc=curfc_[fib];
    153     }
    154   }
    155   if (fgsamefc) {
    156     totsamefc_++;  return false;  // c'est OK  , same framecounter
    157   }
    158   else {  // else !fgsame
    159     for(uint_4 fib=0; fib<memgr_.NbFibres(); fib++) {
    160       while (curfc_[fib]<cfc) {
    161         if (ReadNext(fib)) return true;  // probleme
    162       }
    163     }
    164   }   // fin de  else !fgsame
    165   totsamefc_++;
    166   return false; // c'est OK
     154  if (!rdsamefc_ || (memgr_.NbFibres()<2))  {
     155    uint_8 cfc=curfc_[0];
     156    bool fgsamefc=true;
     157    for(size_t fib=1; fib<memgr_.NbFibres(); fib++) {
     158      if (curfc_[fib]!=cfc)   fgsamefc=false;
     159    }
     160    if (fgsamefc)  totsamefc_++; 
     161    return false;  // c'est OK
     162  }
     163  //  On va essayer de lire jusqu'a avoir same_frame_counter
     164  bool echec=true;
     165  while (echec) {
     166    uint_8 cfc=curfc_[0];
     167    bool fgsamefc=true;
     168    for(size_t fib=1; fib<memgr_.NbFibres(); fib++) {
     169      if (curfc_[fib]!=cfc) {
     170        fgsamefc=false;
     171        if (curfc_[fib] > cfc)  cfc=curfc_[fib];
     172      }
     173    }
     174    if (fgsamefc) {
     175      totsamefc_++;  echec=false; return false;  // c'est OK  , same framecounter
     176    }
     177    else {  // else !fgsame
     178      for(uint_4 fib=0; fib<memgr_.NbFibres(); fib++) {
     179        while (curfc_[fib]<cfc) {
     180          if (ReadNext(fib)) return true;  // probleme
     181        }
     182      }
     183    }   // fin de  else !fgsame
     184  }  // fin de while(echec): lecture jusqu'a same_frame_counter
     185
     186  return true; // probleme
    167187}
    168188
Note: See TracChangeset for help on using the changeset viewer.