Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

DC_TestPUSTelecommand Class Reference

#include <DC_TestPUSTelecommand.h>

Inheritance diagram for DC_TestPUSTelecommand:

PUSTelecommand Telecommand PunctualAction CC_RootObject List of all members.

Detailed Description

Telecommand that can be used as part of an end-to-end PUS test scenario to simulate a PUS telecommand.

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)

Author:
Alessandro Pasetti (P&P Software GmbH)
Version:
1.0

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.


Constructor & Destructor Documentation

DC_TestPUSTelecommand::DC_TestPUSTelecommand void   ) 
 

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.


Member Function Documentation

bool DC_TestPUSTelecommand::canExecute void   )  [virtual]
 

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
See also:
setExecutionCheckValue

CC_TelecommandManager::activate

Returns:
the value of the internal variable setExecutionCheckValue

Reimplemented from Telecommand.

Definition at line 46 of file DC_TestPUSTelecommand.cpp.

TD_ActionOutcome DC_TestPUSTelecommand::doAction void   )  [protected, virtual]
 

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.
See also:
PunctualAction::execute
Returns:
the execution outcome code (either ACTION_SUCCESS or ACTION_FAILURE depending on the value byte 6 of the application data)

Implements PunctualAction.

Definition at line 35 of file DC_TestPUSTelecommand.cpp.

bool DC_TestPUSTelecommand::getActionOutcome  ) 
 

Get the action outcome returned by method doAction.

If the return value is true, then action outcome is ACTION_SUCCESS. Otherwise it ACTION_FAILURE.

See also:
setActionOutcome
Returns:
a flag indicating which value of action outcome is returned by method doAction

Definition at line 82 of file DC_TestPUSTelecommand.cpp.

TD_CheckCode DC_TestPUSTelecommand::getExecutionCheckCode void   )  const [virtual]
 

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 setExecutionCheckCode.

See also:
setExecutionCheckCode
Returns:
the validity check code

Reimplemented from Telecommand.

Definition at line 66 of file DC_TestPUSTelecommand.cpp.

unsigned int DC_TestPUSTelecommand::getExecutionCounter void   ) 
 

Getter method for the execution counter.

Returns:
the execution counter

Definition at line 31 of file DC_TestPUSTelecommand.cpp.

unsigned int DC_TestPUSTelecommand::getNumberOfRawData void   )  const [virtual]
 

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.

See also:
setRawData
Returns:
alwys returns the value 6

Reimplemented from Telecommand.

Definition at line 123 of file DC_TestPUSTelecommand.cpp.

TD_CheckCode DC_TestPUSTelecommand::getValidityCheckCode void   )  const [virtual]
 

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 setValidityCheckCode.

See also:
setValidityCheckCode
Returns:
the validity check code

Reimplemented from PUSTelecommand.

Definition at line 62 of file DC_TestPUSTelecommand.cpp.

bool DC_TestPUSTelecommand::isValid void   )  [virtual]
 

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
See also:
setValidityCheckValue

CC_TelecommandManager::load

Returns:
the value of the internal variable setExecutionCheckValue

Reimplemented from PUSTelecommand.

Definition at line 50 of file DC_TestPUSTelecommand.cpp.

void DC_TestPUSTelecommand::setActionOutcome bool  executionSuccess  ) 
 

Set the action outcome returned by method doAction.

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.

See also:
doAction
Parameters:
executionSuccess if true, then the action outcome is forced to ACTION_SUCCESS, otherwise it is forced to ACTION_FAILURE

Definition at line 78 of file DC_TestPUSTelecommand.cpp.

void DC_TestPUSTelecommand::setExecutionCheckCode TD_CheckCode  executionCheckCode  ) 
 

Set the value of the execution check code.

This is a setter method for an internal variable which defines the return value of method getExecutionCheckCode.

See also:
getExecutionCheckCode
Parameters:
executionCheckCode the value of the validity check code

Definition at line 74 of file DC_TestPUSTelecommand.cpp.

void DC_TestPUSTelecommand::setExecutionCheckValue bool  executionCheckValue  ) 
 

Set the return value of the execution check.

This is a setter method for the internal variable executionCheckValue which defines the return value of the execution check implemented by this telecommand.

See also:
canExecute
Parameters:
executionCheckValue the value of the internal variable setExecutionCheckValue

Definition at line 54 of file DC_TestPUSTelecommand.cpp.

void DC_TestPUSTelecommand::setRawData unsigned int  i,
unsigned char  d
[virtual]
 

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.

See also:
getNumberOfRawData
Parameters:
i the index of the raw telecommand data
d the raw data

Reimplemented from Telecommand.

Definition at line 86 of file DC_TestPUSTelecommand.cpp.

void DC_TestPUSTelecommand::setValidityCheckCode TD_CheckCode  validityCheckCode  ) 
 

Set the value of the validity check code.

This is a setter method for an internal variable which defines the return value of method getValidityCheckCode.

See also:
getValidityCheckCode
Parameters:
validityCheckCode the value of the validity check code

Reimplemented from PUSTelecommand.

Definition at line 70 of file DC_TestPUSTelecommand.cpp.

void DC_TestPUSTelecommand::setValidityCheckValue bool  validityCheckValue  ) 
 

Set the return value of the validity check.

This is a setter method for the internal variable validityCheckValue which defines the return value of the validity check implemented by this telecommand.

See also:
isValid
Parameters:
validityCheckValue the value of the internal variable setExecutionCheckValue

Definition at line 58 of file DC_TestPUSTelecommand.cpp.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved