source: Sophya/trunk/ArchTOIPipe/TestPipes/tstring2cout.cc@ 3452

Last change on this file since 3452 was 2361, checked in by cecile, 22 years ago

nouveaux tuyaux de ring : theta, phi puis Nsamples mesures

File size: 2.0 KB
Line 
1//#define TOISEQBUFFERED
2
3#include <unistd.h>
4#include "toi.h"
5#include "cgt.h"
6#include "toiprocessor.h"
7#include "fitsringrdr.h"
8#include "toimanager.h"
9#ifdef TOISEQBUFFERED
10#include "toiseqbuff.h"
11#else
12#include "toisegment.h"
13#endif
14
15#include "sambainit.h"
16#include "ring2cout.h"
17#include "timing.h"
18
19#include <stdexcept>
20
21void usage(void);
22void usage(void) {
23 cout<<"tsttoi2ring fitsin_ring Nrings"<<endl;
24 return;
25}
26
27////////////////////////////////////////////////////////////////
28int main(int narg, char** arg) {
29
30TOIManager* mgr = TOIManager::getManager();
31
32//-- Decodage arguments
33bool fgsegmented = true;
34int wsize = 512;
35bool snimplicit = false;
36
37if(narg != 3) {usage(); exit(2);}
38 char * fitsin_ring = arg[1];
39 long nr=atoi(arg[2]);
40
41 cout<<">>>> tsttoi2ring:"<<endl;
42cout<<"Fits Infile Value "<<fitsin_ring<<endl;
43
44
45SophyaInit();
46InitTim();
47
48//--------------------------------------------------------------------
49try {
50//--------------------------------------------------------------------
51
52 CGT plombier(fgsegmented,wsize);
53 plombier.SetDebugLevel(99);
54
55 // FITS reader et writer
56 FITSRingReader rfitsr(fitsin_ring);
57 rfitsr.setNRings(nr);
58
59
60 // TOI Processor
61 Ring2cout ring2p(1024,nr);
62 cout<<"RING2cout created"<<endl;
63
64
65 // Definition des tuyaux
66
67 plombier.Connect(rfitsr,"signal",ring2p,"Phase");
68
69
70 // Run
71 cout<<"----- FITSReaderTOI::PrintStatus() : -----"<<endl;
72
73 plombier.Start();
74 plombier.ListTOIs(cout, 1);
75 cout << "Joining ..." << endl;
76
77 mgr->joinAll();
78 PrtTim("End threads");
79
80//--------------------------------------------------------------------
81} catch (PThrowable & exc) {
82 cout<<"\ntsttoi2ring: Catched Exception \n"<<(string)typeid(exc).name()
83 <<" - Msg= "<<exc.Msg()<<endl;
84} catch (const std::exception & sex) {
85 cout<<"\ntsttoi2ring: Catched std::exception \n"
86 <<(string)typeid(sex).name()<<endl;
87} catch (...) {
88 cout<<"\ntsttoi2ring: some other exception was caught ! "<<endl;
89}
90//--------------------------------------------------------------------
91
92exit(0);
93}
Note: See TracBrowser for help on using the repository browser.