fsfw/defaultcfg/config/objects/Factory.cpp

55 lines
1.8 KiB
C++
Raw Normal View History

2020-10-20 17:38:41 +02:00
#include "Factory.h"
2020-10-20 17:47:52 +02:00
#include "../tmtc/apid.h"
#include "../tmtc/pusIds.h"
#include "../objects/systemObjectList.h"
#include "../devices/logicalAddresses.h"
#include "../devices/powerSwitcherList.h"
2020-10-20 17:38:41 +02:00
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <fsfw/events/EventManager.h>
#include <fsfw/health/HealthTable.h>
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
#include <fsfw/tmtcservices/CommandingServiceBase.h>
#include <fsfw/tmtcservices/PusServiceBase.h>
#include <cstdint>
/**
2020-10-20 17:47:52 +02:00
* This class should be used to create all system objects required for
* the on-board software, using the object ID list from the configuration
* folder.
2020-10-20 17:38:41 +02:00
*
2020-10-20 17:47:52 +02:00
* The objects are registered in the internal object manager automatically.
* This is used later to add objects to tasks.
*
* This file also sets static framework IDs.
2020-10-20 17:38:41 +02:00
*
2020-10-20 17:47:52 +02:00
* Framework objects are created first.
2020-10-20 17:38:41 +02:00
* @ingroup init
*/
void Factory::produce(void) {
setStaticFrameworkObjectIds();
new EventManager(objects::EVENT_MANAGER);
new HealthTable(objects::HEALTH_TABLE);
//new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
}
void Factory::setStaticFrameworkObjectIds() {
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
PusServiceBase::packetDestination = objects::TM_FUNNEL;
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS;
DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT;
TmPacketStored::timeStamperId = objects::PUS_TIME;
2020-10-20 17:47:52 +02:00
//TmFunnel::downlinkDestination = objects::NO_OBJECT;
2020-10-20 17:38:41 +02:00
}