Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.ModeManagement
Class ModeChangeAction

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
              |
              +--RtjAocsFramework.ModeManagement.ModeChangeAction
All Implemented Interfaces:
Configurable, Resettable, Telemeterable
Direct Known Subclasses:
NullModeChangeAction, TestModeChangeAction

public class ModeChangeAction
extends AocsObject

Base class from which all objects encapsulating to be taken when a mode manager performs a mode change are derived. Often, a mode switch by a mode manager must be accompanied by some special actions related to the exit from the old mode and/or the entry into the new one. Consider for instance an attitude controller component that manages several control algorithms corresponding to different operational mode. When a new mode is entered, its associated control algorithm should be reset to remove the memory of previous activations.

Actions that are associated to a mode transition are called "mode change actions". The framework offers two mechanisms for their implementations. The most straightforward approach is simply to hard-code the mode change actions into the concrete mode manager. Thus, for instance, in the case of the attitude controller example, when the mode manager finds that it has to perform a change mode, then it executes any actions that are associated to the mode change. A second, more systematic approach, is to encapsulate the mode change actions into objects that are derived from this base class ModeChangeAction. Such objects are called "mode change objects". A mode change action object can be associated to a mode manager and then the mode manager calls method doModeExitAction on the mode change object when a mode is exited and method doModeEntryAction when a mode is entered.

Mode change actions can be linked together in a chain of responsibility. When the mode manager performs a mode transition, it calls methods doModeExitAction and doModeEntryAction on a ModeChangeAction object but the method calls might actually be passed along a chain of linked mode change action objects. In a typical configuration, each mode change action object in the chain specializes in one of the transition into or out of one particular mode.

Copyright: see the Copyright Notice.

Version:
1.0
Author:
Alessandro Pasetti (University of Konstanz)

Field Summary
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
ModeChangeAction()
           
 
Method Summary
 void doModeEntryAction(int newMode)
          Performs the actions associated to a transition into mode oldMode.
 void doModeExitAction(int oldMode)
          Performs the actions associated to a transition out of mode oldMode.
 ModeChangeAction getNextModeChangeAction()
          Return the next mode change action in the chain of responsibility.
 int getTelemetryImageLength()
          Return the length (in bits) of the telemetry image of the object.
 void resetConfiguration()
          Unload the link to the next mode change action in the chain of responsibility.
 void setNextModeChangeAction(ModeChangeAction n)
          Set up the link to the next mode change action in the chain of responsibility.
 void writeToTelemetry(TelemetryStream tmStream)
          Direct the object to write its own state to the telemetry stream.
 
Methods inherited from class RtjAocsFramework.BasicObjects.AocsObject
addConfigurationListener, addFailureListener, finalize, getAocsClock, getConfigurationListenerList, getCycle, getDestructionRecoveryAction, getFailureListenerList, getSystemManager, getTelemetryFormat, getTime, isConfigured, removeConfigurationListener, removeFailureListener, reportConfigurationEvent, reportFailure, reset, resetStaticConfiguration, setAocsClock, setDestructionRecoveryAction, setMaxNumberOfConfigurationListeners, setMaxNumberOfFailureListeners, setSystemManager, setTelemetryFormat
 
Methods inherited from class RtjAocsFramework.BasicObjects.RootObject
getClassId, getInstanceId, setClassId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModeChangeAction

public ModeChangeAction()
Method Detail

doModeExitAction

public void doModeExitAction(int oldMode)
Performs the actions associated to a transition out of mode oldMode. The implementation in this base class simply hands over the request to the next change action in the responsibility chain.


doModeEntryAction

public void doModeEntryAction(int newMode)
Performs the actions associated to a transition into mode oldMode. The implementation in this base class simply hands over the request to the next change action in the responsibility chain.


resetConfiguration

public void resetConfiguration()
Unload the link to the next mode change action in the chain of responsibility.

Specified by:
resetConfiguration in interface Configurable
Overrides:
resetConfiguration in class AocsObject

writeToTelemetry

public void writeToTelemetry(TelemetryStream tmStream)
Description copied from interface: Telemeterable
Direct the object to write its own state to the telemetry stream.

Specified by:
writeToTelemetry in interface Telemeterable
Overrides:
writeToTelemetry in class AocsObject

getTelemetryImageLength

public int getTelemetryImageLength()
Description copied from interface: Telemeterable
Return the length (in bits) of the telemetry image of the object. This method is useful to verify that the quantity of data generated by a given object is compatible with the capacity of the telemetry channel.

Specified by:
getTelemetryImageLength in interface Telemeterable
Overrides:
getTelemetryImageLength in class AocsObject

setNextModeChangeAction

public void setNextModeChangeAction(ModeChangeAction n)
Set up the link to the next mode change action in the chain of responsibility.


getNextModeChangeAction

public ModeChangeAction getNextModeChangeAction()
Return the next mode change action in the chain of responsibility.


Real-Time Java AOCS Framework v1.0 API Specification

Real-Time Java AOCS Framework project home page

Automatic Control Laboratory, ETH Zuerich
Physikstrasse 3
CH-8092 Zuerich, Switzerland