Changeset 393 in Sophya for trunk/Poubelle


Ignore:
Timestamp:
Sep 1, 1999, 11:24:28 AM (26 years ago)
Author:
ansari
Message:

Deplacement init toiiter pour eviter 2 archeopsfiles

Location:
trunk/Poubelle/archTOI.old
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Poubelle/archTOI.old/archeopsfile.cc

    r350 r393  
    251251  }
    252252}
    253 
    254 
    255253
    256254ArcheopsFile::ArcheopsFile(string const& fname) {
  • trunk/Poubelle/archTOI.old/ssthandler.cc

    r350 r393  
    1313#include <math.h>
    1414#include "ssthandler.h"
     15#include <iostream.h>
    1516
    1617// diodpermut[i] = channel de la diode i
     
    3435  prcTodo=0;
    3536  seuil=100;
    36  
    3737}
    3838
     
    7777{
    7878  delete[] stars;
    79   delete[] diodeT; 
     79  delete[] diodeT;
    8080}
    8181
  • trunk/Poubelle/archTOI.old/toiiter.cc

    r363 r393  
    4040 
    4141 auxGPS = NULL;
    42 
     42 
     43 initDone = false;
    4344}
    4445
     
    7778  auxGPS = x.auxGPS;
    7879  if (auxGPS) auxGPS = auxGPS->clone();
     80 
     81  initDone = x.initDone;
    7982}
    8083
     
    9396
    9497void TOIIter::Init() {
     98 if (initDone) return;
     99 initDone = true;
    95100 // On a soit un repertoire, soit une liste de fichiers....
    96101  if (directory == "") {
     
    315320
    316321bool TOIIter::Next() {
     322  if (!initDone) Init();
    317323  while (1) {
    318324    if (!NextSample()) return false; // end of files
     
    365371      while (file->sameBlockNumAhead()) {  // tant que meme numero de bloc, on lit
    366372        if (!file->nextBlock()) {          // fin de fichier ?
    367           if (NextFile()) file->nextBlock();
    368           else break;
     373          if (NextFile()) file->nextBlock(); // fichier suivant
     374          else return false;    // tout fini
    369375        }
    370376      }
     
    383389 
    384390bool TOIIter::canGetValue(int column) {
     391  if (!initDone) Init();
    385392   if (column < 0 || column >= infos.size()) return false;
    386393   TOIKind kind = infos[column].kind;
     
    439446 
    440447double TOIIter::getValue(int column) {
     448  if (!initDone) Init();
    441449   if (column < 0 || column >= infos.size()) return -1;
    442450   TOIKind kind = infos[column].kind;
     
    503511 
    504512bool   TOIIter::newValue(int column) {
     513  if (!initDone) Init();
    505514   if (column < 0 || column >= infos.size()) return false;
    506515   TOIKind kind = infos[column].kind;
     
    596605 
    597606int TOIIter::getSampleIndex() {
     607  if (!initDone) Init();
    598608   if (file) {
    599609     return file->blockNum() * file->nEchBlock() + imes;
     
    604614
    605615double TOIIter::getMJD() {
     616  if (!initDone) Init();
    606617  int sample = getSampleIndex();
    607618  return tBlock0 + sample*perEch/86400.;
     
    621632
    622633block_type_param* TOIIter::lastParam() {
     634  if (!initDone) Init();
    623635  if (file) return file->lastParam();
    624636  else return rawIter->lastParam();
  • trunk/Poubelle/archTOI.old/toiiter.h

    r363 r393  
    8080   block_type_sst_comprime*  lastSSTComp();
    8181   
    82    ArcheopsFile* currentFile() {return file;}
     82   ArcheopsFile* currentFile() {if (!initDone) Init(); return file;}
    8383
    8484protected:
     
    132132   
    133133   private:
     134   bool initDone;
    134135};
    135136
  • trunk/Poubelle/archTOI.old/toisvr.cc

    r358 r393  
    5454 
    5555TOIIter TOISvr::DoQuery() {
    56   iter.Init();
     56  //iter.Init();
    5757  return iter;
    5858}
Note: See TracChangeset for help on using the changeset viewer.