- Timestamp:
- 11/27/11 10:33:59 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ratescan.cc
r12555 r12654 68 68 DimDescribedService fDimProc; 69 69 70 int fCounter;71 70 int fSeconds; 72 73 71 int fSecondsMax; 72 73 int fThreshold; 74 74 int fThresholdMin; 75 75 int fThresholdMax; … … 154 154 return; 155 155 156 if (f Counter<0/* || fStatusFTM.second!=FTM::kTakingData*/)156 if (fThreshold<0/* || fStatusFTM.second!=FTM::kTakingData*/) 157 157 return; 158 158 … … 176 176 { 177 177 Message("Rate scan stopped due zero trigger rate."); 178 f Counter= -1;178 fThreshold = -1; 179 179 return; 180 180 } … … 208 208 209 209 const double time = sdata.fElapsedTime*fSeconds; 210 const uint32_t th = fThreshold Min+fCounter*fThresholdStep;210 const uint32_t th = fThreshold; 211 211 212 212 float data[2+3+1+40+160]; … … 237 237 fDimData.Update(); 238 238 239 f Counter++;239 fThreshold += fThresholdStep; 240 240 241 241 if (fSeconds>=fSecondsMax) 242 242 { 243 243 Message("Rate scan stopped due to timeout."); 244 f Counter=-1;244 fThreshold=-1; 245 245 return; 246 246 } 247 247 248 if (fThreshold Min+fCounter*fThresholdStep>fThresholdMax)248 if (fThreshold>fThresholdMax) 249 249 { 250 250 Message("Rate scan finished."); 251 fCounter = -1; 252 253 //DimClient::sendCommandNB("FTM_CONTROL/STOP_TRIGGER", NULL, 0); 251 fThreshold = -1; 254 252 return; 255 253 } … … 257 255 fSeconds = -2; // FIXME: In principle one missed report is enough 258 256 259 const int32_t cmd[2] = { -1, fThreshold Min+fCounter*fThresholdStep};257 const int32_t cmd[2] = { -1, fThreshold }; 260 258 DimClient::sendCommandNB(fCommand.c_str(), (void*)cmd, 8); 261 259 } … … 324 322 //Dim::SendCommand("FTM_CONTROL/STOP_TRIGGER"); 325 323 326 f Counter = 0;324 fThreshold = fThresholdMin; 327 325 fSeconds = -2; 328 326 … … 338 336 int StopRateScan() 339 337 { 340 f Counter= -1;338 fThreshold = -1; 341 339 Message("Rate scan manually stopped."); 342 340 … … 431 429 // At least one subsystem is not connected 432 430 // if (fStatusFTM.second>=FTM::kConnected) 433 return f Counter<0 ? kStateConnected : kStateInProgress;431 return fThreshold<0 ? kStateConnected : kStateInProgress; 434 432 } 435 433 … … 447 445 "|max[DAC]:Value at which scan will end" 448 446 "|step[DAC]:Step size for scan"), 449 f Counter(-1), fReference(kCamera), fReferenceIdx(0)447 fThreshold(-1), fReference(kCamera), fReferenceIdx(0) 450 448 { 451 449 // ba::io_service::work is a kind of keep_alive for the loop.
Note:
See TracChangeset
for help on using the changeset viewer.