fprime/Ref/DpDemo/DpDemo.hpp
Justine West dfaf496263
Add DP Demo for testing DPs and fprime-dp-writer (#3951)
* Initial DpDemo component, added test for decoding DPs

* Updated Dp demo to include additional types, arrays, and struct records

* Added struct member array to DP demo

* Remove unused tlm

* Cleanup after merging devel

* Add deepdiff to requirements, fix formatting, update spelling

* fpp v3.0.0a16

* fprime-gds v4.0.0a10

* Add 3 array record cases to DP demo

* Remove comments

* Remove deepdiff

* Formatting, update spelling

* FPP v3.0.0a18

* Spelling

---------

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
2025-08-05 12:28:00 -07:00

78 lines
2.6 KiB
C++

// ======================================================================
// \title DpDemo.hpp
// \author jawest
// \brief hpp file for DpDemo component implementation class
// ======================================================================
#ifndef Ref_DpDemo_HPP
#define Ref_DpDemo_HPP
#include "Ref/DpDemo/DpDemoComponentAc.hpp"
namespace Ref {
class DpDemo final : public DpDemoComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct DpDemo object
DpDemo(const char* const compName //!< The component name
);
//! Destroy DpDemo object
~DpDemo();
private:
// ----------------------------------------------------------------------
// Handler implementations for commands
// ----------------------------------------------------------------------
//! Handler implementation for run
//!
//! Example port: receiving calls from the rate group
void run_handler(FwIndexType portNum, //!< The port number
U32 context //!< The call order
) override;
//! Handler implementation for command SelectColor
//!
//! Select color
void SelectColor_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
Ref::DpDemo_ColorEnum color) override;
//! Handler implementation for command Dp
//!
//! Command for generating a DP
void Dp_cmdHandler(FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
DpDemo_DpReqType reqType,
U32 priority) override;
private:
// ----------------------------------------------------------------------
// Handler implementations for data products
// ----------------------------------------------------------------------
//! Receive a container of type DpDemoContainer
void dpRecv_DpDemoContainer_handler(DpContainer& container, //!< The container
Fw::Success::T status //!< The container status
) override;
// DP cleanup helper
void cleanupAndSendDp();
// Member variables
DpDemo_ColorEnum selectedColor;
U32 numRecords;
U32 dpPriority;
DpContainer dpContainer;
bool dpInProgress;
};
} // namespace Ref
#endif