eive-obsw/mission/system/acs/StrFdir.cpp

27 lines
907 B
C++
Raw Normal View History

2023-03-08 18:09:50 +01:00
#include "StrFdir.h"
2024-02-13 16:45:59 +01:00
#include <eive/objects.h>
#include <fsfw/events/EventManagerIF.h>
#include <mission/acs/defs.h>
2023-03-08 18:09:50 +01:00
StrFdir::StrFdir(object_id_t strObject)
: DeviceHandlerFailureIsolation(strObject, objects::NO_OBJECT) {}
ReturnValue_t StrFdir::eventReceived(EventMessage* event) {
2023-11-15 16:54:54 +01:00
if (event->getEvent() == acs::PTG_CTRL_NO_ATTITUDE_INFORMATION) {
2023-03-08 18:09:50 +01:00
setFaulty(event->getEvent());
return returnvalue::OK;
}
return DeviceHandlerFailureIsolation::eventReceived(event);
}
2024-02-13 16:45:59 +01:00
ReturnValue_t StrFdir::initialize() {
ReturnValue_t result = DeviceHandlerFailureIsolation::initialize();
if (result != returnvalue::OK) {
return result;
}
EventManagerIF* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
return manager->subscribeToEvent(eventQueue->getId(),
event::getEventId(acs::PTG_CTRL_NO_ATTITUDE_INFORMATION));
}