source: Sophya/trunk/Poubelle/archTOI.old/ssthandler.h@ 414

Last change on this file since 414 was 412, checked in by ansari, 26 years ago

nouvelles toi

File size: 3.4 KB
Line 
1// ssthandler.h
2// Eric Aubourg CEA/DAPNIA/SPP juillet 1999
3
4#ifndef SSTHANDLER_H
5#define SSTHANDLER_H
6
7#include <math.h>
8#include <vector>
9#include <map>
10
11#ifndef nb_max_bolo
12#define _archeops // Acquisition Archeops (avec transputer)
13#define programme
14extern "C" {
15#include "archeops.h"
16}
17#endif
18
19class ArcheopsFile;
20
21// Zone findStar
22#include "sstetoile.h"
23#include "pisteetoile.h"
24
25//#define SST_DEBUG
26#define NbChanDump (10)
27#define NbPhotDiodBarette (46)
28#define NbEtInMapMax (100)
29#define SSTChassLog (true)
30#define NbSampleBlock (2*nb_per_block)
31// Fin Zone findStar
32
33class SSTHandler {
34public:
35 SSTHandler();
36 SSTHandler(SSTHandler const&);
37 SSTHandler& operator = (SSTHandler const&);
38 virtual ~SSTHandler();
39
40 enum process { permDiode = 1,
41 findStars = 2,
42 findPeriod = 4,
43 findAxis = 8 };
44
45 void NeedProcess(int prcMask);
46 void ProcessBlock(block_type_sst*);
47 bool NeedBlocks() {return prcTodo != 0;}
48
49 static void Has2Bars(bool, int elecOffset=0); // elecOffset : which wired together
50
51 long getLastBlkNum() {return lastBlkNum;}
52 int getRawSignal(int imesure, int idiode); // for last block
53 int getSignal(int imesure, int idiode); // for last block, imesure<0 -> history
54
55 // Zone findStar
56 int getNumbStar(int iSampl);
57 // return number of star found in sample number iSampl
58 int getStarZ(int iSampl, int istar);
59 // return diode number of the star
60 double getStarF(int iSampl, int istar);
61 // return star flux in Ampère
62 double getStarTime(int iSampl, int istar);
63 // return star time in this sample
64
65 static int getDiodPermut(int i) {return diodpermut[i];}
66
67protected:
68 int diodeRaw[nb_per_block*2][48];
69 int diodeHistLength;
70 int* diodeT; //[>nb_per_block*2]*[nb_photo_diodes];
71 int prcTodo;
72 int starHistLength;
73 long lastBlkNum;
74
75 // Is there two photoDiod Arrays and how are they connected?
76 static bool has2bars;
77 static int elecOffset;
78
79 inline int& diode(int iSamp, int iDiod) {return diodeT[iSamp*nb_photo_diodes+iDiod];}
80
81 static int diodpermut[46]; // diodpermut[i] = channel de la diode i
82
83 void DecodeTMBlock(block_type_sst*, int i, int* diodes); // mesure i -> diodes
84 void PermutDiode(); // diodeRaw -> diode, avec decalage, 1 echantillon.
85 int FindStars(block_type_sst* blk); // sur les 72 derniers echantillons dans diode.
86 // return nmber of star found in last block
87
88 // Zone findStar
89 int NbStarInBlock;
90
91 PisteEtoile** PisteBar;
92
93#ifdef SST_DEBUG
94 ofstream** pPisteDump;
95#endif
96
97 map<double,SSTEtoile> StarHistoryMap;
98 // On stocke les etoiles de manière ordonnée en temps
99 typedef map<double,SSTEtoile>::iterator StarHistIter;
100 typedef map<double,SSTEtoile>::const_iterator StarConstHistIter;
101
102 vector<SSTEtoile> LastBlockStarVec;
103 // Vecteur des SSTEtoile du block classees en ordre de temps decroissant.
104 //vector<SSTEtoile> reverse_iterator StarVecRevIter LastBlockStarVec.rbegin();
105 SSTEtoile LastStar;
106 PisteEtoile* pPiste; // Piste courante d'analyse
107 int Diodedata[NbSampleBlock];
108 int offseDataDiod;
109 int LastBlockSSTNb; // Gère la disparition des blocs défectueux
110 int noStarDet;
111 int FirstSplNb(block_type_sst* blk); // Calcule l'index du premier echantillon du block analysé
112 static ofstream sstchass;
113 static bool sstchassinit;
114
115 void findStarConstruct();
116 void findStarDestruct();
117};
118
119#endif
Note: See TracBrowser for help on using the repository browser.