SoC Calculator #754

Merged
muellerr merged 74 commits from soc-calculator into main 2023-10-11 10:50:48 +02:00
6 changed files with 101 additions and 0 deletions
Showing only changes of commit 634f6c6001 - Show all commits

View File

@ -158,6 +158,7 @@ enum commonObjects : uint32_t {
PL_SUBSYSTEM = 0x73010002, PL_SUBSYSTEM = 0x73010002,
TCS_SUBSYSTEM = 0x73010003, TCS_SUBSYSTEM = 0x73010003,
COM_SUBSYSTEM = 0x73010004, COM_SUBSYSTEM = 0x73010004,
EPS_SUBSYSTEM = 0x73010005,
TM_FUNNEL = 0x73000100, TM_FUNNEL = 0x73000100,
PUS_TM_FUNNEL = 0x73000101, PUS_TM_FUNNEL = 0x73000101,

View File

@ -0,0 +1,27 @@
#include <mission/system/eps/EpsSubsystem.h>
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
EpsSubsystem::EpsSubsystem(object_id_t objectId, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables)
: Subsystem(objectId, maxNumberOfSequences, maxNumberOfTables) {}
void EpsSubsystem::announceMode(bool recursive) {
const char* modeStr = "UNKNOWN";
switch (mode) {
case (HasModesIF::MODE_OFF): {
modeStr = "OFF";
break;
}
case (HasModesIF::MODE_ON): {
modeStr = "ON";
break;
}
case (DeviceHandlerIF::MODE_NORMAL): {
modeStr = "NORMAL";
break;
}
}
sif::info << "EPS subsystem is now in " << modeStr << " mode" << std::endl;
return Subsystem::announceMode(recursive);
}

View File

@ -0,0 +1,13 @@
#ifndef MISSION_SYSTEM_OBJECTS_EPSSUBSYSTEM_H_
#define MISSION_SYSTEM_OBJECTS_EPSSUBSYSTEM_H_
#include <fsfw/subsystem/Subsystem.h>
class EpsSubsystem : public Subsystem {
public:
EpsSubsystem(object_id_t objectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
private:
void announceMode(bool recursive) override;
};
#endif /* MISSION_SYSTEM_OBJECTS_EPSSUBSYSTEM_H_ */

View File

@ -0,0 +1,42 @@
#include <mission/system/power/epsModeTree.h>
#include "eive/objects.h"
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
#include "fsfw/subsystem/Subsystem.h"
#include "mission/system/treeUtil.h"
EpsSubsystem satsystem::eps::SUBSYSTEM(objects::EPS_SUBSYSTEM, 12, 24);
namespace {
// Alias for checker function
const auto check = subsystem::checkInsert;
void buildOffSequence(Subsystem& ss, ModeListEntry& eh);
void buildNormalSequence(Subsystem& ss, ModeListEntry& eh);
} // namespace
static const auto OFF = HasModesIF::MODE_OFF;
static const auto NML = DeviceHandlerIF::MODE_NORMAL;
auto EPS_SEQUENCE_OFF = std::make_pair(OFF, FixedArrayList<ModeListEntry, 3>());
auto EPS_TABLE_OFF_TGT = std::make_pair((OFF << 24) | 1, FixedArrayList<ModeListEntry, 2>());
auto EPS_TABLE_OFF_TRANS_0 = std::make_pair((OFF << 24) | 2, FixedArrayList<ModeListEntry, 2>());
auto EPS_TABLE_OFF_TRANS_1 = std::make_pair((OFF << 24) | 3, FixedArrayList<ModeListEntry, 7>());
auto EPS_SEQUENCE_NORMAL = std::make_pair(NML, FixedArrayList<ModeListEntry, 3>());
auto EPS_TABLE_NORMAL_TGT = std::make_pair((NML << 24) | 1, FixedArrayList<ModeListEntry, 2>());
auto EPS_TABLE_NORMAL_TRANS_0 = std::make_pair((NML << 24) | 2, FixedArrayList<ModeListEntry, 7>());
auto EPS_TABLE_NORMAL_TRANS_1 = std::make_pair((NML << 24) | 3, FixedArrayList<ModeListEntry, 2>());
Subsystem& satsystem::eps::init() {
ModeListEntry entry;
buildOffSequence(SUBSYSTEM, entry);
buildNormalSequence(SUBSYSTEM, entry);
SUBSYSTEM.setInitialMode(OFF);
return SUBSYSTEM;
}
namespace {
void buildOffSequence(Subsystem& ss, ModeListEntry& eh) {}
void buildNormalSequence(Subsystem& ss, ModeListEntry& eh) {} // namespace

View File

@ -0,0 +1,15 @@
#ifndef MISSION_SYSTEM_TREE_EPSMODETREE_H_
#define MISSION_SYSTEM_TREE_EPSMODETREE_H_
#include <mission/system/power/EpsSubsystem.h>
namespace satsystem {
namespace eps {
extern EpsSubsystem SUBSYSTEM;
Subsystem& init();
} // namespace eps
} // namespace satsystem
#endif /* MISSION_SYSTEM_TREE_EPSMODETREE_H_ */

View File

@ -11,6 +11,7 @@
#include "eive/objects.h" #include "eive/objects.h"
#include "mission/com/defs.h" #include "mission/com/defs.h"
#include "mission/system/acs/acsModeTree.h" #include "mission/system/acs/acsModeTree.h"
#include "mission/system/power/epsModeTree.h"
#include "mission/system/tcs/tcsModeTree.h" #include "mission/system/tcs/tcsModeTree.h"
#include "mission/system/tree/payloadModeTree.h" #include "mission/system/tree/payloadModeTree.h"
#include "treeUtil.h" #include "treeUtil.h"
@ -40,6 +41,8 @@ void satsystem::init(bool commandPlPcdu1) {
tcsSubsystem.connectModeTreeParent(EIVE_SYSTEM); tcsSubsystem.connectModeTreeParent(EIVE_SYSTEM);
auto& comSubsystem = com::init(); auto& comSubsystem = com::init();
comSubsystem.connectModeTreeParent(EIVE_SYSTEM); comSubsystem.connectModeTreeParent(EIVE_SYSTEM);
auto& epsSubsystem = eps::init();
epsSubsystem.connectModeTreeParent(EIVE_SYSTEM);
ModeListEntry entry; ModeListEntry entry;
buildBootSequence(EIVE_SYSTEM, entry); buildBootSequence(EIVE_SYSTEM, entry);
buildSafeSequence(EIVE_SYSTEM, entry); buildSafeSequence(EIVE_SYSTEM, entry);