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

DC_PUSTmLogger Class Reference

#include <DC_PUSTmLogger.h>

Inheritance diagram for DC_PUSTmLogger:

TelemetryStream CC_RootObject List of all members.

Detailed Description

Telemetry logger stream that logs all telemetry packets in an internal data structure and offers methods to inspect their content.

This class defines a telemetry buffer where telemetry packets are stored as they are written to the telemetry stream. The telemetry buffer is organized as a circular buffer. When the end of the buffer is reached, its first entry is overwritten. This class must be configured by specifying the capacity of the buffer and the maximum length (in bytes) of the application data of the telemetry packets to be stored in the buffer. This class is intended to be used for testing purposes only.

This telemetry stream writes the following data to the telemery buffer for each telemetry packet:

Each of the above items can be separately accessed through dedicated getter methods.
Author:
Alessandro Pasetti (P&P Software GmbH)
Version:
1.0

Definition at line 42 of file DC_PUSTmLogger.h.

Public Member Functions

 DC_PUSTmLogger (void)
 Instantiate the component.

void setBufferCapacity (unsigned int n)
 Set the capacity of the telemetry buffer.

unsigned int getBufferCapacity (void) const
 Return the capacity of the telemetry buffer.

void setMaxPacketLength (unsigned int n)
 Set the maximum length (in number of bytes) of the application of the telemetry packets.

unsigned int getMaxPacketLength (void) const
 Return the capacity of the telemetry buffer.

unsigned int getPacketCounter (void) const
 Get the number of packets that have been written to the telemetry logger so far.

TD_TelemetryType getType (unsigned int i) const
 Get the type of the i-th packet before the last in the telemetry buffer.

TD_TelemetrySubType getSubType (unsigned int i) const
 Get the subtype of the i-th packet before the last in the telemetry buffer.

TD_ObsTime getTimeTag (unsigned int i) const
 Get the time tag of the i-th packet before the last in the telemetry buffer.

unsigned int getLength (unsigned int i) const
 Get the length (number of bytes in the application data) of the i-th packet before the last in the telemetry buffer.

unsigned char getData (unsigned int i, unsigned int j) const
 Get the j-th application data byte of the i-th packet before the last in the telemetry buffer.

virtual bool doesPacketFit (TelemetryPacket *pPacket)
 Return true if the argument packet fits in the telemetry logger.

virtual void write (TelemetryPacket *pItem)
 Write one telemetry packet to the telemetry logger.

virtual bool isObjectConfigured (void)
 Perform a class-specific configuration check on the telemetry logger stream: verify that the maximum length of the telemetry packets and the maximum number of telemetry packets have been set.


Constructor & Destructor Documentation

DC_PUSTmLogger::DC_PUSTmLogger void   ) 
 

Instantiate the component.

The class identifier is set. The telemetry buffer is left uninitialized to signify that the component is not yet configured.

Definition at line 21 of file DC_PUSTmLogger.cpp.


Member Function Documentation

bool DC_PUSTmLogger::doesPacketFit TelemetryPacket pPacket  )  [virtual]
 

Return true if the argument packet fits in the telemetry logger.

A pseudo-code implementation for this method is as follows:

      if ( pItem->getNumberOfBytes()<getMaxPacketLength() )
          return true;
	    else
          return false; 
Parameters:
pPacket the telemetry packet to be written to the telemetry stream
Returns:
true if the telemetry packet fits in the telemetry logger, false otherwise

Reimplemented from TelemetryStream.

Definition at line 71 of file DC_PUSTmLogger.cpp.

unsigned int DC_PUSTmLogger::getBufferCapacity void   )  const
 

Return the capacity of the telemetry buffer.

See also:
setBufferCapacity
Returns:
the capacity of the telemetry buffer

Definition at line 45 of file DC_PUSTmLogger.cpp.

unsigned char DC_PUSTmLogger::getData unsigned int  i,
unsigned int  j
const
 

Get the j-th application data byte of the i-th packet before the last in the telemetry buffer.

The way the argument i is interpreted is the same as for method getType. The argument j must lie in the range [0,L-1] where L is the length of the i-th packet (as returned by method getLength).

See also:
getType
Parameters:
i the packet index
j the byte index
Returns:
the application data byte

unsigned int DC_PUSTmLogger::getLength unsigned int  i  )  const
 

Get the length (number of bytes in the application data) of the i-th packet before the last in the telemetry buffer.

The way the argument i is interpreted is the same as for method getType.

See also:
getType
Parameters:
i the packet index
Returns:
the packet length

unsigned int DC_PUSTmLogger::getMaxPacketLength void   )  const
 

Return the capacity of the telemetry buffer.

See also:
setBufferCapacity
Returns:
the capacity of the telemetry buffer

Definition at line 63 of file DC_PUSTmLogger.cpp.

unsigned int DC_PUSTmLogger::getPacketCounter void   )  const
 

Get the number of packets that have been written to the telemetry logger so far.

Returns:
the number of packets written so far

Definition at line 67 of file DC_PUSTmLogger.cpp.

TD_TelemetrySubType DC_PUSTmLogger::getSubType unsigned int  i  )  const
 

Get the subtype of the i-th packet before the last in the telemetry buffer.

The way the argument i is interpreted is the same as for method getType.

See also:
getType
Parameters:
i the packet index
Returns:
the packet sub type

TD_ObsTime DC_PUSTmLogger::getTimeTag unsigned int  i  )  const
 

Get the time tag of the i-th packet before the last in the telemetry buffer.

The way the argument i is interpreted is the same as for method getType.

See also:
getType
Parameters:
i the packet index
Returns:
the packet time tag

TD_TelemetryType DC_PUSTmLogger::getType unsigned int  i  )  const
 

Get the type of the i-th packet before the last in the telemetry buffer.

If N is the number of packets to have been written so far to the telemetry logger stream, then this method returns the type of the (N-i)-th packet to have been written to the logger. The value of i should be smaller than the capacity of the telemetry buffer. If this is not the case, then a value of zero is returned.

Parameters:
i the packet index
Returns:
the packet type

bool DC_PUSTmLogger::isObjectConfigured void   )  [virtual]
 

Perform a class-specific configuration check on the telemetry logger stream: verify that the maximum length of the telemetry packets and the maximum number of telemetry packets have been set.

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

Reimplemented from CC_RootObject.

Definition at line 108 of file DC_PUSTmLogger.cpp.

void DC_PUSTmLogger::setBufferCapacity unsigned int  n  ) 
 

Set the capacity of the telemetry buffer.

The capacity of the telemetry buffer is the maximum number of telemetry packets that can be written to the buffer without overwriting any existing packet. This is an initialization method that should only be called once. Only positive values for the argument of this method are legal.

Parameters:
n the capacity of the telemetry buffer

Definition at line 29 of file DC_PUSTmLogger.cpp.

void DC_PUSTmLogger::setMaxPacketLength unsigned int  n  ) 
 

Set the maximum length (in number of bytes) of the application of the telemetry packets.

This is an initialization method that should only be called once. Only positive values for the argument of this method are legal.

Parameters:
n the maximum length of the telemetry packet application data

Definition at line 49 of file DC_PUSTmLogger.cpp.

void DC_PUSTmLogger::write TelemetryPacket pItem  )  [virtual]
 

Write one telemetry packet to the telemetry logger.

When the telemetry logger is full, its oldest entry is overwritten. If the length of the packet exceeds M (the maximum length set with method setMaxPacketLength), then only the first M application data bytes are written to the telemetry logger. The telemetry packet data are extracted from the telemetry packet component through its data acquisition service. If the packet provides it, then the fast version of the service is used. Otherwise the safe version is used. Method isFastAcquisitionImplemented is used to determine whether the fast version is provided.

Parameters:
pItem the telemetry packet to be written to the telemetry stream

Implements TelemetryStream.

Definition at line 80 of file DC_PUSTmLogger.cpp.


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