reduce duplicate code
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit

This commit is contained in:
Robin Müller 2023-09-12 14:27:14 +02:00
parent 0a455183f4
commit 24de951038
Signed by: muellerr
GPG Key ID: A649FB78196E3849
5 changed files with 20 additions and 22 deletions

View File

@ -162,15 +162,8 @@ void ObjectFactory::produce(void* args) {
CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel,
&ipCoreHandler); &ipCoreHandler);
createCcsdsComponents(ccsdsArgs); createCcsdsComponents(ccsdsArgs);
#if OBSW_TM_TO_PTME == 1
if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) {
pusFunnel->addLiveDestinationByRawId("VC0 NORMAL LIVE TM", ccsdsArgs.normalLiveTmDest, 0);
}
if (ccsdsArgs.cfdpLiveTmDest != MessageQueueIF::NO_QUEUE) {
cfdpFunnel->addLiveDestinationByRawId("VC0 CFDP LIVE TM", ccsdsArgs.cfdpLiveTmDest, 0);
}
#endif
#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */
/* Test Task */ /* Test Task */
#if OBSW_ADD_TEST_CODE == 1 #if OBSW_ADD_TEST_CODE == 1
createTestComponents(gpioComIF); createTestComponents(gpioComIF);

View File

@ -108,18 +108,7 @@ void ObjectFactory::produce(void* args) {
#endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif /* OBSW_ADD_STAR_TRACKER == 1 */
#if OBSW_ADD_CCSDS_IP_CORES == 1 #if OBSW_ADD_CCSDS_IP_CORES == 1
CcsdsIpCoreHandler* ipCoreHandler = nullptr; createCcsdsIpCoreComponents();
CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel,
&ipCoreHandler);
createCcsdsComponents(ccsdsArgs);
#if OBSW_TM_TO_PTME == 1
if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) {
pusFunnel->addLiveDestinationByRawId("VC0 NORMAL LIVE TM", ccsdsArgs.normalLiveTmDest, 0);
}
if (ccsdsArgs.cfdpLiveTmDest != MessageQueueIF::NO_QUEUE) {
cfdpFunnel->addLiveDestinationByRawId("VC0 CFDP LIVE TM", ccsdsArgs.cfdpLiveTmDest, 0);
}
#endif
#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */
#if OBSW_ADD_SCEX_DEVICE == 1 #if OBSW_ADD_SCEX_DEVICE == 1

View File

@ -1057,3 +1057,18 @@ ReturnValue_t ObjectFactory::readFirmwareVersion() {
} }
return returnvalue::OK; return returnvalue::OK;
} }
ReturnValue_t ObjectFactory::readCcsdsIpCoreComponents(CcsdsComponentArgs& ccsdsArgs) {
CcsdsIpCoreHandler* ipCoreHandler = nullptr;
ReturnValue_t result = createCcsdsComponents(ccsdsArgs);
#if OBSW_TM_TO_PTME == 1
if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) {
ccsdsArgs.pusFunnel.addLiveDestinationByRawId("VC0 NORMAL LIVE TM", ccsdsArgs.normalLiveTmDest,
0);
}
if (ccsdsArgs.cfdpLiveTmDest != MessageQueueIF::NO_QUEUE) {
ccsdsArgs.cfdpFunnel.addLiveDestinationByRawId("VC0 CFDP LIVE TM", ccsdsArgs.cfdpLiveTmDest, 0);
}
#endif
return result;
}

View File

@ -83,6 +83,7 @@ void createTestComponents(LinuxLibgpioIF* gpioComIF);
void createPlI2cResetGpio(LinuxLibgpioIF* gpioComIF); void createPlI2cResetGpio(LinuxLibgpioIF* gpioComIF);
void testAcsBrdAss(AcsBoardAssembly* assAss); void testAcsBrdAss(AcsBoardAssembly* assAss);
ReturnValue_t readCcsdsIpCoreComponents(CcsdsComponentArgs& args);
}; // namespace ObjectFactory }; // namespace ObjectFactory

View File

@ -1,8 +1,6 @@
#ifndef MISSION_SYSDEFS_H_ #ifndef MISSION_SYSDEFS_H_
#define MISSION_SYSDEFS_H_ #define MISSION_SYSDEFS_H_
#include "eive/eventSubsystemIds.h"
#include <fsfw/action/ActionMessage.h> #include <fsfw/action/ActionMessage.h>
#include <fsfw/action/HasActionsIF.h> #include <fsfw/action/HasActionsIF.h>
#include <fsfw/modes/ModeMessage.h> #include <fsfw/modes/ModeMessage.h>
@ -11,6 +9,8 @@
#include <atomic> #include <atomic>
#include <cstring> #include <cstring>
#include "eive/eventSubsystemIds.h"
namespace signals { namespace signals {
extern std::atomic_bool CFDP_CHANNEL_THROTTLE_SIGNAL; extern std::atomic_bool CFDP_CHANNEL_THROTTLE_SIGNAL;