Changeset 14508


Ignore:
Timestamp:
10/22/12 22:22:50 (13 years ago)
Author:
tbretz
Message:
Next try to fix the problem of wrong zero rate warnings.
File:
1 edited

Legend:

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

    r14507 r14508  
    13681368    }
    13691369
     1370    int HandleMcpStateChange()
     1371    {
     1372        const int32_t &last  = fDimFtmControl.last.second;
     1373        const int32_t &state = fDimFtmControl.state();
     1374
     1375        // If a new run has ben started ensure that the counter
     1376        // is reset. The reset in HandleFtmTriggerRates might
     1377        // arrive only after the run was started.
     1378        if (last<MCP::State::kTriggerOn && state>=MCP::State::kTriggerOn)
     1379            fFtmControlTriggerRateTooLow = -1;
     1380
     1381        return StateMachineImp::kSM_KeepState;
     1382    }
     1383
     1384
    13701385    int HandleFtmTriggerRates(const EventImp &d)
    13711386    {
     
    13811396
    13821397        // New run started
    1383         if (dim.fTriggerRate<0 || dim.fElapsedTime<=0)
     1398        if (dim.fTriggerRate<0)
    13841399        {
    13851400            fFtmControlTriggerRateTooLow = -1;
     
    22892304                           "Sensor temperature exceeds outside temperature by more than 8&deg;C");
    22902305
    2291         newerr |= SetError(fFtmControlTriggerRateTooLow>2 && fDimMcp.state()==MCP::State::kTakingData,
     2306        newerr |= SetError(fFtmControlTriggerRateTooLow>1 && fDimMcp.state()==MCP::State::kTakingData,
    22922307                           "Trigger rate below 1Hz during data taking");
    22932308
     
    27972812        fDimFscControl.SetCallback(bind(&StateMachineSmartFACT::HandleFscControlStateChange, this, placeholders::_1));
    27982813        fDimDriveControl.SetCallback(bind(&StateMachineSmartFACT::HandleDriveControlStateChange, this, placeholders::_1));
     2814        fDimMcp.SetCallback(bind(&StateMachineSmartFACT::HandleMcpStateChange, this));
    27992815        fDimControl.SetCallback(bind(&StateMachineSmartFACT::HandleControlStateChange, this, placeholders::_1));
    28002816        fDimControl.AddCallback("dotest.dim", bind(&StateMachineSmartFACT::HandleDoTest, this, placeholders::_1));
Note: See TracChangeset for help on using the changeset viewer.