| Rev | Line |   | 
|---|
| [350] | 1 | // archtoi.h
 | 
|---|
 | 2 | // Eric Aubourg         CEA/DAPNIA/SPP   juillet 1999
 | 
|---|
 | 3 | 
 | 
|---|
| [342] | 4 | #ifndef ARCHTOI_H
 | 
|---|
 | 5 | #define ARCHTOI_H
 | 
|---|
 | 6 | 
 | 
|---|
 | 7 | #include <iostream.h>
 | 
|---|
 | 8 | #include <string>
 | 
|---|
 | 9 | #include <list>
 | 
|---|
 | 10 | #include <vector>
 | 
|---|
 | 11 | #include "toisvr.h"
 | 
|---|
| [352] | 12 | #include "fitsio.h"
 | 
|---|
| [342] | 13 | 
 | 
|---|
 | 14 | using namespace std; 
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | class ArchTOI {
 | 
|---|
 | 17 | public:
 | 
|---|
 | 18 |   ArchTOI(istream& str);
 | 
|---|
 | 19 |   ArchTOI(string const& filename);
 | 
|---|
 | 20 | 
 | 
|---|
| [352] | 21 |   void run(string const& outfilename);
 | 
|---|
| [342] | 22 |   
 | 
|---|
| [350] | 23 |   enum fmt {ascii_fmt, fits_fmt};
 | 
|---|
| [342] | 24 |   enum flg {hasflag = 1,
 | 
|---|
 | 25 |             useNA   = 2};
 | 
|---|
 | 26 |   
 | 
|---|
 | 27 | protected:
 | 
|---|
 | 28 |   void init();
 | 
|---|
 | 29 |   void readReq(istream& str);
 | 
|---|
 | 30 |   bool processOption(string line); // false when #END : stop processing...
 | 
|---|
 | 31 |   void processTOIReq(string line);
 | 
|---|
 | 32 |   TOISvr svr;
 | 
|---|
 | 33 |   list<string> headertoi;
 | 
|---|
 | 34 |   list<string> headeropt;
 | 
|---|
| [352] | 35 |   list<string> toinames;
 | 
|---|
| [342] | 36 |   vector<flg>  toiflags;
 | 
|---|
 | 37 |   fmt format;
 | 
|---|
 | 38 |   string undef;
 | 
|---|
 | 39 |   bool allBolos; // tous les bolos dans le header. Sinon seulement bolos transmis.
 | 
|---|
| [352] | 40 |   
 | 
|---|
 | 41 |   void (ArchTOI::*openFile)(string const& filename);
 | 
|---|
 | 42 |   void (ArchTOI::*outHeader)(TOIIter& iter);
 | 
|---|
 | 43 |   void (ArchTOI::*outValue)(int icolumn, double value, bool notdef=false);
 | 
|---|
 | 44 |   void (ArchTOI::*endLine)();
 | 
|---|
 | 45 |   void (ArchTOI::*closeFile)();
 | 
|---|
 | 46 |   
 | 
|---|
 | 47 |   void openFile_A(string const& filename);
 | 
|---|
 | 48 |   void outHeader_A(TOIIter& iter);
 | 
|---|
 | 49 |   void outValue_A(int icolumn, double value, bool notdef=false);
 | 
|---|
 | 50 |   void endLine_A();
 | 
|---|
 | 51 |   void closeFile_A();
 | 
|---|
 | 52 | 
 | 
|---|
 | 53 |   void openFile_F(string const& filename);
 | 
|---|
 | 54 |   void outHeader_F(TOIIter& iter);
 | 
|---|
 | 55 |   void outValue_F(int icolumn, double value, bool notdef=false);
 | 
|---|
 | 56 |   void endLine_F();
 | 
|---|
 | 57 |   void closeFile_F();
 | 
|---|
 | 58 |   
 | 
|---|
 | 59 |   fitsfile* fptr;
 | 
|---|
 | 60 |   int fitsStatus;
 | 
|---|
 | 61 |   int fitsLine;
 | 
|---|
| [359] | 62 |   ostream* ostr;
 | 
|---|
| [342] | 63 | };
 | 
|---|
 | 64 | 
 | 
|---|
| [356] | 65 | #define ARCHTOI_VERS "1.0"
 | 
|---|
 | 66 | 
 | 
|---|
| [342] | 67 | #endif
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.