Changeset 2892


Ignore:
Timestamp:
01/23/04 15:35:41 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2891 r2892  
    99   * mbase/MAstro.cc:
    1010     - Fixed calculation of MJD. In Ymd2Mjd a plus should be a minus.
     11
     12   * mreport/MReport*.[h,cc]:
     13     - changed all classes to return Int_t instead of Bool_t in
     14       InterpreteBody
     15     - changed MReportFileRead such, that a wrong line results in
     16       skipping the line instead of abort reading.
    1117
    1218
  • trunk/MagicSoft/Mars/mreport/MReport.cc

    r2678 r2892  
    9191// argument.
    9292//
    93 Bool_t MReport::InterpreteBody(TString &str)
     93Int_t MReport::InterpreteBody(TString &str)
    9494{
    9595    *fLog << warn << "No interpreter existing for: " << fIdentifier << endl;
     
    115115        return kCONTINUE;
    116116
    117     if (!InterpreteBody(str))
    118         return kFALSE;
     117    const Int_t rc = InterpreteBody(str);
     118    if (rc != kTRUE)
     119        return rc;
    119120
    120121    SetReadyToSave();
  • trunk/MagicSoft/Mars/mreport/MReport.h

    r2678 r2892  
    2525
    2626    virtual Bool_t SetupReading(MParList &plist);
    27     virtual Bool_t InterpreteBody(TString &str);
     27    virtual Int_t InterpreteBody(TString &str);
    2828
    2929    Int_t  Interprete(TString &str, const MTime &start, const MTime &stop);
  • trunk/MagicSoft/Mars/mreport/MReportCC.cc

    r2814 r2892  
    5858// Interprete the body of the CC-REPORT string
    5959//
    60 Bool_t MReportCC::InterpreteBody(TString &str)
     60Int_t MReportCC::InterpreteBody(TString &str)
    6161{
    6262    // Remove the 30 tokens of the subsystem status
     
    7272    if (n!=4)
    7373    {
    74         *fLog << err << "ERROR - Wrong number of arguments." << endl;
    75         return kFALSE;
     74        *fLog << warn << "WARNING - Wrong number of arguments." << endl;
     75        return kCONTINUE;
    7676    }
    7777    /*
  • trunk/MagicSoft/Mars/mreport/MReportCC.h

    r2864 r2892  
    1414    Float_t fSolarRadiation; // [W/m^2] IR-Radiation
    1515
    16     Bool_t InterpreteBody(TString &str);
     16    Int_t InterpreteBody(TString &str);
    1717
    1818public:
  • trunk/MagicSoft/Mars/mreport/MReportCamera.cc

    r2814 r2892  
    109109    if (!str.BeginsWith(tag))
    110110    {
    111         *fLog << err << "ERROR - '" << tag << "' tag not found." << endl;
     111        *fLog << warn << "WARNING - '" << tag << "' tag not found." << endl;
    112112        return kFALSE;
    113113    }
     
    152152            continue;
    153153
    154         *fLog << err << "ERROR - Reading hexadecimal HV information." << endl;
     154        *fLog << warn << "WARNING - Reading hexadecimal HV information." << endl;
    155155        return kFALSE;
    156156    }
     
    179179    if (n!=13)
    180180    {
    181         *fLog << err << "ERROR - Reading information of 'COOL' section." << endl;
     181        *fLog << warn << "WARNING - Reading information of 'COOL' section." << endl;
    182182        return kFALSE;
    183183    }
     
    222222    if (n!=12)
    223223    {
    224         *fLog << err << "ERROR - Reading information of 'LID' section." << endl;
     224        *fLog << warn << "WARNING - Reading information of 'LID' section." << endl;
    225225        return kFALSE;
    226226    }
     
    260260    if (n!=4)
    261261    {
    262         *fLog << err << "ERROR - Reading information of 'HVPS' section." << endl;
     262        *fLog << warn << "WARNING - Reading information of 'HVPS' section." << endl;
    263263        return kFALSE;
    264264    }
     
    291291    if (n!=19)
    292292    {
    293         *fLog << err << "ERROR - Reading information of 'LV' section." << endl;
     293        *fLog << warn << "WARNING - Reading information of 'LV' section." << endl;
    294294        return kFALSE;
    295295    }
     
    336336    if (n!=2)
    337337    {
    338         *fLog << err << "ERROR - Reading information of 'AUX' section." << endl;
     338        *fLog << warn << "WARNING - Reading information of 'AUX' section." << endl;
    339339        return kFALSE;
    340340    }
     
    363363    if (n!=4)
    364364    {
    365         *fLog << err << "ERROR - Reading information of 'CAL' section." << endl;
     365        *fLog << warn << "WARNING - Reading information of 'CAL' section." << endl;
    366366        return kFALSE;
    367367    }
     
    393393    if (n!=13)
    394394    {
    395         *fLog << err << "ERROR - Cannot interprete status' of subsystems." << endl;
     395        *fLog << warn << "WARNING - Cannot interprete status' of subsystems." << endl;
    396396        return kFALSE;
    397397    }
     
    420420// Interprete the body of the CAMERA-REPORT string
    421421//
    422 Bool_t MReportCamera::InterpreteBody(TString &str)
     422Int_t MReportCamera::InterpreteBody(TString &str)
    423423{
    424424    if (!InterpreteCamera(str))
    425         return kFALSE;
     425        return kCONTINUE;
    426426
    427427    if (!InterpreteDC(str))
    428         return kFALSE;
     428        return kCONTINUE;
    429429
    430430    if (!InterpreteHV(str))
    431         return kFALSE;
     431        return kCONTINUE;
    432432
    433433    if (!InterpreteCOOL(str))
    434         return kFALSE;
     434        return kCONTINUE;
    435435
    436436    if (!InterpreteLID(str))
    437         return kFALSE;
     437        return kCONTINUE;
    438438
    439439    if (!InterpreteHVPS(str))
    440         return kFALSE;
     440        return kCONTINUE;
    441441
    442442    if (!InterpreteLV(str))
    443         return kFALSE;
     443        return kCONTINUE;
    444444
    445445    if (!InterpreteAUX(str))
    446         return kFALSE;
     446        return kCONTINUE;
    447447
    448448    if (!InterpreteCAL(str))
    449         return kFALSE;
     449        return kCONTINUE;
    450450
    451451    if (str!="OVER")
    452452    {
    453         *fLog << err << "ERROR - 'OVER' tag not found." << endl;
    454         return kFALSE;
    455     }
    456 
    457     return kTRUE;
    458 }
     453        *fLog << warn << "WARNING - 'OVER' tag not found." << endl;
     454        return kCONTINUE;
     455    }
     456
     457    return kTRUE;
     458}
  • trunk/MagicSoft/Mars/mreport/MReportCamera.h

    r2707 r2892  
    3939    Bool_t InterpreteCAL(TString &str);
    4040
    41     Bool_t InterpreteBody(TString &str);
     41    Int_t InterpreteBody(TString &str);
    4242
    4343public:
  • trunk/MagicSoft/Mars/mreport/MReportCurrents.cc

    r2814 r2892  
    7070// Interprete the body of the DC-REPORT string
    7171//
    72 Bool_t MReportCurrents::InterpreteBody(TString &str)
     72Int_t MReportCurrents::InterpreteBody(TString &str)
    7373{
    7474    Int_t len;
     
    7777    if (n!=2)
    7878    {
    79         *fLog << err << "ERROR - Reading status information." << endl;
    80         return kFALSE;
     79        *fLog << warn << "WARNING - Reading status information." << endl;
     80        return kCONTINUE;
    8181    }
    8282
     
    9797        if (n!=1)
    9898        {
    99             *fLog << err << "ERROR - Reading hexadecimal DC information." << endl;
    100             return kFALSE;
     99            *fLog << warn << "WARNING - Reading hexadecimal DC information." << endl;
     100            return kCONTINUE;
    101101        }
    102102
     
    107107    str=str.Strip(TString::kLeading);
    108108
    109     return str.IsNull();
     109    return str.IsNull() ? kTRUE : kCONTINUE;
    110110}
  • trunk/MagicSoft/Mars/mreport/MReportCurrents.h

    r2632 r2892  
    1717
    1818    Bool_t SetupReading(MParList &plist);
    19     Bool_t InterpreteBody(TString &str);
     19    Int_t InterpreteBody(TString &str);
    2020
    2121public:
  • trunk/MagicSoft/Mars/mreport/MReportDAQ.cc

    r2780 r2892  
    4848}
    4949
    50 Bool_t MReportDAQ::InterpreteBody(TString &str)
     50Int_t MReportDAQ::InterpreteBody(TString &str)
    5151{
    5252    *fLog << dbg << "D" << flush;
  • trunk/MagicSoft/Mars/mreport/MReportDAQ.h

    r2707 r2892  
    99{
    1010private:
    11     Bool_t InterpreteBody(TString &str);
     11    Int_t InterpreteBody(TString &str);
    1212
    1313public:
  • trunk/MagicSoft/Mars/mreport/MReportDrive.cc

    r2814 r2892  
    8888// Interprete the body of the DRIVE-REPORT string
    8989//
    90 Bool_t MReportDrive::InterpreteBody(TString &str)
     90Int_t MReportDrive::InterpreteBody(TString &str)
    9191{
    9292    MAstro::String2Angle(str, fRa);
     
    9797    Int_t n=sscanf(str.Data(), "%lf %n", &fMjd, &len);
    9898    if (n!=1)
    99         return kFALSE;
     99    {
     100        *fLog << warn << "WARNING - Not enough arguments." << endl;
     101        return kCONTINUE;
     102    }
    100103
    101104    str.Remove(0, len);
     
    108111    n=sscanf(str.Data(), "%lf %lf %n", &fErrorZd, &fErrorAz, &len);
    109112    if (n!=2)
    110         return kFALSE;
     113    {
     114        *fLog << warn << "WARNING - Not enough arguments." << endl;
     115        return kCONTINUE;
     116    }
    111117
    112118    str.Remove(0, len);
     
    114120    str = str.Strip(TString::kBoth);
    115121
    116     return str.IsNull();
     122    return str.IsNull() ? kTRUE : kCONTINUE;
    117123}
    118124
  • trunk/MagicSoft/Mars/mreport/MReportDrive.h

    r2814 r2892  
    2323    Double_t fErrorAz;    // [?] sistem error in the azimuth angle axis
    2424
    25     Bool_t InterpreteBody(TString &str);
     25    Int_t InterpreteBody(TString &str);
    2626
    2727public:
  • trunk/MagicSoft/Mars/mreport/MReportFileRead.cc

    r2814 r2892  
    255255
    256256    const Int_t rc = rep->Interprete(str, fStart, fStop);
    257     if (rc==kFALSE)
    258     {
    259         *fLog << err << "ERROR - Interpretation of '" << rep->GetName() << "' failed (Line #" << fNumLine << ")" << endl;
    260         return kFALSE;
     257
     258    switch (rc)
     259    {
     260    case kFALSE:
     261        *fLog << err << "ERROR - Interpretation of '" << rep->GetName() << "' failed (Line #" << fNumLine << ")... abort." << endl;
     262        break;
     263    case kCONTINUE:
     264        *fLog << warn << "WARNING - Interpretation of '" << rep->GetName() << "' failed (Line #" << fNumLine << ")... skipped." << endl;
     265        break;
    261266    }
    262267
     
    284289    while ((rep=(MReportHelp*)Next()))
    285290    {
     291        *fLog << inf;
    286292        *fLog << " " << setw(7) << rep->GetNumReports() << " (";
    287293        *fLog << setw(3) << (int)(100.*rep->GetNumReports()/GetNumExecutions());
    288294        *fLog << "%): " << rep->GetName() << endl;
     295
     296        if (rep->GetNumSkipped()==0)
     297            continue;
     298
     299        *fLog << warn;
     300        *fLog << " " << setw(7) << rep->GetNumSkipped() << " (";
     301        *fLog << setw(3) << (int)(100.*rep->GetNumSkipped()/GetNumExecutions());
     302        *fLog << "%): " << rep->GetName() << " skipped!" << endl;
    289303    }
    290304
  • trunk/MagicSoft/Mars/mreport/MReportHelp.cc

    r2799 r2892  
    5656// default constructor.
    5757//
    58 MReportHelp::MReportHelp(const char *name, MLog *fLog) : fReport(NULL), fNumReports(0)
     58MReportHelp::MReportHelp(const char *name, MLog *fLog) : fReport(NULL), fNumReports(0), fNumSkipped(0)
    5959{
    6060    TClass *cls = gROOT->GetClass(name);
     
    142142    const Int_t rc = fReport->Interprete(str, start, stop);
    143143
    144     if (rc==kFALSE)
    145         return kFALSE;
    146 
    147     fNumReports++;
     144    switch (rc)
     145    {
     146    case kTRUE:     fNumReports++; break;
     147    case kCONTINUE: fNumSkipped++; break;
     148    }
    148149    return rc;
    149150}
  • trunk/MagicSoft/Mars/mreport/MReportHelp.h

    r2799 r2892  
    1818    MReport *fReport;
    1919    ULong_t  fNumReports;
     20    ULong_t  fNumSkipped;
    2021
    2122public:
     
    2526    const char *GetName() const;
    2627    ULong_t GetNumReports() const { return fNumReports; }
     28    ULong_t GetNumSkipped() const { return fNumSkipped; }
    2729    ULong_t Hash() const;
    2830    MReport *GetReport() { return fReport; }
  • trunk/MagicSoft/Mars/mreport/MReportRun.cc

    r2814 r2892  
    5757// Interprete the body of the RUN-REPORT string
    5858//
    59 Bool_t MReportRun::InterpreteBody(TString &str)
     59Int_t MReportRun::InterpreteBody(TString &str)
    6060{
    6161    Int_t len;
     
    6363    if (n!=1)
    6464    {
    65         *fLog << err << "ERROR - Wrong number of arguments." << endl;
    66         return kFALSE;
     65        *fLog << warn << "WARNING - Wrong number of arguments." << endl;
     66        return kCONTINUE;
    6767    }
    6868    str.Remove(0, len);
  • trunk/MagicSoft/Mars/mreport/MReportRun.h

    r2728 r2892  
    1212    TString fSourceName;
    1313
    14     Bool_t InterpreteBody(TString &str);
     14    Int_t InterpreteBody(TString &str);
    1515
    1616public:
  • trunk/MagicSoft/Mars/mreport/MReportTrigger.cc

    r2814 r2892  
    5252// Interprete the body of the TRIGGER-REPORT string
    5353//
    54 Bool_t MReportTrigger::InterpreteBody(TString &str)
     54Int_t MReportTrigger::InterpreteBody(TString &str)
    5555{
    5656    str = str.Strip(TString::kLeading);
     
    5959    if (ws<=0)
    6060    {
    61         *fLog << err << "ERROR - Cannot determin name of trigger table." << endl;
    62         return kFALSE;
     61        *fLog << warn << "WARNING - Cannot determin name of trigger table." << endl;
     62        return kCONTINUE;
    6363    }
    6464
     
    7474        if (n!=1)
    7575        {
    76             *fLog << err << "ERROR - Scaler Value #" << i << " missing." << endl;
    77             return kFALSE;
     76            *fLog << warn << "WARNING - Scaler Value #" << i << " missing." << endl;
     77            return kCONTINUE;
    7878        }
    7979        pos += len;
     
    8282    if (n!=2)
    8383    {
    84         *fLog << err << "ERROR - Couldn't read Trigger rates." << endl;
     84        *fLog << warn << "WARNING - Couldn't read Trigger rates." << endl;
    8585        return kFALSE;
    8686    }
     
    9292        if (n!=1)
    9393        {
    94             *fLog << err << "ERROR - Rate #" << i << " missing." << endl;
     94            *fLog << warn << "WARNING - Rate #" << i << " missing." << endl;
    9595            return kFALSE;
    9696        }
     
    100100    str.Strip(TString::kBoth);
    101101
    102     return str==(TString)"OVER";
     102    return str==(TString)"OVER" ? kTRUE : kCONTINUE;
    103103}
  • trunk/MagicSoft/Mars/mreport/MReportTrigger.h

    r2865 r2892  
    1919    //TArrayF fRates;           //[Hz] curently undefined
    2020
    21     Bool_t InterpreteBody(TString &str);
     21    Int_t InterpreteBody(TString &str);
    2222
    2323public:
Note: See TracChangeset for help on using the changeset viewer.