right we need dummies ...
This commit is contained in:
parent
5f9247ee1e
commit
33d3e7686c
@ -43,3 +43,18 @@ ReturnValue_t PlPcduDummy::initializeLocalDataPool(localpool::DataPool &localDat
|
||||
localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, new PoolEntry<float>({0.0}, true));
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PlPcduDummy::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode,
|
||||
uint32_t *msToReachTheMode) {
|
||||
if (commandedMode != MODE_OFF) {
|
||||
PoolReadGuard pg(&enablePl);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) {
|
||||
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode,
|
||||
msToReachTheMode);
|
||||
}
|
||||
}
|
||||
return NON_OP_STATE_OF_CHARGE;
|
||||
}
|
||||
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode);
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef DUMMIES_PLPCDUDUMMY_H_
|
||||
#define DUMMIES_PLPCDUDUMMY_H_
|
||||
|
||||
#include <common/config/eive/objects.h>
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <mission/controller/controllerdefinitions/PowerCtrlDefinitions.h>
|
||||
#include <mission/payload/payloadPcduDefinitions.h>
|
||||
|
||||
class PlPcduDummy : public DeviceHandlerBase {
|
||||
@ -29,6 +31,10 @@ class PlPcduDummy : public DeviceHandlerBase {
|
||||
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) override;
|
||||
|
||||
ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode,
|
||||
uint32_t *msToReachTheMode) override;
|
||||
pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER);
|
||||
};
|
||||
|
||||
#endif /* DUMMIES_PLPCDUDUMMY_H_ */
|
||||
|
@ -23,6 +23,21 @@ ReturnValue_t PlocMpsocDummy::buildCommandFromCommand(DeviceCommandId_t deviceCo
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PlocMpsocDummy::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode,
|
||||
uint32_t *msToReachTheMode) {
|
||||
if (commandedMode != MODE_OFF) {
|
||||
PoolReadGuard pg(&enablePl);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) {
|
||||
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode,
|
||||
msToReachTheMode);
|
||||
}
|
||||
}
|
||||
return NON_OP_STATE_OF_CHARGE;
|
||||
}
|
||||
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode);
|
||||
}
|
||||
|
||||
ReturnValue_t PlocMpsocDummy::scanForReply(const uint8_t *start, size_t len,
|
||||
DeviceCommandId_t *foundId, size_t *foundLen) {
|
||||
return returnvalue::OK;
|
||||
|
@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/config/eive/objects.h>
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <mission/controller/controllerdefinitions/PowerCtrlDefinitions.h>
|
||||
|
||||
#include "mission/power/defs.h"
|
||||
|
||||
@ -24,6 +26,9 @@ class PlocMpsocDummy : public DeviceHandlerBase {
|
||||
size_t commandDataLen) override;
|
||||
ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
|
||||
size_t *foundLen) override;
|
||||
ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode,
|
||||
uint32_t *msToReachTheMode) override;
|
||||
pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER);
|
||||
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override;
|
||||
void fillCommandAndReplyMap() override;
|
||||
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
||||
|
@ -51,3 +51,19 @@ ReturnValue_t PlocSupervisorDummy::getSwitches(const uint8_t **switches,
|
||||
*switches = reinterpret_cast<const uint8_t *>(&switchId);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PlocSupervisorDummy::checkModeCommand(Mode_t commandedMode,
|
||||
Submode_t commandedSubmode,
|
||||
uint32_t *msToReachTheMode) {
|
||||
if (commandedMode != MODE_OFF) {
|
||||
PoolReadGuard pg(&enablePl);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) {
|
||||
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode,
|
||||
msToReachTheMode);
|
||||
}
|
||||
}
|
||||
return NON_OP_STATE_OF_CHARGE;
|
||||
}
|
||||
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode);
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/config/eive/objects.h>
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <mission/controller/controllerdefinitions/PowerCtrlDefinitions.h>
|
||||
#include <mission/power/defs.h>
|
||||
|
||||
class PlocSupervisorDummy : public DeviceHandlerBase {
|
||||
@ -32,4 +34,7 @@ class PlocSupervisorDummy : public DeviceHandlerBase {
|
||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) override;
|
||||
ReturnValue_t getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) override;
|
||||
ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode,
|
||||
uint32_t *msToReachTheMode) override;
|
||||
pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user