|
xentara-cpp-control v1.0.1
The Xentara C++ Control Framework
|
An interface class which provides declaration of all the callbacks for this control. More...
#include <xentara/Control.hpp>
Public Member Functions | |
| virtual | ~Control ()=0 |
| Virtual Destructor. | |
| virtual auto | initialize (InitContext &context) -> void=0 |
| Callback that is called by the framework to initialize the control object. | |
| virtual auto | step (RunContext &context) -> void=0 |
| Main callback responsible for executing the core control logic. | |
| virtual auto | enterPreOp (RunContext &context) -> void |
| Called by the framework at the beginning of the pre-operational stage. | |
| virtual auto | enterOperational (RunContext &context) -> void |
| Called by the framework once at the conclusion of the pre-operational stage, just before entering into the operational stage. | |
| virtual auto | enterPostOp (RunContext &context) -> void |
| Called by the framework at the beginning of the post-operational stage. | |
| virtual auto | final (RunContext &context) -> void |
| Called by the framework once at the conclusion of the post-operational stage. | |
| virtual auto | preOpDone () -> bool |
| Called by the framework during the pre-operational stage to assess the status of this stage. | |
| virtual auto | postOpDone () -> bool |
| Called by the framework during the post-operational stage to assess the status of this stage. | |
| Control (const Control &)=delete | |
| Deleted copy constructor. | |
| auto | operator= (const Control &) -> bool=delete |
| Deleted assignment operator. | |
Protected Member Functions | |
| Control ()=default | |
| Constructor. | |
An interface class which provides declaration of all the callbacks for this control.
You need to derive your control class from this base class.
|
pure virtualdefault |
Virtual Destructor.
|
delete |
Deleted copy constructor.
|
protecteddefault |
Constructor.
|
virtual |
Called by the framework once at the conclusion of the pre-operational stage, just before entering into the operational stage.
This callback should ensure that all control variables, including configurations and data points, are set to valid values before entering the operational stage. It provides an opportunity to finalize any necessary setup before normal operation begins.
| context | Provides access to time stamps, counters, errors, and it is used for reading and writing of Inputs and Outputs. |
|
virtual |
Called by the framework at the beginning of the post-operational stage.
This callback should be responsible for cleaning up and setting control variables to safe values before the control stops. It is executed outside the regular timer sequence to ensure the cleanup and safe value configuration are completed before advancing to the next stage. If more time is needed to complete these tasks, Xentara must remain in this stage until the task is complete. To manage this, implement the postOpDone() callback. This function is called immediately after enterPostOp() to determine whether the task is complete or if the framework should continue calling enterPostOp(). Your logic within postOpDone() should return false if the setup is not yet finished. This will trigger another enterPostOp() call, preventing progression to the next stage until setup is complete.
| context | Provides access to time stamps, counters, errors, and it is used for reading and writing of Inputs and Outputs. |
|
virtual |
Called by the framework at the beginning of the pre-operational stage.
This callback should be responsible for performing the initial setup required before the control becomes operational. It is executed outside the regular timer sequence to ensure all setup tasks are completed before advancing to the next stage. If additional time is needed for setup, Xentara must remain in this stage until the process is complete. To manage this, implement the preOpDone() callback. This function is called immediately after enterPreOp() to determine whether the setup is complete or if the framework should continue calling enterPreOp(). Your logic within preOpDone() should return false if the setup is not yet finished. This will trigger another enterPreOp() call, preventing progression to the next stage until setup is complete.
| context | Provides access to time stamps, counters, errors, and it is used for reading and writing of Inputs and Outputs. |
|
virtual |
Called by the framework once at the conclusion of the post-operational stage.
This callback allows you to verify that all control variables are set to safe values before the control process fully stops. It provides a final opportunity to ensure that the system is in a safe state as it exits the operational stage.
| context | Provides access to time stamps, counters, errors, and it is used for reading and writing of Inputs and Outputs. |
|
pure virtual |
Callback that is called by the framework to initialize the control object.
This callback provides access to all configuration settings which are done within the Control block in the Xentara Model tree. It also provides access to any needed Xentara elements, including data points and the timer information for the control task. This information from context should be stored as member variables in your control class for later use.
| context | The initialization context that provides access to the control’s configuration, as well as the Xentara model tree. |
|
delete |
Deleted assignment operator.
|
virtual |
Called by the framework during the post-operational stage to assess the status of this stage.
This function is used to indicate to Xentara that all necessary tasks during the post-operational stage are finished. It is called after the enterPostOp() and step() callbacks, when called during the post-operational stage, to determine whether the control is ready to transition to the next stage. If your clean up or safe value setup is complete, returning true will signal to Xentara that the control is ready to proceed to the next stage. If setup is still ongoing, returning false will keep Xentara in the post-operational stage and cause enterPostOp() or step() to be invoked again until the setup is finished.
|
virtual |
Called by the framework during the pre-operational stage to assess the status of this stage.
This function is used to indicate to Xentara that all necessary tasks during the pre-operational stage are finished. It is called after the enterPreOp() and step() callbacks, when invoked during the pre-operational stage, to determine whether the control is ready to transition to the operational stage. If your initial setup is complete, returning true will signal to Xentara that the control is ready to proceed to the operational stage. If setup is still ongoing, returning false will keep Xentara in the pre-operational stage and cause enterPreOp() or step() to be invoked again until the setup is finished.
|
pure virtual |
Main callback responsible for executing the core control logic.
This callback must contain the primary control logic and is invoked during the pre-operational stage, operational stage, and post-operational stage of Xentara. To differentiate between stages, use RunContext::currentStage(). The callback is triggered either based on the configured timer sequence or by event triggers, with timing information accessible via RunContext. During the pre-operational and post-operational stages, after this function is called, the preOpDone() and postOpDone() callbacks will be invoked, respectively, to determine if the tasks in these stages are complete. To request Xentara to continue calling this function to complete your pending tasks, implement preOpDone() or postOpDone() to return false until the tasks are finished. Once the tasks are completed, return true. If this function is called during the operational stage, it simply executes the control step without additional completion checks.
| context | Provides access to time stamps, counters, errors, and it is used for reading and writing of Inputs and Outputs. |