[350] | 1 | // toiiter.h
|
---|
| 2 | // Eric Aubourg CEA/DAPNIA/SPP juillet 1999
|
---|
| 3 |
|
---|
[310] | 4 | #ifndef TOIITER_H
|
---|
| 5 | #define TOIITER_H
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | #include <vector>
|
---|
| 9 | #include <set>
|
---|
[350] | 10 | #include <map>
|
---|
[310] | 11 | #include <string>
|
---|
| 12 | #include "archeopsfile.h"
|
---|
[358] | 13 | #include "auxgps.h"
|
---|
[363] | 14 | #include "tsid.h"
|
---|
[310] | 15 |
|
---|
| 16 | enum TOIKind {
|
---|
[342] | 17 | sampleNum, // Numero d''echantillon (timer interne transputer)
|
---|
[315] | 18 | internalTime, // temps transputer depuis debut manip, en secondes.
|
---|
[350] | 19 | mjd, // UTC (en jours, MJD = JD - 2450000). index=0 : premier bloc GPS. 1: + sioux.
|
---|
[310] | 20 | boloTens, // tension en microVolts, filtree avec filtre carre indexe par bolometre
|
---|
| 21 | boloRaw, // tension brute, non filtree indexe par bolometre
|
---|
[342] | 22 | boloTemp, // Kelvins
|
---|
[350] | 23 | sstDiode, // signal brut SST, indice = diode, 0-45
|
---|
| 24 | sstChannel, // signal brut SST, indice = canal, 0-47
|
---|
[342] | 25 | sstStarZ, // numero de diode d''une eventuelle etoile, i=etoile 0..n
|
---|
| 26 | sstStarF, // flux d''une eventuelle etoile, <0 si moins de i+1 etoiles
|
---|
| 27 | gyroRaw, // valeur brute du gyro, index = 0,1,2
|
---|
| 28 | gpsTime, // temps fourni par GPS
|
---|
[315] | 29 | longitude, // position ballon
|
---|
| 30 | latitude, // position ballon
|
---|
[342] | 31 | altitude, // position ballon
|
---|
[315] | 32 | tsid, // temps sideral en secondes
|
---|
[310] | 33 | azimut, // a preciser, reconstruit SST, magneto, autres...
|
---|
[315] | 34 | alphaAxis, //
|
---|
| 35 | deltaAxis, //
|
---|
[342] | 36 | alphaSst, //
|
---|
| 37 | deltaSst, //
|
---|
[315] | 38 | alphaBolo, // sur le ciel, indexe par bolometre
|
---|
| 39 | deltaBolo // sur le ciel, indexe par bolometre
|
---|
[310] | 40 | };
|
---|
| 41 |
|
---|
[315] | 42 | class TOIInterpolator;
|
---|
[310] | 43 |
|
---|
| 44 | class TOIIter {
|
---|
| 45 | public:
|
---|
[315] | 46 | TOIIter(TOIIter const&); // $CHECK$ prevoir operator = ?
|
---|
[310] | 47 | ~TOIIter();
|
---|
| 48 | bool Next();
|
---|
| 49 |
|
---|
[315] | 50 | bool canGetValue(int column); // data is available for that...
|
---|
| 51 | double getValue(int column);
|
---|
| 52 | bool newValue(int column); // a juste change ?
|
---|
| 53 | bool extendValue(int column); // une valeur plus ancienne, etendue ?
|
---|
| 54 | bool interpValue(int column); // une valeur interpolee avec valeur future ?
|
---|
[342] | 55 | bool isTrig(int column);
|
---|
[310] | 56 | TOIKind getKind(int column);
|
---|
[315] | 57 | int getIndex(int column); // si plusieurs, exemple, tension bolo 2
|
---|
[310] | 58 |
|
---|
[315] | 59 | bool canGetTOI(TOIKind kind, int index=0);
|
---|
| 60 | double getTOI(TOIKind kind, int index=0);
|
---|
| 61 |
|
---|
| 62 |
|
---|
[342] | 63 | int getBlockSampleIndex(); // numero d''echantillon dans dernier bloc bolo
|
---|
| 64 | int getSampleIndex(); // numero d''echantillon
|
---|
[358] | 65 | double getMJD();
|
---|
[310] | 66 |
|
---|
| 67 | block_type_param* lastParam();
|
---|
| 68 | block_type_journal* lastJournal();
|
---|
| 69 | block_type_reglage* lastReglage();
|
---|
| 70 | block_type_dilution* lastDilution();
|
---|
| 71 | block_type_gps* lastGPS();
|
---|
| 72 | block_type_une_periode* lastUnePeriode();
|
---|
| 73 | block_type_synchro_sol* lastSynchroSol();
|
---|
| 74 | block_type_pointage_sol* lastPointageSol();
|
---|
| 75 | block_type_bolo* lastBolo();
|
---|
| 76 | block_type_gyro* lastGyro();
|
---|
| 77 | block_type_sst* lastSST();
|
---|
| 78 | block_type_bolo_comprime* lastBoloComp();
|
---|
| 79 | block_type_gyro_comprime* lastGyroComp();
|
---|
| 80 | block_type_sst_comprime* lastSSTComp();
|
---|
[342] | 81 |
|
---|
| 82 | ArcheopsFile* currentFile() {return file;}
|
---|
[310] | 83 |
|
---|
| 84 | protected:
|
---|
| 85 | TOIIter();
|
---|
| 86 | void Init(); // After setting the options, opens the first file.
|
---|
[350] | 87 | void ScanFiles(); // Parcourt tous les fichiers, cherche le premier echantillon...
|
---|
[310] | 88 |
|
---|
[350] | 89 | bool NextSample(); // no test of trange
|
---|
[310] | 90 | bool NextFile();
|
---|
| 91 |
|
---|
| 92 | ArcheopsFile* file;
|
---|
[350] | 93 | string directory; // If directory scanning
|
---|
| 94 | set<string> files; // list of files to be read...
|
---|
| 95 | map<string, long> file1stSamp; // premier echantillon de chaque fichier
|
---|
[310] | 96 | set<string>::iterator curFile;
|
---|
[342] | 97 | bool isOnBoardRecorder;
|
---|
[310] | 98 |
|
---|
| 99 | int imes;
|
---|
| 100 |
|
---|
| 101 | double tStart, tEnd;
|
---|
| 102 |
|
---|
| 103 | double tBlock0; // MJD du bloc numero zero...
|
---|
[342] | 104 | double perEch; // periode d''echantillonage en secondes
|
---|
[310] | 105 |
|
---|
| 106 | struct info {
|
---|
| 107 | TOIKind kind;
|
---|
| 108 | int index;
|
---|
| 109 | bool triggering;
|
---|
| 110 | bool interpolated;
|
---|
| 111 | };
|
---|
| 112 |
|
---|
[315] | 113 | int getColTOI(TOIKind kind, int index=0);
|
---|
| 114 |
|
---|
[310] | 115 | long trigMask;
|
---|
| 116 |
|
---|
| 117 | vector<info> infos;
|
---|
| 118 |
|
---|
| 119 | friend class TOISvr;
|
---|
| 120 |
|
---|
[342] | 121 | // Gestion de l''interpolation, par delegation a un autre iterateur
|
---|
[315] | 122 | TOIIter* rawIter; // iterateur sans interpolation, qui avance avec retard
|
---|
| 123 | // en bufferisant les valeurs. S'il existe, on lui delegue
|
---|
| 124 | // toutes les operations agissant sur le fichier.
|
---|
| 125 | TOIInterpolator* interp; // interpolateurs pour stocker les valeurs
|
---|
| 126 | long lastSample; // last interpolated sample
|
---|
| 127 | long maxLookAhead;
|
---|
[342] | 128 | bool fetchAhead(); // avance d''une TOI en nourrissant les interpolateurs
|
---|
[315] | 129 |
|
---|
[358] | 130 | AuxGPS* auxGPS;
|
---|
[363] | 131 | TSid tSid;
|
---|
[358] | 132 |
|
---|
[310] | 133 | private:
|
---|
| 134 | };
|
---|
| 135 |
|
---|
| 136 | #endif
|
---|