eive-obsw/mission/core/GenericFactory.cpp

119 lines
4.4 KiB
C++
Raw Normal View History

2020-11-20 18:10:39 +01:00
#include "GenericFactory.h"
#include <fsfwconfig/objects/systemObjectList.h>
#include <fsfwconfig/tmtc/apid.h>
#include <fsfwconfig/tmtc/pusIds.h>
2020-11-25 16:17:16 +01:00
#include <fsfwconfig/OBSWconfig.h>
2020-12-04 14:14:08 +01:00
#include <fsfwconfig/devices/addresses.h>
2020-11-20 18:10:39 +01:00
#include <fsfw/events/EventManager.h>
#include <fsfw/health/HealthTable.h>
#include <fsfw/internalError/InternalErrorReporter.h>
#include <fsfw/pus/CService200ModeCommanding.h>
#include <fsfw/pus/Service17Test.h>
#include <fsfw/pus/Service1TelecommandVerification.h>
#include <fsfw/pus/Service3Housekeeping.h>
2020-11-20 18:10:39 +01:00
#include <fsfw/pus/Service2DeviceAccess.h>
#include <fsfw/pus/Service5EventReporting.h>
#include <fsfw/pus/Service8FunctionManagement.h>
#include <fsfw/pus/Service9TimeManagement.h>
#include <fsfw/storagemanager/PoolManager.h>
#include <fsfw/tcdistribution/CCSDSDistributor.h>
#include <fsfw/tcdistribution/PUSDistributor.h>
#include <fsfw/timemanager/TimeStamper.h>
#include <mission/utility/TmFunnel.h>
2020-12-14 08:42:48 +01:00
#include <bsp_linux/comIF/cookies/CspCookie.h>
#include <bsp_linux/comIF/CspComIF.h>
2020-12-20 13:31:44 +01:00
#include "mission/devices/GomspaceDeviceHandler.h"
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
2020-11-20 18:10:39 +01:00
2020-11-25 16:17:16 +01:00
#if ADD_TEST_CODE == 1
//#include <test/testtasks/TestTask.h>
#endif
2020-11-20 18:10:39 +01:00
void ObjectFactory::produceGenericObjects() {
/* Framework objects */
new EventManager(objects::EVENT_MANAGER);
new HealthTable(objects::HEALTH_TABLE);
2020-12-14 22:03:57 +01:00
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
2020-11-20 18:10:39 +01:00
new TimeStamper(objects::TIME_STAMPER);
{
2020-12-14 22:03:57 +01:00
PoolManager::LocalPoolConfig poolCfg = {
{100, 16}, {50, 32}, {25, 64}, {15, 128}, {5, 1024}
};
new PoolManager(objects::TC_STORE, poolCfg);
2020-11-20 18:10:39 +01:00
}
{
2020-12-14 22:03:57 +01:00
PoolManager::LocalPoolConfig poolCfg = {
{100, 16}, {50, 32}, {25, 64}, {15, 128}, {5, 1024}
};
new PoolManager(objects::TM_STORE, poolCfg);
2020-11-20 18:10:39 +01:00
}
{
2020-12-14 22:03:57 +01:00
PoolManager::LocalPoolConfig poolCfg = {
{100, 16}, {50, 32}, {25, 64}, {15, 128}, {5, 1024}
};
new PoolManager(objects::IPC_STORE, poolCfg);
2020-11-20 18:10:39 +01:00
}
new CCSDSDistributor(apid::EIVE_OBSW, objects::CCSDS_PACKET_DISTRIBUTOR);
new PUSDistributor(apid::EIVE_OBSW, objects::PUS_PACKET_DISTRIBUTOR,
objects::CCSDS_PACKET_DISTRIBUTOR);
/* TMTC Reception via UDP socket */
new TmFunnel(objects::TM_FUNNEL);
/* PUS stack */
new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION,
2020-12-14 22:03:57 +01:00
apid::EIVE_OBSW, pus::PUS_SERVICE_1, objects::TM_FUNNEL, 20);
2020-11-20 18:10:39 +01:00
new Service2DeviceAccess(objects::PUS_SERVICE_2_DEVICE_ACCESS,
apid::EIVE_OBSW, pus::PUS_SERVICE_2, 3, 10);
new Service3Housekeeping(objects::PUS_SERVICE_3_HOUSEKEEPING,
apid::EIVE_OBSW, pus::PUS_SERVICE_3);
2020-11-20 18:10:39 +01:00
new Service5EventReporting(objects::PUS_SERVICE_5_EVENT_REPORTING,
apid::EIVE_OBSW, pus::PUS_SERVICE_5, 50);
new Service8FunctionManagement(objects::PUS_SERVICE_8_FUNCTION_MGMT,
apid::EIVE_OBSW, pus::PUS_SERVICE_8, 3, 10);
new Service9TimeManagement(objects::PUS_SERVICE_9_TIME_MGMT,
apid::EIVE_OBSW, pus::PUS_SERVICE_9);
new Service17Test(objects::PUS_SERVICE_17_TEST, apid::EIVE_OBSW,
pus::PUS_SERVICE_17);
new CService200ModeCommanding(objects::PUS_SERVICE_200_MODE_MGMT,
apid::EIVE_OBSW, pus::PUS_SERVICE_200);
2020-12-04 14:14:08 +01:00
/* Cookies */
2020-12-14 08:42:48 +01:00
CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_LENGTH,
addresses::P60DOCK);
2020-12-20 17:35:03 +01:00
CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH,
addresses::PDU1);
CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH,
addresses::PDU2);
2020-12-21 10:26:28 +01:00
CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_LENGTH,
addresses::ACU);
2020-12-04 14:14:08 +01:00
/* Communication interfaces */
2020-12-20 13:31:44 +01:00
new CspComIF(objects::CSP_COM_IF);
2020-12-04 14:14:08 +01:00
/* Device Handler */
2020-12-20 13:31:44 +01:00
new GomspaceDeviceHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF,
p60DockCspCookie, P60Dock::MAX_CONFIGTABLE_ADDRESS,
P60Dock::MAX_HKTABLE_ADDRESS);
2020-12-20 17:35:03 +01:00
new GomspaceDeviceHandler(objects::PDU1_HANDLER, objects::CSP_COM_IF,
pdu1CspCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU::MAX_HKTABLE_ADDRESS);
new GomspaceDeviceHandler(objects::PDU2_HANDLER, objects::CSP_COM_IF,
pdu2CspCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU::MAX_HKTABLE_ADDRESS);
2020-12-21 10:26:28 +01:00
new GomspaceDeviceHandler(objects::ACU_HANDLER, objects::CSP_COM_IF,
acuCspCookie, ACU::MAX_CONFIGTABLE_ADDRESS,
ACU::MAX_HKTABLE_ADDRESS);
2020-12-04 14:14:08 +01:00
2020-11-20 18:10:39 +01:00
/* Test Device Handler */
2020-11-25 16:17:16 +01:00
#if ADD_TEST_CODE == 1
// new TestTask(objects::TEST_TASK);
2020-11-20 18:10:39 +01:00
#endif
}