Changeset 17644 for trunk/FACT++/src
- Timestamp:
- 04/03/14 16:07:02 (11 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/HeadersRateScan.h
r13918 r17644 14 14 kConfiguring, 15 15 kInProgress, 16 kPaused, 16 17 }; 17 18 } -
trunk/FACT++/src/ratescan.cc
r16866 r17644 37 37 DimDescribedService fDimProc; 38 38 39 bool fAutoPause; 40 39 41 int fCounter; 40 42 int fCounterMax; … … 93 95 return GetCurrentState(); 94 96 95 if (GetCurrentState() !=RateScan::State::kInProgress)97 if (GetCurrentState()<RateScan::State::kInProgress) 96 98 return GetCurrentState(); 97 99 … … 100 102 if (++fCounter<0) 101 103 return GetCurrentState(); 104 105 if (GetCurrentState()==RateScan::State::kPaused) 106 fCounter=0; 102 107 103 108 if (fCounter==0) … … 285 290 Message(msg); 286 291 287 return RateScan::State::kInProgress; 292 if (!fAutoPause) 293 return RateScan::State::kInProgress; 294 295 fAutoPause = false; 296 297 return RateScan::State::kPaused; 288 298 } 289 299 290 300 int StopRateScan() 291 301 { 292 if (GetCurrentState() !=RateScan::State::kConfiguring && GetCurrentState()!=RateScan::State::kInProgress)302 if (GetCurrentState()<RateScan::State::kConfiguring) 293 303 return GetCurrentState(); 294 304 … … 364 374 365 375 return GetCurrentState(); 376 } 377 378 int TriggerAutoPause(const EventImp &evt) 379 { 380 fAutoPause = true; 381 return GetCurrentState(); 382 } 383 384 int Pause() 385 { 386 return RateScan::State::kPaused; 387 } 388 389 int Resume() 390 { 391 return RateScan::State::kInProgress; 366 392 } 367 393 … … 398 424 "|max[DAC]:Value at which scan will end" 399 425 "|step[DAC]:Step size for scan"), 400 f Threshold(-1), fReference(kCamera), fReferenceIdx(0)426 fAutoPause(false), fThreshold(-1), fReference(kCamera), fReferenceIdx(0) 401 427 { 402 428 // ba::io_service::work is a kind of keep_alive for the loop. … … 430 456 "Rate scan in progress."); 431 457 458 AddStateName(RateScan::State::kPaused, "Paused", 459 "Rate scan in progress but paused."); 460 432 461 AddEvent("START_THRESHOLD_SCAN", "I:3", RateScan::State::kConnected) 433 462 (bind(&StateMachineRateScan::StartRateScan, this, placeholders::_1, "SET_THRESHOLD")) … … 444 473 "|step[int]:Single step in DAC counts"); 445 474 446 AddEvent("CHANGE_STEP_SIZE", "I:1", RateScan::State::k InProgress)475 AddEvent("CHANGE_STEP_SIZE", "I:1", RateScan::State::kPaused, RateScan::State::kInProgress) 447 476 (bind(&StateMachineRateScan::ChangeStepSize, this, placeholders::_1)) 448 477 ("Change the step size during a ratescan in progress" 449 478 "|step[int]:Single step in DAC counts"); 450 479 451 AddEvent("CHANGE_MAXIMUM", "I:1", RateScan::State::k InProgress)480 AddEvent("CHANGE_MAXIMUM", "I:1", RateScan::State::kPaused, RateScan::State::kInProgress) 452 481 (bind(&StateMachineRateScan::ChangeMaximum, this, placeholders::_1)) 453 482 ("Change the maximum limit during a ratescan in progress" 454 483 "|max[int]:Limiting value in DAC counts"); 455 484 456 AddEvent("STOP", RateScan::State::kConfiguring, RateScan::State::k InProgress)485 AddEvent("STOP", RateScan::State::kConfiguring, RateScan::State::kPaused, RateScan::State::kInProgress) 457 486 (bind(&StateMachineRateScan::StopRateScan, this)) 458 487 ("Stop a ratescan in progress"); … … 469 498 ("Use the given patch trigger-rate as reference for the reolution" 470 499 "|patch[idx]:Index of the patch (360*crate+36*board+patch)"); 500 501 AddEvent("TRIGGER_AUTO_PAUSE", RateScan::State::kDimNetworkNA, RateScan::State::kDisconnected, RateScan::State::kConnected) 502 (bind(&StateMachineRateScan::TriggerAutoPause, this, placeholders::_1)) 503 ("Enable an automatic pause for the next ratescan, after it got configured."); 504 505 AddEvent("PAUSE", RateScan::State::kInProgress) 506 (bind(&StateMachineRateScan::Pause, this)) 507 ("Pause a ratescan in progress"); 508 AddEvent("RESUME", RateScan::State::kPaused) 509 (bind(&StateMachineRateScan::Resume, this)) 510 ("Resume a paused ratescan"); 471 511 472 512 AddEvent("PRINT")
Note:
See TracChangeset
for help on using the changeset viewer.