add dual lane power switcher for PL PCDU
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
2022-03-25 15:56:44 +01:00
parent 0937697637
commit 74fa98d161
5 changed files with 23 additions and 15 deletions

View File

@ -14,12 +14,14 @@
PayloadPcduHandler::PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie,
GpioIF* gpioIF, SdCardMountedIF* sdcMan,
bool periodicPrintout)
PowerSwitchIF* pwrSwitcher, pcduSwitches::Switches switchA,
pcduSwitches::Switches switchB, bool periodicPrintout)
: DeviceHandlerBase(objectId, comIF, cookie),
adcSet(this),
periodicPrintout(periodicPrintout),
gpioIF(gpioIF),
sdcMan(sdcMan) {}
sdcMan(sdcMan),
pwrStateMachine(switchA, switchB, pwrSwitcher) {}
void PayloadPcduHandler::doStartUp() {
if ((state != States::PL_PCDU_OFF) and (state != States::ON_TRANS_SSR)) {
@ -34,8 +36,8 @@ void PayloadPcduHandler::doStartUp() {
void PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subModeFrom) {
using namespace plpcdu;
if(submode == plpcdu::NORMAL_ALL_ON or submode == plpcdu::NORMAL_ADC_ONLY) {
if(state == States::PL_PCDU_OFF) {
if (submode == plpcdu::NORMAL_ALL_ON or submode == plpcdu::NORMAL_ADC_ONLY) {
if (state == States::PL_PCDU_OFF) {
// TODO: Config error, emit error printout
setMode(MODE_OFF);
}
@ -59,7 +61,7 @@ void PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subMode
monMode = MonitoringMode::CLOSE_TO_ZERO;
}
}
if(state == States::ON_TRANS_ADC_CLOSE_ZERO) {
if (state == States::ON_TRANS_ADC_CLOSE_ZERO) {
if (adcState == AdcStates::BOOT_DELAY) {
if (adcCountdown.hasTimedOut()) {
adcState = AdcStates::SEND_SETUP;
@ -69,7 +71,7 @@ void PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subMode
if (adcState == AdcStates::SEND_SETUP) {
if (adcCmdExecuted) {
adcState = AdcStates::NORMAL;
if(submode == plpcdu::NORMAL_ADC_ONLY) {
if (submode == plpcdu::NORMAL_ADC_ONLY) {
setMode(MODE_NORMAL, NORMAL_ADC_ONLY);
}
adcCountdown.setTimeout(100);