Ignore:
Timestamp:
10/29/11 21:37:20 (13 years ago)
Author:
tbretz
Message:
Added the possibility to change the step size and maximum during a ratescan.
File:
1 edited

Legend:

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

    r12312 r12323  
    6666
    6767    DimDescribedService fDimData;
     68    DimDescribedService fDimProc;
    6869
    6970    int fCounter;
     
    9495
    9596    string fCommand;
     97
     98    void UpdateProc()
     99    {
     100        const array<uint32_t,3> v = {{ fThresholdMin, fThresholdMax, fThresholdStep }};
     101        fDimProc.Update(v);
     102    }
    96103
    97104    pair<Time, int> GetNewState(DimStampedInfo &info) const
     
    280287        fThresholdStep = evt.Get<uint32_t>(8);
    281288
     289        UpdateProc();
     290
    282291        const Time now;
    283292
     
    368377        fReference    = kPatch;
    369378        fReferenceIdx = evt.GetUInt();
     379
     380        return GetCurrentState();
     381    }
     382
     383    int ChangeStepSize(const EventImp &evt)
     384    {
     385        if (!CheckEventSize(evt.GetSize(), "ChangeStepSize", 4))
     386            return kSM_FatalError;
     387
     388        fThresholdStep = evt.Get<uint32_t>();
     389
     390        UpdateProc();
     391
     392        return GetCurrentState();
     393    }
     394
     395    int ChangeMaximum(const EventImp &evt)
     396    {
     397        if (!CheckEventSize(evt.GetSize(), "ChangeMaximum", 4))
     398            return kSM_FatalError;
     399
     400        fThresholdMax = evt.Get<uint32_t>();
    370401
    371402        return GetCurrentState();
     
    401432        fRates("FTM_CONTROL/TRIGGER_RATES", (void*)NULL, 0, this),
    402433        fDimData("RATE_SCAN/DATA", "I:1;F:1;F:1;F:1;F:40;F:160", ""),
     434        fDimProc("RATE_SCAN/PROCESS_DATA", "I:1;I:1;I:1",
     435                 "Rate scan process data"
     436                 "|min[DAC]:Value at which scan was started"
     437                 "|max[DAC]:Value at which scan will end"
     438                 "|step[DAC]:Step size for scan"),
    403439        fCounter(-1), fReference(kCamera), fReferenceIdx(0)
    404440    {
     
    436472             "|max[int]:Limiting value in DAC counts"
    437473             "|step[int]:Single step in DAC counts");
     474
     475        AddEvent("CHANGE_STEP_SIZE", "I:1", kStateInProgress)
     476            (bind(&StateMachineRateScan::ChangeStepSize, this, placeholders::_1))
     477            ("Change the step size during a ratescan in progress"
     478             "|step[int]:Single step in DAC counts");
     479
     480        AddEvent("CHANGE_MAXIMUM", "I:1", kStateInProgress)
     481            (bind(&StateMachineRateScan::ChangeMaximum, this, placeholders::_1))
     482            ("Change the maximum limit during a ratescan in progress"
     483             "|max[int]:Limiting value in DAC counts");
    438484
    439485        AddEvent("STOP", kStateInProgress)
Note: See TracChangeset for help on using the changeset viewer.