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

CriticalTelecommand Class Reference
[Telecommand Management]

#include <CriticalTelecommand.h>

Inheritance diagram for CriticalTelecommand:

Telecommand PunctualAction CC_RootObject DC_DummyCriticalTelecommand List of all members.

Detailed Description

Base class for telecommands with a potentially high criticality level.

This is an abstract class. Concrete telecommands are obtained by deriving this class.

This class adds to the basic functionalities defined by its base class the possibility of marking a telecommand as critical. Telecommands that are marked critical are executed according to an "arm-fire" protocol. The basic idea is that the first time the telecommand receives an execute request, it does not take any action but it sets an internal status to "armed". The actual execution of the telecommand only occurs when the second execute request is received. The two execution requests must not occur too far from each other in time and they must be made with exactly the same set of parameters. The precise implementation of the "arm-fire" mechanism is described below.

The telecommand can be in one of two states:

The arm status is maintained by the execution check (see comment of method canExecute).

The telecommand maintains a maximum armed duration. Its value represents the maximum time that can elapse between the time when the "arm" command was received and the time when the "fire" command is received. If the "fire" command is received after this interval as elapsed, then an event report is created to record the fact.

The telecommand defines an image store service and an image validity check. Their purpose is to allow to verify that telecommand parameters at the time the "arm" command is received are the same as when the "fire" command is received. The image store service allows the current values of the telecommand parameters to be stored in some internal data structure. The image validity check allows the current values of the telecomand parameters to be compared with the values that were stored in the last call to the image store service.

The criticality level of the telecommand can be set by the user. The criticality level can have two values: not critical and critical. If the telecommand is marked not critical, then it behaves exactly as an instance of its super class.

This implementation of the "arm-fire" mechanism stores the information about the arm status and about the telecommand parameters into the telecommand component itself. Note in particular that the standard telecommand manager provided by the OBS Framework (CC_TelecommandManager), is not aware of whether a given telecommand is critical or not. It is therefore the responsibility of the user to ensure that the same component is loaded into the telecommand manager when the telecommand is received the first time ("arm command") and when it is received the second time ("fire command").

See also:
CC_TelecommandManager
Author:
Alessandro Pasetti

Roberto Totaro

Version:
1.0

Definition at line 80 of file CriticalTelecommand.h.

Public Member Functions

 CriticalTelecommand (void)
 Instantiate a critical telecommand.

void reset (void)
 Reverts the telecommand to its original state (i.e.

bool isCritical (void)
 Return the criticality level of the telecommand.

void setCriticalityLevel (bool isCritical)
 Set the criticality level.

bool isArmed (void)
 Return the arm status of the telecommand.

virtual bool isImageValid (void)
 Execute the image validity check.

virtual void storeImage (void)
 Implement the image store service.

void setMaxArmedDuration (TD_ObsTime t)
 Set the maximum armed duration.

TD_ObsTime getMaxArmedDuration (void)
 Get the maximum armed duration.

TD_ObsTime getTimeWhenArmed (void)
 Get the value of the on-board time when the telecommand was last armed.

void setObsClock (ObsClock *pObsClock)
 Load the OBS Clock component.

ObsClockgetObsClock (void) const
 Return the OBS Clock component.

virtual bool canExecute (void)
 Perform the execution check on the telecommand.

virtual bool isObjectConfigured (void)
 Perform a class-specific configuration check on the telecommand: verify that the maximum armed duration has a legal value and that the on-board clock component has been loaded.


Protected Member Functions

virtual TD_ActionOutcome doAction (void)
 Encapsulate the implementation of the action associated with this critical telecommand.

virtual TD_ActionOutcome doCriticalAction (void)=0
 A derived class shall provide a concrete implementation of this method, which performs the actual critical telecommand action.


Constructor & Destructor Documentation

CriticalTelecommand::CriticalTelecommand void   ) 
 

Instantiate a critical telecommand.

The arm status is set to "not armed". The maximum armed duration is set to an illegal value to signify that the component is not yet configured. The criticality level is set to "not critical".

Definition at line 17 of file CriticalTelecommand.cpp.


Member Function Documentation

bool CriticalTelecommand::canExecute void   )  [virtual]
 

Perform the execution check on the telecommand.

A pseudo-code implementation of this method is as follows:

    if (TC is critical and armed) {
       if (TC has timed-out) {
          Add an EVT_CRIT_TC_TIMEOUT event to the log
          return false;
       }

       if (TC image is not valid) {
          Add an EVT_CRIT_TC_IMG_INV event to the log
          return false;
       }
    }

    return true;
 
See also:
CC_TelecommandManager::activate
Returns:
true if the telecommand can execute, false otherwise

Reimplemented from Telecommand.

Definition at line 72 of file CriticalTelecommand.cpp.

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

Encapsulate the implementation of the action associated with this critical telecommand.

This method verifies if the telecommand is armed and, if so, calls doCriticalAction, which implements the actual telecommand functionality. A non-critical telecommand is executed immediately (i.e. the arm-fire mechanism is disabled). A pseudo-code implementation of this method is as follows:

    if (TC is armed or it is not critical) {
       Disarm the TC
       Set the "time when armed" to an invalid value
       return doCriticalAction();
    }
    else {
       Arm the TC
       Save the current OBS time as "time when armed"
       Add an EVT_CRIT_TC_ARMED event to the log
       return ACTION_SUCCESS;
    }
 

This method is called by PunctualAction::execute().

See also:
PunctualAction::execute

doCriticalAction

Returns:
the outcome code of the telecommand action

Implements PunctualAction.

Definition at line 90 of file CriticalTelecommand.cpp.

virtual TD_ActionOutcome CriticalTelecommand::doCriticalAction void   )  [protected, pure virtual]
 

A derived class shall provide a concrete implementation of this method, which performs the actual critical telecommand action.

doCriticalAction() is invoked only the second time a specific critical telecommand is received (the first time, the telecommand is armed).

This method is called by doAction().

See also:
doAction
Returns:
the outcome code of the telecommand action

Implemented in DC_DummyCriticalTelecommand.

TD_ObsTime CriticalTelecommand::getMaxArmedDuration void   ) 
 

Get the maximum armed duration.

Returns:
the maximum armed duration

Definition at line 54 of file CriticalTelecommand.cpp.

ObsClock * CriticalTelecommand::getObsClock void   )  const
 

Return the OBS Clock component.

See also:
setObsClock
Returns:
the OBS Clock component.

Definition at line 62 of file CriticalTelecommand.cpp.

TD_ObsTime CriticalTelecommand::getTimeWhenArmed void   ) 
 

Get the value of the on-board time when the telecommand was last armed.

If the telecommand was never armed, a value of zero is returned.

Returns:
the on-board time when the telecommand was last armed

Definition at line 58 of file CriticalTelecommand.cpp.

bool CriticalTelecommand::isArmed void   ) 
 

Return the arm status of the telecommand.

If the criticality level of the telecommand is "not critical", this method always returns "not armed".

Returns:
true if the telecommand is armed, false otherwise

Definition at line 37 of file CriticalTelecommand.cpp.

bool CriticalTelecommand::isCritical void   ) 
 

Return the criticality level of the telecommand.

Returns:
true if the telecommand is critical, false otherwise

Definition at line 29 of file CriticalTelecommand.cpp.

bool CriticalTelecommand::isImageValid void   )  [virtual]
 

Execute the image validity check.

This class provides a default implementation that returns "image is valid".

See also:
canExecute
Returns:
true if the telecommand is valid, false otherwise

Reimplemented in DC_DummyCriticalTelecommand.

Definition at line 41 of file CriticalTelecommand.cpp.

bool CriticalTelecommand::isObjectConfigured void   )  [virtual]
 

Perform a class-specific configuration check on the telecommand: verify that the maximum armed duration has a legal value and that the on-board clock component has been loaded.

Returns:
true if the component is configured, false otherwise.

Reimplemented from Telecommand.

Definition at line 109 of file CriticalTelecommand.cpp.

void CriticalTelecommand::reset void   ) 
 

Reverts the telecommand to its original state (i.e.

isTcCritical=CRITICAL, isTcArmed=NOT_ARMED, timeWhenArmed=-1, maxArmedDuration=-1, pObsClock=pNULL).

Definition at line 21 of file CriticalTelecommand.cpp.

void CriticalTelecommand::setCriticalityLevel bool  isCritical  ) 
 

Set the criticality level.

This method would normally be called during the component initialization phase (probably by the constructor of the concrete telecommand class).

Parameters:
isCritical if true, the telecommand is marked "critical", otherwise it is marked "not critical"

Definition at line 33 of file CriticalTelecommand.cpp.

void CriticalTelecommand::setMaxArmedDuration TD_ObsTime  t  ) 
 

Set the maximum armed duration.

Parameters:
t the maximum armed duration
See also:
canExecute

Definition at line 49 of file CriticalTelecommand.cpp.

void CriticalTelecommand::setObsClock ObsClock pObsClock  ) 
 

Load the OBS Clock component.

Critical telecommands need access to the on-board clock to time-stamp the reception of an "arm" command.

Parameters:
pObsClock the OBS Clock component.

Definition at line 67 of file CriticalTelecommand.cpp.

void CriticalTelecommand::storeImage void   )  [virtual]
 

Implement the image store service.

This class provides a default implementation that returns without doing anything.

See also:
canExecute

Definition at line 45 of file CriticalTelecommand.cpp.


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