improved s/a deployment handler
This commit is contained in:
parent
4d4cf3f694
commit
32d17b9f03
@ -84,14 +84,13 @@ void SolarArrayDeploymentHandler::handleStateMachine() {
|
||||
break;
|
||||
case WAIT_FOR_MAIN_SWITCH_OFF:
|
||||
if (mainLineSwitcher->getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_OFF) {
|
||||
stateMachine = FINISHED_DEPLOYMENT;
|
||||
stateMachine = WAIT_ON_DELOYMENT_COMMAND;
|
||||
} else if (mainSwitchCountdown.hasTimedOut()) {
|
||||
triggerEvent(MAIN_SWITCH_OFF_TIMEOUT);
|
||||
stateMachine = FINISHED_DEPLOYMENT;
|
||||
sif::error << "SolarArrayDeploymentHandler::handleStateMachine: Failed to switch main"
|
||||
<< " switch off" << std::endl;
|
||||
stateMachine = WAIT_ON_DELOYMENT_COMMAND;
|
||||
}
|
||||
case FINISHED_DEPLOYMENT:
|
||||
break;
|
||||
default:
|
||||
sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Invalid state" << std::endl;
|
||||
@ -143,7 +142,6 @@ void SolarArrayDeploymentHandler::switchDeploymentTransistors() {
|
||||
void SolarArrayDeploymentHandler::handleDeploymentFinish() {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
if (deploymentCountdown.hasTimedOut()) {
|
||||
stateMachine = FINISHED_DEPLOYMENT;
|
||||
actionHelper.finish(rememberCommanderId, DEPLOY_SOLAR_ARRAYS, RETURN_OK);
|
||||
result = gpioInterface->pullLow(deplSA1);
|
||||
if (result != RETURN_OK) {
|
||||
@ -157,6 +155,7 @@ void SolarArrayDeploymentHandler::handleDeploymentFinish() {
|
||||
}
|
||||
mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF);
|
||||
mainSwitchCountdown.setTimeout(mainLineSwitcher->getSwitchDelayMs());
|
||||
stateMachine = WAIT_FOR_MAIN_SWITCH_OFF;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,8 +76,7 @@ private:
|
||||
WAIT_ON_8V_SWITCH,
|
||||
SWITCH_DEPL_GPIOS,
|
||||
WAIT_ON_DEPLOYMENT_FINISH,
|
||||
WAIT_FOR_MAIN_SWITCH_OFF,
|
||||
FINISHED_DEPLOYMENT
|
||||
WAIT_FOR_MAIN_SWITCH_OFF
|
||||
};
|
||||
|
||||
StateMachine stateMachine = WAIT_ON_DELOYMENT_COMMAND;
|
||||
|
Loading…
Reference in New Issue
Block a user