#include <CalibrationControllerImpl.h>
Inheritance diagram for SctCalibrationController::CalibrationControllerImpl:
Public Member Functions | |||||
Overrides | |||||
all nothrow | |||||
virtual ScanLibrary & | getScanLibrary () const | ||||
virtual TestLibrary & | getTestLibrary () const | ||||
virtual SequenceLibrary & | getSequenceLibrary () const | ||||
virtual void | doScan (boost::shared_ptr< ScanRequest > r) | ||||
virtual void | doTest (boost::shared_ptr< TestRequest > t) | ||||
virtual void | doSequence (boost::shared_ptr< SequenceRequest > r) | ||||
virtual void | abort () | ||||
virtual Sct_SctApi_T_Scan * | getScan (unsigned long runNumber, unsigned long scanNumber) const | ||||
virtual void | setUpdateOption (Sct_CalibrationController_T_CalibrationController_UpdateOption) | ||||
virtual void | updateWith (ilu_T_CString testResultInIs) | ||||
Internal for communication with RunControl: | |||||
| |||||
void | setApi (Sct_SctApi_T_SctApi &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_T_SctApi * | getApi () const | ||||
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) | ||||
Initializes the singleton - should only be called by main or the RunController. | |||||
CalibrationControllerImpl & | instance () | ||||
Gets the CC instance. | |||||
Private Member Functions | |||||
CalibrationControllerImpl (RunControl &rc) | |||||
void | updateStatus () | ||||
bool | isInControl () | ||||
bool | isBusy () | ||||
void | setBusy (bool busy) | ||||
void | executeSequence (SequenceRequest &sr) | ||||
Executes a sequence. | |||||
auto_ptr< Test > | executeTest (TestRequest &tr, boost::shared_ptr< const Sequence > s) | ||||
Executes a Test
| |||||
void | executeScan (ScanRequest &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_T_Scan *scan) | ||||
Utility function: get all modules in all modulegroups for a particular scan. | |||||
Private Attributes | |||||
Sct_SctApi_T_SctApi * | 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.
|
Applies changes from the TestResults for a given run and scan number to a list of modules
Definition at line 215 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 404 of file CalibrationControllerImpl.cpp. References abortNow, abortRightNow, SctCalibrationController::Ipc::ScanRequest::clockByTwo(), SctCalibrationController::Ipc::ScanRequest::configureModules(), CalibrationControllerStatus::currentScanIndex, SctCalibrationController::Ipc::ScanRequest::delay(), SctCalibrationController::Ipc::ScanRequest::getScan(), SctCalibrationController::Ipc::ScanRequest::isRaw(), nextScanNumber, status, and SctCalibrationController::Ipc::ScanRequest::width(). Referenced by executeTest(). |
Here is the call graph for this function:
|
Executes a sequence.
Definition at line 146 of file CalibrationControllerImpl.cpp. References applyChanges(), SctCalibrationController::Ipc::TestRequest::canFeedback(), CalibrationControllerStatus::currentSequence, SctCalibrationController::Ipc::SequenceRequest::endSequence(), executeTest(), getNextScanNumber(), SctCalibrationController::Ipc::SequenceRequest::getNextTest(), getRunNumber(), nextScanNumber, runNumber, sctApiError(), SctCalibrationController::Ipc::SequenceRequest::startSequence(), and status. Referenced by SctCalibrationController::SequenceRequestWorker::operator()(). |
Here is the call graph for this function:
|
Executes a Test
Definition at line 323 of file CalibrationControllerImpl.cpp. References abortNow, abortRightNow, CalibrationControllerStatus::currentTest, SctCalibrationController::Ipc::TestRequest::endTest(), executeScan(), SctCalibrationController::Ipc::TestRequest::getNextScan(), SctCalibrationController::Ipc::ScanRequest::getScan(), nextScanNumber, TestData::nScans, runNumber, TestData::runNumber, sctApiError(), setNextScanNumber(), TestData::startScanNumber, SctCalibrationController::Ipc::TestRequest::startTest(), 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 63 of file CalibrationControllerImpl.cpp. Referenced by applyChanges(). |
|
Get the number of the next scan.
Definition at line 123 of file CalibrationControllerImpl.cpp. References nextScanNumber. Referenced by executeSequence(). |
|
Get the current run number.
Definition at line 119 of file CalibrationControllerImpl.cpp. References runNumber. Referenced by executeSequence(). |
|
Called when the CC is no longer in charge.
Definition at line 94 of file CalibrationControllerImpl.cpp. References CalibrationControllerStatus::INCONTROL, CalibrationControllerStatus::LOADED, CalibrationControllerStatus::status, and status. |
|
Initializes the singleton - should only be called by main or the RunController.
Definition at line 437 of file CalibrationControllerImpl.cpp. References inst. |
|
Gets the CC instance.
Definition at line 442 of file CalibrationControllerImpl.cpp. References inst. |
|
Called when a reset is requested.
Definition at line 71 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 77 of file CalibrationControllerImpl.cpp. References CalibrationControllerStatus::ERROR, rc, CalibrationControllerStatus::status, status, and Sct::AbstractThrowable::what(). Referenced by executeSequence(), and executeTest(). |
Here is the call graph for this function:
|
Sets the SctApi reference.
Definition at line 67 of file CalibrationControllerImpl.cpp. |
|
Sets the next scan number .
Definition at line 127 of file CalibrationControllerImpl.cpp. References nextScanNumber. Referenced by executeTest(). |
|
The RunController calls this to tell the CC to take control The CC is then in charge until giveupControl is called.
Definition at line 83 of file CalibrationControllerImpl.cpp. References CalibrationControllerStatus::INCONTROL, CalibrationControllerStatus::LOADED, nextScanNumber, CalibrationControllerStatus::status, and status. |
|
The worker group class.
Definition at line 176 of file CalibrationControllerImpl.h. |
|
Flag used to indicate the user has requested an abort.
Definition at line 170 of file CalibrationControllerImpl.h. Referenced by 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 171 of file CalibrationControllerImpl.h. Referenced by executeScan(), and executeTest(). |
|
The singleton object. Not valid until initialize has been called.
Definition at line 508 of file CalibrationControllerImpl.cpp. Referenced by initialize(), and instance(). |
|
The worker group that handles executing sequences.
Definition at line 174 of file CalibrationControllerImpl.h. |
|
The number of the next scan.
Definition at line 169 of file CalibrationControllerImpl.h. Referenced by executeScan(), executeSequence(), executeTest(), getNextScanNumber(), setNextScanNumber(), and takeControl(). |
|
The RunController.
Definition at line 167 of file CalibrationControllerImpl.h. Referenced by sctApiError(). |
|
The current run number.
Definition at line 168 of file CalibrationControllerImpl.h. Referenced by executeSequence(), executeTest(), and getRunNumber(). |
|
Our current status.
Definition at line 166 of file CalibrationControllerImpl.h. Referenced by applyChanges(), executeScan(), executeSequence(), executeTest(), giveupControl(), SctCalibrationController::SequenceRequestWorker::operator()(), reset(), sctApiError(), and takeControl(). |