|
Real-Time Java AOCS Framework v1.0 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--RtjAocsFramework.BasicObjects.RootObject
|
+--RtjAocsFramework.BasicObjects.AocsObject
|
+--RtjAocsFramework.ModeManagement.ModeManager
|
+--RtjAocsFramework.ModeManagement.CyclingModeManager
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.
| 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.BasicObjects.RootObject |
getClassId, getInstanceId, setClassId |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CyclingModeManager(int nModes,
int defaultMode,
int numberOfListeners)
nModes - number of modes managed by the mode managerdefaultMode - default mode upon creation and after resetnumberOfListeners - maximum number of listeners to mode eventspublic CyclingModeManager()
| Method Detail |
public void setNumberOfStrategies(int n)
setNumberOfStrategies in class ModeManagerprotected void updateMode()
updateMode in class ModeManagerModeManager.updateMode()public RootObject getImplementer(int strategy)
Recall that cycling mode managers only have one strategy and hence the strategy argument must always be equal to 1.
getImplementer in class ModeManager
|
Real-Time Java AOCS Framework v1.0 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||