1 | #ifndef MARS_MReport
|
---|
2 | #define MARS_MReport
|
---|
3 |
|
---|
4 | #ifndef MARS_MParContainer
|
---|
5 | #include "MParContainer.h"
|
---|
6 | #endif
|
---|
7 | #ifndef MARS_MTime
|
---|
8 | #include "MTime.h"
|
---|
9 | #endif
|
---|
10 |
|
---|
11 | namespace std
|
---|
12 | {
|
---|
13 | class fits;
|
---|
14 | }
|
---|
15 | class MTime;
|
---|
16 | class MParList;
|
---|
17 |
|
---|
18 | class MReport : public MParContainer
|
---|
19 | {
|
---|
20 | private:
|
---|
21 | const TString fIdentifier; //! Identifier of the subsystem
|
---|
22 | const Bool_t fHasReportTime; //! Intermediate solution for DC currents
|
---|
23 |
|
---|
24 | Byte_t fState; // Status of the subsystem
|
---|
25 | MTime *fTime; //! pointer to the corresponding time stamp
|
---|
26 |
|
---|
27 | ULong_t Hash() const { return fIdentifier.Hash(); }
|
---|
28 | Bool_t InterpreteHeader(TString &str, Int_t ver);
|
---|
29 |
|
---|
30 | protected:
|
---|
31 | Bool_t CheckTag(TString &str, const char *tag) const;
|
---|
32 |
|
---|
33 | void Copy(TObject &obj) const;
|
---|
34 |
|
---|
35 | public:
|
---|
36 | MReport(const char *id, Bool_t time=kTRUE) : fIdentifier(id), fHasReportTime(time), fState(0xff), fTime(0) { }
|
---|
37 |
|
---|
38 | virtual Bool_t SetupReading(MParList &plist);
|
---|
39 | virtual Bool_t SetupReadingFits(std::fits &fits) { return kFALSE; }
|
---|
40 | virtual Int_t InterpreteBody(TString &str, Int_t ver);
|
---|
41 |
|
---|
42 | Int_t Interprete(TString &str, const MTime &start, const MTime &stop, const Int_t ver);
|
---|
43 | virtual Int_t InterpreteFits(const std::fits &fits) { return kFALSE; }
|
---|
44 | Bool_t CheckIdentifier(TString &str) const
|
---|
45 | {
|
---|
46 | if (!str.BeginsWith(fIdentifier))
|
---|
47 | return kFALSE;
|
---|
48 |
|
---|
49 | str.Remove(0, fIdentifier.Length());
|
---|
50 | str = str.Strip(TString::kBoth);
|
---|
51 |
|
---|
52 | return kTRUE;
|
---|
53 | }
|
---|
54 |
|
---|
55 | const TString &GetIdentifier() const { return fIdentifier; }
|
---|
56 |
|
---|
57 | Byte_t GetState() const { return fState; }
|
---|
58 | Double_t GetMjd() const { return fTime ? fTime->GetMjd() : -1; }
|
---|
59 |
|
---|
60 | MTime *GetTime() { return fTime; }
|
---|
61 |
|
---|
62 | ClassDef(MReport, 1) // Base class for control reports
|
---|
63 | };
|
---|
64 |
|
---|
65 | #endif
|
---|