Changeset 11014 for trunk/FACT++/src


Ignore:
Timestamp:
06/13/11 17:06:33 (13 years ago)
Author:
tbretz
Message:
Fixed some limits; some improvements to the output
File:
1 edited

Legend:

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

    r10997 r11014  
    563563    bool Check(const uint32_t *dat, uint32_t maxaddr, uint32_t maxval)
    564564    {
    565         if (dat[0]>FAD::kMaxRegAddr)
     565        if (dat[0]>maxaddr)
    566566        {
    567567            ostringstream msg;
     
    571571        }
    572572
    573         if (dat[1]>FAD::kMaxRegValue)
     573        if (dat[1]>maxval)
    574574        {
    575575            ostringstream msg;
     
    603603            return T::kSM_FatalError;
    604604
    605         // ---- was uint32_t
    606605        const int32_t *dat = evt.Ptr<int32_t>();
    607606
    608         // ---- -1 for all
    609         //if (!Check(dat, FAD::kMaxRoiAddr, FAD::kMaxRoiValue))
    610         //            return T::GetCurrentState();
    611 
    612607        for (BoardList::iterator i=fBoards.begin(); i!=fBoards.end(); i++)
    613             i->second.second->CmdSetRoi(dat[0], dat[1]);
     608            if (!i->second.second->CmdSetRoi(dat[0], dat[1]))
     609            {
     610                ostringstream msg;
     611                msg << hex << "Channel " << dat[0] << " or Value " << dat[1] << " out of range.";
     612                T::Error(msg);
     613                return false;
     614            }
     615
    614616
    615617        return T::GetCurrentState();
     
    835837        }
    836838
    837         T::Out() << "Thread :";
     839        T::Out() << "Event builder thread:";
    838840        if (!IsThreadRunning())
    839841            T::Out() << " not";
     
    10271029public:
    10281030    StateMachineFAD(ostream &out=cout) :
    1029         T(out, "FAD_CONTROL"), EventBuilderWrapper(static_cast<MessageImp&>(*this)), ba::io_service::work(static_cast<ba::io_service&>(*this)),
     1031        T(out, "FAD_CONTROL"), EventBuilderWrapper(*static_cast<MessageImp*>(this)), ba::io_service::work(static_cast<ba::io_service&>(*this)),
    10301032        fStatus1(40), fStatus2(40),
    10311033        fDimConnection("FAD_CONTROL/CONNECTIONS", "C:41", "")
Note: See TracChangeset for help on using the changeset viewer.