[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 |
|
---|
[407] | 16 | class ArchTOI : public RequestHandler {
|
---|
[342] | 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};
|
---|
[407] | 26 |
|
---|
| 27 | virtual bool processTOIReq(string line, string toiname, TOIKind toi, int index,
|
---|
| 28 | bool interp, bool repet, bool flag, bool notrig);
|
---|
| 29 | virtual bool processOption(string keyw, string args);
|
---|
[342] | 30 |
|
---|
| 31 | protected:
|
---|
| 32 | void init();
|
---|
| 33 | TOISvr svr;
|
---|
| 34 | list<string> headertoi;
|
---|
| 35 | list<string> headeropt;
|
---|
[352] | 36 | list<string> toinames;
|
---|
[342] | 37 | vector<flg> toiflags;
|
---|
| 38 | fmt format;
|
---|
| 39 | string undef;
|
---|
| 40 | bool allBolos; // tous les bolos dans le header. Sinon seulement bolos transmis.
|
---|
[352] | 41 |
|
---|
| 42 | void (ArchTOI::*openFile)(string const& filename);
|
---|
| 43 | void (ArchTOI::*outHeader)(TOIIter& iter);
|
---|
| 44 | void (ArchTOI::*outValue)(int icolumn, double value, bool notdef=false);
|
---|
| 45 | void (ArchTOI::*endLine)();
|
---|
| 46 | void (ArchTOI::*closeFile)();
|
---|
| 47 |
|
---|
| 48 | void openFile_A(string const& filename);
|
---|
| 49 | void outHeader_A(TOIIter& iter);
|
---|
| 50 | void outValue_A(int icolumn, double value, bool notdef=false);
|
---|
| 51 | void endLine_A();
|
---|
| 52 | void closeFile_A();
|
---|
| 53 |
|
---|
| 54 | void openFile_F(string const& filename);
|
---|
| 55 | void outHeader_F(TOIIter& iter);
|
---|
| 56 | void outValue_F(int icolumn, double value, bool notdef=false);
|
---|
| 57 | void endLine_F();
|
---|
| 58 | void closeFile_F();
|
---|
| 59 |
|
---|
| 60 | fitsfile* fptr;
|
---|
| 61 | int fitsStatus;
|
---|
| 62 | int fitsLine;
|
---|
[359] | 63 | ostream* ostr;
|
---|
[407] | 64 |
|
---|
| 65 | string requestVersion;
|
---|
| 66 | list<string> comments;
|
---|
[342] | 67 | };
|
---|
| 68 |
|
---|
[407] | 69 | #define ARCHTOI_VERS "1.1"
|
---|
| 70 | #define ARCHTOI_TAG "notag"
|
---|
[356] | 71 |
|
---|
[342] | 72 | #endif
|
---|