Changeset 12477 for trunk


Ignore:
Timestamp:
11/09/11 21:51:58 (13 years ago)
Author:
tbretz
Message:
Moved RunDescription to HeadersFAD, added it as a second argument to Open and write the run-type to the header.
Location:
trunk/FACT++/src
Files:
6 edited

Legend:

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

    r11999 r12477  
    4848// =======================================================================
    4949
    50 bool DataDump::Open(RUN_HEAD* h)
     50bool DataDump::Open(const RUN_HEAD* h, const FAD::RunDescription &)
    5151{
    5252    fFileName = "/dev/null";
  • trunk/FACT++/src/DataProcessorImp.h

    r11893 r12477  
    77struct _EVENT;
    88struct _RUN_TAIL;
     9
     10namespace FAD
     11{
     12    struct RunDescription;
     13};
    914
    1015typedef struct _RUN_HEAD RUN_HEAD;
     
    3035    virtual ~DataProcessorImp() { }
    3136
    32     virtual bool Open(RUN_HEAD* h) = 0;
     37    virtual bool Open(const RUN_HEAD* h, const FAD::RunDescription &desc) = 0;
    3338    virtual bool WriteEvt(EVENT *) = 0;
    3439    virtual bool Close(RUN_TAIL * = 0) = 0;
     
    5560    DataDump(const std::string &path, uint32_t id, MessageImp &imp) : DataProcessorImp(path, id, imp) { }
    5661
    57     bool Open(RUN_HEAD* h);
     62    bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
    5863    bool WriteEvt(EVENT *e);
    5964    bool Close(RUN_TAIL * = 0);
  • trunk/FACT++/src/DataWriteFits.cc

    r12454 r12477  
    11#include "DataWriteFits.h"
    22
     3#include "HeadersFAD.h"
    34#include "FAD.h"
    45#include "Converter.h"
     
    3031//! @param h a pointer to the RUN_HEAD structure that contains the informations relative to this run
    3132//
    32 bool DataWriteFits::Open(RUN_HEAD* h)
     33bool DataWriteFits::Open(const RUN_HEAD* h, const FAD::RunDescription &d)
    3334{
    3435    if (fConv)
     
    9495        fFile.WriteKey("NROI",     h->Nroi,     "Number of slices per pixels");
    9596        fFile.WriteKey("NROITM",   realRoiTM,   "Number of slices per time-marker"); //ETIENNE from NroiTMm to Nroi
    96                 int realOffset = (h->NroiTM > h->Nroi) ?  h->NroiTM - 2*h->Nroi : 0;
    97                 fFile.WriteKey("OFFSET", realOffset, "Offset between pixels ROI and TM ROi"); //ETIENNE added
     97
     98        const uint16_t realOffset = (h->NroiTM > h->Nroi) ?  h->NroiTM - 2*h->Nroi : 0;
     99        fFile.WriteKey("OFFSET", realOffset, "Offset between pixels ROI and TM ROi"); //ETIENNE added
    98100
    99101        //FIXME should we also put the start and stop time of the received data ?
     
    103105        fFile.WriteKey("ADCRANGE", 2000,        "Dynamic range in mV");
    104106        fFile.WriteKey("ADC",      12,          "Resolution in bits");
    105 
     107        fFile.WriteKey("TYPE",     d.name,      "File type according to FAD configuration (Config database)");
    106108
    107109        // Write a single key for:
  • trunk/FACT++/src/DataWriteRaw.cc

    r11893 r12477  
    11#include "DataWriteRaw.h"
    22
     3#include "HeadersFAD.h"
    34#include "FAD.h"
    45
     
    1819}
    1920
    20 bool DataWriteRaw::Open(RUN_HEAD *h)
     21bool DataWriteRaw::Open(const RUN_HEAD *h, const FAD::RunDescription &d)
    2122{
    2223    const string name = FormFileName("bin");
     
    5152
    5253    WriteBlockHeader(kRunHeader, 1, 0, sizeof(RUN_HEAD)-sizeof(PEVNT_HEADER*));
    53     fOut.write(reinterpret_cast<char*>(h), sizeof(RUN_HEAD)-sizeof(PEVNT_HEADER*));
     54    fOut.write(reinterpret_cast<const char*>(h), sizeof(RUN_HEAD)-sizeof(PEVNT_HEADER*));
    5455
    5556    for (int i=0; i<40; i++)
  • trunk/FACT++/src/DataWriteRaw.h

    r11893 r12477  
    8181    };
    8282
    83     bool Open(RUN_HEAD *h);
     83    bool Open(const RUN_HEAD *h, const FAD::RunDescription &d);
    8484    bool WriteEvt(EVENT *evt);
    8585    bool Close(RUN_TAIL *tail= 0);
  • trunk/FACT++/src/HeadersFAD.h

    r12438 r12477  
    401401    };
    402402
     403    struct RunDescription
     404    {
     405        uint32_t maxtime;
     406        uint32_t maxevt;
     407
     408        std::string name;
     409
     410        Configuration reference;
     411    };
     412
    403413    // --------------------------------------------------------------------
    404414#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.