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 {
|
---|
11 | sampleNum, // Numero d''echantillon (timer interne transputer)
|
---|
12 | internalTime, // temps transputer depuis debut manip, en secondes.
|
---|
13 | utc, // UTC (en jours, MJD = JD - 2450000). index=0 : premier bloc GPS. 1: + sioux.
|
---|
14 | boloTens, // tension en microVolts, filtree avec filtre carre indexe par bolometre
|
---|
15 | boloRaw, // tension brute, non filtree indexe par bolometre
|
---|
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
|
---|
23 | longitude, // position ballon
|
---|
24 | latitude, // position ballon
|
---|
25 | altitude, // position ballon
|
---|
26 | tsid, // temps sideral en secondes
|
---|
27 | azimut, // a preciser, reconstruit SST, magneto, autres...
|
---|
28 | alphaAxis, //
|
---|
29 | deltaAxis, //
|
---|
30 | alphaSst, //
|
---|
31 | deltaSst, //
|
---|
32 | alphaBolo, // sur le ciel, indexe par bolometre
|
---|
33 | deltaBolo // sur le ciel, indexe par bolometre
|
---|
34 | };
|
---|
35 |
|
---|
36 | class TOIInterpolator;
|
---|
37 |
|
---|
38 | class TOIIter {
|
---|
39 | public:
|
---|
40 | TOIIter(TOIIter const&); // $CHECK$ prevoir operator = ?
|
---|
41 | ~TOIIter();
|
---|
42 | bool Next();
|
---|
43 |
|
---|
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 ?
|
---|
49 | bool isTrig(int column);
|
---|
50 | TOIKind getKind(int column);
|
---|
51 | int getIndex(int column); // si plusieurs, exemple, tension bolo 2
|
---|
52 |
|
---|
53 | bool canGetTOI(TOIKind kind, int index=0);
|
---|
54 | double getTOI(TOIKind kind, int index=0);
|
---|
55 |
|
---|
56 |
|
---|
57 | int getBlockSampleIndex(); // numero d''echantillon dans dernier bloc bolo
|
---|
58 | int getSampleIndex(); // numero d''echantillon
|
---|
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();
|
---|
74 |
|
---|
75 | ArcheopsFile* currentFile() {return file;}
|
---|
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;
|
---|
88 | bool isOnBoardRecorder;
|
---|
89 |
|
---|
90 | int imes;
|
---|
91 |
|
---|
92 | double tStart, tEnd;
|
---|
93 |
|
---|
94 | double tBlock0; // MJD du bloc numero zero...
|
---|
95 | double perEch; // periode d''echantillonage en secondes
|
---|
96 |
|
---|
97 | struct info {
|
---|
98 | TOIKind kind;
|
---|
99 | int index;
|
---|
100 | bool triggering;
|
---|
101 | bool interpolated;
|
---|
102 | };
|
---|
103 |
|
---|
104 | int getColTOI(TOIKind kind, int index=0);
|
---|
105 |
|
---|
106 | long trigMask;
|
---|
107 |
|
---|
108 | vector<info> infos;
|
---|
109 |
|
---|
110 | friend class TOISvr;
|
---|
111 |
|
---|
112 | // Gestion de l''interpolation, par delegation a un autre iterateur
|
---|
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;
|
---|
119 | bool fetchAhead(); // avance d''une TOI en nourrissant les interpolateurs
|
---|
120 |
|
---|
121 | private:
|
---|
122 | };
|
---|
123 |
|
---|
124 | #endif
|
---|