Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.ModeManagement
Class CyclingModeManager

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
              |
              +--RtjAocsFramework.ModeManagement.ModeManager
                    |
                    +--RtjAocsFramework.ModeManagement.CyclingModeManager
All Implemented Interfaces:
Configurable, Monitorable, Resettable, Telemeterable
Direct Known Subclasses:
CyclingControllerModeManager, CyclingTelemetryModeManager

public class CyclingModeManager
extends ModeManager

This class encapsulates a cycling mode manager that uses the "on-call mode update mechanism" to cycle through its modes in a fixed sequence. Cycling mode managers have only one strategy. A mode transition is triggered whenever the implementer is retrieved (ie. their updateMode method is called whenever getImplemeter is called). Thus, the cycling mode manager returns its implementers one after the other in a fixed sequence.

The implementers are treated as instances of RootObject. Hence, this class should not be used by itself (except for testing) but should instead be placed in wrapper that performs the (potentially unsafe) type casts between RootObject and the type of the implementers.

Copyright: see the Copyright Notice.

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

Field Summary
 
Fields inherited from class RtjAocsFramework.ModeManagement.ModeManager
currentMode, nModes, nStrategies
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
CyclingModeManager()
          Default constructor: the object should not be used before being initialized.
CyclingModeManager(int nModes, int defaultMode, int numberOfListeners)
          Recall that cycling mode managers can have only one strategy and therefore the number of strategies does not appear as a constructor parameter.
 
Method Summary
 RootObject getImplementer(int strategy)
          This method first retrieves the implementer corresponding to the current mode and then calls updateMode.
 void setNumberOfStrategies(int n)
          Calling this method causes a configuration error.
protected  void updateMode()
          The cycling mode manager cycles through all available modes in sequence.
 
Methods inherited from class RtjAocsFramework.ModeManagement.ModeManager
addChangeListener, addModeListener, changeMode, disableMode, enableMode, fireChangeEvent, fireModeEvent, forceMode, getAocsObject, getDefaultMode, getMode, getModeChangeAction, getMonitorablePropertyValue, getNumberOfModes, getNumberOfMonitorableProperties, getTelemetryImageLength, isConfigured, isModeLegal, loadImplementer, notifyMonitors, releaseMode, removeChangeListener, removeModeListener, reset, resetConfiguration, setDefaultMode, setMaxNumberOfChangeListeners, setMaxNumberOfModeListeners, setMode, setModeChangeAction, setNumberOfModes, setPropertyMonitorListSize, writeToTelemetry
 
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

CyclingModeManager

public CyclingModeManager(int nModes,
                          int defaultMode,
                          int numberOfListeners)
Recall that cycling mode managers can have only one strategy and therefore the number of strategies does not appear as a constructor parameter.

Parameters:
nModes - number of modes managed by the mode manager
defaultMode - default mode upon creation and after reset
numberOfListeners - maximum number of listeners to mode events

CyclingModeManager

public CyclingModeManager()
Default constructor: the object should not be used before being initialized. Initialization is performed by setting the number of modes, the default mode, the maximum number of mode event listeners and the mode change action. The number of strategies is set by default equal to 1.

Method Detail

setNumberOfStrategies

public void setNumberOfStrategies(int n)
Calling this method causes a configuration error. The number of strategies is always equal to 1 in a cycling mode manager.

Overrides:
setNumberOfStrategies in class ModeManager

updateMode

protected void updateMode()
The cycling mode manager cycles through all available modes in sequence. When updateMode is called, a transition is made to the next higher mode. If the current mode was the highest mode, then a transition is made to mode 0.

Overrides:
updateMode in class ModeManager
See Also:
ModeManager.updateMode()

getImplementer

public RootObject getImplementer(int strategy)
This method first retrieves the implementer corresponding to the current mode and then calls updateMode. Thus, a mode transition is performed whenever the implementer is access. This ensures that successive accesses will return all implementers in sequence.

Recall that cycling mode managers only have one strategy and hence the strategy argument must always be equal to 1.

Overrides:
getImplementer in class ModeManager

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