#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 | |||||
all nothrow | |||||
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 | |||||
CalibrationControllerImpl & | initialize (RunControl &rc) | ||||
Sct_CalibrationController::CalibrationController_ptr | instance () | ||||
Gets the CC instance. | |||||
Private Member Functions | |||||
CalibrationControllerImpl (RunControl &rc) | |||||
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 | |||||
std::list< string > | getAllModulesForScan (Sct_SctApi::Scan_ptr scan) | ||||
Utility function: get all modules in all modulegroups for a particular scan. | |||||
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 | |||||
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 39 of file CalibrationControllerImpl.h.
|
If the CC is not busy there is nothing to abort, so ignore: Definition at line 151 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 254 of file CalibrationControllerImpl.cpp. References getApi(), status, 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 471 of file CalibrationControllerImpl.cpp. References abortNow, abortRightNow, CalibrationControllerStatus::currentScanIndex, getApi(), nextScanNumber, and status. Referenced by executeTest(). |
Here is the call graph for this function:
|
Executes a sequence.
Definition at line 169 of file CalibrationControllerImpl.cpp. References applyChanges(), CalibrationControllerStatus::currentSequence, executeTest(), getApi(), getNextScanNumber(), getRunNumber(), nextScanNumber, runNumber, sctApiError(), and status. Referenced by SctCalibrationController::SequenceRequestWorker::operator()(). |
Here is the call graph for this function:
|
Executes a Test
Definition at line 366 of file CalibrationControllerImpl.cpp. References abortNow, abortRightNow, CalibrationControllerStatus::currentTest, executeScan(), getApi(), nextScanNumber, TestData::nScans, runNumber, TestData::runNumber, sctApiError(), setNextScanNumber(), TestData::startScanNumber, status, TestData::testName, TestData::testPoints, TestData::testPoints_size, and TestData::testVariable. Referenced by executeSequence(). |
Here is the call graph for this function:
|
Utility function: get all modules in all modulegroups for a particular scan.
|
|
Get the handle to the SctApi.
Definition at line 68 of file CalibrationControllerImpl.cpp. Referenced by abort(), applyChanges(), executeScan(), executeSequence(), executeTest(), and setNextScanNumber(). |
|
Get the number of the next scan.
Definition at line 141 of file CalibrationControllerImpl.cpp. References nextScanNumber. Referenced by executeSequence(). |
|
Get the current run number.
Definition at line 137 of file CalibrationControllerImpl.cpp. References runNumber. Referenced by executeSequence(). |
|
Called when the CC is no longer in charge.
Definition at line 112 of file CalibrationControllerImpl.cpp. References CalibrationControllerStatus::INCONTROL, CalibrationControllerStatus::LOADED, CalibrationControllerStatus::status, and status. |
|
Gets the CC instance.
Definition at line 536 of file CalibrationControllerImpl.cpp. References inst. |
|
Called when a reset is requested.
Definition at line 89 of file CalibrationControllerImpl.cpp. References CalibrationControllerStatus::LOADED, CalibrationControllerStatus::status, and status. |
|
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 96 of file CalibrationControllerImpl.cpp. References rc, and Sct::AbstractThrowable::what(). Referenced by executeSequence(), and executeTest(). |
Here is the call graph for this function:
|
Sets the SctApi reference.
Definition at line 85 of file CalibrationControllerImpl.cpp. |
|
Sets the next scan number .
Definition at line 145 of file CalibrationControllerImpl.cpp. References getApi(), and nextScanNumber. Referenced by executeTest(). |
Here is the call graph for this function:
|
Initializes the singleton - should only be called by main or the RunController.
Definition at line 44 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 101 of file CalibrationControllerImpl.cpp. References CalibrationControllerStatus::INCONTROL, CalibrationControllerStatus::LOADED, nextScanNumber, CalibrationControllerStatus::status, and status. |
|
The worker group class.
Definition at line 178 of file CalibrationControllerImpl.h. |
|
Flag used to indicate the user has requested an abort.
Definition at line 172 of file CalibrationControllerImpl.h. Referenced by abort(), executeScan(), and executeTest(). |
|
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 173 of file CalibrationControllerImpl.h. Referenced by abort(), executeScan(), and executeTest(). |
|
The singleton object. Not valid until initialize has been called.
Definition at line 589 of file CalibrationControllerImpl.cpp. Referenced by instance(). |
|
The worker group that handles executing sequences.
Definition at line 176 of file CalibrationControllerImpl.h. |
|
The number of the next scan.
Definition at line 171 of file CalibrationControllerImpl.h. Referenced by executeScan(), executeSequence(), executeTest(), getNextScanNumber(), setNextScanNumber(), and takeControl(). |
|
The RunController.
Definition at line 169 of file CalibrationControllerImpl.h. Referenced by sctApiError(). |
|
The current run number.
Definition at line 170 of file CalibrationControllerImpl.h. Referenced by executeSequence(), executeTest(), and getRunNumber(). |
|
Our current status.
Definition at line 168 of file CalibrationControllerImpl.h. Referenced by abort(), applyChanges(), executeScan(), executeSequence(), executeTest(), giveupControl(), SctCalibrationController::SequenceRequestWorker::operator()(), reset(), and takeControl(). |