Feature: STR Assembly #437

Merged
muellerr merged 12 commits from feature_str_assy into develop 2023-03-08 18:13:34 +01:00
6 changed files with 58 additions and 9 deletions
Showing only changes of commit 4e9646fe10 - Show all commits

View File

@ -9,6 +9,7 @@
#include <mission/devices/MgmRm3100CustomHandler.h> #include <mission/devices/MgmRm3100CustomHandler.h>
#include <mission/system/objects/CamSwitcher.h> #include <mission/system/objects/CamSwitcher.h>
#include <mission/system/objects/ImtqAssembly.h> #include <mission/system/objects/ImtqAssembly.h>
#include <mission/system/objects/StrAssembly.h>
#include <mission/system/objects/SyrlinksAssembly.h> #include <mission/system/objects/SyrlinksAssembly.h>
#include "OBSWConfig.h" #include "OBSWConfig.h"
@ -903,6 +904,8 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
} }
void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) { void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) {
auto* strAssy = new StrAssembly(objects::STAR_TRACKER);
strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
auto* starTrackerCookie = auto* starTrackerCookie =
new SerialCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD, new SerialCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL); startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
@ -912,7 +915,7 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) {
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie,
strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V); strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V);
starTracker->setPowerSwitcher(pwrSwitcher); starTracker->setPowerSwitcher(pwrSwitcher);
starTracker->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); starTracker->connectModeTreeParent(*strAssy);
} }
void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) {

View File

@ -240,30 +240,26 @@ void scheduling::initTasks() {
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); scheduling::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM);
} }
#if OBSW_ADD_MGT == 1
result = acsSysTask->addComponent(objects::IMTQ_ASSY); result = acsSysTask->addComponent(objects::IMTQ_ASSY);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("IMTQ_ASSY", objects::IMTQ_ASSY); scheduling::printAddObjectError("IMTQ_ASSY", objects::IMTQ_ASSY);
} }
#endif
#if OBSW_ADD_ACS_BOARD == 1
result = acsSysTask->addComponent(objects::ACS_BOARD_ASS); result = acsSysTask->addComponent(objects::ACS_BOARD_ASS);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS); scheduling::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS);
} }
#endif /* OBSW_ADD_ACS_HANDLERS */
#if OBSW_ADD_RW == 1
result = acsSysTask->addComponent(objects::RW_ASSY); result = acsSysTask->addComponent(objects::RW_ASSY);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("RW_ASS", objects::RW_ASSY); scheduling::printAddObjectError("RW_ASS", objects::RW_ASSY);
} }
#endif
#if OBSW_ADD_SUS_BOARD_ASS == 1
result = acsSysTask->addComponent(objects::SUS_BOARD_ASS); result = acsSysTask->addComponent(objects::SUS_BOARD_ASS);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS); scheduling::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS);
} }
#endif result = acsSysTask->addComponent(objects::STR_ASSY);
if (result != returnvalue::OK) {
scheduling::printAddObjectError("STR_ASSY", objects::STR_ASSY);
}
PeriodicTaskIF* tcsSystemTask = factory->createPeriodicTask( PeriodicTaskIF* tcsSystemTask = factory->createPeriodicTask(
"TCS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); "TCS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc);

View File

@ -146,6 +146,7 @@ enum commonObjects : uint32_t {
CAM_SWITCHER = 0x73000006, CAM_SWITCHER = 0x73000006,
SYRLINKS_ASSY = 0x73000007, SYRLINKS_ASSY = 0x73000007,
IMTQ_ASSY = 0x73000008, IMTQ_ASSY = 0x73000008,
STR_ASSY = 0x73000009,
EIVE_SYSTEM = 0x73010000, EIVE_SYSTEM = 0x73010000,
ACS_SUBSYSTEM = 0x73010001, ACS_SUBSYSTEM = 0x73010001,
PL_SUBSYSTEM = 0x73010002, PL_SUBSYSTEM = 0x73010002,

View File

@ -13,6 +13,7 @@ target_sources(
SusAssembly.cpp SusAssembly.cpp
RwAssembly.cpp RwAssembly.cpp
DualLanePowerStateMachine.cpp DualLanePowerStateMachine.cpp
StrAssembly.cpp
PowerStateMachineBase.cpp PowerStateMachineBase.cpp
DualLaneAssemblyBase.cpp DualLaneAssemblyBase.cpp
TcsBoardAssembly.cpp) TcsBoardAssembly.cpp)

View File

@ -0,0 +1,30 @@
#include "StrAssembly.h"
#include <eive/objects.h>
StrAssembly::StrAssembly(object_id_t objectId) {
ModeListEntry entry;
entry.setObject(objects::STAR_TRACKER);
entry.setMode(MODE_OFF);
entry.setSubmode(SUBMODE_NONE);
commandTable.insert(entry);
}
ReturnValue_t StrAssembly::commandChildren(Mode_t mode, Submode_t submode) {
commandTable[0].setMode(mode);
commandTable[0].setSubmode(submode);
HybridIterator<ModeListEntry> iter(commandTable.begin(), commandTable.end());
executeTable(iter);
return returnvalue::OK;
}
ReturnValue_t StrAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) {
if (childrenMap[objects::STAR_TRACKER].mode != wantedMode) {
return NOT_ENOUGH_CHILDREN_IN_CORRECT_STATE;
}
return returnvalue::OK;
}
ReturnValue_t StrAssembly::isModeCombinationValid(Mode_t mode, Submode_t submode) {
return returnvalue::OK;
}

View File

@ -0,0 +1,18 @@
#ifndef MISSION_SYSTEM_OBJECTS_STRASSEMBLY_H_
#define MISSION_SYSTEM_OBJECTS_STRASSEMBLY_H_
#include "fsfw/devicehandlers/AssemblyBase.h"
class StrAssembly : public AssemblyBase {
public:
StrAssembly(object_id_t objectId);
private:
FixedArrayList<ModeListEntry, 1> commandTable;
ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) override;
ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override;
ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override;
};
#endif /* MISSION_SYSTEM_OBJECTS_STRASSEMBLY_H_ */