source: trunk/Mars/mreport/MReport.h@ 14916

Last change on this file since 14916 was 12776, checked in by tbretz, 13 years ago
Added virtual functions for reading contents from FITS data.
File size: 1.7 KB
Line 
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
11namespace std
12{
13 class fits;
14}
15class MTime;
16class MParList;
17
18class MReport : public MParContainer
19{
20private:
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
30protected:
31 Bool_t CheckTag(TString &str, const char *tag) const;
32
33 void Copy(TObject &obj) const;
34
35public:
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 kTRUE; }
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 kTRUE; }
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
Note: See TracBrowser for help on using the repository browser.