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