Changeset 12238 for trunk


Ignore:
Timestamp:
10/23/11 14:37:55 (13 years ago)
Author:
tbretz
Message:
Give scan range with the START command.
File:
1 edited

Legend:

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

    r12237 r12238  
    169169                reference = fTriggersPatch[fReferenceIdx];
    170170
    171             if (sqrt(reference)>fResolution*reference && fSeconds<fSecondsMax)
     171            if ((reference==0 || sqrt(reference)>fResolution*reference) && fSeconds<fSecondsMax)
    172172            {
    173173                ostringstream out;
     
    176176                    out << " (" << sqrt(reference)/reference << ")";
    177177                Info(out);
     178
    178179                return;
    179180            }
     
    238239    }
    239240
    240     int StartRateScan()
    241     {
     241    int StartRateScan(const EventImp &evt)
     242    {
     243        if (!CheckEventSize(evt.GetSize(), "StartRateScan", 12))
     244            return kSM_FatalError;
     245
     246        fThresholdMin   = evt.Get<uint32_t>();
     247        fThresholdMax   = evt.Get<uint32_t>(4);
     248        fThresholdStep = evt.Get<uint32_t>(8);
     249
    242250        ofstream fout("ratescan.txt", ios::app);
    243251        fout << "# ----- " << Time() << " -----" << endl;
     
    257265
    258266        Message("Starting Trigger (FTM)");
    259         Dim::SendCommand("FTM_CONTROL/SET_PRESCALING", int32_t(20));
     267        //Dim::SendCommand("FTM_CONTROL/SET_PRESCALING", int32_t(20));
    260268        Dim::SendCommand("FTM_CONTROL/SET_THRESHOLD", data);
    261269        //Dim::SendCommand("FTM_CONTROL/STOP_RUN");
     
    371379                     "Rate scan in progress.");
    372380
    373         AddEvent("START", kStateConnected)
    374             (bind(&StateMachineRateScan::StartRateScan, this))
    375             ("");
    376 
    377         AddEvent("START", kStateConnected)
    378             (bind(&StateMachineRateScan::StartRateScan, this))
    379             ("");
     381        AddEvent("START", "I:3", kStateConnected)
     382            (bind(&StateMachineRateScan::StartRateScan, this, placeholders::_1))
     383            ("Start rate scan for the defined range"
     384             "|min[int]:Start value in DAC counts"
     385             "|max[int]:Limiting value in DAC counts"
     386             "|step[int]:Single step in DAC counts");
    380387
    381388        AddEvent("STOP", kStateInProgress)
     
    428435//             "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
    429436*/
     437/*
     438        AddEvent("SET_RANGE", "I:3")
     439            (bind(&StateMachineRateScan::SetRange, this, placeholders::_1))
     440            ("Set raneg for ratescane"
     441             "|min[int]:Start value in DAC counts"
     442             "|max[int]:Limiting value in DAC counts"
     443             "|step[int]:Single step in DAC counts");
     444*/
    430445        AddEvent("PRINT")
    431446            (bind(&StateMachineRateScan::Print, this))
     
    441456            return 1;
    442457        }*/
    443 
    444         fThresholdMin  = 0;
    445         fThresholdMax  = 100;
    446         fThresholdStep = 1;
    447458
    448459        fSecondsMax    = 150;
Note: See TracChangeset for help on using the changeset viewer.