1 | #include <stdlib.h>
|
---|
2 |
|
---|
3 | #include "brparam.h"
|
---|
4 | #include "strutilxx.h"
|
---|
5 | #include "bracqvers.h"
|
---|
6 |
|
---|
7 | #ifndef BRSPORTID
|
---|
8 | #define BRSPORTID 6912
|
---|
9 | #endif
|
---|
10 |
|
---|
11 | /* --Methode-- */
|
---|
12 | ADCBoardDesc::ADCBoardDesc(int id, string sbid, string cyc_firmw, string str1_firmw, string str2_firmw)
|
---|
13 | : id_(id), sbid_(sbid), cyclone_firmware_(cyc_firmw), stratix1_firmware_(str1_firmw), stratix2_firmware_(str2_firmw)
|
---|
14 | {
|
---|
15 |
|
---|
16 | }
|
---|
17 |
|
---|
18 | /* --Methode-- */
|
---|
19 | ADCBoardDesc::ADCBoardDesc(ADCBoardDesc const& bdes)
|
---|
20 | : id_(bdes.id_), sbid_(bdes.sbid_), cyclone_firmware_(bdes.cyclone_firmware_),
|
---|
21 | stratix1_firmware_(bdes.stratix1_firmware_), stratix2_firmware_(bdes.stratix2_firmware_)
|
---|
22 | {
|
---|
23 | }
|
---|
24 |
|
---|
25 | /* --Methode-- */
|
---|
26 | ADCBoardDesc& ADCBoardDesc::Set(ADCBoardDesc const & bdes)
|
---|
27 | {
|
---|
28 | id_ = bdes.id_;
|
---|
29 | sbid_ = bdes.sbid_;
|
---|
30 | cyclone_firmware_ = bdes.cyclone_firmware_;
|
---|
31 | stratix1_firmware_ = bdes.stratix1_firmware_;
|
---|
32 | stratix2_firmware_ = bdes.stratix2_firmware_;
|
---|
33 | return(*this);
|
---|
34 | }
|
---|
35 |
|
---|
36 | /* --Methode-- */
|
---|
37 | ostream& ADCBoardDesc::Print(ostream& os)
|
---|
38 | {
|
---|
39 | os << "ADCBoard#" << id_ << "(" << sbid_ << ") Cyclone:" << cyclone_firmware_
|
---|
40 | << " Stratix1: " << stratix1_firmware_ << " Stratix2: " << stratix2_firmware_ << endl;
|
---|
41 | return os;
|
---|
42 | }
|
---|
43 |
|
---|
44 | /* --Methode-- */
|
---|
45 | BRConfList::BRConfList()
|
---|
46 | : basedir_("./")
|
---|
47 | {
|
---|
48 | }
|
---|
49 |
|
---|
50 | /* --Methode-- */
|
---|
51 | BRConfList::BRConfList(string basedir)
|
---|
52 | : basedir_(basedir)
|
---|
53 | {
|
---|
54 | }
|
---|
55 |
|
---|
56 | /* --Methode-- */
|
---|
57 | BRConfList::BRConfList(string basedir, vector<ADCBoardDesc> boards)
|
---|
58 | : basedir_(basedir), boards_(boards)
|
---|
59 | {
|
---|
60 | size_t len = basedir_.length();
|
---|
61 | if ((len>1)&&(basedir_[len-1]!='/')) basedir_ += '/';
|
---|
62 | }
|
---|
63 |
|
---|
64 | /* --Methode-- */
|
---|
65 | BRConfList::BRConfList(BRConfList const & cf)
|
---|
66 | : basedir_(cf.basedir_), boards_(cf.boards_)
|
---|
67 | {
|
---|
68 | }
|
---|
69 |
|
---|
70 | /* --Methode-- */
|
---|
71 | void BRConfList::SetBaseDirectory(string basedir)
|
---|
72 | {
|
---|
73 | basedir_=basedir;
|
---|
74 | size_t len = basedir_.length();
|
---|
75 | if ((len>1)&&(basedir_[len-1]!='/')) basedir_ += '/';
|
---|
76 | }
|
---|
77 |
|
---|
78 | /* --Methode-- */
|
---|
79 | void BRConfList::Set(BRConfList const & cf)
|
---|
80 | {
|
---|
81 | basedir_=cf.basedir_;
|
---|
82 | boards_=cf.boards_;
|
---|
83 | }
|
---|
84 |
|
---|
85 | /* --Methode-- */
|
---|
86 | ostream& BRConfList::Print(ostream& os)
|
---|
87 | {
|
---|
88 | os << " ----- BRConfList:: BaseDir:" << basedir_ << " NBoards= " << boards_.size() << endl;
|
---|
89 | for(size_t k=0; k<boards_.size(); k++) boards_[k].Print(os);
|
---|
90 | return os;
|
---|
91 | }
|
---|
92 |
|
---|
93 | /* --Methode-- */
|
---|
94 | void BRConfList::ReadDCFile(string file)
|
---|
95 | {
|
---|
96 | // A FAIRE
|
---|
97 | }
|
---|
98 |
|
---|
99 | // Classe qui memorise tous les parametres importants de l'acquisition
|
---|
100 | #define PMAXNBFIBRES 64
|
---|
101 |
|
---|
102 | /* --Methode-- */
|
---|
103 | BRParList::BRParList(string acqmod, string fibres,unsigned int paqsz,
|
---|
104 | unsigned int dmaszkb, int nfiles, int nblocfile,
|
---|
105 | string outpath, uint_4 nzon , uint_4 npaqzon)
|
---|
106 | {
|
---|
107 | AcqMode=acqmod;
|
---|
108 | fgdatafft=false;
|
---|
109 | fgsinglechannel=false;
|
---|
110 |
|
---|
111 | FiberListS=fibres;
|
---|
112 | FiberIdsS="1,2,3,4,5,6,7,8";
|
---|
113 | for (int ii=0; ii<PMAXNBFIBRES; ii++) FiberIds.push_back(ii+1);
|
---|
114 |
|
---|
115 | PaqSize=paqsz;
|
---|
116 |
|
---|
117 | dmasizekb=dmaszkb;
|
---|
118 | maxkwedma_=1000;
|
---|
119 | nretrydma_=3;
|
---|
120 | first_maxkwedma_=20000;
|
---|
121 | first_nretrydma_=9;
|
---|
122 |
|
---|
123 | NbFiles=nfiles;
|
---|
124 | NBlocPerFile=nblocfile;
|
---|
125 | OutPathName=outpath;
|
---|
126 |
|
---|
127 | nZones=nzon;
|
---|
128 | nPaqZone=npaqzon;
|
---|
129 |
|
---|
130 | swapall=BR_Copy;
|
---|
131 | savesigfits=true;
|
---|
132 | fgnulldev4fits=false;
|
---|
133 |
|
---|
134 | fg_hard_ctrlc=false;
|
---|
135 |
|
---|
136 | fgreducpsize=false;
|
---|
137 | reducneedcopy=false;
|
---|
138 | pqreducmode=BR_CopyRA;
|
---|
139 | redpqsize=PaqSize;
|
---|
140 | reducoffset=0;
|
---|
141 |
|
---|
142 | tcpportid=BRSPORTID;
|
---|
143 | pci2eth_fgdirect=false;
|
---|
144 | ethr_nlink=0;
|
---|
145 | ethr_forcesamefc_=false;
|
---|
146 | ethr_sfc_maxdpc_=0;
|
---|
147 | ethr_sfc_maxresync_=0;
|
---|
148 | ethr_waitendmsg_=false;
|
---|
149 |
|
---|
150 | skysource="";
|
---|
151 |
|
---|
152 | // --- variables de controle pour le monitoring
|
---|
153 | fgdoProc=false;
|
---|
154 | nmeanProc=512;
|
---|
155 | stepProc=5;
|
---|
156 | nmaxProc=0;
|
---|
157 | // --- variables de controle pour le calcul des visibilites
|
---|
158 | fgdoVisiC = false;
|
---|
159 | nmeanVisiC=1024;
|
---|
160 | nbcalgrpVisiC=1;
|
---|
161 | nthrVisiC=1;
|
---|
162 | freqminVisiC=freqmaxVisiC=0;
|
---|
163 | nbinfreqVisiC=1;
|
---|
164 |
|
---|
165 | // Autres variables / variables speciales
|
---|
166 | monothr=false;
|
---|
167 | activate_pattern=false;
|
---|
168 | nopciLossRate=0.;
|
---|
169 |
|
---|
170 | // niveau d'impression,debug ...
|
---|
171 | prtlevel_=0;
|
---|
172 | prtmodulo_=50000;
|
---|
173 | Decode(); // On decode et on complete les parametres
|
---|
174 | }
|
---|
175 |
|
---|
176 | /* --Methode-- */
|
---|
177 | BRParList::BRParList(BRParList const & p)
|
---|
178 | {
|
---|
179 | Set(p);
|
---|
180 | }
|
---|
181 |
|
---|
182 | /* --Methode-- */
|
---|
183 | void BRParList::Set(BRParList const & p)
|
---|
184 | {
|
---|
185 | AcqMode=p.AcqMode;
|
---|
186 | fgdatafft=p.fgdatafft;
|
---|
187 | fgsinglechannel=p.fgsinglechannel;
|
---|
188 |
|
---|
189 | FiberListS=p.FiberListS;
|
---|
190 | FiberNum=p.FiberNum;
|
---|
191 | FiberIdsS=p.FiberIdsS;
|
---|
192 | FiberIds=p.FiberIds;
|
---|
193 |
|
---|
194 | PaqSize=p.PaqSize;
|
---|
195 |
|
---|
196 | dmasizekb=p.dmasizekb;
|
---|
197 | maxkwedma_=p.maxkwedma_;
|
---|
198 | nretrydma_=p.nretrydma_;
|
---|
199 | first_maxkwedma_=p.first_maxkwedma_;
|
---|
200 | first_nretrydma_=p.first_nretrydma_;
|
---|
201 |
|
---|
202 | NbFiles=p.NbFiles;
|
---|
203 | NBlocPerFile=p.NBlocPerFile;
|
---|
204 | OutPathName=p.OutPathName;
|
---|
205 |
|
---|
206 | nZones=p.nZones;
|
---|
207 | nPaqZone=p.nPaqZone;
|
---|
208 |
|
---|
209 | swapall=p.swapall;
|
---|
210 | savesigfits=p.savesigfits;
|
---|
211 | fgnulldev4fits=p.fgnulldev4fits;
|
---|
212 | fg_hard_ctrlc=p.fg_hard_ctrlc;
|
---|
213 | fgnulldev4fits=p.fgnulldev4fits;
|
---|
214 |
|
---|
215 | fgreducpsize=p.fgreducpsize;
|
---|
216 | reducneedcopy=p.reducneedcopy;
|
---|
217 | pqreducmode=p.pqreducmode;
|
---|
218 | redpqsize=p.redpqsize;
|
---|
219 | reducoffset=p.reducoffset;
|
---|
220 |
|
---|
221 | tcpportid=p.tcpportid;
|
---|
222 | pci2eth_fgdirect=p.pci2eth_fgdirect;
|
---|
223 | eths_targets=p.eths_targets;
|
---|
224 | ethr_nlink=p.ethr_nlink;
|
---|
225 | ethr_forcesamefc_=p.ethr_forcesamefc_;
|
---|
226 | ethr_sfc_maxdpc_=p.ethr_sfc_maxdpc_;
|
---|
227 | ethr_sfc_maxresync_=p.ethr_sfc_maxresync_;
|
---|
228 | ethr_waitendmsg_=p.ethr_waitendmsg_;
|
---|
229 |
|
---|
230 | skysource=p.skysource;
|
---|
231 |
|
---|
232 | fgdoProc=p.fgdoProc;
|
---|
233 | nmeanProc=p.nmeanProc;
|
---|
234 | stepProc=p.stepProc;
|
---|
235 | nmaxProc=p.nmaxProc;
|
---|
236 |
|
---|
237 | monothr=p.monothr;
|
---|
238 | activate_pattern=p.activate_pattern;
|
---|
239 |
|
---|
240 | nopciLossRate=p.nopciLossRate;
|
---|
241 |
|
---|
242 | prtlevel_=p.prtlevel_;
|
---|
243 | prtmodulo_=p.prtlevel_;
|
---|
244 |
|
---|
245 | return;
|
---|
246 | }
|
---|
247 |
|
---|
248 | /* --Methode-- */
|
---|
249 | void BRParList::ReadDCFile(string file)
|
---|
250 | {
|
---|
251 | DataCards conf(file);
|
---|
252 | if(conf.HasKey("fibres"))
|
---|
253 | FiberListS= conf.SParam("fibres",0,"1");
|
---|
254 | else if(conf.HasKey("fibers"))
|
---|
255 | FiberListS= conf.SParam("fibers",0,"1");
|
---|
256 | if(conf.HasKey("fiberids"))
|
---|
257 | FiberIdsS= conf.SParam("fiberids",0,"1");
|
---|
258 |
|
---|
259 | OutPathName= conf.SParam("outpathname",0,"TstAcq");
|
---|
260 | skysource= conf.SParam("skysource",0,"");
|
---|
261 | PaqSize=(uint_4)conf.IParam("paqsize",0,16424);
|
---|
262 |
|
---|
263 | dmasizekb =(uint_4) conf.IParam("dmasizekb",0,32);
|
---|
264 | maxkwedma_=(unsigned int)conf.IParam("waitenddma",0,1000);
|
---|
265 | nretrydma_=(unsigned int)conf.IParam("waitenddma",1,3);
|
---|
266 | first_maxkwedma_=(unsigned int)conf.IParam("waitenddma",2,20*maxkwedma_);
|
---|
267 | first_nretrydma_=(unsigned int)conf.IParam("waitenddma",3,3*nretrydma_);
|
---|
268 |
|
---|
269 | NbFiles=conf.IParam("nbfiles",0,1);
|
---|
270 | NBlocPerFile=conf.IParam("nblocperfile",0,10);
|
---|
271 | AcqMode =conf.SParam("acqmode",0,"std");
|
---|
272 | nZones=(uint_4)conf.IParam("memmgr",0,4);
|
---|
273 | nPaqZone=(uint_4)conf.IParam("memmgr",1,128);
|
---|
274 | if (conf.HasKey("reducpaqsz")) { // reduction des tailles de paquets
|
---|
275 | fgreducpsize=true;
|
---|
276 | redpqsize=(uint_4)conf.IParam("reducpaqsz",0,PaqSize/4);
|
---|
277 | reducoffset=(uint_4)conf.IParam("reducpaqsz",1,0);
|
---|
278 | }
|
---|
279 | // Mot cle pour le mode envoi-reception sur ethernet
|
---|
280 | tcpportid=conf.IParam("tcpportid",0,BRSPORTID);
|
---|
281 | if (conf.HasKey("pci2ethdirect")) pci2eth_fgdirect = true; // Transfer direct DMA -> Ethernet
|
---|
282 | if (conf.HasKey("ethrtargets")) { // Machines destinations des paquets
|
---|
283 | for(int it=0; it<conf.NbParam("ethrtargets"); it++)
|
---|
284 | eths_targets.push_back(conf.SParam("ethrtargets",it));
|
---|
285 | }
|
---|
286 | ethr_nlink=conf.IParam("ethrnlink",0,0); // Nombre de sources de paquets en reception ethernet
|
---|
287 | if (conf.HasKey("ethrforcesamefc")) {
|
---|
288 | ethr_forcesamefc_=true; // force SAME FrameCounter on all links
|
---|
289 | ethr_sfc_maxdpc_=conf.IParam("ethrforcesamefc",0,0);
|
---|
290 | ethr_sfc_maxresync_=conf.IParam("ethrforcesamefc",1,0);
|
---|
291 | }
|
---|
292 | if (conf.HasKey("ethrwaitendmsg")) ethr_waitendmsg_=true;
|
---|
293 |
|
---|
294 | // Parametre de controle du monitoring
|
---|
295 | if (conf.HasKey("monitor")) {
|
---|
296 | fgdoProc=true;
|
---|
297 | nmeanProc=conf.IParam("monitor",0,512);
|
---|
298 | stepProc=conf.IParam("monitor",1,10);
|
---|
299 | nmaxProc=conf.IParam("monitor",2,0);
|
---|
300 | }
|
---|
301 | // Parametres pour le calcul des visibilites - le flag fgdoVisiC ne peut etre active
|
---|
302 | // qu'avec l'option de ligne de commande de mfacq
|
---|
303 | if (conf.HasKey("visicalc")) {
|
---|
304 | nmeanVisiC=conf.IParam("visicalc",0,1024);
|
---|
305 | nbcalgrpVisiC=conf.IParam("visicalc",1,1);
|
---|
306 | nthrVisiC=conf.IParam("visicalc",2,1);
|
---|
307 | }
|
---|
308 | if (conf.HasKey("visicfreq")) {
|
---|
309 | freqminVisiC=conf.IParam("visicfreq",0,0);
|
---|
310 | freqmaxVisiC=conf.IParam("visicfreq",1,0);
|
---|
311 | nbinfreqVisiC=conf.IParam("visicfreq",2,1);
|
---|
312 | }
|
---|
313 |
|
---|
314 | nopciLossRate=conf.DParam("nopcilossrate",0,0.);
|
---|
315 | fg_hard_ctrlc=conf.HasKey("hard_ctrlc");
|
---|
316 | if (conf.HasKey("nosavesigfits")) savesigfits=false;
|
---|
317 | if (conf.HasKey("prtlev")) {
|
---|
318 | prtlevel_=conf.IParam("prtlev",0,0);
|
---|
319 | prtmodulo_=conf.IParam("prtlev",1,50000);
|
---|
320 | }
|
---|
321 |
|
---|
322 | Decode();
|
---|
323 | }
|
---|
324 |
|
---|
325 | /* --Methode-- */
|
---|
326 | void BRParList::Decode()
|
---|
327 | {
|
---|
328 | vector<string> fiblist;
|
---|
329 | FillVStringFrString(FiberListS, fiblist, ',');
|
---|
330 | FiberNum.resize(fiblist.size());
|
---|
331 | for (int fib=0; fib<fiblist.size(); fib++) {
|
---|
332 | FiberNum[fib]=atoi(fiblist[fib].c_str());
|
---|
333 | }
|
---|
334 | vector<string> fibids;
|
---|
335 | FillVStringFrString(FiberIdsS, fibids, ',');
|
---|
336 | for (int fib=0; fib<fibids.size(); fib++) {
|
---|
337 | FiberIds[fib]=atoi(fibids[fib].c_str());
|
---|
338 | }
|
---|
339 |
|
---|
340 | if (OutPathName == "/dev/null") {
|
---|
341 | fgnulldev4fits=true;
|
---|
342 | }
|
---|
343 | else {
|
---|
344 | size_t len = OutPathName.length();
|
---|
345 | if ((len>1)&&(OutPathName[len-1]!='/')) OutPathName+='/';
|
---|
346 | fgnulldev4fits=false;
|
---|
347 | }
|
---|
348 | string acqmode = AcqMode;
|
---|
349 | fgdatafft=false; fgsinglechannel=false;
|
---|
350 | reducneedcopy=false; pqreducmode=BR_TwoChanReduc;
|
---|
351 | if ((acqmode == "std")||(acqmode=="raw2c")) swapall = BR_Copy ;
|
---|
352 | if (acqmode=="raw1c") { swapall = BR_Copy ; fgsinglechannel=true; pqreducmode=BR_OneChanReduc; }
|
---|
353 |
|
---|
354 | if ((acqmode == "fft2c")||(acqmode == "fft1c")) swapall = BR_Copy ;
|
---|
355 | if (acqmode == "nosw") swapall = BR_Copy ;
|
---|
356 | if (acqmode == "nof") { swapall = BR_Copy ; savesigfits = false; }
|
---|
357 | if (acqmode == "ordfft1c") { swapall = BR_FFTOneChan; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; }
|
---|
358 | if (acqmode == "ordfft2c") { swapall = BR_FFTTwoChan; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; }
|
---|
359 |
|
---|
360 | if (acqmode == "fft1cnof")
|
---|
361 | { swapall = BR_FFTOneChan; savesigfits = false; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; }
|
---|
362 | if (acqmode == "fft2cnof")
|
---|
363 | { swapall = BR_FFTTwoChan; savesigfits = false; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; }
|
---|
364 | if (acqmode == "mono") { monothr = true; swapall = BR_Copy; }
|
---|
365 | if (acqmode == "monodirect") { monothr = true; swapall = BR_CopyHDR;}
|
---|
366 | if (acqmode == "patmonodirect") { monothr = true; swapall = BR_CopyHDR; activate_pattern=true; }
|
---|
367 | if (acqmode == "patmono") { monothr = true; swapall = BR_Copy; activate_pattern=true; }
|
---|
368 | if (acqmode == "patnof") { savesigfits = false; swapall = BR_Copy; activate_pattern=true; }
|
---|
369 | if (acqmode == "pattern") { savesigfits = true; swapall = BR_Copy; activate_pattern=true; }
|
---|
370 |
|
---|
371 | if (acqmode == "swapall") swapall = BR_SwapAll;
|
---|
372 | if (acqmode == "fft1csw")
|
---|
373 | { swapall = BR_FFTOneChanSwapAll; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; }
|
---|
374 | if (acqmode == "fft2csw")
|
---|
375 | { swapall = BR_FFTTwoChanSwapAll; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; }
|
---|
376 | if (acqmode == "fft1cswnof")
|
---|
377 | { swapall = BR_FFTOneChanSwapAll; savesigfits = false; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; }
|
---|
378 | if (acqmode == "fft2cswnof")
|
---|
379 | { swapall = BR_FFTTwoChanSwapAll; savesigfits = false; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; }
|
---|
380 | if ((acqmode == "swh") || (acqmode == "mxs") || (acqmode == "monoswh") ) swapall = BR_SwapHDR;
|
---|
381 | if ((acqmode == "swapallnof") || (acqmode == "mxs") ) savesigfits = false;
|
---|
382 | if (acqmode == "monoswh") { monothr = true; swapall = BR_SwapHDR;; }
|
---|
383 | if (acqmode == "monosw") { monothr = true; swapall = BR_SwapAll; }
|
---|
384 |
|
---|
385 | if (acqmode == "swap32") swapall = BR_Swap32 ;
|
---|
386 | if (acqmode == "nof32") { swapall = BR_Swap32 ; savesigfits = false; }
|
---|
387 | if (acqmode == "fft1c32")
|
---|
388 | { swapall = BR_FFTOneChanSwap32; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; }
|
---|
389 | if (acqmode == "fft2c32")
|
---|
390 | { swapall = BR_FFTTwoChanSwap32; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; }
|
---|
391 | if (acqmode == "fft1cnof32")
|
---|
392 | { swapall = BR_FFTOneChanSwap32; savesigfits = false; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; }
|
---|
393 | if (acqmode == "fft2cnof32")
|
---|
394 | { swapall = BR_FFTTwoChanSwap32; savesigfits = false; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; }
|
---|
395 |
|
---|
396 | if ((swapall==BR_FFTTwoChan)||(swapall==BR_FFTTwoChanSwapAll)||(swapall==BR_FFTTwoChanSwap32)) {
|
---|
397 | fgdatafft=true;
|
---|
398 | }
|
---|
399 | if ((swapall==BR_FFTOneChan)||(swapall==BR_FFTOneChanSwapAll)||(swapall==BR_FFTOneChanSwap32)) {
|
---|
400 | fgdatafft=true; fgsinglechannel=true;
|
---|
401 | }
|
---|
402 |
|
---|
403 | if (fgreducpsize) {
|
---|
404 | if (redpqsize>=PaqSize) fgreducpsize=false;
|
---|
405 | else {
|
---|
406 | if(reducoffset>(PaqSize-redpqsize)/2) reducoffset=(PaqSize-redpqsize)/2;
|
---|
407 | }
|
---|
408 | }
|
---|
409 | }
|
---|
410 |
|
---|
411 | /* --Methode-- */
|
---|
412 | ostream& BRParList::Print(ostream& os)
|
---|
413 | {
|
---|
414 | os << " ------ BRParList::Print() ----- " << endl;
|
---|
415 | os << " FiberListS=" << FiberListS ;
|
---|
416 | os << " FiberIdsS=" << FiberIdsS ;
|
---|
417 | os << " Fibers (Num->Id): ";
|
---|
418 | for(size_t f=0; f<NbFibers(); f++) cout << FiberNum[f] << " -> " << FiberIds[f] << " ; " ;
|
---|
419 | os << endl;
|
---|
420 | os << " PaqSize=" <<PaqSize;
|
---|
421 | os << " DMA_Size_kb=" <<dmasizekb << " (EndDMA: Maxkw=" << maxkwedma_ << " NRetry=" << nretrydma_
|
---|
422 | << " FirstDMA: Maxkw=" << first_maxkwedma_ << " NRetry=" << first_nretrydma_ << ")" << endl;
|
---|
423 | os << " AcqMode="<<AcqMode;
|
---|
424 | os << " Type of acquisition :" << BRPaquet::FmtConvToString( swapall) << endl;
|
---|
425 | os << " SkySource=" << skysource;
|
---|
426 | os << " NbFiles="<<NbFiles;
|
---|
427 | os << " NBlocPerFile="<<NBlocPerFile;
|
---|
428 | os << " OutPathName="<<OutPathName << endl;
|
---|
429 | os << " MemMgr: nZones="<<nZones;
|
---|
430 | os << " nPaqZone="<<nPaqZone<<endl;
|
---|
431 | if (fgreducpsize) {
|
---|
432 | os << " PaquetSize Reduction, ReducedSize=" << redpqsize << " Offset=" << reducoffset << endl;
|
---|
433 | }
|
---|
434 | if (eths_targets.size()>0) {
|
---|
435 | cout << " DMA->Ethernet NbTargets=" << eths_targets.size()
|
---|
436 | << ((pci2eth_fgdirect)?" (DirectTransferMode) " : " " ) << " :";
|
---|
437 | for(size_t it=0; it<eths_targets.size(); it++) cout << eths_targets[it] << " , ";
|
---|
438 | cout << endl;
|
---|
439 | }
|
---|
440 | cout << " TCP-PortId=" << tcpportid << " EthernetRead NbSources (=NbLinks)= " << ethr_nlink << endl;
|
---|
441 | if (ethr_forcesamefc_)
|
---|
442 | cout << "EthernetReader mode: ForceSameFrameCounter read mode with Max_PaquetCounterDiff= "
|
---|
443 | << ethr_sfc_maxdpc_ << " MaxNbResync=" << ethr_sfc_maxresync_
|
---|
444 | << ((ethr_waitendmsg_)?" Wait_For_END_Message_Before_Terminate ":" ") << endl;
|
---|
445 | else
|
---|
446 | cout << "EthernetReader mode: AllOKPaquets read mode "
|
---|
447 | << ((ethr_waitendmsg_)?" Wait_For_END_Message_Before_Terminate ":" ") << endl;
|
---|
448 |
|
---|
449 | if (fgdoProc>0)
|
---|
450 | os << " Monitoring NMeanProc=" << nmeanProc << " StepProc=" << stepProc << " NMaxProc=" << nmaxProc << endl;
|
---|
451 | else os << " No monotoring thread " << endl;
|
---|
452 | if (fgdoVisiC) {
|
---|
453 | os << " Visibility calculation, nbCalGrp=" << nbcalgrpVisiC << " NThr/VisCal=" << nthrVisiC << endl;
|
---|
454 | os << " ... VisiCalc FrequencyBinning FreqMin= " << freqminVisiC << " FreqMax= " << freqmaxVisiC
|
---|
455 | << " NBinFreq= " << nbinfreqVisiC<< endl;
|
---|
456 | }
|
---|
457 | os << " fg_hard_ctrlc=" << ((fg_hard_ctrlc)?"true":"false");
|
---|
458 | os << " Save to fits " << ((savesigfits)?"true":"false") << endl;
|
---|
459 | os << " monothr y(1)/n(0) " << ((monothr)?"true":"false");
|
---|
460 | os << " ActivatePattern " << ((activate_pattern)?"true":"false") << endl;
|
---|
461 | os << " PrtLevel=" << prtlevel_ << " PrtCntModulo=" << prtmodulo_ << endl;
|
---|
462 |
|
---|
463 | return os;
|
---|
464 | }
|
---|
465 |
|
---|
466 |
|
---|
467 | //-------------------- Classe BRAcqConfig -----------------------
|
---|
468 |
|
---|
469 | BRParList* BRAcqConfig::param_=NULL;
|
---|
470 | BRConfList* BRAcqConfig::config_=NULL;
|
---|
471 |
|
---|
472 | /* --Methode-- */
|
---|
473 | BRAcqConfig::BRAcqConfig()
|
---|
474 | {
|
---|
475 | if (param_==NULL) param_ = new BRParList;
|
---|
476 | if (config_==NULL) config_ = new BRConfList;
|
---|
477 | }
|
---|
478 |
|
---|
479 | /* --Methode-- */
|
---|
480 | ostream& BRAcqConfig::Print(ostream& os)
|
---|
481 | {
|
---|
482 | os << " ------------ BAORadio Acq Run/Configuration -------- " << endl;
|
---|
483 | config_->Print(os);
|
---|
484 | param_->Print(os);
|
---|
485 | os << " ----------------------------------------------------- " << endl;
|
---|
486 | }
|
---|
487 |
|
---|
488 | /* --Methode-- */
|
---|
489 | int BRAcqConfig::CreateOutputDirectories()
|
---|
490 | {
|
---|
491 | char cmd[1024];
|
---|
492 | if (param_->fgnulldev4fits!=true) {
|
---|
493 | sprintf(cmd,"mkdir %s%s",config_->BaseDirectory().c_str(), param_->OutPathName.c_str());
|
---|
494 | if (system(cmd) < 0) {
|
---|
495 | cout << "CreateOutputDirectories()/Error: Can not create subdirectory "
|
---|
496 | << cmd << " -> stop" << endl;
|
---|
497 | return 2;
|
---|
498 | }
|
---|
499 | cout << "CreateOutputDirectories() - Executed command " << cmd << endl;
|
---|
500 |
|
---|
501 | memset(cmd,0,1024);
|
---|
502 | for (int i= 0; i< NFibers() ; i++) {
|
---|
503 | sprintf(cmd,"mkdir %s%s/Fiber%d",config_->BaseDirectory().c_str(), param_->OutPathName.c_str(),param_->FiberNum[i]);
|
---|
504 | if (system(cmd) < 0) {
|
---|
505 | cout << "CreateOutputDirectories()/Error: Can not create subdirectory "
|
---|
506 | << cmd << " -> stop" << endl;
|
---|
507 | return 3;
|
---|
508 | }
|
---|
509 | else cout << "CreateOutputDirectories() - Executed command " << cmd << endl;
|
---|
510 | }
|
---|
511 | }
|
---|
512 | else {
|
---|
513 | string ProcPathName = "./XZXZXZX/";
|
---|
514 | cout << " Using " << ProcPathName << " for other processed files ... " << endl;
|
---|
515 | char cmd[512];
|
---|
516 | sprintf(cmd,"mkdir %s",ProcPathName.c_str());
|
---|
517 | if (system(cmd) < 0) {
|
---|
518 | cout << "CreateOutputDirectories()/Error: Can not create subdirectory ./XZXZXZX/"
|
---|
519 | << "-> stop" << endl;
|
---|
520 | return 3;
|
---|
521 | }
|
---|
522 | else cout << "CreateOutputDirectories() - Executed command " << cmd << endl;
|
---|
523 | }
|
---|
524 | return 0;
|
---|
525 | }
|
---|
526 |
|
---|
527 | /* --Methode-- */
|
---|
528 | string BRAcqConfig::OutputDirectoryFib(int ifib)
|
---|
529 | {
|
---|
530 | char buff[24];
|
---|
531 | sprintf(buff,"Fiber%d/",param_->FiberNum[ifib]);
|
---|
532 | return ( config_->BaseDirectory() + param_->OutPathName + buff );
|
---|
533 | }
|
---|