#include <DC_TestPUSTelecommand.h>
Inheritance diagram for DC_TestPUSTelecommand:
This telecommand consists of an execution counter that is incremented by one every time the telecommand is executed. The telecommand additionally offers methods to change the return value of its execution check and of its validity check and to set the values of validity and execution check codes. These are useful to simulate telecommands whose execution check returns "telecommand cannot executed" or whose validity check returns "telecommand not valid". Similarly, it is possible to set the return value of the execution method to either ACTION_SUCCESS or ACTION_FAILURE.
The initial values of the execution counter, of the validity and execution check return values, of the execution return value, and of the validity and execution check codes are defined in the telecommand application data that are loaded when the telecommand is configured through the raw data load service.
The type and subtype of the telecommand are set to PUS_TYPE_TEST and PUS_ST_TC_TEST, respectively.
The application data associated to this telecommand are assumed to consist of 6 bytes which are interpreted as follows:<ul> Byte 0: the initial value of the execution counter Byte 1: the initial value of the execution check value Byte 2: the initial value of the validity check value Byte 3: the initial value of the execution check code Byte 4: the initial value of the validity check code Byte 5: the value of the execution outcome return value (ACTION_FAILURE if 1, ACTION_SUCCESS otherwise)
Definition at line 53 of file DC_TestPUSTelecommand.h.
Public Member Functions | |
DC_TestPUSTelecommand (void) | |
Instantiate a test telecommand. | |
unsigned int | getExecutionCounter (void) |
Getter method for the execution counter. | |
virtual bool | canExecute (void) |
Execute the execution check on the telecommand. | |
virtual bool | isValid (void) |
Execute the validity check on the telecommand. | |
virtual TD_CheckCode | getValidityCheckCode (void) const |
Return the validity check code for the telecommand. | |
virtual TD_CheckCode | getExecutionCheckCode (void) const |
Return the execution check code for the telecommand. | |
void | setExecutionCheckValue (bool executionCheckValue) |
Set the return value of the execution check. | |
void | setValidityCheckValue (bool validityCheckValue) |
Set the return value of the validity check. | |
void | setValidityCheckCode (TD_CheckCode validityCheckCode) |
Set the value of the validity check code. | |
void | setExecutionCheckCode (TD_CheckCode executionCheckCode) |
Set the value of the execution check code. | |
void | setActionOutcome (bool executionSuccess) |
Set the action outcome returned by method doAction . | |
bool | getActionOutcome () |
Get the action outcome returned by method doAction . | |
virtual void | setRawData (unsigned int i, unsigned char d) |
Implementation of the raw data load service. | |
virtual unsigned int | getNumberOfRawData (void) const |
Return the number of raw data bytes that can be loaded with the raw telecommand data load service. | |
Protected Member Functions | |
virtual TD_ActionOutcome | doAction (void) |
Increment the execution counter by one and return the execution outcome code set in the application data. |
|
Instantiate a test telecommand. The class identifier is set. The telecommand type and subtype are set the values indicated in the class comment. All other internal variables are set to dummy values. Definition at line 18 of file DC_TestPUSTelecommand.cpp. |
|
Execute the execution check on the telecommand. A pseudo-code implementation for this method is as follows: return executionCheckValue;The internal variable executionCheckValue is initialized when the telecommand application data are loaded. Its value can additionally be changed with method setExecutionCheckValue
Reimplemented from Telecommand. Definition at line 46 of file DC_TestPUSTelecommand.cpp. |
|
Increment the execution counter by one and return the execution outcome code set in the application data. A pseudo-code implementation for this method is as follows: if (exectionCounter<255) executionCounter++; else executionCounter=0; if (executionSuccess) return ACTION_SUCCESS; else return ACTION_FAILURE;The vlaue of the internal flag executionSuccess is read from the telecommand application data.
Implements PunctualAction. Definition at line 35 of file DC_TestPUSTelecommand.cpp. |
|
Get the action outcome returned by method If the return value is true, then action outcome is ACTION_SUCCESS. Otherwise it ACTION_FAILURE.
Definition at line 82 of file DC_TestPUSTelecommand.cpp. |
|
Return the execution check code for the telecommand.
This implementation returns a user-defined value that is initialized when the telecommand application data are loaded and that can be set with method
Reimplemented from Telecommand. Definition at line 66 of file DC_TestPUSTelecommand.cpp. |
|
Getter method for the execution counter.
Definition at line 31 of file DC_TestPUSTelecommand.cpp. |
|
Return the number of raw data bytes that can be loaded with the raw telecommand data load service. Since the size of the application data for this telecommand is fixed and equal to six, this method always returns the value of six.
Reimplemented from Telecommand. Definition at line 123 of file DC_TestPUSTelecommand.cpp. |
|
Return the validity check code for the telecommand.
This implementation returns a user-defined value that is initialized when the telecommand application data are loaded and that can be set with method
Reimplemented from PUSTelecommand. Definition at line 62 of file DC_TestPUSTelecommand.cpp. |
|
Execute the validity check on the telecommand. A pseudo-code implementation for this method is as follows: return validityCheckValue;The internal variable validityCheckValue is initialized when the telecommand application data are loaded. Its value can be changed with method setValidityCheckValue
Reimplemented from PUSTelecommand. Definition at line 50 of file DC_TestPUSTelecommand.cpp. |
|
Set the action outcome returned by method The possible values are foreseen ACTION_SUCCESS or ACTION_FAILURE. The former is used if the value set with this method is true. Otherwise the latter is used.
Definition at line 78 of file DC_TestPUSTelecommand.cpp. |
|
Set the value of the execution check code.
This is a setter method for an internal variable which defines the return value of method
Definition at line 74 of file DC_TestPUSTelecommand.cpp. |
|
Set the return value of the execution check.
This is a setter method for the internal variable
Definition at line 54 of file DC_TestPUSTelecommand.cpp. |
|
Implementation of the raw data load service. This method would normally be called by a telecommand loader to load the application data into the the telecommand component. This method interprets the raw data as they are loaded and uses them to initialize the internal variables of the telecommand component. The expected layout of the application data is specified in the class comment.
Reimplemented from Telecommand. Definition at line 86 of file DC_TestPUSTelecommand.cpp. |
|
Set the value of the validity check code.
This is a setter method for an internal variable which defines the return value of method
Reimplemented from PUSTelecommand. Definition at line 70 of file DC_TestPUSTelecommand.cpp. |
|
Set the return value of the validity check.
This is a setter method for the internal variable
Definition at line 58 of file DC_TestPUSTelecommand.cpp. |