Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

CC_TelemetryManager Class Reference
[Functionality ManagersTelemetry Management]

#include <CC_TelemetryManager.h>

Inheritance diagram for CC_TelemetryManager:

CC_RootObject List of all members.

Detailed Description

This class encapsulates a telemetry manager.

The telemetry manager is responsible for controlling the dispatch of telemetry packets to the telemetry stream. The telemetry packets can be dispatched to the telemetry stream in two modes:

The telemetry mode manager is a plug-in component that must be configured with the telemetry packets by an external client. The packets for immediate dispatch are instead loaded in an internal queue (the immediate dispatch queue) whose size must be defined as part of the configuration procedure of the telemetry manager.

The telemetry packets are written to the telemetry stream when the telemetry stream is activated (invocation of method activate). At this time, the telemetry packets that were directly loaded since the last activation and the telemetry packets that are provided by the telemetry mode manager are first updated and then their written to the telemetry stream.

The telemetry manager contributes to the management of the "in use" status of telemetry packets. More precisely, packets that are submitted for immediate dispatch are marked as "no longer in use" after being processed.

The telemetry stream component is a plug-in component of the telemetry manager.

The configuration procedure for a newly instantiated telemetry manager is as follows:

  1. Load a telemetry stream component (method setTelemetryStream).
  2. Load a telemetry mode manager component (method setTelemetryModeManager).
  3. Set the size of the immediate dispatch queue (method setImmediateQueueSize).
The above operations can be executed in any order.

See also:
TelemetryPacket
Author:
Alessandro Pasetti (P&P Software GmbH)
Version:
1.0

Definition at line 70 of file CC_TelemetryManager.h.

Public Member Functions

 CC_TelemetryManager (void)
 Instantiate a telemetry manager.

void setTelemetryModeManager (TelemetryModeManager *pTmModeManager)
 Load the telemetry mode manager.

TelemetryModeManagergetTelemetryModeManager (void) const
 Get the telemetry mode manager.

void setTelemetryStream (TelemetryStream *pTmStream)
 Load the telemetry stream component.

TelemetryStreamgetTelemetryStream (void) const
 Get the telemetry stream component.

void setImmediateQueueSize (unsigned int size)
 Set the size of the immediate dispatch queue.

unsigned int getImmediateQueueSize ()
 Return the size of the immediate dispatch queue.

TelemetryPacketgetImmediateQueueEntry (unsigned int i)
 Return the i-th entry in the immediate dispatch queue.

bool isImmediateQueueFull ()
 Return true if the size of the immediate dispatch queue is zero or if the immediate dispatch queue is full.

virtual void activate (void)
 Dispatch the telemetry packets to the telemetry stream.

void sendTelemetryPacket (TelemetryPacket *pTmPacket)
 Add the argument telemetry packet to the immediate dispatch queue.

void unloadTelemetryPacket (TelemetryPacket *pTmPacket)
 Check if the argument telemetry packet is currently in the immediate dispatch queue and, if it is, remove it.

unsigned int getImmediateQueueLoaded ()
 Return the number of telemetry packets currently loaded in the immediate dispatch queue.

virtual bool isObjectConfigured (void)
 Perform a class-specific configuration check on the telemetry manager: verify that the telemetry stream and telemetry mode manager have been loaded and that the size of the immediate load packet queue has been set.


Constructor & Destructor Documentation

CC_TelemetryManager::CC_TelemetryManager void   ) 
 

Instantiate a telemetry manager.

The class identifier is set and all internal data structures are initialized to illegal values to signify that the component is not yet configured.

Definition at line 20 of file CC_TelemetryManager.cpp.


Member Function Documentation

void CC_TelemetryManager::activate void   )  [virtual]
 

Dispatch the telemetry packets to the telemetry stream.

Both the telemetry packets provided by the telemetry mode manager and those loaded for immediate dispatch since the last activation are written to the telemetry stream. A pseudo-code implementation for this method is as follows:

      for (all pTmPacket items in the immediate dispatch queue) {
          pTmPacket->update();
          if ( !pTmPacket->isValid() ) {
              createEventReport(EVT_TM_WORD_NOT_VALID);
              pTmPacket->setInUse(false);
          }
          if ( !pTmPacket fits in telemetry stream )
              createEventReport(EVT_TOO_MANY_TM_BYTES);
              pTmPacket->setInUse(false);
          }
          pTmStream->write(pTmPacket)
          pTmPacket->setInUse(false);
      }
      . . .   // clear immediate dispatch queue
      for (all pTmPacket items provided by the telemetry mode manager) {
          pTmPacket->update();
          if ( !pTmPacket->isValid() ) {
              createEventReport(EVT_TM_WORD_NOT_VALID);
          }
          if ( !pTmPacket fits in telemetry stream )
              createEventReport(EVT_TOO_MANY_TM_BYTES);
          }
          pTmStream->write(pTmPacket)
      }
      pTmStream->flush(); 
In the above pseudo-code, pTmStream is the telemetry stream where the telemetry packets are written and pTmFactory is the telemetry packet factory.

Each telemetry packet is first updated and its validity is then checked. If validity is confirmed, it is checked that the packet fits in the telemetry stream. If it does, it is written to the telemetry stream. In the case of telemetry packets from the immediate dispatch queue, the packets are marked as "no longer in use" after being processed. If the telemetry packet is not valid or if it does not fit in the telemetry channel, event reports are generated. After all telemetry packets have been processed, the telemetry stream is flushed.

See also:
TD_EventType

Definition at line 73 of file CC_TelemetryManager.cpp.

TelemetryPacket * CC_TelemetryManager::getImmediateQueueEntry unsigned int  i  ) 
 

Return the i-th entry in the immediate dispatch queue.

The index i should lie in the range [0,N-1] where N is the size of the queue. If the value of i is out of range, a null pointer is returned. A null pointer will also be returned if the i-the entry in the queue is empty. This method is only intended for testing purposes. It should not be used in an operational context. This method may return null

Returns:
the size of the immediate dispatch queue

Definition at line 60 of file CC_TelemetryManager.cpp.

unsigned int CC_TelemetryManager::getImmediateQueueLoaded  ) 
 

Return the number of telemetry packets currently loaded in the immediate dispatch queue.

Returns:
the number of telemetry packets currently loaded in the immediate dispatch queue

Definition at line 155 of file CC_TelemetryManager.cpp.

unsigned int CC_TelemetryManager::getImmediateQueueSize  ) 
 

Return the size of the immediate dispatch queue.

Returns:
the size of the immediate dispatch queue

Definition at line 56 of file CC_TelemetryManager.cpp.

TelemetryModeManager * CC_TelemetryManager::getTelemetryModeManager void   )  const
 

Get the telemetry mode manager.

Returns:
the telemetry mode manager

Definition at line 33 of file CC_TelemetryManager.cpp.

TelemetryStream * CC_TelemetryManager::getTelemetryStream void   )  const
 

Get the telemetry stream component.

Returns:
the telemetry stream component

Definition at line 43 of file CC_TelemetryManager.cpp.

bool CC_TelemetryManager::isImmediateQueueFull  ) 
 

Return true if the size of the immediate dispatch queue is zero or if the immediate dispatch queue is full.

Returns:
true if the immediate dispatch queue is full

Definition at line 66 of file CC_TelemetryManager.cpp.

bool CC_TelemetryManager::isObjectConfigured void   )  [virtual]
 

Perform a class-specific configuration check on the telemetry manager: verify that the telemetry stream and telemetry mode manager have been loaded and that the size of the immediate load packet queue has been set.

Returns:
true if the telemetry manager is configured, false otherwise.

Reimplemented from CC_RootObject.

Definition at line 167 of file CC_TelemetryManager.cpp.

void CC_TelemetryManager::sendTelemetryPacket TelemetryPacket pTmPacket  ) 
 

Add the argument telemetry packet to the immediate dispatch queue.

The telemetry packet will be dispatched to the telemetry stream at the next activation of the telemetry manager. If the queue is already full, then an event report of type EVT_TM_QUEUE_FULL is generated.

Parameters:
pTmPacket the telemetry packet component

Definition at line 129 of file CC_TelemetryManager.cpp.

void CC_TelemetryManager::setImmediateQueueSize unsigned int  size  ) 
 

Set the size of the immediate dispatch queue.

This is an initialization method. It should only be called once. The size of the immediate dispatch queue can be zero for the case of applications where the immediate load service is disabled.

Parameters:
size the size of the immediate load packet queue

Definition at line 48 of file CC_TelemetryManager.cpp.

void CC_TelemetryManager::setTelemetryModeManager TelemetryModeManager pTmModeManager  ) 
 

Load the telemetry mode manager.

Parameters:
pTmModeManager the telemetry mode manager

Definition at line 28 of file CC_TelemetryManager.cpp.

void CC_TelemetryManager::setTelemetryStream TelemetryStream pTmStream  ) 
 

Load the telemetry stream component.

The telemetry stream is reset immediately after being loaded.

Parameters:
pTmStream the telemetry stream component

Definition at line 38 of file CC_TelemetryManager.cpp.

void CC_TelemetryManager::unloadTelemetryPacket TelemetryPacket pTmPacket  ) 
 

Check if the argument telemetry packet is currently in the immediate dispatch queue and, if it is, remove it.

Failure to find the argument packet is treated as a nominal situation and is therefore not recorded through an event report.

Parameters:
pTmPacket the telemetry packet component

Definition at line 142 of file CC_TelemetryManager.cpp.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved