Ignore:
Timestamp:
03/29/13 21:28:30 (12 years ago)
Author:
tbretz
Message:
Keep the rate of the first report afte a state change at -1 to signal that the value would be unreliable and to have a handle when the values were resetted. The same is done for the ftm time reference, because it is not available. The on-time however is correct... we keep that.
File:
1 edited

Legend:

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

    r15184 r15185  
    12681268        const uint8_t state = fHeader.fState & FTM::States::kFtmStates;
    12691269
    1270         if (state == fPrevState && fHeader.fTriggerCounter>=fTriggerCounter &&
    1271             fDynamicData.fOnTimeCounter>=fTimeStampOn)
     1270        const bool first = state!=fPrevState ||
     1271            fHeader.fTriggerCounter<fTriggerCounter ||
     1272            fDynamicData.fOnTimeCounter<fTimeStampOn;
     1273
     1274        if (!first)
    12721275        {
    12731276            odiff -= fTimeStampOn;
     
    12871290
    12881291        const FTM::DimTriggerRates rates(fHeader, fDynamicData, fStaticData,
    1289                                          rate, tdiff*1e-6, odiff*1e-6);
     1292                                         first ? -1 : rate, first ? -1 : tdiff*1e-6, odiff*1e-6);
    12901293
    12911294        fDimTriggerRates.setQuality(fHeader.fState);
Note: See TracChangeset for help on using the changeset viewer.