|
|
|
@ -10,10 +10,9 @@
|
|
|
|
|
#include <fsfw/tasks/PeriodicTaskIF.h>
|
|
|
|
|
#include <fsfw/tasks/TaskFactory.h>
|
|
|
|
|
#include <mission/utility/InitMission.h>
|
|
|
|
|
#include "linux/InitMission.h"
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
#include "../linux/scheduling.h"
|
|
|
|
|
#include "ObjectFactory.h"
|
|
|
|
|
|
|
|
|
|
#ifdef LINUX
|
|
|
|
@ -30,7 +29,7 @@ ServiceInterfaceStream sif::error("ERROR", true, false, true);
|
|
|
|
|
|
|
|
|
|
ObjectManagerIF* objectManager = nullptr;
|
|
|
|
|
|
|
|
|
|
void initmission::initMission() {
|
|
|
|
|
void scheduling::initMission() {
|
|
|
|
|
sif::info << "Building global objects.." << std::endl;
|
|
|
|
|
/* Instantiate global object manager and also create all objects */
|
|
|
|
|
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
|
|
|
@ -41,7 +40,7 @@ void initmission::initMission() {
|
|
|
|
|
initTasks();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void initmission::initTasks() {
|
|
|
|
|
void scheduling::initTasks() {
|
|
|
|
|
TaskFactory* factory = TaskFactory::instance();
|
|
|
|
|
if (factory == nullptr) {
|
|
|
|
|
/* Should never happen ! */
|
|
|
|
@ -92,69 +91,69 @@ void initmission::initTasks() {
|
|
|
|
|
"EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
|
|
|
|
result = eventHandling->addComponent(objects::EVENT_MANAGER);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("EVENT_MNGR", objects::EVENT_MANAGER);
|
|
|
|
|
scheduling::printAddObjectError("EVENT_MNGR", objects::EVENT_MANAGER);
|
|
|
|
|
}
|
|
|
|
|
result = eventHandling->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("PUS5", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
|
|
|
|
scheduling::printAddObjectError("PUS5", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PeriodicTaskIF* pusHighPrio = factory->createPeriodicTask(
|
|
|
|
|
"PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
|
|
|
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
|
|
|
|
scheduling::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
|
|
|
|
}
|
|
|
|
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
|
|
|
|
|
scheduling::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
|
|
|
|
|
}
|
|
|
|
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
|
|
|
|
scheduling::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PeriodicTaskIF* pusMedPrio = factory->createPeriodicTask(
|
|
|
|
|
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
|
|
|
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
|
|
|
|
scheduling::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
|
|
|
|
}
|
|
|
|
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT);
|
|
|
|
|
scheduling::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT);
|
|
|
|
|
}
|
|
|
|
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS);
|
|
|
|
|
scheduling::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PeriodicTaskIF* pusLowPrio = factory->createPeriodicTask(
|
|
|
|
|
"PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc);
|
|
|
|
|
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
|
|
|
|
|
scheduling::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PeriodicTaskIF* thermalTask = factory->createPeriodicTask(
|
|
|
|
|
"THERMAL_CTL_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc);
|
|
|
|
|
result = thermalTask->addComponent(objects::RTD_0_IC3_PLOC_HEATSPREADER);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("RTD_0_dummy", objects::RTD_0_IC3_PLOC_HEATSPREADER);
|
|
|
|
|
scheduling::printAddObjectError("RTD_0_dummy", objects::RTD_0_IC3_PLOC_HEATSPREADER);
|
|
|
|
|
}
|
|
|
|
|
result = thermalTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("SUS_0_dummy", objects::SUS_0_N_LOC_XFYFZM_PT_XF);
|
|
|
|
|
scheduling::printAddObjectError("SUS_0_dummy", objects::SUS_0_N_LOC_XFYFZM_PT_XF);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result = thermalTask->addComponent(objects::CORE_CONTROLLER);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("Core controller dummy", objects::CORE_CONTROLLER);
|
|
|
|
|
scheduling::printAddObjectError("Core controller dummy", objects::CORE_CONTROLLER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result = thermalTask->addComponent(objects::THERMAL_CONTROLLER);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER);
|
|
|
|
|
scheduling::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FixedTimeslotTaskIF* pstTask = factory->createFixedTimeslotTask(
|
|
|
|
@ -169,7 +168,7 @@ void initmission::initTasks() {
|
|
|
|
|
"PLOC_SUPV_HELPER", 10, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc);
|
|
|
|
|
result = supvHelperTask->addComponent(objects::PLOC_SUPERVISOR_HELPER);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("PLOC_SUPV_HELPER", objects::PLOC_SUPERVISOR_HELPER);
|
|
|
|
|
scheduling::printAddObjectError("PLOC_SUPV_HELPER", objects::PLOC_SUPERVISOR_HELPER);
|
|
|
|
|
}
|
|
|
|
|
#endif /* OBSW_ADD_PLOC_SUPERVISOR */
|
|
|
|
|
|
|
|
|
@ -179,7 +178,7 @@ void initmission::initTasks() {
|
|
|
|
|
#if OBSW_ADD_TEST_CODE == 1
|
|
|
|
|
result = testTask->addComponent(objects::TEST_TASK);
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
|
|
|
|
|
scheduling::printAddObjectError("TEST_TASK", objects::TEST_TASK);
|
|
|
|
|
}
|
|
|
|
|
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
|
|
|
|
|
|
|
|
|