Changeset 11139


Ignore:
Timestamp:
06/23/11 16:34:30 (13 years ago)
Author:
tbretz
Message:
Added option to set maximum event buffer memory.
File:
1 edited

Legend:

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

    r11127 r11139  
    798798        for (BoardList::iterator i=fBoards.begin(); i!=fBoards.end(); i++)
    799799            i->second.second->CmdSetRunNumber(num);
     800
     801        return T::GetCurrentState();
     802    }
     803
     804    int SetMaxMemoryBuffer(const EventImp &evt)
     805    {
     806        if (!CheckEventSize(evt.GetSize(), "SetMaxMemoryBuffer", 2))
     807            return T::kSM_FatalError;
     808
     809        const int16_t mem = evt.GetShort();
     810
     811        if (mem<=0)
     812        {
     813            ostringstream msg;
     814            msg << hex << "Value " << mem << " out of range.";
     815            T::Error(msg);
     816            return false;
     817        }
     818
     819        SetMaxMemory(mem);
    800820
    801821        return T::GetCurrentState();
     
    13961416            ("");
    13971417
     1418        T::AddEvent("SET_MAX_MEMORY", "S:1")
     1419            (boost::bind(&StateMachineFAD::SetMaxMemoryBuffer, this, _1))
     1420            ("Set maximum memory buffer size allowed to be consumed by the EventBuilder to buffer events."
     1421             "|memory[short]:Buffer size in Mega-bytes.");
     1422
    13981423        T::AddEvent("SET_REGISTER", "I:2")
    13991424            (boost::bind(&StateMachineFAD::SetRegister, this, _1))
Note: See TracChangeset for help on using the changeset viewer.