Changeset 14024 for trunk/FACT++/src


Ignore:
Timestamp:
06/01/12 16:13:10 (12 years ago)
Author:
tbretz
Message:
Some exception handling around WriteFits
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DataCalib.cc

    r14022 r14024  
    211211}
    212212
    213 void DataCalib::WriteFits()
    214 {
    215     // EXCEPTION HANDLEING!
    216     const string filename = FormFileName("drs.fits");
    217 
     213void DataCalib::WriteFits(const string &filename)
     214{
    218215    ofits file(filename.c_str());
    219216
     
    258255    const int n = (1440*1024*4 + 1440*roi*2 + ntm*roi*2 + 3)*sizeof(float);
    259256    file.WriteRow(fStats.data()+1, n);
    260 
    261     ostringstream str;
    262     str << "Wrote DRS calibration data (step=" << fData.fStep << ", roi=" << roi << ") to '" << filename << "'";
    263     Info(str.str());
    264257}
    265258
     
    308301
    309302    if (fData.fStep<=2)
    310         WriteFits();
     303    {
     304        const string filename = FormFileName("drs.fits");
     305        try
     306        {
     307            WriteFits(filename);
     308
     309            ostringstream str;
     310            str << "Wrote DRS calibration data (step=" << fData.fStep << ", roi=" << fData.fRoi << ") to '" << filename << "'";
     311            Info(str);
     312        }
     313        catch (const exception &e)
     314        {
     315            Error("Exception writing '"+filename+"': "+e.what());
     316        }
     317    }
    311318
    312319    Update(fDim, fDimRuns);
  • trunk/FACT++/src/DataCalib.h

    r14000 r14024  
    2424//    uint16_t fDAC[8];
    2525
    26     void WriteFits();
     26    void WriteFits(const std::string &filename);
    2727
    2828    int GetDrsStep() const { return fData.fStep; }
Note: See TracChangeset for help on using the changeset viewer.