Changeset 14503 for trunk/FACT++


Ignore:
Timestamp:
10/22/12 20:43:00 (12 years ago)
Author:
tbretz
Message:
Added a third configuration error state which checks if the clock conditioner was locked.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r13910 r14503  
    4646            kConfigError1 = 0x101,
    4747            kConfigError2 = 0x102,
     48            kConfigError3 = 0x103,
    4849        };
    4950    }
  • trunk/FACT++/src/ftmctrl.cc

    r14491 r14503  
    11641164        throw runtime_error("ConnectionFTM::GetState - Impossible code reached.");
    11651165    }
     1166
     1167    bool IsLocked() const { return fHeader.fState&FTM::kFtmLocked; }
    11661168
    11671169    int GetCounter(FTM::Types type) { return fCounter[type]; }
     
    19171919        }
    19181920
     1921        // FIXME: Add timeouts and go to error state
     1922        //        so that a configuration error can be handled
    19191923        switch (T::GetCurrentState())
    19201924        {
     
    19571961            // will be received
    19581962            fCounterStat = fFTM.GetCounter(FTM::kStaticData);
     1963
     1964            if (!fFtm.IsLocked())
     1965            {
     1966                 T::Warn("Configuration successfull, but clock conditioner not locked.");
     1967                 return FTM::State::kConfigError3;
     1968            }
    19591969
    19601970            T::Info(" ==> TODO: Update run in database!");
     
    19751985        }
    19761986
     1987        // FIXME: Do we have to check the state of the clock conditioner here?
     1988
    19771989        if (T::GetCurrentState()==FTM::State::kConfigured &&
    19781990            fFTM.GetState()==ConnectionFTM::kTriggerOn)
     
    20152027                        "Ethernet connection to FTM established, FTM trigger output to FADs enabled.");
    20162028
    2017         T::AddStateName(FTM::State::kConfigError1, "ErrorInConfig1", "");
    2018         T::AddStateName(FTM::State::kConfigError2, "ErrorInConfig2", "");
     2029        T::AddStateName(FTM::State::kConfigError1, "ErrorInConfig1", "Unexpected state received from FTM");
     2030        T::AddStateName(FTM::State::kConfigError2, "ErrorInConfig2", "Unexpected state received from FTM");
     2031        T::AddStateName(FTM::State::kConfigError3, "ClockCondError", "Clock conditioner not locked");
    20192032
    20202033        // FTM Commands
Note: See TracChangeset for help on using the changeset viewer.