Mode introspection and fixes
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
parent
06b6c0838a
commit
acd365e421
@ -1851,3 +1851,7 @@ bool CoreController::isNumber(const std::string &s) {
|
||||
return !s.empty() && std::find_if(s.begin(), s.end(),
|
||||
[](unsigned char c) { return !std::isdigit(c); }) == s.end();
|
||||
}
|
||||
|
||||
ModeDefinitionHelper CoreController::getModeDefinitionHelper() {
|
||||
return ModeDefinitionHelper::create<ControllerModes, DefaultSubmode>();
|
||||
}
|
@ -93,6 +93,8 @@ class CoreController : public ExtendedControllerBase {
|
||||
ReturnValue_t handleAction(core::XscRebootObcAction* action);
|
||||
ReturnValue_t handleAction(core::RebootObcAction* action);
|
||||
|
||||
ModeDefinitionHelper getModeDefinitionHelper() override;
|
||||
|
||||
ReturnValue_t handleCommandMessage(CommandMessage* message) override;
|
||||
void performControlOperation() override;
|
||||
|
||||
|
@ -51,10 +51,10 @@ void printEnum(ParameterIF* param) {
|
||||
for (auto iter : param->getEnumValues()) {
|
||||
printf("---enum value %li: \"%s\"\n", iter, param->getEnumDescriptions()[i++]);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
void printModes(HasModesIF* object) {
|
||||
ModeHelperIF* modeHelper = object->getModeHelper();
|
||||
const ModeHelper* modeHelper = object->getModeHelper();
|
||||
|
||||
auto modes = modeHelper->getModes();
|
||||
|
||||
@ -68,7 +68,7 @@ void printModes(HasModesIF* object) {
|
||||
printf("--submode \"%s\" (%i)\n", submode.second, submode.first);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
void printAction(HasActionsIF* actionIf) {
|
||||
auto actionMap = actionIf->getActionHelper()->getActionMap();
|
||||
@ -178,11 +178,13 @@ void initmission::initMission() {
|
||||
printAction(actionIf);
|
||||
}
|
||||
|
||||
/*HasModesIF* hasmodesIF = dynamic_cast<HasModesIF*>(iter.second);
|
||||
HasModesIF* hasmodesIF = dynamic_cast<HasModesIF*>(iter.second);
|
||||
if (hasmodesIF != nullptr) {
|
||||
printModes(hasmodesIF);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
HousekeepingIF* hasHousekeeping = dynamic_cast<HousekeepingIF*>(iter.second);
|
||||
if (hasHousekeeping != nullptr) {
|
||||
printHousekeeping(hasHousekeeping);
|
||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit d634bdb7753282f009bd2581945b861d9836c1a4
|
||||
Subproject commit c7e6f01f9bdd542ceb0bc7b948b5af426ef9aa95
|
@ -53,6 +53,11 @@ ReturnValue_t GPSHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ModeDefinitionHelper GPSHyperionLinuxController::getModeDefinitionHelper() {
|
||||
//TODO verify which modes are supported
|
||||
return ModeDefinitionHelper::create<ControllerModes, DefaultSubmode>();
|
||||
}
|
||||
|
||||
ReturnValue_t GPSHyperionLinuxController::executeAction(Action *action) {
|
||||
return action->handle();
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase {
|
||||
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
||||
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
|
||||
uint32_t* msToReachTheMode) override;
|
||||
ModeDefinitionHelper getModeDefinitionHelper() override;
|
||||
ReturnValue_t executeAction(Action* action) override;
|
||||
ReturnValue_t handleAction(GPSHyperionLinuxAction * action);
|
||||
ReturnValue_t initialize() override;
|
||||
|
@ -61,6 +61,10 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode,
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ModeDefinitionHelper AcsController::getModeDefinitionHelper() {
|
||||
return ModeDefinitionHelper::create<ControllerModes, DefaultSubmode>();
|
||||
}
|
||||
|
||||
void AcsController::copyMgmData() {
|
||||
{
|
||||
PoolReadGuard pg(&mgm0Lis3Set);
|
||||
|
@ -30,6 +30,8 @@ class AcsController : public ExtendedControllerBase {
|
||||
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
|
||||
uint32_t* msToReachTheMode) override;
|
||||
|
||||
ModeDefinitionHelper getModeDefinitionHelper() override;
|
||||
|
||||
// MGMs
|
||||
acsctrl::MgmData mgmData;
|
||||
|
||||
|
@ -231,6 +231,10 @@ ReturnValue_t ThermalController::checkModeCommand(Mode_t mode, Submode_t submode
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ModeDefinitionHelper ThermalController::getModeDefinitionHelper() {
|
||||
return ModeDefinitionHelper::create<ControllerModes, DefaultSubmode>();
|
||||
}
|
||||
|
||||
void ThermalController::copySensors() {
|
||||
PoolReadGuard pg0(&max31865Set0);
|
||||
if (pg0.getReadResult() == HasReturnvaluesIF::RETURN_OK) {
|
||||
|
@ -27,6 +27,8 @@ class ThermalController : public ExtendedControllerBase {
|
||||
virtual ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
|
||||
uint32_t* msToReachTheMode) override;
|
||||
|
||||
ModeDefinitionHelper getModeDefinitionHelper() override;
|
||||
|
||||
private:
|
||||
static const uint32_t DELAY = 500;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "DualLaneAssemblyBase.h"
|
||||
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
@ -92,6 +93,10 @@ ReturnValue_t DualLaneAssemblyBase::pwrStateMachineWrapper() {
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ModeDefinitionHelper DualLaneAssemblyBase::getModeDefinitionHelper() {
|
||||
return ModeDefinitionHelper::create<DeviceHandlerIF::DeviceHandlerMode, duallane::Submodes>();
|
||||
}
|
||||
|
||||
ReturnValue_t DualLaneAssemblyBase::isModeCombinationValid(Mode_t mode, Submode_t submode) {
|
||||
using namespace duallane;
|
||||
if (submode != A_SIDE and submode != B_SIDE and submode != DUAL_MODE) {
|
||||
|
@ -22,6 +22,8 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF {
|
||||
pcdu::Switches switch1, pcdu::Switches switch2, Event pwrSwitchTimeoutEvent,
|
||||
Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent);
|
||||
|
||||
ModeDefinitionHelper getModeDefinitionHelper() override;
|
||||
|
||||
protected:
|
||||
// This helper object complete encapsulates power switching
|
||||
DualLanePowerStateMachine pwrStateMachine;
|
||||
|
@ -189,3 +189,7 @@ void RwAssembly::handleModeTransitionFailed(ReturnValue_t result) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ModeDefinitionHelper RwAssembly::getModeDefinitionHelper() {
|
||||
return ModeDefinitionHelper::create<DeviceHandlerIF::DeviceHandlerMode, HasModesIF::DefaultSubmode>();
|
||||
}
|
@ -15,6 +15,10 @@ class RwAssembly : public AssemblyBase {
|
||||
RwAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
|
||||
power::Switch_t switcher, RwHelper helper);
|
||||
|
||||
~RwAssembly() {}
|
||||
|
||||
ModeDefinitionHelper getModeDefinitionHelper() override;
|
||||
|
||||
private:
|
||||
static constexpr uint8_t NUMBER_RWS = 4;
|
||||
RwHelper helper;
|
||||
|
@ -203,3 +203,7 @@ void TcsBoardAssembly::handleModeTransitionFailed(ReturnValue_t result) {
|
||||
triggerEvent(MODE_TRANSITION_FAILED, result);
|
||||
}
|
||||
}
|
||||
|
||||
ModeDefinitionHelper TcsBoardAssembly::getModeDefinitionHelper(){
|
||||
return ModeDefinitionHelper::create<DeviceHandlerIF::DeviceHandlerMode, HasModesIF::DefaultSubmode>();
|
||||
}
|
@ -22,6 +22,8 @@ class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF {
|
||||
|
||||
ReturnValue_t initialize() override;
|
||||
|
||||
ModeDefinitionHelper getModeDefinitionHelper();
|
||||
|
||||
private:
|
||||
static constexpr uint8_t NUMBER_RTDS = 16;
|
||||
PowerSwitcher switcher;
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define MISSION_SYSTEM_DEFINITIONS_H_
|
||||
|
||||
#include <fsfw/modes/ModeMessage.h>
|
||||
#include <fsfw/introspection/ClasslessEnum.h>
|
||||
|
||||
namespace power {
|
||||
|
||||
@ -12,7 +13,7 @@ enum class OpCodes { NONE, TO_OFF_DONE, TO_NOT_OFF_DONE, TIMEOUT_OCCURED };
|
||||
|
||||
namespace duallane {
|
||||
|
||||
enum Submodes : Submode_t { A_SIDE = 0, B_SIDE = 1, DUAL_MODE = 2 };
|
||||
FSFW_CLASSLESS_ENUM(Submodes, Submode_t, ((A_SIDE, 0, "Side A")) ((B_SIDE, 1, "Side B")) ((DUAL_MODE, 2, "Dual mode")))
|
||||
|
||||
} // namespace duallane
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user