Changeset 12522 for trunk/FACT++/src


Ignore:
Timestamp:
11/15/11 14:09:51 (14 years ago)
Author:
tbretz
Message:
Added a new service FILE_FORMAT to distribute the file format currently switched on; added controlos and displays to set and see the file format.
Location:
trunk/FACT++/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/EventBuilderWrapper.h

    r12499 r12522  
    7575    };
    7676
    77     enum FileFormat_t
    78     {
    79         kNone = 0,
    80         kDebug,
    81         kFits,
    82         kRaw,
    83         kCalib
    84     };
    85 
    86     FileFormat_t fFileFormat;
    87 
     77    FAD::FileFormat_t fFileFormat;
    8878
    8979    uint32_t fMaxRun;
     
    110100    DimDescribedService fDimStatistics1;
    111101    DimDescribedService fDimStatistics2;
     102    DimDescribedService fDimFileFormat;
    112103
    113104    bool fDebugStream;
     
    178169public:
    179170    EventBuilderWrapper(MessageImp &imp) : fMsg(imp),
    180         fFileFormat(kNone), fMaxRun(0), fLastOpened(0), fLastClosed(0),
     171        fFileFormat(FAD::kNone), fMaxRun(0), fLastOpened(0), fLastClosed(0),
    181172        fDimWriteStats  ("FAD_CONTROL", imp),
    182173        fDimRuns        ("FAD_CONTROL/RUNS",               "I:5;C", ""),
     
    197188        fDimStatistics1 ("FAD_CONTROL/STATISTICS1",        "I:3;I:5;X:4;I:3;I:3;I:40;I:1;I:2;C:40;I:40;I:40;X:40", ""),
    198189        fDimStatistics2 ("FAD_CONTROL/STATISTICS2",        "I:1;I:280;X:40;I:40;I:4;I:4;I:2;I:2;I:3;C:40",  ""),
     190        fDimFileFormat  ("FAD_CONTROL/FILE_FORMAT",        "S:1",  ""),
    199191        fDebugStream(false), fDebugRead(false), fDebugLog(false)
    200192    {
     
    407399    bool IsIgnored(int i) const { return g_port[i].sockDef==-1; }
    408400
    409     void SetOutputFormat(FileFormat_t f)
     401    void SetOutputFormat(FAD::FileFormat_t f)
    410402    {
    411403        fFileFormat = f;
    412         if (fFileFormat==kCalib)
     404        fDimFileFormat.Update(uint16_t(f));
     405        if (fFileFormat==FAD::kCalib)
    413406        {
    414407            DataCalib::Restart();
     
    565558        switch (fFileFormat)
    566559        {
    567         case kNone:  file = new DataDump(fPath, runid,  fMsg); break;
    568         case kDebug: file = new DataDebug(fPath, runid, fMsg); break;
    569         case kFits:  file = new DataWriteFits(fPath, runid,  fMsg); break;
    570         case kRaw:   file = new DataWriteRaw(fPath, runid,   fMsg); break;
    571         case kCalib: file = new DataCalib(fPath, runid, fDimDrsCalibration, fMsg); break;
     560        case FAD::kNone:  file = new DataDump(fPath, runid,  fMsg); break;
     561        case FAD::kDebug: file = new DataDebug(fPath, runid, fMsg); break;
     562        case FAD::kFits:  file = new DataWriteFits(fPath, runid,  fMsg); break;
     563        case FAD::kRaw:   file = new DataWriteRaw(fPath, runid,   fMsg); break;
     564        case FAD::kCalib: file = new DataCalib(fPath, runid, fDimDrsCalibration, fMsg); break;
    572565        }
    573566
  • trunk/FACT++/src/HeadersFAD.h

    r12495 r12522  
    6666        kConfigured,
    6767        kWritingData
     68    };
     69
     70    enum FileFormat_t
     71    {
     72        kNone = 0,  // Nothing is written just some little output in the log-stream
     73        kDebug,     // The contents of the headers are output to the console
     74        kFits,      // FITS files are written
     75        kRaw,       // Raw binary streams are written
     76        kCalib      // DRS calibration in progress
    6877    };
    6978
  • trunk/FACT++/src/fadctrl.cc

    r12501 r12522  
    823823        const uint16_t fmt = evt.GetUShort();
    824824
     825        // A simple way to make sure that no invalid file format
     826        // is passed to the event builder
    825827        switch (fmt)
    826828        {
    827         case 0: SetOutputFormat(kNone);  break;
    828         case 1: SetOutputFormat(kDebug); break;
    829         case 2: SetOutputFormat(kFits);  break;
    830         case 3: SetOutputFormat(kRaw);   break;
    831         case 4: SetOutputFormat(kCalib); break;
     829        case FAD::kNone: 
     830        case FAD::kDebug:
     831        case FAD::kFits: 
     832        case FAD::kRaw:   
     833        case FAD::kCalib:
     834            SetOutputFormat(FAD::FileFormat_t(fmt));
     835            break;
    832836        default:
    833837            T::Error("File format unknonw.");
     
    840844    int StartDrsCalibration()
    841845    {
    842         SetOutputFormat(kCalib);
     846        SetOutputFormat(FAD::kCalib);
    843847        return T::GetCurrentState();
    844848    }
     
    15561560        // deletion and creation of threads and more.
    15571561        ResetConfig();
     1562        SetOutputFormat(FAD::kNone);
    15581563
    15591564        // State names
Note: See TracChangeset for help on using the changeset viewer.