Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.ManoeuvreManagement
Class Manoeuvre

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
              |
              +--RtjAocsFramework.ManoeuvreManagement.Manoeuvre
All Implemented Interfaces:
Configurable, Monitorable, Resettable, Telemeterable
Direct Known Subclasses:
AttitudeSlew, DummyManoeuvre, JbedSmmRamp, JbedSmmTriangularWave

public abstract class Manoeuvre
extends AocsObject
implements Monitorable

Manoeuvre is an abstract class providing default - and mostly trivial - implementations of its methods. Concrete manoeuvres are instances of subclasses of Manoeuvre. Manoeuvres are loaded in a manoeuvre manager that is responsible for correctly executing them. The manoeuvre manager uses the methods exposed by class Manoeuvre to control manoeuvre execution.

Manoeuvres are implemented as state machine. They can be in one of the following states: ready, inProcess, finished, aborted, onHold, beenReset. The current state is exposed as a monitorable property.

Manoeuvres act as event sources. They fire a manoeuvre event whenever their internal state changes and they fire a change event whenever their monitored property undergoes a change as specified by its registered monitors.

Copyright: see the Copyright Notice.

Version:
1.0
Author:
Tim Brown (St. Louis, MO, U.S.A.), Vaclav Cechticky (IfA ETHZ)
See Also:
The Manoeuvre Management Framelet Document.

Field Summary
static byte aborted
          Manoeuvre state
static byte beenReset
          Manoeuvre state
protected  byte currentState
           
protected  int execTime
           
static byte finished
          Manoeuvre state
static byte inProcess
          Manoeuvre state
static byte onHold
          Manoeuvre state
static byte ready
          Manoeuvre state
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
Manoeuvre()
          Manoeuvre
 
Method Summary
 void abort()
          The abort method is called to allow a manoeuvre to perform any clean-up actions before it is descheduled.
 void addChangeListener(ChangeListener l)
          Initialization method to register listeners to change events.
 void addManoeuvreListener(ManoeuvreListener l)
          Initialization method to register listeners to manoeuvre events.
 void addMonitor(PropertyMonitor m, ChangeObject c)
          Adds a new PropertyMonitor object into the list of registered property monitors together with a new ChangeObject specifying the change profile in which the registered minitor is interested.
 boolean canContinue()
          Manoeuvre execution should only proceed if external conditions are safe.
 boolean canHold()
          The manoeuvre manager may wish to temporarily interrupt execution of a manoeuvre.
 boolean canResume()
          The manoeuvre manager can request from the manoeuvre and indication of whether or not its execution can be resumed by calling the method canResume.
 boolean canStart()
          Return true if the manoeuvre is ready to start execution.
 void doContinue()
          Manoeuvres execute over a prolonged period of time.
protected  void fireChangeEvent(short eventTypeId, ChangeObject changeObject, double lastValue)
          Fire a change event to all registered listeners.
protected  void fireManoeuvreEvent(short eventTypeId)
          Fire a manoeuvre event to all registered listeners.
 AocsObject getAocsObject()
          Manouvres expose their current state as a monitorable property.
 double getMonitorablePropertyValue(int i)
          Manouvres expose their current state as a monitorable property.
 int getNumberOfMonitorableProperties()
          Manouvres expose a single monitorable property.
 byte getState()
          Returns the current state of the manoeuvre.
 int getTelemetryImageLength()
          Return the length in bits of the telemetry image that would be written by the object in response to a call to method writeToTelemetry.
 int getTimeTag()
          Manoeuvres may carry a time tag defining the time after which they can be considered for execution.
 short getType()
          Returns the manoeuvre type.
 void hold()
          If the manoeuvre manager decides to interrupt execution of the manoeuvre, it should call the method hold on the manoeuvre to allow it to take any action required in connection with a suspension of the manoeuvre.
 void initialize()
          Manoeuvres may have to perform some special initialization action when their execution begins.
 boolean isConfigured()
          Checks the configuration.
 boolean isFinished()
          The method isFinished returns true when the manoeuvre has terminated.
 boolean isHolding()
          The manoeuvre manager can determine whether or not the manoeuvre is currently suspended by calling the method isHolding.
 boolean isInUse()
          Returns the value of the inUse flag.
protected  void notifyMonitors(byte newManoeuvreState)
          When a manoeuvre's state changes, the manoeuvre is responsible for notifying any registered property monitors of its state change.
 void removeChangeListener(ChangeListener l)
          Initialization method to unregister change event listeners.
 void removeManoeuvreListener(ManoeuvreListener l)
          Initialization method to unregister manoeuvre event listeners.
 void removeMonitor(PropertyMonitor m)
          Removes a PropertyMonitor object from the list of registered monitors.
 void reset()
          Resetting a manoeuvre is similar, but not quite identical, to aborting the manoeuvre.
 void resetConfiguration()
          Resets configuration of the super object and performs the local reset of the configuration.
 void resume()
          When the manoeuvre execution is resumed, method resume should be called.
 void setInUse(boolean inUse)
          Flag inUse is true when the manoeuvre is loaded.
 void setMaxNumberOfChangeListeners(int n)
          Initialization method to set the maximum number of listeners to change events.
 void setMaxNumberOfManoeuvreListeners(int n)
          Initialization method to set the maximum number of listeners to manoeuvre events.
 void setPropertyMonitorListSize(int n)
          Initialization method to set the maximum number of monitors for the manoeuvre state property.
 void setTimeTag(int t)
          Sets a new time tag.
 void terminate()
          When the manoeuvre manager detects that the manoeuvre has terminated execution, it calls terminate to give the manoeuvre the chance to perform any final closedown actions and then de-schedules it.
 boolean wasAborted()
          Method wasAborted returns true if the manoeuvre has been aborted.
 void writeToTelemetry(TelemetryStream stream)
          Causes 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
 

Field Detail

ready

public static final byte ready
Manoeuvre state

See Also:
Constant Field Values

inProcess

public static final byte inProcess
Manoeuvre state

See Also:
Constant Field Values

finished

public static final byte finished
Manoeuvre state

See Also:
Constant Field Values

aborted

public static final byte aborted
Manoeuvre state

See Also:
Constant Field Values

onHold

public static final byte onHold
Manoeuvre state

See Also:
Constant Field Values

beenReset

public static final byte beenReset
Manoeuvre state

See Also:
Constant Field Values

execTime

protected int execTime

currentState

protected byte currentState
Constructor Detail

Manoeuvre

public Manoeuvre()
Manoeuvre

Method Detail

addManoeuvreListener

public void addManoeuvreListener(ManoeuvreListener l)
Initialization method to register listeners to manoeuvre events.


removeManoeuvreListener

public void removeManoeuvreListener(ManoeuvreListener l)
Initialization method to unregister manoeuvre event listeners.


setMaxNumberOfManoeuvreListeners

public void setMaxNumberOfManoeuvreListeners(int n)
Initialization method to set the maximum number of listeners to manoeuvre events. Attempts to call it more than once will result in a configuration error being generated.


addChangeListener

public void addChangeListener(ChangeListener l)
Initialization method to register listeners to change events.


removeChangeListener

public void removeChangeListener(ChangeListener l)
Initialization method to unregister change event listeners.


setMaxNumberOfChangeListeners

public void setMaxNumberOfChangeListeners(int n)
Initialization method to set the maximum number of listeners to change events. Attempts to call it more than once will result in a configuration error being generated.


fireManoeuvreEvent

protected void fireManoeuvreEvent(short eventTypeId)
Fire a manoeuvre event to all registered listeners. The event records a change in the internal state of the manoeuvre.


fireChangeEvent

protected void fireChangeEvent(short eventTypeId,
                               ChangeObject changeObject,
                               double lastValue)
Fire a change event to all registered listeners. The event records a change in the single monitored property exposed by the manoeuvre object.

Parameters:
eventTypeId - the event type identifier
changeObject - the change object through which the propoerty value was passed and that triggered the property change
lastValue - the most recent value of the property that underwent the change

notifyMonitors

protected void notifyMonitors(byte newManoeuvreState)
When a manoeuvre's state changes, the manoeuvre is responsible for notifying any registered property monitors of its state change. This notification is carried out by firing a change event and by invoking the monitor's propertyChange method.

Parameters:
newManoeuvreState - is a new changed manoeuvre state.

canStart

public boolean canStart()
Return true if the manoeuvre is ready to start execution. Reaching the time tag is not necessarily enough to trigger execution of a manoeuvre. Sometimes, other conditions have to be satisfied to ensure that the manoeuvre can execute safely.

Returns:
the true value if the Aocs context in such as to make execution of the manoeuvre safe. The manoeuvre manager will only start manoeuvre execution if the method canStart() returns true.

initialize

public void initialize()
Manoeuvres may have to perform some special initialization action when their execution begins. This method encapsulates this type of action. It is called by the manoeuvre manager the first time the manoeuvre is executed.


canContinue

public boolean canContinue()
Manoeuvre execution should only proceed if external conditions are safe. For instance, a manoeuvre that performs a slew should periodically check that the spacecraft is indeed following the slew profile. If the deviation from the slew profile exceeds some pre-specified threshold, then an error is likely to have occurred and the manoeuvre should be aborted. The manoeuvre manager can call this method to ask the manoeuvre to verify if the conditions for its continued execution hold. If they do, then method doContinue can be called and the manoeuvre execution is advanced. If they do not, the manoeuvre is aborted. After a manoeuvre is aborted it is cancelled from the list of pending manoeuvres and will no longer be executed.

Returns:
the true value if the conditions for its continued execution hold

doContinue

public void doContinue()
Manoeuvres execute over a prolonged period of time. This method is called by the manoeuvre manager to advance the execution of the manoeuvre. When a manoeuvre object receives this command, it retrieves the current aocs time and performs any actions that are due for execution at that time. This is an empty method and must be defined in concrete subclasses of Manoeuvre.


abort

public void abort()
The abort method is called to allow a manoeuvre to perform any clean-up actions before it is descheduled. The manoeuvre manager calls abort when a manoeuvre must be aborted. This may happen either because the manoeuvre itself declares that it is unable to continue execution (i.e. canContinue returns false) or because the manoeuvre manager autonomously decides to abort the manoeuvre.


wasAborted

public boolean wasAborted()
Method wasAborted returns true if the manoeuvre has been aborted.


terminate

public void terminate()
When the manoeuvre manager detects that the manoeuvre has terminated execution, it calls terminate to give the manoeuvre the chance to perform any final closedown actions and then de-schedules it. The base Manoeuvre class does not implement any termination action other than firing a manoeuvre event to inform event listeners of the manoeuvre termination.


isFinished

public boolean isFinished()
The method isFinished returns true when the manoeuvre has terminated.


canHold

public boolean canHold()
The manoeuvre manager may wish to temporarily interrupt execution of a manoeuvre. The manoeuvre manager can call the method canHold on the manoeuvre to determine whether or not execution of the manoeuvre can be temporarily interrupted.


hold

public void hold()
If the manoeuvre manager decides to interrupt execution of the manoeuvre, it should call the method hold on the manoeuvre to allow it to take any action required in connection with a suspension of the manoeuvre.


isHolding

public boolean isHolding()
The manoeuvre manager can determine whether or not the manoeuvre is currently suspended by calling the method isHolding.


canResume

public boolean canResume()
The manoeuvre manager can request from the manoeuvre and indication of whether or not its execution can be resumed by calling the method canResume.


resume

public void resume()
When the manoeuvre execution is resumed, method resume should be called.


getTelemetryImageLength

public int getTelemetryImageLength()
Return the length in bits of the telemetry image that would be written by the object in response to a call to method writeToTelemetry.

Specified by:
getTelemetryImageLength in interface Telemeterable
Overrides:
getTelemetryImageLength in class AocsObject
Returns:
the length in bits of the telemetry image

writeToTelemetry

public void writeToTelemetry(TelemetryStream stream)
Causes the object to write its own state to the telemetry stream.

Specified by:
writeToTelemetry in interface Telemeterable
Overrides:
writeToTelemetry in class AocsObject
Parameters:
stream - the telemetry stream

reset

public void reset()
Resetting a manoeuvre is similar, but not quite identical, to aborting the manoeuvre. Resetting a manoeuvre, which is done by calling the this method of the manoeuvre, can be thought of as a more gentle form of aborting the manoeuvre. Resetting a manoeuvre causes the manoeuvre's canContinue() method to return false. When the canContinue method returns false, the manoeuvre manager responds by aborting the manoeuvre.

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

resetConfiguration

public void resetConfiguration()
Resets configuration of the super object and performs the local reset of the configuration.

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

isConfigured

public boolean isConfigured()
Checks the configuration.

Specified by:
isConfigured in interface Configurable
Overrides:
isConfigured in class AocsObject
Returns:
the true value if the object is configured, otherwise returns false

setInUse

public void setInUse(boolean inUse)
Flag inUse is true when the manoeuvre is loaded. The flag is set to true by the manoeuvre manager when it loads the manoeuvre and reset to false when it unloads it.


isInUse

public boolean isInUse()
Returns the value of the inUse flag.


setPropertyMonitorListSize

public void setPropertyMonitorListSize(int n)
Initialization method to set the maximum number of monitors for the manoeuvre state property. This method should only be called once. Attempts to call it more than once will result in a configuration error event being generated.

Parameters:
n - is a size of the property monitor list

addMonitor

public void addMonitor(PropertyMonitor m,
                       ChangeObject c)
Adds a new PropertyMonitor object into the list of registered property monitors together with a new ChangeObject specifying the change profile in which the registered minitor is interested. object into the change object list.

Parameters:
m - the property monitor
c - the change object specifying the change profile in which the property monitor is interested

removeMonitor

public void removeMonitor(PropertyMonitor m)
Removes a PropertyMonitor object from the list of registered monitors.

Parameters:
m - the property monitor

getTimeTag

public int getTimeTag()
Manoeuvres may carry a time tag defining the time after which they can be considered for execution. This method is provided to retrieve a manoeuvre's time tag.


setTimeTag

public void setTimeTag(int t)
Sets a new time tag.

Parameters:
t - the new time tag

getState

public byte getState()
Returns the current state of the manoeuvre.


getMonitorablePropertyValue

public double getMonitorablePropertyValue(int i)
Manouvres expose their current state as a monitorable property. Manoeuvres expose a single property. This method always return the current state regardless of the value of argument i. Attempts to access the property values with i greater than 0 will result in the generation of a failure event.

Specified by:
getMonitorablePropertyValue in interface Monitorable
See Also:
Monitorable

getNumberOfMonitorableProperties

public int getNumberOfMonitorableProperties()
Manouvres expose a single monitorable property.

Specified by:
getNumberOfMonitorableProperties in interface Monitorable

getAocsObject

public AocsObject getAocsObject()
Manouvres expose their current state as a monitorable property.

Specified by:
getAocsObject in interface Monitorable

getType

public short getType()
Returns the manoeuvre type. In the current implementation, the type of a manoeuvre is the same as its class identifier.


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