| 1 | /* ======================================================================== *\
|
|---|
| 2 | !
|
|---|
| 3 | ! *
|
|---|
| 4 | ! * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
|---|
| 5 | ! * Software. It is distributed to you in the hope that it can be a useful
|
|---|
| 6 | ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
|---|
| 7 | ! * It is distributed WITHOUT ANY WARRANTY.
|
|---|
| 8 | ! *
|
|---|
| 9 | ! * Permission to use, copy, modify and distribute this software and its
|
|---|
| 10 | ! * documentation for any purpose is hereby granted without fee,
|
|---|
| 11 | ! * provided that the above copyright notice appear in all copies and
|
|---|
| 12 | ! * that both that copyright notice and this permission notice appear
|
|---|
| 13 | ! * in supporting documentation. It is provided "as is" without express
|
|---|
| 14 | ! * or implied warranty.
|
|---|
| 15 | ! *
|
|---|
| 16 | !
|
|---|
| 17 | !
|
|---|
| 18 | ! Author(s): Thomas Bretz, 12/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
|
|---|
| 19 | !
|
|---|
| 20 | ! Copyright: MAGIC Software Development, 2000-2003
|
|---|
| 21 | !
|
|---|
| 22 | !
|
|---|
| 23 | \* ======================================================================== */
|
|---|
| 24 |
|
|---|
| 25 | //////////////////////////////////////////////////////////////////////////////
|
|---|
| 26 | //
|
|---|
| 27 | // MReportCC
|
|---|
| 28 | //
|
|---|
| 29 | // This is the class interpreting and storing the CC-REPORT information.
|
|---|
| 30 | //
|
|---|
| 31 | // From here maily weather station data is decoded such as
|
|---|
| 32 | // temperature, humidity, wind-speed and solar radiation
|
|---|
| 33 | //
|
|---|
| 34 | //////////////////////////////////////////////////////////////////////////////
|
|---|
| 35 | #include "MReportCC.h"
|
|---|
| 36 |
|
|---|
| 37 | #include "MLogManip.h"
|
|---|
| 38 |
|
|---|
| 39 | #include "MAstro.h"
|
|---|
| 40 |
|
|---|
| 41 | ClassImp(MReportCC);
|
|---|
| 42 |
|
|---|
| 43 | using namespace std;
|
|---|
| 44 |
|
|---|
| 45 | MReportCC::MReportCC() : MReport("CC-REPORT", kFALSE)
|
|---|
| 46 | {
|
|---|
| 47 | fName = "MReportCC";
|
|---|
| 48 | fTitle = "Class for CC-REPORT information";
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 | Bool_t MReportCC::InterpreteBody(TString &str)
|
|---|
| 52 | {
|
|---|
| 53 | // Remove the 30 tokens of the subsystem status
|
|---|
| 54 | // table 12.1 p59
|
|---|
| 55 | for (int i=0; i<30; i++)
|
|---|
| 56 | str.Remove(0, str.First(' ')+1);
|
|---|
| 57 |
|
|---|
| 58 | Int_t len;
|
|---|
| 59 | const Int_t n=sscanf(str.Data(),
|
|---|
| 60 | "%*f %*f %*f %*f %f %f %f %f %*f %*f %n",
|
|---|
| 61 | &fTemperature, &fSolarRadiation, &fWindSpeed,
|
|---|
| 62 | &fHumidity, &len);
|
|---|
| 63 | if (n!=4)
|
|---|
| 64 | {
|
|---|
| 65 | *fLog << err << "ERROR - Wrong number of arguments." << endl;
|
|---|
| 66 | return kFALSE;
|
|---|
| 67 | }
|
|---|
| 68 | /*
|
|---|
| 69 | str.Remove(0, len);
|
|---|
| 70 |
|
|---|
| 71 | *fLog << dbg << str << endl;
|
|---|
| 72 |
|
|---|
| 73 | if (str!=(TString)"OVER")
|
|---|
| 74 | {
|
|---|
| 75 | *fLog << err << "ERROR - Termination (OVER) too far away." << endl;
|
|---|
| 76 | return kFALSE;
|
|---|
| 77 | }
|
|---|
| 78 | */
|
|---|
| 79 | return kTRUE;
|
|---|
| 80 | }
|
|---|