This commit is contained in:
Ulrich Mohr 2022-08-18 16:33:53 +02:00
parent 45e5ea362d
commit 73971ad486
7 changed files with 43 additions and 23 deletions

View File

@ -79,11 +79,6 @@ class XscRebootObcAction : public TemplateAction<CoreController, XscRebootObcAct
Parameter<Selection> copy = Parameter<Selection>::createParameter(this, "Copy");
};
class MountOtherCopyAction : public TemplateAction<CoreController, MountOtherCopyAction, ActionId> {
public:
MountOtherCopyAction(CoreController *owner) : TemplateAction(owner, ActionId::MOUNT_OTHER_COPY){};
};
class RebootObcAction : public TemplateAction<CoreController, RebootObcAction, ActionId> {
public:
RebootObcAction(CoreController *owner) : TemplateAction(owner, ActionId::REBOOT_OBC){};

View File

@ -169,7 +169,7 @@ ReturnValue_t CoreController::handleAction(core::SwitchRebootFileHandlingAction
std::string path = sdcMan->getCurrentMountPrefix() + REBOOT_FILE;
// Disable the reboot file mechanism
parseRebootFile(path, rebootFile);
if (action->enableRebootFile == core::Boolenum::NO) {
if (action->enableRebootFile.value == core::Boolenum::NO) {
rebootFile.enabled = false;
rewriteRebootFile(rebootFile);
} else {
@ -181,7 +181,7 @@ ReturnValue_t CoreController::handleAction(core::SwitchRebootFileHandlingAction
ReturnValue_t CoreController::handleAction(core::ResetRebootCountersAction *action) {
xsc::Chip chip = xsc::NO_CHIP;
switch (action->chip) {
switch (action->chip.value) {
case core::ResetRebootCountersAction::Selection::ALL:
chip = xsc::ALL_CHIP;
break;
@ -193,7 +193,7 @@ ReturnValue_t CoreController::handleAction(core::ResetRebootCountersAction *acti
break;
}
xsc::Copy copy = xsc::NO_COPY;
switch (action->copy) {
switch (action->copy.value) {
case core::ResetRebootCountersAction::Selection::ALL:
copy = xsc::ALL_COPY;
break;
@ -210,13 +210,13 @@ ReturnValue_t CoreController::handleAction(core::ResetRebootCountersAction *acti
}
ReturnValue_t CoreController::handleAction(core::SwitchImageLockAction *action) {
bool lock = action->lock == core::Boolenum::YES;
bool lock = action->lock.value == core::Boolenum::YES;
xsc::Chip chip = xsc::CHIP_0;
if (action->chip == core::SwitchImageLockAction::Selection::ONE) {
if (action->chip.value == core::SwitchImageLockAction::Selection::ONE) {
chip = xsc::CHIP_1;
}
xsc::Copy copy = xsc::COPY_0;
if (action->copy == core::SwitchImageLockAction::Selection::ONE) {
if (action->copy.value == core::SwitchImageLockAction::Selection::ONE) {
copy = xsc::COPY_0;
}
setRebootMechanismLock(lock, chip, copy);
@ -855,13 +855,13 @@ void CoreController::initPrint() {
}
ReturnValue_t CoreController::handleAction(core::XscRebootObcAction *action) {
if (action->chip == core::XscRebootObcAction::Selection::SAME and
not(action->copy == core::XscRebootObcAction::Selection::SAME)) {
if (action->chip.value == core::XscRebootObcAction::Selection::SAME and
not(action->copy.value == core::XscRebootObcAction::Selection::SAME)) {
return HasActionsIF::INVALID_PARAMETERS;
}
bool rebootSameBootCopy = false;
if (action->chip == core::XscRebootObcAction::Selection::SAME and
action->copy == core::XscRebootObcAction::Selection::SAME) {
if (action->chip.value == core::XscRebootObcAction::Selection::SAME and
action->copy.value == core::XscRebootObcAction::Selection::SAME) {
rebootSameBootCopy = true;
}
bool protOpPerformed = false;
@ -888,11 +888,11 @@ ReturnValue_t CoreController::handleAction(core::XscRebootObcAction *action) {
generateChipStateFile();
// If any boot copies are unprotected, protect them here
auto tgtChip = xsc::CHIP_0;
if (action->chip == core::XscRebootObcAction::Selection::ONE) {
if (action->chip.value == core::XscRebootObcAction::Selection::ONE) {
tgtChip = xsc::CHIP_1;
}
auto tgtCopy = xsc::COPY_0;
if (action->copy == core::XscRebootObcAction::Selection::ONE) {
if (action->copy.value == core::XscRebootObcAction::Selection::ONE) {
tgtCopy = xsc::COPY_1;
}

View File

@ -91,7 +91,6 @@ class CoreController : public ExtendedControllerBase {
ReturnValue_t handleAction(core::SwitchImageLockAction* action);
ReturnValue_t handleAction(core::SetMaxRebootCntAction* action);
ReturnValue_t handleAction(core::XscRebootObcAction* action);
ReturnValue_t handleAction(core::MountOtherCopyAction* action);
ReturnValue_t handleAction(core::RebootObcAction* action);
ReturnValue_t handleCommandMessage(CommandMessage* message) override;
@ -194,6 +193,16 @@ class CoreController : public ExtendedControllerBase {
core::HkSet hkSet;
core::ListDirectoryIntoFileAction listDirectoryIntoFileAction =
core::ListDirectoryIntoFileAction(this);
core::SwitchRebootFileHandlingAction switchRebootFileHandlingAction =
core::SwitchRebootFileHandlingAction(this);
core::ResetRebootCountersAction resetRebootCountersAction = core::ResetRebootCountersAction(this);
core::SwitchImageLockAction switchImageLockAction = core::SwitchImageLockAction(this);
core::SetMaxRebootCntAction setMaxRebootCntAction = core::SetMaxRebootCntAction(this);
core::XscRebootObcAction xscRebootObcAction = core::XscRebootObcAction(this);
core::RebootObcAction rebootObcAction = core::RebootObcAction(this);
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
Countdown sdCardCheckCd = Countdown(120000);

View File

@ -58,10 +58,10 @@ class PdecHandler : public SystemObject,
MessageQueueId_t getCommandQueue() const;
ActionHelper *getActionHelper() override;
ActionHelper* getActionHelper() override;
ReturnValue_t executeAction(Action* action) override;
ReturnValue_t handleAction(PdecPrintClcwAction * action);
ReturnValue_t handleAction(PdecPrintMonAction * action);
ReturnValue_t handleAction(PdecPrintClcwAction* action);
ReturnValue_t handleAction(PdecPrintMonAction* action);
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PDEC_HANDLER;
@ -225,6 +225,9 @@ class PdecHandler : public SystemObject,
enum class State : uint8_t { INIT, RUNNING, WAIT_FOR_RECOVERY };
PdecPrintClcwAction pdecPrintClcwAction = PdecPrintClcwAction(this);
PdecPrintMonAction pdecPrintMonAction = PdecPrintMonAction(this);
/**
* @brief Reads and handles messages stored in the commandQueue
*/

View File

@ -108,7 +108,7 @@ ReturnValue_t HeaterHandler::executeAction(Action* action) { return action->hand
ReturnValue_t HeaterHandler::handleAction(SetHeaterAction* heaterAction) {
auto& heater = heaterVec.at(heaterAction->switchNr);
auto action = heaterAction->switchAction;
auto action = heaterAction->switchAction.value;
// Always accepts OFF commands
if (action == SetHeaterAction::SwitchAction::SET_SWITCH_ON) {
HasHealthIF::HealthState health = heater.healthDevice->getHealth();
@ -116,7 +116,7 @@ ReturnValue_t HeaterHandler::handleAction(SetHeaterAction* heaterAction) {
health == HasHealthIF::NEEDS_RECOVERY) {
return HasHealthIF::OBJECT_NOT_HEALTHY;
}
auto cmdSource = heaterAction->cmdSource;
auto cmdSource = heaterAction->cmdSource.value;
if (health == HasHealthIF::EXTERNAL_CONTROL and
cmdSource == SetHeaterAction::CmdSourceParam::INTERNAL) {
return HasHealthIF::IS_EXTERNALLY_CONTROLLED;

View File

@ -142,6 +142,8 @@ class HeaterHandler : public ExecutableObjectIF,
StorageManagerIF* ipcStore = nullptr;
SetHeaterAction heaterAction = SetHeaterAction(this);
void readCommandQueue();
/**

View File

@ -143,6 +143,17 @@ class CCSDSHandler : public SystemObject,
bool linkState = DOWN;
// instances of the actions
SetLowRateAction setLowRateAction = SetLowRateAction(this);
SetHighRateAction setHighRateAction = SetHighRateAction(this);
EnTransmitterAction enTransmitterAction = EnTransmitterAction(this);
DisableTransmitterAction disableTransmitterAction = DisableTransmitterAction(this);
ArbitraryRateAction arbitraryRateAction = ArbitraryRateAction(this);
EnableTxClkManipulatorAction enableTxClkManipulatorAction = EnableTxClkManipulatorAction(this);
DisableTxClkManipulatorAction disableTxClkManipulatorAction = DisableTxClkManipulatorAction(this);
UpdateOnRisingEdgeAction updateOnRisingEdgeAction = UpdateOnRisingEdgeAction(this);
UpdateOnFallingEdgeAction updateOnFallingEdgeAction = UpdateOnFallingEdgeAction(this);
void readCommandQueue(void);
void handleTelemetry();
void handleTelecommands();