#include <CopyControlBlock.h>
Inheritance diagram for CopyControlBlock:
A copy control block is a control block that implements a copy link to its inputs and outputs. It adds to its ControlBlock
base class the following attributes:<ul> The input buffers: internal data structure where the values of the control block inputs are copied at the beginning of a propagation cycle. The state propagation and output update services read the value of the inputs from the input buffers. The output buffers: internal data structure where the values of the control block outputs are written by the output update service. These values are intended to be copied to the external output destination locations. The input and output buffers are implemented as arrays. They are declared protected
to give concrete subclasses ready access to them.
This class adds services to copy the input values from their external locations to the internal input buffers and to copy the output values from the internal output buffers to their external destinations.
Roberto Totaro
Definition at line 41 of file CopyControlBlock.h.
Public Member Functions | |
CopyControlBlock (void) | |
Instantiate a copy control block. | |
TD_Float | getInput (unsigned int i) const |
Return the value of the i-th input. | |
TD_Float | getOutput (unsigned int i) const |
Return the value of the i-th output. | |
void | setInput (unsigned int i, TD_Float newValue) |
Set the value of the i-th input. | |
void | setOutput (unsigned int i, TD_Float newValue) |
Set the value of the i-th output. | |
virtual void | reset (void) |
Reset the control block bringing its state and input and output buffers to the values they had when the configuration process of the control block was terminated. | |
Protected Member Functions | |
virtual void | setNumberOfInputs (unsigned int n) |
Set the number of inputs. | |
virtual void | setNumberOfOutputs (unsigned int n) |
Set the number of outputs. | |
Protected Attributes | |
TD_Float * | u |
Array to hold the input buffer. | |
TD_Float * | y |
Array to hold the output buffer. |
|
Instantiate a copy control block. The input and output buffers are initialized to illegal values to signify that the control block is not yet configured. Definition at line 19 of file CopyControlBlock.cpp. |
|
Return the value of the i-th input. The argument i must lie in the interval [0,n-1] where n is the number of inputs. No check is performed on the legality of the index i.
Definition at line 62 of file CopyControlBlock.cpp. |
|
Return the value of the i-th output. The argument i must lie in the interval [0,n-1] where n is the number of outputs. No check is performed on the legality of the index i.
Definition at line 68 of file CopyControlBlock.cpp. |
|
Reset the control block bringing its state and input and output buffers to the values they had when the configuration process of the control block was terminated. A pseudocode implementation of this method is as follows:<PRE> ControlBlock::reset(); // call method in super class to reset the state reset the input buffers to zero; reset the output buffers to zero; Reimplemented from ControlBlock. Reimplemented in DC_DummyCopyControlBlock, and DC_MatlabCopyPID. Definition at line 74 of file CopyControlBlock.cpp. |
|
Set the value of the i-th input. The argument i must lie in the interval [0,n-1] where n is the number of inputs. Illegal argument values trigger the generation of an event report EVT_ILLEGAL_CB.
Definition at line 44 of file CopyControlBlock.cpp. |
|
Set the number of inputs. This method causes the memory for the input buffer to be allocated. The number of inputs must be non-negative. The input values are initialized to zero. This is an initialization method: it shall be called only once.
Implements ControlBlock. Definition at line 24 of file CopyControlBlock.cpp. |
|
Set the number of outputs. This method causes the memory for the output buffer to be allocated. The number of outputs must be non-negative. The output values are initialized to zero. This is an initialization method: it shall be called only once.
Implements ControlBlock. Definition at line 34 of file CopyControlBlock.cpp. |
|
Set the value of the i-th output. The argument i must lie in the interval [0,n-1] where n is the number of outputs. Illegal argument values trigger the generation of an event report EVT_ILLEGAL_CB. This method should not normally be used since the output is computed internally by propagating the input and the state. It is provided for convenience only for non-nominal situations.
Definition at line 53 of file CopyControlBlock.cpp. |
|
Array to hold the input buffer. u[i] holds the i-th state variable with i lying in the interval [0,N-1] where N is the number of inputs. Definition at line 51 of file CopyControlBlock.h. |
|
Array to hold the output buffer. y[i] holds the i-th output variable with i lying in the interval [0,N-1] where N is the number of outputs. Definition at line 61 of file CopyControlBlock.h. |