#include <DC_CycleDataItem16TmStream.h>
Inheritance diagram for DC_CycleDataItem16TmStream:
The data items will normally encapsulate hardware registers representing the telemetry interface. The data items are implemented as instances of class DC_RawDataItem
.
This class maintains a write counter. The write counter has a value between 0 and N-1 where N is the number of data items managed by the telemetry stream. The counter is reset to 0 by a call to operation reset
or flush
. It is incremented by 1 every time a new 16-bit word is written to a data item. When the write counter reaches the value of N, no further items can be written and write requests remain without effect until a reset
or flush
is performed.
The number of data items is a user-defined parameter. It must be set as part of the component configuration.
Definition at line 42 of file DC_CycleDataItem16TmStream.h.
Public Member Functions | |
DC_CycleDataItem16TmStream (void) | |
Instantiate the component. | |
virtual void | reset (void) |
Reset the telemetry stream. | |
virtual void | flush (void) |
The flush operation is equivalent to a reset operation. | |
virtual unsigned int | getCapacity (void) |
Return the number of data items managed by this telemetry stream. | |
void | setNumberOfDataItems (unsigned int n) |
Set the number of data items managed by this telemetry stream. | |
void | setDataItem (unsigned int n, DC_RawDataItem *pDataItem) |
Set the n-th data item. | |
virtual bool | doesPacketFit (TelemetryPacket *pPacket) |
Return true if it is possible to write the entire content of the argument telemetry packet to the data item. | |
virtual void | write (TelemetryPacket *pItem) |
Write the telemetry packet content to the data items. | |
virtual bool | isObjectConfigured (void) |
Perform a class-specific configuration check on the telemetry stream: verify that the number of data items has been set and that all data items have been loaded. |
|
Instantiate the component. The class identifier is set. The number of data items is set to an illegal value to signify that the component is not yet configured. Definition at line 23 of file DC_CycleDataItem16TmStream.cpp. |
|
Return true if it is possible to write the entire content of the argument telemetry packet to the data item. A pseudo-code implementation for this method is as follows: if ( pItem->getNumberOfBytes() greater than 2*(N-writeCounter) ) return false; else return true;where N is the number of data items in the telemetry stream and writeCounter is the value of the write counter.
Reimplemented from TelemetryStream. Definition at line 62 of file DC_CycleDataItem16TmStream.cpp. |
|
The flush operation is equivalent to a reset operation.
Reimplemented from TelemetryStream. Definition at line 34 of file DC_CycleDataItem16TmStream.cpp. |
|
Return the number of data items managed by this telemetry stream.
The number of data items is set with method
Reimplemented from TelemetryStream. Definition at line 38 of file DC_CycleDataItem16TmStream.cpp. |
|
Perform a class-specific configuration check on the telemetry stream: verify that the number of data items has been set and that all data items have been loaded.
Reimplemented from CC_RootObject. Definition at line 83 of file DC_CycleDataItem16TmStream.cpp. |
|
Reset the telemetry stream. The write counter is reset to 0. Reimplemented from TelemetryStream. Definition at line 29 of file DC_CycleDataItem16TmStream.cpp. |
|
Set the n-th data item.
The data item are the locations to which the bytes written from the telemetry packet are written. The index n must lie in the interval [0,N-1] where N is the number of data items managed by this telemetry stream (the return value of method
Definition at line 56 of file DC_CycleDataItem16TmStream.cpp. |
|
Set the number of data items managed by this telemetry stream. This method causes the memory for the data structure holding the data items to be allocated. After the successful allocation of the memory, the telemetry stream is reset. This is an initialization method. It should be called before the telemetry stream is used the first time and it should not be called more than once. The number of data items should be greater than 0.
Definition at line 43 of file DC_CycleDataItem16TmStream.cpp. |
|
Write the telemetry packet content to the data items. Only the telemetry bytes in the telemetry packet are written (the header information - the telemetry packet time tag, destination, type and subtype - are not written). A pseudo-code implementation for this method is as follows: for (i=0; i<(pItem->getNumberOfBytes()-1); i=i+2) collect the i-th and (i+1)-bytes from pItem if ( writeCounter smaller than N-1 ) combine the i-th and (i+1)-bytes in one 16-bit word; write the 16-bit word to writeCounter-th data item; writeCounter++; else return;where N is the number of data items in the telemetry stream. The merge of two successive telemetry bytes from the telemetry packet into one single 16-bit word is done by overlaying the i-th byte with the least significant byte of the data item word and the (i+1)-th byte with the most significant byte.
Implements TelemetryStream. Definition at line 67 of file DC_CycleDataItem16TmStream.cpp. |