bugfix for dual to single side transition
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
parent
a196ab136e
commit
5890e639fe
@ -34,10 +34,17 @@ void DualLaneAssemblyBase::performChildOperation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DualLaneAssemblyBase::startTransition(Mode_t mode, Submode_t submode) {
|
void DualLaneAssemblyBase::startTransition(Mode_t mode, Submode_t submode) {
|
||||||
// doStartTransition(mode, submode);
|
|
||||||
using namespace duallane;
|
using namespace duallane;
|
||||||
pwrStateMachine.reset();
|
pwrStateMachine.reset();
|
||||||
if (mode != MODE_OFF) {
|
if (mode != MODE_OFF) {
|
||||||
|
// Special exception: A transition from dual side to single mode must be handled like
|
||||||
|
// going OFF.
|
||||||
|
if ((this->mode == MODE_ON or this->mode == DeviceHandlerIF::MODE_NORMAL) and
|
||||||
|
this->submode == DUAL_MODE and submode != DUAL_MODE) {
|
||||||
|
dualToSingleSideTransition = true;
|
||||||
|
AssemblyBase::startTransition(mode, submode);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// If anything other than MODE_OFF is commanded, perform power state machine first
|
// If anything other than MODE_OFF is commanded, perform power state machine first
|
||||||
// Cache the target modes, required by power state machine
|
// Cache the target modes, required by power state machine
|
||||||
pwrStateMachine.start(mode, submode);
|
pwrStateMachine.start(mode, submode);
|
||||||
@ -111,7 +118,7 @@ ReturnValue_t DualLaneAssemblyBase::isModeCombinationValid(Mode_t mode, Submode_
|
|||||||
|
|
||||||
void DualLaneAssemblyBase::handleModeReached() {
|
void DualLaneAssemblyBase::handleModeReached() {
|
||||||
using namespace duallane;
|
using namespace duallane;
|
||||||
if (targetMode == MODE_OFF) {
|
if (targetMode == MODE_OFF or dualToSingleSideTransition) {
|
||||||
pwrStateMachine.start(targetMode, targetSubmode);
|
pwrStateMachine.start(targetMode, targetSubmode);
|
||||||
// Now we can switch off the power. After that, the AssemblyBase::handleModeReached function
|
// Now we can switch off the power. After that, the AssemblyBase::handleModeReached function
|
||||||
// will be called
|
// will be called
|
||||||
@ -229,6 +236,7 @@ void DualLaneAssemblyBase::finishModeOp() {
|
|||||||
pwrStateMachine.reset();
|
pwrStateMachine.reset();
|
||||||
powerRetryCounter = 0;
|
powerRetryCounter = 0;
|
||||||
tryingOtherSide = false;
|
tryingOtherSide = false;
|
||||||
|
dualToSingleSideTransition = false;
|
||||||
dualModeErrorSwitch = true;
|
dualModeErrorSwitch = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF {
|
|||||||
uint8_t powerRetryCounter = 0;
|
uint8_t powerRetryCounter = 0;
|
||||||
bool tryingOtherSide = false;
|
bool tryingOtherSide = false;
|
||||||
bool dualModeErrorSwitch = true;
|
bool dualModeErrorSwitch = true;
|
||||||
|
bool dualToSingleSideTransition = false;
|
||||||
duallane::Submodes defaultSubmode = duallane::Submodes::A_SIDE;
|
duallane::Submodes defaultSubmode = duallane::Submodes::A_SIDE;
|
||||||
|
|
||||||
enum RecoveryCustomStates {
|
enum RecoveryCustomStates {
|
||||||
|
Loading…
Reference in New Issue
Block a user