use stack handler in PL PCDU component
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:
@ -16,27 +16,21 @@
|
||||
|
||||
PayloadPcduHandler::PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie,
|
||||
GpioIF* gpioIF, SdCardMountedIF* sdcMan,
|
||||
PowerSwitchIF* pwrSwitcher, power::Switch_t switchA,
|
||||
power::Switch_t switchB, bool periodicPrintout)
|
||||
Stack5VHandler& stackHandler, bool periodicPrintout)
|
||||
: DeviceHandlerBase(objectId, comIF, cookie),
|
||||
adcSet(this),
|
||||
stackHandler(stackHandler),
|
||||
periodicPrintout(periodicPrintout),
|
||||
gpioIF(gpioIF),
|
||||
sdcMan(sdcMan),
|
||||
pwrStateMachine(switchA, switchB, pwrSwitcher) {}
|
||||
sdcMan(sdcMan) {}
|
||||
|
||||
void PayloadPcduHandler::doStartUp() {
|
||||
if ((state != States::PL_PCDU_OFF) and (state != States::ON_TRANS_SSR)) {
|
||||
// Config error
|
||||
sif::error << "PayloadPcduHandler::doStartUp: Invalid state" << std::endl;
|
||||
}
|
||||
if (pwrStateMachine.getState() == power::States::IDLE) {
|
||||
pwrStateMachine.start(MODE_ON, pwrSubmode);
|
||||
}
|
||||
clearSetOnOffFlag = true;
|
||||
auto opCode = pwrStateMachine.fsm();
|
||||
if (opCode == power::OpCodes::TO_NOT_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) {
|
||||
pwrStateMachine.reset();
|
||||
if (true) {
|
||||
quickTransitionAlreadyCalled = false;
|
||||
state = States::POWER_CHANNELS_ON;
|
||||
setMode(_MODE_TO_ON);
|
||||
@ -48,17 +42,12 @@ void PayloadPcduHandler::doShutDown() {
|
||||
quickTransitionBackToOff(false, false);
|
||||
quickTransitionAlreadyCalled = true;
|
||||
}
|
||||
if (pwrStateMachine.getState() == power::States::IDLE) {
|
||||
pwrStateMachine.start(MODE_OFF, 0);
|
||||
}
|
||||
if (clearSetOnOffFlag) {
|
||||
std::memset(adcSet.processed.value, 0, adcSet.processed.getSerializedSize());
|
||||
clearSetOnOffFlag = false;
|
||||
}
|
||||
|
||||
auto opCode = pwrStateMachine.fsm();
|
||||
if (opCode == power::OpCodes::TO_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) {
|
||||
pwrStateMachine.reset();
|
||||
if (true) {
|
||||
state = States::PL_PCDU_OFF;
|
||||
// No need to set mode _MODE_POWER_DOWN, power switching was already handled
|
||||
setMode(MODE_OFF);
|
||||
|
Reference in New Issue
Block a user