Changeset 11630
- Timestamp:
- 07/26/11 21:09:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ftmctrl.cc
r11595 r11630 678 678 bool SetThreshold(int32_t patch, int32_t value) 679 679 { 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) 684 684 return false; 685 685 … … 689 689 690 690 bool ident = true; 691 for (int i=0; i< 160; i++)691 for (int i=0; i<=FTM::StaticData::kMaxPatchIdx; i++) 692 692 if (data[i/4].fDAC[patch%4] != value) 693 693 { … … 699 699 return true; 700 700 701 for (int i=0; i< 160; i++)701 for (int i=0; i<=FTM::StaticData::kMaxPatchIdx; i++) 702 702 data[i/4].fDAC[i%4] = value; 703 703 … … 2242 2242 !CheckConfigVal<uint16_t>(conf, data.kMaxIntensity, "light-pulser.external.intensity.", *it) || 2243 2243 !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) || 2244 2246 0) 2245 2247 return 2; … … 2314 2316 } 2315 2317 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 2316 2330 fConfigs[*it] = data; 2331 2332 // trigger.threshold.dac-0: 2317 2333 2318 2334 /* … … 2397 2413 ("trigger.disable-pixel.*", vars<uint16_t>(), "") 2398 2414 ("trigger.disable-patch.*", vars<uint16_t>(), "") 2415 ("trigger.threshold.pixel.*", var<uint16_t>(), "") 2416 ("trigger.threshold.patch.*", var<uint16_t>(), "") 2399 2417 ("ftu-report-interval.*", var<uint16_t>(), "") 2400 2418 ("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.