Merge remote-tracking branch 'origin/develop' into refactoring_bugfixes_power_switching
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2023-03-14 13:56:54 +01:00
39 changed files with 329 additions and 142 deletions

View File

@ -1,5 +1,13 @@
#include "PayloadSubsystem.h"
#include "mission/payloadDefs.h"
PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables)
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {}
void PayloadSubsystem::announceMode(bool recursive) {
const char* modeStr = payload::getModeStr(static_cast<payload::Mode>(mode));
sif::info << "PAYLOAD subsystem is now in " << modeStr << " mode" << std::endl;
Subsystem::announceMode(recursive);
}

View File

@ -9,6 +9,7 @@ class PayloadSubsystem : public Subsystem {
uint32_t maxNumberOfTables);
private:
void announceMode(bool recursive) override;
};
#endif /* MISSION_SYSTEM_PAYLOADSUBSYSTEM_H_ */

View File

@ -1,5 +1,4 @@
#ifndef MISSION_SYSTEM_DEFINITIONS_H_
#define MISSION_SYSTEM_DEFINITIONS_H_
#pragma once
#include <fsfw/modes/ModeMessage.h>
@ -15,24 +14,3 @@ namespace duallane {
enum Submodes : Submode_t { A_SIDE = 0, B_SIDE = 1, DUAL_MODE = 2 };
} // namespace duallane
namespace payload {
enum Mode {
OFF = 0,
SUPV_ONLY = 10,
MPSOC_STREAM = 11,
CAM_STREAM = 12,
EARTH_OBSV = 13,
SCEX = 14
};
namespace ploc {
enum Modes { OFF = 0, SUPV_ONLY = 1, MPSOC_ON = 2 };
}
} // namespace payload
#endif /* MISSION_SYSTEM_DEFINITIONS_H_ */

View File

@ -7,6 +7,7 @@
#include "eive/objects.h"
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
#include "mission/payloadDefs.h"
#include "mission/system/objects/PayloadSubsystem.h"
#include "mission/system/objects/definitions.h"
#include "util.h"
@ -20,7 +21,7 @@ void initEarthObsvSequence(Subsystem& ss, ModeListEntry& eh);
void initScexSequence(Subsystem& ss, ModeListEntry& eh);
} // namespace
PayloadSubsystem satsystem::pl::SUBSYSTEM = PayloadSubsystem(objects::PL_SUBSYSTEM, 12, 24);
PayloadSubsystem satsystem::payload::SUBSYSTEM = PayloadSubsystem(objects::PL_SUBSYSTEM, 12, 24);
const auto check = subsystem::checkInsert;
static const auto OFF = HasModesIF::MODE_OFF;
@ -77,7 +78,7 @@ auto PL_TABLE_SCEX_TGT =
auto PL_TABLE_SCEX_TRANS_0 =
std::make_pair((payload::Mode::SCEX << 24) | 2, FixedArrayList<ModeListEntry, 1>());
Subsystem& satsystem::pl::init() {
Subsystem& satsystem::payload::init() {
ModeListEntry entry;
initOffSequence(SUBSYSTEM, entry);
initPlMpsocStreamSequence(SUBSYSTEM, entry);

View File

@ -5,12 +5,12 @@
namespace satsystem {
namespace pl {
namespace payload {
extern PayloadSubsystem SUBSYSTEM;
Subsystem& init();
} // namespace pl
} // namespace payload
} // namespace satsystem

View File

@ -26,7 +26,7 @@ static const auto NML = DeviceHandlerIF::MODE_NORMAL;
void satsystem::init() {
auto& acsSubsystem = acs::init();
acsSubsystem.connectModeTreeParent(EIVE_SYSTEM);
auto& payloadSubsystem = pl::init();
auto& payloadSubsystem = payload::init();
payloadSubsystem.connectModeTreeParent(EIVE_SYSTEM);
auto& tcsSubsystem = tcs::init();
tcsSubsystem.connectModeTreeParent(EIVE_SYSTEM);
@ -87,8 +87,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) {
iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TGT.second);
check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TGT.first, &EIVE_TABLE_SAFE_TGT.second)), ctxc);
// Build SAFE transition 0. Two transitions to reduce number of consecutive events and because
// consecutive commanding of TCS and ACS can lead to SPI issues.
// Build SAFE transition 0.
iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second);
iht(objects::COM_SUBSYSTEM, com::RX_ONLY, 0, EIVE_TABLE_SAFE_TRANS_0.second);
iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TRANS_0.second);