![]() |
F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
|
Svc::DpWriter
is an active component for writing data products to disk. It does the following:
Svc::DpManager
, and possibly through an instance of Svc::BufferAccumulator
, before reaching DpWriter
.Requirement | Description | Rationale | Verification Method |
---|---|---|---|
SVC-DPWRITER-001 | Svc::DpWriter shall provide a port for receiving Fw::Buffer objects pointing to filled data product containers. | The purpose of DpWriter is to write the data products to disk. | Unit Test |
SVC-DPWRITER-002 | Svc::DpWriter shall provide an array of ports for sending Fw::Buffer objects for processing. | This requirement supports downstream processing of the data in the buffer. | Unit Test |
SVC-DPWRITER-003 | On receiving a data product container C, Svc::DpWriter shall use the processing type field of the header of C to select zero or more processing ports to invoke, in port order. | The processing type field is a bit mask. A one in bit 2^n in the bit mask selects port index n . | Unit Test |
SVC-DPWRITER-004 | On receiving an Fw::Buffer B, and after performing any requested processing on B, Svc::DpWriter shall write B to disk. | The purpose of DpWriter is to write data products to the disk. | Unit Test |
SVC-DPWRITER-005 | Svc::DpManager shall provide telemetry that reports the number of data products written and the number of bytes written. | This requirement establishes the telemetry interface for the component. | Unit test |
The diagram below shows the DpWriter
component.
DpWriter
has the following ports:
Kind | Name | Port Type | Usage |
---|---|---|---|
async input | schedIn | Svc.Sched | Schedule in port |
async input | bufferSendIn | Fw.BufferSend | Port for receiving data products to write to disk |
output | procBufferSendOut | [DpWriterNumProcPorts] Fw.BufferSend | Port for processing data products |
output | deallocBufferSendOut | Fw.BufferSend | Port for deallocating data product buffers |
time get | timeGetOut | Fw.Time | Time get port |
telemetry | tlmOut | Fw.Tlm | Telemetry port |
event | eventOut | Fw.Log | Event port |
text event | textEventOut | Fw.LogText | Text event port |
DpWriter
maintains the following state:
numDataProducts (U32)
: The number of data products written.numBytes (U64)
: The number of bytes written.The configuration constant DpWriterNumProcPorts
specifies the number of ports for connecting components that perform processing.
The config
function specifies the following constants:
fileNamePrefix (string)
: The prefix to use for file names.fileNameSuffix (string)
: The suffix to use for file names.This handler sends out the state variables as telemetry.
This handler receives a mutable reference to a buffer B
. It does the following:
B
is valid and that the first sizeof(FwPacketDescriptorType)
bytes of the memory referred to by B
hold the serialized value Fw_PACKET_DP
. If not, emit a warning event.ProcType
field out of the container header stored in the memory pointed to by B
. If the value is a valid port number N
for procBufferSendOut
, then invoke procBufferSendOut
at port number N
, passing in B
. This step updates the memory pointed to by B
in place.B
to a file, using the format described in the **File Format** section. For the time stamp, use the time provided by timeGetOut
.B
on deallocBufferSendOut
.Each file stores a serialized data product record, with the format described in the data products documentation.
The name of each file consists of fileNamePrefix
followed by an ID, a time stamp, and fileNameSuffix
. The ID consists of an underscore character _
followed by the container ID. The time stamp consists of an underscore character _
followed by a seconds value, an underscore character, and a microseconds value.
For example, suppose that the file name prefix is container_data
and the file name suffix is .dat
. Suppose that container ID is 100, the seconds value is 100000, and the microseconds value is 1000. Then the file name is container_data_100_100000_1000.dat
.
Name | Type | Description |
---|---|---|
NumDataProducts | U32 | The number of data products handled |
NumBytes | U64 | The number of bytes handled |
Name | Severity | Description |
---|---|---|
BufferTooSmall | warning high | Incoming buffer is too small to hold a data product container |
InvalidPacketDescriptor | warning high | Incoming buffer had an invalid packet descriptor |
The following topology diagram shows how to connect Svc::DpWriter
to a DpManager
component and a processor component. The diagrams use the following instances:
dpManager
: An instance of Svc::DpManager
.dpProcessor
: A component that processes data product containers.dpWriter
: An instance of Svc::DpWriter
.producer
: A component that produces data products.The following diagram shows what happens when a buffer is sent to DpWriter
, is processed, and is written to disk.