Ignore:
Timestamp:
07/26/11 21:09:00 (13 years ago)
Author:
tbretz
Message:
Added program options to set the DAC of the trheshold values.
File:
1 edited

Legend:

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

    r11595 r11630  
    678678    bool SetThreshold(int32_t patch, int32_t value)
    679679    {
    680         if (patch>159)
    681             return false;
    682 
    683         if (value<0 || value>0xffff)
     680        if (patch>FTM::StaticData::kMaxPatchIdx)
     681            return false;
     682
     683        if (value<0 || value>FTM::StaticData::kMaxDAC)
    684684            return false;
    685685
     
    689689
    690690            bool ident = true;
    691             for (int i=0; i<160; i++)
     691            for (int i=0; i<=FTM::StaticData::kMaxPatchIdx; i++)
    692692                if (data[i/4].fDAC[patch%4] != value)
    693693                {
     
    699699                return true;
    700700
    701             for (int i=0; i<160; i++)
     701            for (int i=0; i<=FTM::StaticData::kMaxPatchIdx; i++)
    702702                data[i/4].fDAC[i%4] = value;
    703703
     
    22422242                !CheckConfigVal<uint16_t>(conf, data.kMaxIntensity,       "light-pulser.external.intensity.",     *it) ||
    22432243                !CheckConfigVal<uint16_t>(conf, data.kMaxIntensity,       "light-pulser.internal.intensity.",     *it) ||
     2244                !CheckConfigVal<uint16_t>(conf, data.kMaxDAC,             "trigger.threshold.pixel.",             *it) ||
     2245                !CheckConfigVal<uint16_t>(conf, data.kMaxDAC,             "trigger.threshold.patch..",            *it) ||
    22442246                0)
    22452247                return 2;
     
    23142316            }
    23152317
     2318            const uint16_t th0 = conf.GetDef<uint16_t>("trigger.threshold.pixel.", *it);
     2319            const uint16_t th1 = conf.GetDef<uint16_t>("trigger.threshold.patch.", *it);
     2320
     2321            for (int i=0; i<=FTM::StaticData::kMaxPatchIdx; i++)
     2322            {
     2323                data[i].fDAC[0] = th0;
     2324                data[i].fDAC[1] = th0;
     2325                data[i].fDAC[2] = th0;
     2326                data[i].fDAC[3] = th0;
     2327                data[i].fDAC[4] = th1;
     2328            }
     2329
    23162330            fConfigs[*it] = data;
     2331
     2332            // trigger.threshold.dac-0:
    23172333
    23182334            /*
     
    23972413        ("trigger.disable-pixel.*",              vars<uint16_t>(), "")
    23982414        ("trigger.disable-patch.*",              vars<uint16_t>(), "")
     2415        ("trigger.threshold.pixel.*",            var<uint16_t>(),  "")
     2416        ("trigger.threshold.patch.*",            var<uint16_t>(),  "")
    23992417        ("ftu-report-interval.*",                var<uint16_t>(),  "")
    24002418        ("light-pulser.external.enable-group1.*", var<bool>(),     "Enable LED group 1 of external light pulser")
Note: See TracChangeset for help on using the changeset viewer.