mirror of
https://github.com/nasa/fpp.git
synced 2025-12-10 00:40:22 -06:00
251 lines
6.4 KiB
C++
Vendored
251 lines
6.4 KiB
C++
Vendored
// ======================================================================
|
|
// \title ParamsTopologyAc.cpp
|
|
// \author Generated by fpp-to-cpp
|
|
// \brief cpp file for Params topology
|
|
// ======================================================================
|
|
|
|
#include "ParamsTopologyAc.hpp"
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Component instances
|
|
// ----------------------------------------------------------------------
|
|
|
|
namespace M {
|
|
|
|
M::C c1(FW_OPTIONAL_NAME("c1"));
|
|
|
|
}
|
|
|
|
namespace M {
|
|
|
|
M::C c2(FW_OPTIONAL_NAME("c2"));
|
|
|
|
}
|
|
|
|
namespace M {
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Helper functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
void initComponents(const TopologyState& state) {
|
|
M::c1.init(InstanceIds::M_c1);
|
|
M::c2.init(InstanceIds::M_c2);
|
|
}
|
|
|
|
void configComponents(const TopologyState& state) {
|
|
// Nothing to do
|
|
}
|
|
|
|
void setBaseIds() {
|
|
M::c1.setIdBase(BaseIds::M_c1);
|
|
M::c2.setIdBase(BaseIds::M_c2);
|
|
}
|
|
|
|
void connectComponents() {
|
|
// Nothing to do
|
|
}
|
|
|
|
void regCommands() {
|
|
M::c1.regCommands();
|
|
M::c2.regCommands();
|
|
}
|
|
|
|
void readParameters() {
|
|
M::c1.readParamFile();
|
|
}
|
|
|
|
void loadParameters() {
|
|
M::c1.loadParamsSpecial();
|
|
M::c2.loadParameters();
|
|
}
|
|
|
|
void startTasks(const TopologyState& state) {
|
|
// Nothing to do
|
|
}
|
|
|
|
void stopTasks(const TopologyState& state) {
|
|
// Nothing to do
|
|
}
|
|
|
|
void freeThreads(const TopologyState& state) {
|
|
// Nothing to do
|
|
}
|
|
|
|
void tearDownComponents(const TopologyState& state) {
|
|
// Nothing to do
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Setup and teardown functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
void setup(const TopologyState& state) {
|
|
initComponents(state);
|
|
configComponents(state);
|
|
setBaseIds();
|
|
connectComponents();
|
|
regCommands();
|
|
readParameters();
|
|
loadParameters();
|
|
startTasks(state);
|
|
}
|
|
|
|
void teardown(const TopologyState& state) {
|
|
stopTasks(state);
|
|
freeThreads(state);
|
|
tearDownComponents(state);
|
|
}
|
|
|
|
}
|
|
|
|
#if FW_DIRECT_PORT_CALLS
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Topology-dependent component implementation
|
|
// ----------------------------------------------------------------------
|
|
|
|
namespace M {
|
|
|
|
bool CComponentBase::isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const {
|
|
FW_ASSERT(
|
|
(0 <= portNum) && (portNum < NUM_CMDREGOUT_OUTPUT_PORTS),
|
|
static_cast<FwAssertArgType>(portNum),
|
|
static_cast<FwAssertArgType>(NUM_CMDREGOUT_OUTPUT_PORTS)
|
|
);
|
|
bool result = false;
|
|
const auto instance = this->getInstance();
|
|
switch (instance) {
|
|
default:
|
|
FW_ASSERT(0, static_cast<FwAssertArgType>(instance));
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
bool CComponentBase::isConnected_cmdResponseIn_OutputPort(FwIndexType portNum) const {
|
|
FW_ASSERT(
|
|
(0 <= portNum) && (portNum < NUM_CMDRESPONSEIN_OUTPUT_PORTS),
|
|
static_cast<FwAssertArgType>(portNum),
|
|
static_cast<FwAssertArgType>(NUM_CMDRESPONSEIN_OUTPUT_PORTS)
|
|
);
|
|
bool result = false;
|
|
const auto instance = this->getInstance();
|
|
switch (instance) {
|
|
default:
|
|
FW_ASSERT(0, static_cast<FwAssertArgType>(instance));
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
bool CComponentBase::isConnected_prmGetOut_OutputPort(FwIndexType portNum) const {
|
|
FW_ASSERT(
|
|
(0 <= portNum) && (portNum < NUM_PRMGETOUT_OUTPUT_PORTS),
|
|
static_cast<FwAssertArgType>(portNum),
|
|
static_cast<FwAssertArgType>(NUM_PRMGETOUT_OUTPUT_PORTS)
|
|
);
|
|
bool result = false;
|
|
const auto instance = this->getInstance();
|
|
switch (instance) {
|
|
default:
|
|
FW_ASSERT(0, static_cast<FwAssertArgType>(instance));
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
bool CComponentBase::isConnected_prmSetOut_OutputPort(FwIndexType portNum) const {
|
|
FW_ASSERT(
|
|
(0 <= portNum) && (portNum < NUM_PRMSETOUT_OUTPUT_PORTS),
|
|
static_cast<FwAssertArgType>(portNum),
|
|
static_cast<FwAssertArgType>(NUM_PRMSETOUT_OUTPUT_PORTS)
|
|
);
|
|
bool result = false;
|
|
const auto instance = this->getInstance();
|
|
switch (instance) {
|
|
default:
|
|
FW_ASSERT(0, static_cast<FwAssertArgType>(instance));
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
void CComponentBase::cmdRegOut_out(
|
|
FwIndexType portNum,
|
|
FwOpcodeType opCode
|
|
) const {
|
|
FW_ASSERT(
|
|
(0 <= portNum) && (portNum < NUM_CMDREGOUT_OUTPUT_PORTS),
|
|
static_cast<FwAssertArgType>(portNum),
|
|
static_cast<FwAssertArgType>(NUM_CMDREGOUT_OUTPUT_PORTS)
|
|
);
|
|
const auto instance = this->getInstance();
|
|
switch (instance) {
|
|
default:
|
|
FW_ASSERT(0, static_cast<FwAssertArgType>(instance));
|
|
break;
|
|
}
|
|
}
|
|
|
|
void CComponentBase::cmdResponseIn_out(
|
|
FwIndexType portNum,
|
|
FwOpcodeType opCode,
|
|
U32 cmdSeq,
|
|
const Fw::CmdResponse& response
|
|
) const {
|
|
FW_ASSERT(
|
|
(0 <= portNum) && (portNum < NUM_CMDRESPONSEIN_OUTPUT_PORTS),
|
|
static_cast<FwAssertArgType>(portNum),
|
|
static_cast<FwAssertArgType>(NUM_CMDRESPONSEIN_OUTPUT_PORTS)
|
|
);
|
|
const auto instance = this->getInstance();
|
|
switch (instance) {
|
|
default:
|
|
FW_ASSERT(0, static_cast<FwAssertArgType>(instance));
|
|
break;
|
|
}
|
|
}
|
|
|
|
Fw::ParamValid CComponentBase::prmGetOut_out(
|
|
FwIndexType portNum,
|
|
FwPrmIdType id,
|
|
Fw::ParamBuffer& val
|
|
) const {
|
|
FW_ASSERT(
|
|
(0 <= portNum) && (portNum < NUM_PRMGETOUT_OUTPUT_PORTS),
|
|
static_cast<FwAssertArgType>(portNum),
|
|
static_cast<FwAssertArgType>(NUM_PRMGETOUT_OUTPUT_PORTS)
|
|
);
|
|
const auto instance = this->getInstance();
|
|
Fw::ParamValid _result = {};
|
|
switch (instance) {
|
|
default:
|
|
FW_ASSERT(0, static_cast<FwAssertArgType>(instance));
|
|
break;
|
|
}
|
|
return _result;
|
|
}
|
|
|
|
void CComponentBase::prmSetOut_out(
|
|
FwIndexType portNum,
|
|
FwPrmIdType id,
|
|
Fw::ParamBuffer& val
|
|
) const {
|
|
FW_ASSERT(
|
|
(0 <= portNum) && (portNum < NUM_PRMSETOUT_OUTPUT_PORTS),
|
|
static_cast<FwAssertArgType>(portNum),
|
|
static_cast<FwAssertArgType>(NUM_PRMSETOUT_OUTPUT_PORTS)
|
|
);
|
|
const auto instance = this->getInstance();
|
|
switch (instance) {
|
|
default:
|
|
FW_ASSERT(0, static_cast<FwAssertArgType>(instance));
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|