Changeset 14433 for trunk/FACT++/src/ratecontrol.cc
- Timestamp:
- 10/02/12 10:14:40 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ratecontrol.cc
r14354 r14433 167 167 for (int i=0; i<40; i++) 168 168 { 169 if (fBlock[i]) 170 { 171 fBlock[i] = false; 172 continue; 173 } 174 169 175 int maxi = -1; 170 176 … … 186 192 } 187 193 188 if (fBlock[i])189 {190 fBlock[i] = false;191 continue;192 }193 194 194 for (int j=0; j<4; j++) 195 195 { … … 441 441 return RateControl::State::kDisconnected; 442 442 443 if (GetCurrentState()==RateControl::State::kSettingGlobalThreshold) 443 const bool inprog = fEnabled && fTriggerOn && fDimRS.state()<RateScan::State::kConfiguring; 444 445 switch (GetCurrentState()) 446 { 447 case RateControl::State::kSettingGlobalThreshold: 444 448 return RateControl::State::kSettingGlobalThreshold; 445 449 446 if (GetCurrentState()==RateControl::State::kGlobalThresholdSet) 447 return RateControl::State::kGlobalThresholdSet; 448 449 if (fEnabled && fTriggerOn && fDimRS.state()<RateScan::State::kConfiguring) 450 return RateControl::State::kInProgress; 451 452 return RateControl::State::kConnected; 450 case RateControl::State::kGlobalThresholdSet: 451 if (!inprog) 452 return RateControl::State::kGlobalThresholdSet; 453 454 case RateControl::State::kInProgress: 455 if (inprog) 456 return RateControl::State::kInProgress; 457 } 458 459 return RateControl::State::kInConnected; 453 460 } 454 461 … … 487 494 "All needed subsystems are connected to their hardware, no action is performed."); 488 495 489 AddStateName(RateControl::State::kSettingGlobalThreshold, "Calibrating", ""); 490 AddStateName(RateControl::State::kGlobalThresholdSet, "GlobalThresholdSet", ""); 496 AddStateName(RateControl::State::kSettingGlobalThreshold, "Calibrating", 497 "A global minimum thrshold is currently determined."); 498 499 AddStateName(RateControl::State::kGlobalThresholdSet, "GlobalThresholdSet", 500 "A global threshold has ben set, waiting for the trigger to be switched on."); 491 501 492 502 AddStateName(RateControl::State::kInProgress, "InProgress", 493 "Rate scanin progress.");503 "Rate control in progress."); 494 504 495 505 AddEvent("CALIBRATE") 496 506 (bind(&StateMachineRateControl::Calibrate, this)) 497 (" ");507 ("Start a search for a reasonable minimum global threshold"); 498 508 499 509 AddEvent("START", "", RateControl::State::kConnected, RateControl::State::kGlobalThresholdSet) 500 510 (bind(&StateMachineRateControl::StartRC, this)) 501 (" ");511 ("Enable rate control (it will start when the trigger is on and a calibration was successfull)"); 502 512 503 513 AddEvent("STOP", "", RateControl::State::kSettingGlobalThreshold, RateControl::State::kInProgress) 504 514 (bind(&StateMachineRateControl::StopRC, this)) 505 (" ");515 ("Stop rat control"); 506 516 507 517 AddEvent("SET_MIN_THRESHOLD", "I:1") 508 518 (bind(&StateMachineRateControl::SetMinThreshold, this, placeholders::_1)) 509 (" ");519 ("Set a minimum threshold at which th rate control starts calibrating"); 510 520 511 521 AddEvent("SET_TARGET_RATE", "F:1") 512 522 (bind(&StateMachineRateControl::SetTargetRate, this, placeholders::_1)) 513 (" ");523 ("Set a target trigger rate for the calibration"); 514 524 515 525 AddEvent("PRINT") 516 526 (bind(&StateMachineRateControl::Print, this)) 517 (" ");527 ("Print current status"); 518 528 519 529 AddEvent("SET_VERBOSE", "B")
Note:
See TracChangeset
for help on using the changeset viewer.