2020-10-20 17:39:48 +02:00
|
|
|
#include "Factory.h"
|
2020-10-20 17:53:47 +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:39:48 +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>
|
2020-11-08 15:20:51 +01:00
|
|
|
#include <internalError/InternalErrorReporter.h>
|
2020-10-20 17:39:48 +02:00
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
/**
|
2020-10-20 17:53:47 +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:39:48 +02:00
|
|
|
*
|
2020-10-20 17:53:47 +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:39:48 +02:00
|
|
|
*
|
2020-10-20 17:53:47 +02:00
|
|
|
* Framework objects are created first.
|
2020-10-20 17:39:48 +02:00
|
|
|
* @ingroup init
|
|
|
|
*/
|
|
|
|
void Factory::produce(void) {
|
|
|
|
setStaticFrameworkObjectIds();
|
|
|
|
new EventManager(objects::EVENT_MANAGER);
|
|
|
|
new HealthTable(objects::HEALTH_TABLE);
|
2020-11-08 15:20:51 +01:00
|
|
|
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
|
2020-10-20 17:39:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Factory::setStaticFrameworkObjectIds() {
|
2020-11-08 15:20:51 +01:00
|
|
|
PusServiceBase::packetSource = objects::NO_OBJECT;
|
|
|
|
PusServiceBase::packetDestination = objects::NO_OBJECT;
|
2020-10-20 17:39:48 +02:00
|
|
|
|
2020-11-08 15:20:51 +01:00
|
|
|
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
|
|
|
|
CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
|
2020-10-20 17:39:48 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-11-08 15:20:51 +01:00
|
|
|
TmPacketStored::timeStamperId = objects::NO_OBJECT;
|
2020-10-20 17:39:48 +02:00
|
|
|
}
|
|
|
|
|