Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.TelecommandManagement
Class TelecommandManager

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
              |
              +--RtjAocsFramework.TelecommandManagement.TelecommandManager
All Implemented Interfaces:
ActiveObject, Configurable, Resettable, Telemeterable

public class TelecommandManager
extends AocsObject
implements ActiveObject

Encapsulation of a telecommand manager. The telecommand manager is an active component that is responsible for the execution of the telecommands. It maintains a list of pending telecommands and, when it is activated, it goes through the list and processes all telecommands in sequence.

The telecommand manager is a source of telecommand events. It fires telecommand events when a telecommand has been loaded and when a telecommand has been executed.

Copyright: see the Copyright Notice.

Version:
1.0
Author:
Alessandro Pasetti (University of Konstanz)
See Also:
The Telecommand Framelet Document.

Field Summary
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
TelecommandManager()
          Construct - without configuring - a telecommand manager.
TelecommandManager(int maxNumberPendingTc, int tcIntStackSize, int tcRealStackSize, int maxNumberOfTelecommandListeners)
          Construct a telecommand manager with the specified integer and real stack sizes and with the specified maximum number of pending telecommands.
 
Method Summary
 void addTelecommandListener(TelecommandListener l)
          Initialization method to register listeners to telecommand events.
 int getNumberOfPendingTelecommands()
          Return the number of pending telecommands.
 RecoveryAction getTelecommandListFullRecoveryAction()
           
 TelecommandLoader getTelecommandLoader()
           
 RecoveryAction getTelecommandStackErrorRecoveryAction()
           
 int getTelemetryImageLength()
          Return the length (in bits) of the telemetry image of the object.
 boolean initialize()
          Initialize an active object before it is scheduled.
 boolean isConfigured()
          Return false if some configuration data are missing.
 void loadTelecommand(Telecommand telecommand)
          Add a telecommand to the list of pending telecommands.
 int popInt()
          Method available to transaction telecommands to retrieve one integer from the internal stack of the telecommand manager.
 double popReal()
          Method available to transaction telecommands to retrieve one integer from the internal stack of the telecommand manager.
 void pushInt(int value)
          Method available to transaction telecommands to save one integer on the internal stack of the telecommand manager.
 void pushReal(double value)
          Method available to transaction telecommands to save one floating point datum on the internal stack of the telecommand manager.
 void removeTelecommandListener(TelecommandListener l)
          Initialization method to unregister telecommand event listeners.
 void reset()
          Reset the internal stack and reset the list of pending telecommands (this also implies releasing the resources allocated to the pending telecommands in the telecommand loader).
 void resetConfiguration()
          Unload the telecommand loader, the recovery actions and reset the lists of pending telecommands and of listeners to telecommands events.
 void runOneCycle(int deadline)
          Process all pending telecommands.
 void setIntegerStackSize(int n)
          Configuration method to set the size of the integer stack used by transaction telecommands to save their internal state.
 void setMaxNumberOfTelecommandListeners(int n)
          Initialization method to set the maximum number of listeners to telecommand events.
 void setMaxNumberPendingTc(int n)
          Configuration method to set the maximum number of pending telecommands that the telecommand manager can hold.
 void setRealStackSize(int n)
          Configuration method to set the size of the floating point stack used by transaction telecommands to save their internal state.
 void setTelecommandListFullRecoveryAction(RecoveryAction r)
           
 void setTelecommandLoader(TelecommandLoader l)
           
 void setTelecommandStackErrorRecoveryAction(RecoveryAction r)
           
 boolean terminate()
          Perfrom any shutdown actions before an active is de-scheduled.
 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, removeConfigurationListener, removeFailureListener, reportConfigurationEvent, reportFailure, 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

TelecommandManager

public TelecommandManager(int maxNumberPendingTc,
                          int tcIntStackSize,
                          int tcRealStackSize,
                          int maxNumberOfTelecommandListeners)
Construct a telecommand manager with the specified integer and real stack sizes and with the specified maximum number of pending telecommands.


TelecommandManager

public TelecommandManager()
Construct - without configuring - a telecommand manager. Before being used, the telecommand manager must be configured by setting the maximum number of pending telecommands, the sizes for the integer and real stacks and the maximum number of listeners to telecommand events.

Method Detail

setMaxNumberOfTelecommandListeners

public void setMaxNumberOfTelecommandListeners(int n)
Initialization method to set the maximum number of listeners to telecommand events.


setMaxNumberPendingTc

public void setMaxNumberPendingTc(int n)
Configuration method to set the maximum number of pending telecommands that the telecommand manager can hold. Attempts to call this method twice will give rise to a configuration event.


setIntegerStackSize

public void setIntegerStackSize(int n)
Configuration method to set the size of the integer stack used by transaction telecommands to save their internal state. Attempts to call this method twice will give rise to a configuration event.


setRealStackSize

public void setRealStackSize(int n)
Configuration method to set the size of the floating point stack used by transaction telecommands to save their internal state. Attempts to call this method twice will give rise to a configuration event.


resetConfiguration

public void resetConfiguration()
Unload the telecommand loader, the recovery actions and reset the lists of pending telecommands and of listeners to telecommands events.

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

reset

public void reset()
Reset the internal stack and reset the list of pending telecommands (this also implies releasing the resources allocated to the pending telecommands in the telecommand loader).

Specified by:
reset in interface Resettable
Overrides:
reset in class AocsObject

isConfigured

public boolean isConfigured()
Description copied from interface: Configurable
Return false if some configuration data are missing.

Typically, a false value indicates that a plug-in component is missing or that the object has not been initialized. This is a negative check only: a return value of true cannot guarantee that the object is correctly configured.

Calls to resetConfiguration on an object A are normally not propagated objects of type AocsObject that are contained or otherwise aggregated to A. The rationale for this policy is that all objects of type AocsObject implement interface configurable and therefore their configuration status should be checked externally (probably through the configuration check service of the system manager).

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

pushInt

public void pushInt(int value)
Method available to transaction telecommands to save one integer on the internal stack of the telecommand manager.


popInt

public int popInt()
Method available to transaction telecommands to retrieve one integer from the internal stack of the telecommand manager.


pushReal

public void pushReal(double value)
Method available to transaction telecommands to save one floating point datum on the internal stack of the telecommand manager.


popReal

public double popReal()
Method available to transaction telecommands to retrieve one integer from the internal stack of the telecommand manager.


getNumberOfPendingTelecommands

public int getNumberOfPendingTelecommands()
Return the number of pending telecommands.


loadTelecommand

public void loadTelecommand(Telecommand telecommand)
Add a telecommand to the list of pending telecommands. This method is typically called by the telecommand loader. If the internal list of pending is already full, a failure event is generated. Upon successful loading of the telecommand, a telecommand event is fired.


runOneCycle

public void runOneCycle(int deadline)
Process all pending telecommands. The actions performed by this method are: 1) It checks if there are any pending telecommands waiting to be executed; 2) For all pending telecommands, it checks their time tag; 3) For all pending telecommands that are due for execution according to their time tag, it checks whether they can execute by calling their canExecute() method; 4) For all pending telecommands that are due for execution according to their time tag, it checks whether they are enabled; 5) It executes all telecommands that are due for execution; 6) It removes from the pending telecommand list the telecommands whose time tag has been passed (regardless of whether they were executed or not); 7) It releases the memory allocated to the telecommands thus removed by calling the release method on the telecommand loader; 8) It fires telecommand events in response to telecommands being executed (using the return value of method execute() to assess execution success or failure).

Specified by:
runOneCycle in interface ActiveObject
Parameters:
deadline - deadline by which the object must have returned. This parameter allows implementation of cooperative scheduling.

initialize

public boolean initialize()
Description copied from interface: ActiveObject
Initialize an active object before it is scheduled.

Specified by:
initialize in interface ActiveObject
Returns:
true if initialization was successful.

terminate

public boolean terminate()
Description copied from interface: ActiveObject
Perfrom any shutdown actions before an active is de-scheduled.

Specified by:
terminate in interface ActiveObject
Returns:
true if shutdown was successful.

addTelecommandListener

public void addTelecommandListener(TelecommandListener l)
Initialization method to register listeners to telecommand events.


removeTelecommandListener

public void removeTelecommandListener(TelecommandListener l)
Initialization method to unregister telecommand event listeners.


setTelecommandLoader

public void setTelecommandLoader(TelecommandLoader l)

getTelecommandLoader

public TelecommandLoader getTelecommandLoader()

setTelecommandListFullRecoveryAction

public void setTelecommandListFullRecoveryAction(RecoveryAction r)

getTelecommandListFullRecoveryAction

public RecoveryAction getTelecommandListFullRecoveryAction()

setTelecommandStackErrorRecoveryAction

public void setTelecommandStackErrorRecoveryAction(RecoveryAction r)

getTelecommandStackErrorRecoveryAction

public RecoveryAction getTelecommandStackErrorRecoveryAction()

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

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