that was a lot of printouts
This commit is contained in:
parent
5e93282662
commit
65c231e92d
@ -86,15 +86,12 @@ ReturnValue_t DualLaneAssemblyBase::pwrStateMachineWrapper() {
|
||||
if (opCode == OpCodes::NONE) {
|
||||
return returnvalue::OK;
|
||||
} else if (opCode == OpCodes::TO_OFF_DONE) {
|
||||
sif::debug << "to off done" << std::endl;
|
||||
// Will be called for transitions to MODE_OFF, where everything is done after power switching
|
||||
finishModeOp();
|
||||
} else if (opCode == OpCodes::TO_NOT_OFF_DONE) {
|
||||
if (dualToSingleSideTransition) {
|
||||
sif::debug << "finishing dual to single side transition" << std::endl;
|
||||
finishModeOp();
|
||||
} else {
|
||||
sif::debug << "starting ASM base transition with submode " << (int) targetSubmode << std::endl;
|
||||
// Will be called for transitions from MODE_OFF to anything else, where the mode still has
|
||||
// to be commanded after power switching
|
||||
AssemblyBase::startTransition(targetMode, targetSubmode);
|
||||
@ -186,7 +183,6 @@ void DualLaneAssemblyBase::handleModeTransitionFailed(ReturnValue_t result) {
|
||||
startTransition(mode, nextSubmode);
|
||||
tryingOtherSide = true;
|
||||
} else {
|
||||
sif::debug << "starting dual side transition" << std::endl;
|
||||
triggerEvent(transitionOtherSideFailedEvent, mode, targetSubmode);
|
||||
// If we have just attempted side swichting, this flag needs to be reset!
|
||||
startTransition(mode, Submodes::DUAL_MODE);
|
||||
|
@ -17,8 +17,6 @@ SusAssembly::SusAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, SusAs
|
||||
}
|
||||
|
||||
ReturnValue_t SusAssembly::commandChildren(Mode_t mode, Submode_t submode) {
|
||||
sif::debug << "commanding children to mode " << mode << " and submode " << (int) submode
|
||||
<< std::endl;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
refreshHelperModes();
|
||||
// Initialize the mode table to ensure all devices are in a defined state
|
||||
@ -27,8 +25,6 @@ ReturnValue_t SusAssembly::commandChildren(Mode_t mode, Submode_t submode) {
|
||||
modeTable[idx].setSubmode(SUBMODE_NONE);
|
||||
}
|
||||
if (recoveryState == RecoveryState::RECOVERY_IDLE) {
|
||||
sif::debug << "checking health states, recovery not ongoing. Commanded submode: " <<
|
||||
(int) submode << std::endl;
|
||||
result = checkAndHandleHealthStates(mode, submode);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
@ -36,7 +32,6 @@ ReturnValue_t SusAssembly::commandChildren(Mode_t mode, Submode_t submode) {
|
||||
}
|
||||
if (recoveryState != RecoveryState::RECOVERY_STARTED) {
|
||||
if (mode == DeviceHandlerIF::MODE_NORMAL or mode == MODE_ON) {
|
||||
sif::debug << "handling on or normal cmd. Submode: " << (int) submode << std::endl;
|
||||
result = handleNormalOrOnModeCmd(mode, submode);
|
||||
}
|
||||
}
|
||||
@ -56,31 +51,9 @@ ReturnValue_t SusAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t submod
|
||||
modeTable[tableIdx].setMode(mode);
|
||||
modeTable[tableIdx].setSubmode(SUBMODE_NONE);
|
||||
}
|
||||
// if (mode == devMode) {
|
||||
// modeTable[tableIdx].setMode(mode);
|
||||
// } else if (mode == DeviceHandlerIF::MODE_NORMAL) {
|
||||
// if (isModeCommandable(objectId, devMode)) {
|
||||
// if (devMode == MODE_ON) {
|
||||
// modeTable[tableIdx].setMode(mode);
|
||||
// modeTable[tableIdx].setSubmode(SUBMODE_NONE);
|
||||
// } else {
|
||||
// modeTable[tableIdx].setMode(MODE_ON);
|
||||
// modeTable[tableIdx].setSubmode(SUBMODE_NONE);
|
||||
// if (internalState != STATE_SECOND_STEP) {
|
||||
// needsSecondStep = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } else if (mode == MODE_ON) {
|
||||
// if (isModeCommandable(objectId, devMode)) {
|
||||
// modeTable[tableIdx].setMode(MODE_ON);
|
||||
// modeTable[tableIdx].setSubmode(SUBMODE_NONE);
|
||||
// }
|
||||
// }
|
||||
};
|
||||
switch (submode) {
|
||||
case (A_SIDE): {
|
||||
sif::debug << "commanding a side" << std::endl;
|
||||
for (uint8_t idx = 0; idx < NUMBER_SUN_SENSORS_ONE_SIDE; idx++) {
|
||||
cmdSeq(helper.susIds[idx], helper.susModes[idx], idx);
|
||||
// Switch off devices on redundant side
|
||||
@ -90,7 +63,6 @@ ReturnValue_t SusAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t submod
|
||||
break;
|
||||
}
|
||||
case (B_SIDE): {
|
||||
sif::debug << "commanding b side" << std::endl;
|
||||
for (uint8_t idx = NUMBER_SUN_SENSORS_ONE_SIDE; idx < NUMBER_SUN_SENSORS; idx++) {
|
||||
cmdSeq(helper.susIds[idx], helper.susModes[idx], idx);
|
||||
// Switch devices on nominal side
|
||||
@ -100,7 +72,6 @@ ReturnValue_t SusAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t submod
|
||||
break;
|
||||
}
|
||||
case (DUAL_MODE): {
|
||||
sif::debug << "commanding dual mode for all sensors" << std::endl;
|
||||
for (uint8_t idx = 0; idx < NUMBER_SUN_SENSORS; idx++) {
|
||||
cmdSeq(helper.susIds[idx], helper.susModes[idx], idx);
|
||||
}
|
||||
@ -152,7 +123,8 @@ void SusAssembly::refreshHelperModes() {
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t SusAssembly::checkAndHandleHealthStates(Mode_t commandedMode, Submode_t commandedSubmode) {
|
||||
ReturnValue_t SusAssembly::checkAndHandleHealthStates(Mode_t commandedMode,
|
||||
Submode_t commandedSubmode) {
|
||||
using namespace returnvalue;
|
||||
ReturnValue_t status = returnvalue::OK;
|
||||
bool needsHealthOverwritten = false;
|
||||
@ -163,7 +135,6 @@ ReturnValue_t SusAssembly::checkAndHandleHealthStates(Mode_t commandedMode, Subm
|
||||
(healthRed == FAULTY or healthRed == PERMANENT_FAULTY)) {
|
||||
overwriteDeviceHealth(devNom, healthNom);
|
||||
overwriteDeviceHealth(devRed, healthRed);
|
||||
sif::debug << "SUS module health was overwritten" << std::endl;
|
||||
needsHealthOverwritten = true;
|
||||
}
|
||||
};
|
||||
@ -175,7 +146,6 @@ ReturnValue_t SusAssembly::checkAndHandleHealthStates(Mode_t commandedMode, Subm
|
||||
};
|
||||
if (commandedSubmode == duallane::DUAL_MODE) {
|
||||
uint8_t idx = 0;
|
||||
sif::debug << "doing dual mode health handling" << std::endl;
|
||||
for (idx = 0; idx < 6; idx++) {
|
||||
checkSusGroup(helper.susIds[idx], helper.susIds[idx + 6]);
|
||||
checkHealthForOneDev(helper.susIds[idx]);
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "PowerStateMachineBase.h"
|
||||
|
||||
#include "fsfw/serviceinterface.h"
|
||||
|
||||
PowerStateMachineBase::PowerStateMachineBase(PowerSwitchIF *pwrSwitcher, dur_millis_t checkTimeout)
|
||||
|
Loading…
Reference in New Issue
Block a user