#include <CC_ManoeuvreManager.h>
Inheritance diagram for CC_ManoeuvreManager:
The manoeuvre manager is responsible for controlling the execution of manoeuvres. Manoeuvres are loaded into the manoeuvre manager and from that moment onward their execution, termination, and abortion remain under the control of the manoeuvre manager. The manoeuvre manager sees manoeuvres as instances of type Manoeuvre
.
The manoeuvre manager maintains a list of pending manoeuvres. This is called the pending manoeuvre list. The pending manoeuvres are the manouvres that are currently loaded into the manoeuvre manager and that are either executing or awaiting to start execution.
External entities typically performs three types of operations upon a manoeuvre manager. They can load a new manoeuvre in the manoeuvre manager. They can abort execution of an already loaded manoeuvre. They can activate the manoeuvre manager to advance the execution of the pending manoeuvres.
The manoeuvre manager contributes to the management of the "in use" status of manoeuvres. More precisely, before unloading a manoeuvre, the manoeuvre manager marks if as "no longer in use".
The manoeuvre manager creates event reports to record the following occurrences:<ul> Attempt to load a manoeuvre when the list of pending manoeuvres is already full A new manoeuvre is loaded A manoeuvre is unloaded In all cases, the event originator that is passed to the event creation method is the manoeuvre that is being processed. Note that the creation of event reports describing changes of state of the manoeuvre are the responsibility of the manoeuvres themselves.
Definition at line 64 of file CC_ManoeuvreManager.h.
Public Member Functions | |
CC_ManoeuvreManager (void) | |
Instantiate a manoeuvre manager. | |
void | reset (void) |
Unload all pending manoeuvres (aborting those that are executing). | |
void | setPendingManoeuvreListSize (const unsigned int listSize) |
Set the size of the pending manoeuvre list representing the maximum number of pending manoeuvre that can be managed by the manoeuvre manager. | |
unsigned int | getPendingManoeuvreListSize (void) |
Get the size of the pending manoeuvre list. | |
unsigned int | getPendingManoeuvres (void) |
Get the number of currently pending manoeuvres. | |
virtual void | load (Manoeuvre *pManoeuvre) |
Load a manoeuvre. | |
virtual void | abort (Manoeuvre *pManoeuvre) |
Abort a manoeuvre. | |
virtual void | activate (void) |
Advance execution of pending manoeuvres. | |
virtual bool | isObjectConfigured (void) |
Perform a class-specific configuration check: verify that the size of the pending manoeuvre list has a legal value. | |
Protected Member Functions | |
virtual void | unload (Manoeuvre *pManoeuvre) |
Unload a manoeuvre. |
|
Instantiate a manoeuvre manager. The size of the pending manoeuvre list is initialized to an illegal value to signify that the manoeuvre manager is not yet configured. The class identifier is set. Definition at line 17 of file CC_ManoeuvreManager.cpp. |
|
Abort a manoeuvre.
An for (all manoeuvre m in the list of pending manoeuvres) if (m==pManoeuvre) { pManoeuvre->abort(); pManoeuvre->setInUse(false); . . . // delete pManoeuvre from list of pending manoeuvres); createEventReport(EVT_MAN_UNLOADED); } return;
Definition at line 97 of file CC_ManoeuvreManager.cpp. |
|
Advance execution of pending manoeuvres. When this method is called, the manoeuvre manager goes through the list of pending manoeuvres and processes them in sequence. This method would typically be called by an external scheduler. A pseudo-code implementation for this method is as follows: for (all manoeuvres m in the list of pending manoeuvres) if ( (!m->isExecuting()) && (m->canStart()) ) { m->initialize(); m->doContinue(); } else if ( (m->isExecuting()) && (m->canContinue()) ) m->doContinue(); else if ( (m->isExecuting()) && (!m->canContinue()) ) m->abort();
if ( m->isFinished() ) m->terminate(); unload(m); } Definition at line 115 of file CC_ManoeuvreManager.cpp. |
|
Get the size of the pending manoeuvre list.
Definition at line 42 of file CC_ManoeuvreManager.cpp. |
|
Get the number of currently pending manoeuvres.
Definition at line 92 of file CC_ManoeuvreManager.cpp. |
|
Perform a class-specific configuration check: verify that the size of the pending manoeuvre list has a legal value.
Reimplemented from CC_RootObject. Definition at line 143 of file CC_ManoeuvreManager.cpp. |
|
Load a manoeuvre.
When a manoeuvre is loaded, it is inserted in the list of pending manoeuvres and is then considered for execution by method If the list of pending manoeuvres is already full, no action is taken other than the creation of an event report to record the attempted manoeuvre load. The manoeuvre manager creates an event whenever a new manoeuvre is loaded. A pseudo-code implementation for this method is as follows: if (list of pending manoeuvres is full) // the manoeuvre list is full { createEventReport(EVT_MAN_LIST_FULL); return; } . . . // insert manoeuvre in list of pending manoeuvres createEventReport(EVT_MAN_LOADED); return;The manId parameter in the above pseudo-code is a manoeuvre identifier. This class uses the class identifier of the manoeuvre component as its identifier.
Definition at line 47 of file CC_ManoeuvreManager.cpp. |
|
Unload all pending manoeuvres (aborting those that are executing). A reset bring the telecommand manager to the state where it was immediately after having being configured. Definition at line 24 of file CC_ManoeuvreManager.cpp. |
|
Set the size of the pending manoeuvre list representing the maximum number of pending manoeuvre that can be managed by the manoeuvre manager. This method causes the memory for the pending manoeuvre list data structure to be allocated and the data structure to be initialized. Only positive values of the manoeuvre list size are legal. This is an initialization method. It should be called before the manoeuvre manager is used the first time and it should not be called more than once.
Definition at line 32 of file CC_ManoeuvreManager.cpp. |
|
Unload a manoeuvre. The manoeuvre is removed from the list of pending manoeuvres and will no longer be considered for execution. The "inUse" status of the manoeuvre is changed to: "manoeuvre not in use". A pseudo-code implementation for this method is as follows: . . . // remove manoeuvre from list of pending manoeuvres pManoeuvre->inUse(false) // mark manoeuvre as "not in use" createEventReport(EVT_MAN_UNLOADED); return;The manId parameter in the above pseudo-code is a manoeuvre identifier. This class uses the class identifier of the manoeuvre component as identifier.
Definition at line 70 of file CC_ManoeuvreManager.cpp. |