#include <CalibrationControllerImpl.h>
Inheritance diagram for SctCalibrationController::CalibrationControllerImpl:
Public Member Functions | |||||||
virtual void | shutdown () | ||||||
Initializes the singleton - should only be called by main or the RunController. | |||||||
Overrides | |||||||
| |||||||
virtual Sct_CalibrationController::ScanLibrary_ptr | getScanLibrary () | ||||||
virtual Sct_CalibrationController::TestLibrary_ptr | getTestLibrary () | ||||||
virtual Sct_CalibrationController::SequenceLibrary_ptr | getSequenceLibrary () | ||||||
virtual void | doScan (Sct_CalibrationController::ScanRequest_ptr r) | ||||||
virtual void | doTest (Sct_CalibrationController::TestRequest_ptr t) | ||||||
virtual void | doSequence (Sct_CalibrationController::SequenceRequest_ptr r) | ||||||
virtual void | abort () | ||||||
virtual Sct_SctApi::Scan_ptr | getScan (unsigned long runNumber, unsigned long scanNumber) | ||||||
virtual void | setUpdateOption (Sct_CalibrationController::CalibrationController::UpdateOption opt) | ||||||
virtual void | updateWith (const char *testResultInIs, bool force) | ||||||
Internal for communication with RunControl: | |||||||
| |||||||
void | setApi (Sct_SctApi::SctApiIPC_ptr api) | ||||||
Sets the SctApi reference. | |||||||
void | takeControl (unsigned int runNumber) | ||||||
The RunController calls this to tell the CC to take control The CC is then in charge until giveupControl is called. | |||||||
void | giveupControl () | ||||||
Called when the CC is no longer in charge. | |||||||
void | reset () | ||||||
Called when a reset is requested. | |||||||
Internal for use by other classes | |||||||
| |||||||
Sct_SctApi::SctApiIPC_ptr | getApi () | ||||||
Get the handle to the SctApi. | |||||||
unsigned int | getRunNumber () const | ||||||
Get the current run number. | |||||||
unsigned int | getNextScanNumber () const | ||||||
Get the number of the next scan. | |||||||
Static Public Member Functions | |||||||
static CalibrationControllerImpl & | initialize (RunControl &rc) | ||||||
static Sct_CalibrationController::CalibrationController_ptr | instance () | ||||||
Gets the CC instance. | |||||||
Private Member Functions | |||||||
CalibrationControllerImpl (RunControl &rc) | |||||||
virtual | ~CalibrationControllerImpl () | ||||||
void | updateStatus () | ||||||
bool | isInControl () | ||||||
bool | isBusy () | ||||||
void | setBusy (bool busy) | ||||||
void | executeSequence (Sct_CalibrationController::SequenceRequest_ptr sr) | ||||||
Executes a sequence. | |||||||
auto_ptr< Test > | executeTest (Sct_CalibrationController::TestRequest_ptr tr, boost::shared_ptr< const Sequence > s) | ||||||
Executes a Test
| |||||||
void | executeScan (Sct_CalibrationController::ScanRequest_ptr s, unsigned int index) | ||||||
Executes a Scan and waits for the Scan to be completed
| |||||||
void | applyChanges (const unsigned long runNumber, const unsigned long scanNumber, const std::list< std::string > &list) | ||||||
Applies changes from the TestResults for a given run and scan number to a list of modules
| |||||||
void | sctApiError (SctApiAccessException &e) | ||||||
Should be called by all nothrow methods when they catch an SctApiAccessException. | |||||||
void | setNextScanNumber (unsigned int scanNumber) | ||||||
Sets the next scan number . | |||||||
Static Private Member Functions | |||||||
static std::list< std::string > | getAllModulesForScan (Sct_SctApi::Scan_ptr scan) | ||||||
Utility function: get all modules in all modulegroups for a particular scan. | |||||||
static CalibrationControllerImpl * | underlyingInstance () | ||||||
Private Attributes | |||||||
Sct_SctApi::SctApiIPC_ptr | m_api | ||||||
CalibrationControllerStatus | status | ||||||
Our current status. | |||||||
RunControl & | rc | ||||||
The RunController. | |||||||
unsigned int | runNumber | ||||||
The current run number. | |||||||
unsigned int | nextScanNumber | ||||||
The number of the next scan. | |||||||
volatile bool | abortNow | ||||||
Flag used to indicate the user has requested an abort. | |||||||
volatile bool | abortRightNow | ||||||
Flag used to indicate that the Api is no longer running and we should not wait for the end of the current scan. | |||||||
boost::thread_group | m_sequence_request_thread_group | ||||||
The worker group that handles executing sequences. | |||||||
Static Private Attributes | |||||||
static CalibrationControllerImpl * | inst | ||||||
The singleton object. Not valid until initialize has been called. | |||||||
Friends | |||||||
class | SequenceRequestWorker | ||||||
The worker group class. |
A singleton, it controls the synchronisation of the various tasks required during testing and calibration.
There is an abort method which allows the premature termination of a sequence or test after the end of the current scan.
Maintains a reference to a SctApi, to which it forwards requests for scans. Requests for sequencees, tests and scans can be made only when in control.
Publishes its status in IS as CalibrationControllerStatus.
Definition at line 45 of file CalibrationControllerImpl.h.
|
If the CC is not busy there is nothing to abort, so ignore: Definition at line 154 of file CalibrationControllerImpl.cpp. References abortNow, abortRightNow, CalibrationControllerStatus::BUSY, getApi(), CalibrationControllerStatus::status, and status. Here is the call graph for this function: ![]() |
|
Applies changes from the TestResults for a given run and scan number to a list of modules
Definition at line 273 of file CalibrationControllerImpl.cpp. References getApi(), SctCalibrationController::ConfigUpdaterManager::instance(), Sct::IS::IOManagerIS::instance(), status, SctCalibrationController::ConfigUpdaterManager::update(), and CalibrationControllerStatus::updateOption. Referenced by executeSequence(). Here is the call graph for this function: ![]() |
|
Executes a Scan and waits for the Scan to be completed
Definition at line 548 of file CalibrationControllerImpl.cpp. References CalibrationControllerStatus::currentScanIndex, getApi(), nextScanNumber, status, and updateStatus(). Here is the call graph for this function: ![]() |
|
Executes a sequence.
Definition at line 172 of file CalibrationControllerImpl.cpp. References applyChanges(), SctCalibrationController::Sequence::create(), CalibrationControllerStatus::currentSequence, executeTest(), getApi(), getNextScanNumber(), getRunNumber(), nextScanNumber, runNumber, sctApiError(), Sct::AbstractThrowable::sendToMrs(), status, and updateStatus(). Referenced by SctCalibrationController::SequenceRequestWorker::operator()(). Here is the call graph for this function: ![]() |
|
Executes a Test
Referenced by executeSequence(). |
|
Utility function: get all modules in all modulegroups for a particular scan.
|
|
Get the handle to the SctApi.
Definition at line 71 of file CalibrationControllerImpl.cpp. References m_api. Referenced by abort(), applyChanges(), executeScan(), executeSequence(), setNextScanNumber(), and updateWith(). |
|
Get the number of the next scan.
Definition at line 144 of file CalibrationControllerImpl.cpp. References nextScanNumber. Referenced by executeSequence(). |
|
Get the current run number.
Definition at line 140 of file CalibrationControllerImpl.cpp. References runNumber. Referenced by executeSequence(). |
|
Called when the CC is no longer in charge.
Definition at line 115 of file CalibrationControllerImpl.cpp. References CalibrationControllerStatus::INCONTROL, CalibrationControllerStatus::LOADED, CalibrationControllerStatus::status, status, and updateStatus(). Referenced by SctCalibrationController::RunControl::sctApiError(), and SctCalibrationController::RunControl::stopEFAction(). Here is the call graph for this function: ![]() |
|
|
Called when a reset is requested.
Definition at line 92 of file CalibrationControllerImpl.cpp. References CalibrationControllerStatus::LOADED, m_api, CalibrationControllerStatus::status, status, and updateStatus(). Referenced by SctCalibrationController::RunControl::resetAction(), and SctCalibrationController::RunControl::unloadAction(). Here is the call graph for this function: ![]() |
|
Should be called by all nothrow methods when they catch an SctApiAccessException. Informs the RunController that an exception has occured and puts it into an error state Definition at line 99 of file CalibrationControllerImpl.cpp. References rc, SctCalibrationController::RunControl::sctApiError(), updateStatus(), and Sct::AbstractThrowable::what(). Referenced by executeSequence(). Here is the call graph for this function: ![]() |
|
Sets the SctApi reference.
Definition at line 88 of file CalibrationControllerImpl.cpp. References m_api. Referenced by SctCalibrationController::RunControl::loadAction(). |
|
Sets the next scan number .
Definition at line 148 of file CalibrationControllerImpl.cpp. References getApi(), and nextScanNumber. Here is the call graph for this function: ![]() |
|
Initializes the singleton - should only be called by main or the RunController.
Definition at line 50 of file CalibrationControllerImpl.h. |
|
The RunController calls this to tell the CC to take control The CC is then in charge until giveupControl is called.
Definition at line 104 of file CalibrationControllerImpl.cpp. References CalibrationControllerStatus::INCONTROL, CalibrationControllerStatus::LOADED, m_api, nextScanNumber, CalibrationControllerStatus::status, status, and updateStatus(). Referenced by SctCalibrationController::RunControl::prepareAction(). Here is the call graph for this function: ![]() |
|
The worker group class.
Definition at line 184 of file CalibrationControllerImpl.h. Referenced by doSequence(). |
|
Flag used to indicate the user has requested an abort.
Definition at line 178 of file CalibrationControllerImpl.h. Referenced by abort(). |
|
Flag used to indicate that the Api is no longer running and we should not wait for the end of the current scan.
Definition at line 179 of file CalibrationControllerImpl.h. Referenced by abort(). |
|
The singleton object. Not valid until initialize has been called.
Definition at line 180 of file CalibrationControllerImpl.h. Referenced by initialize(), instance(), underlyingInstance(), and ~CalibrationControllerImpl(). |
|
The worker group that handles executing sequences.
Definition at line 181 of file CalibrationControllerImpl.h. Referenced by doSequence(). |
|
The number of the next scan.
Definition at line 177 of file CalibrationControllerImpl.h. Referenced by executeScan(), executeSequence(), getNextScanNumber(), setNextScanNumber(), and takeControl(). |
|
The RunController.
Definition at line 175 of file CalibrationControllerImpl.h. Referenced by initialize(), and sctApiError(). |
|
The current run number.
Definition at line 176 of file CalibrationControllerImpl.h. Referenced by executeSequence(), and getRunNumber(). |
|
Our current status.
Definition at line 174 of file CalibrationControllerImpl.h. Referenced by abort(), applyChanges(), CalibrationControllerImpl(), doSequence(), executeScan(), executeSequence(), giveupControl(), isBusy(), isInControl(), SctCalibrationController::SequenceRequestWorker::operator()(), reset(), setBusy(), setUpdateOption(), takeControl(), and updateStatus(). |