Changeset 13915
- Timestamp:
- 05/26/12 14:45:53 (12 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ratecontrol.cc
r13894 r13915 16 16 17 17 #include "HeadersFTM.h" 18 #include "HeadersRateControl.h" 18 19 19 20 namespace ba = boost::asio; … … 33 34 { 34 35 private: 35 enum states_t36 {37 kStateDimNetworkNA = 1,38 kStateDisconnected,39 kStateConnecting,40 kStateConnected,41 42 kStateSettingGlobalThreshold,43 kStateGlobalThresholdSet,44 45 kStateInProgress,46 };47 48 36 bool fTriggerOn; 49 37 … … 351 339 const FTM::DimTriggerRates &sdata = *static_cast<const FTM::DimTriggerRates*>(evt.GetData()); 352 340 353 if (GetCurrentState()== kStateSettingGlobalThreshold)341 if (GetCurrentState()==RateControl::State::kSettingGlobalThreshold) 354 342 ProcessCamera(sdata); 355 343 356 if (GetCurrentState()== kStateInProgress)344 if (GetCurrentState()==RateControl::State::kInProgress) 357 345 ProcessPatches(sdata); 358 346 … … 365 353 { 366 354 Info("Trigger not switched on... CALIBRATE command ignored."); 367 return kStateGlobalThresholdSet;355 return RateControl::State::kGlobalThresholdSet; 368 356 } 369 357 … … 382 370 Info(out); 383 371 384 return kStateSettingGlobalThreshold;372 return RateControl::State::kSettingGlobalThreshold; 385 373 } 386 374 … … 458 446 459 447 if (!fDim.online()) 460 return kStateDimNetworkNA;448 return RateControl::State::kDimNetworkNA; 461 449 462 450 // All subsystems are not connected 463 if (fDimFTM.state()<FTM:: kConnected)464 return kStateDisconnected;465 466 if (GetCurrentState()== kStateSettingGlobalThreshold)451 if (fDimFTM.state()<FTM::State::kConnected) 452 return RateControl::State::kDisconnected; 453 454 if (GetCurrentState()==RateControl::State::kSettingGlobalThreshold) 467 455 { 468 456 if (fTriggerRate<0 || fTriggerRate>fTargetRate) 469 return kStateSettingGlobalThreshold;470 471 return kStateGlobalThresholdSet;472 } 473 474 if (GetCurrentState()== kStateGlobalThresholdSet)457 return RateControl::State::kSettingGlobalThreshold; 458 459 return RateControl::State::kGlobalThresholdSet; 460 } 461 462 if (GetCurrentState()==RateControl::State::kGlobalThresholdSet) 475 463 { 476 464 if (!fTriggerOn) 477 return kStateGlobalThresholdSet;478 //return kStateInProgress;465 return RateControl::State::kGlobalThresholdSet; 466 //return RateControl::State::kInProgress; 479 467 } 480 468 481 469 // At least one subsystem is not connected 482 470 // if (fDimFTM.state()>=FTM::kConnected) 483 return fTriggerOn && fEnabled && fDimRS.state()<5 ? kStateInProgress : kStateConnected;471 return fTriggerOn && fEnabled && fDimRS.state()<5 ? RateControl::State::kInProgress : RateControl::State::kConnected; 484 472 } 485 473 … … 507 495 508 496 // State names 509 AddStateName( kStateDimNetworkNA, "DimNetworkNotAvailable",497 AddStateName(RateControl::State::kDimNetworkNA, "DimNetworkNotAvailable", 510 498 "The Dim DNS is not reachable."); 511 499 512 AddStateName( kStateDisconnected, "Disconnected",500 AddStateName(RateControl::State::kDisconnected, "Disconnected", 513 501 "The Dim DNS is reachable, but the required subsystems are not available."); 514 502 515 AddStateName( kStateConnected, "Connected",503 AddStateName(RateControl::State::kConnected, "Connected", 516 504 "All needed subsystems are connected to their hardware, no action is performed."); 517 505 518 AddStateName( kStateSettingGlobalThreshold, "Calibrating", "");519 AddStateName( kStateGlobalThresholdSet, "GlobalThresholdSet", "");520 521 AddStateName( kStateInProgress, "InProgress",506 AddStateName(RateControl::State::kSettingGlobalThreshold, "Calibrating", ""); 507 AddStateName(RateControl::State::kGlobalThresholdSet, "GlobalThresholdSet", ""); 508 509 AddStateName(RateControl::State::kInProgress, "InProgress", 522 510 "Rate scan in progress."); 523 511
Note:
See TracChangeset
for help on using the changeset viewer.