SoC Calculator #754
@ -158,6 +158,7 @@ enum commonObjects : uint32_t {
|
||||
PL_SUBSYSTEM = 0x73010002,
|
||||
TCS_SUBSYSTEM = 0x73010003,
|
||||
COM_SUBSYSTEM = 0x73010004,
|
||||
EPS_SUBSYSTEM = 0x73010005,
|
||||
|
||||
TM_FUNNEL = 0x73000100,
|
||||
PUS_TM_FUNNEL = 0x73000101,
|
||||
|
27
mission/system/power/EpsSubsystem.cpp
Normal file
27
mission/system/power/EpsSubsystem.cpp
Normal 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);
|
||||
}
|
13
mission/system/power/EpsSubsystem.h
Normal file
13
mission/system/power/EpsSubsystem.h
Normal 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_ */
|
42
mission/system/power/epsModeTree.cpp
Normal file
42
mission/system/power/epsModeTree.cpp
Normal 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
|
15
mission/system/power/epsModeTree.h
Normal file
15
mission/system/power/epsModeTree.h
Normal 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_ */
|
@ -11,6 +11,7 @@
|
||||
#include "eive/objects.h"
|
||||
#include "mission/com/defs.h"
|
||||
#include "mission/system/acs/acsModeTree.h"
|
||||
#include "mission/system/power/epsModeTree.h"
|
||||
#include "mission/system/tcs/tcsModeTree.h"
|
||||
#include "mission/system/tree/payloadModeTree.h"
|
||||
#include "treeUtil.h"
|
||||
@ -40,6 +41,8 @@ void satsystem::init(bool commandPlPcdu1) {
|
||||
tcsSubsystem.connectModeTreeParent(EIVE_SYSTEM);
|
||||
auto& comSubsystem = com::init();
|
||||
comSubsystem.connectModeTreeParent(EIVE_SYSTEM);
|
||||
auto& epsSubsystem = eps::init();
|
||||
epsSubsystem.connectModeTreeParent(EIVE_SYSTEM);
|
||||
ModeListEntry entry;
|
||||
buildBootSequence(EIVE_SYSTEM, entry);
|
||||
buildSafeSequence(EIVE_SYSTEM, entry);
|
||||
|
Loading…
Reference in New Issue
Block a user