This commit is contained in:
parent
ee0646caf1
commit
758f2b9d7a
@ -2,8 +2,11 @@
|
||||
|
||||
#include <mission/power/gsDefs.h>
|
||||
|
||||
AcuDummy::AcuDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
|
||||
: DeviceHandlerBase(objectId, comif, comCookie) {}
|
||||
AcuDummy::AcuDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie, bool enableHkSets)
|
||||
: DeviceHandlerBase(objectId, comif, comCookie),
|
||||
coreHk(this),
|
||||
auxHk(this),
|
||||
enableHkSets(enableHkSets) {}
|
||||
|
||||
AcuDummy::~AcuDummy() {}
|
||||
|
||||
@ -37,7 +40,49 @@ uint32_t AcuDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return
|
||||
|
||||
ReturnValue_t AcuDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) {
|
||||
using namespace ACU;
|
||||
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNELS, new PoolEntry<int16_t>(6));
|
||||
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNELS, new PoolEntry<uint16_t>(6));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_VCC, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VBAT, new PoolEntry<uint16_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(ACU::pool::ACU_TEMPERATURES,
|
||||
new PoolEntry<float>({10.0, 10.0, 10.0}, true));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_MPPT_MODE, new PoolEntry<uint8_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_VBOOST_IN_CHANNELS, new PoolEntry<uint16_t>(6));
|
||||
localDataPoolMap.emplace(pool::ACU_POWER_IN_CHANNELS, new PoolEntry<uint16_t>(6));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_ENABLES, new PoolEntry<uint8_t>(3));
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_RAW_CHANNELS, new PoolEntry<uint16_t>(6));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_BOOTCNT, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_UPTIME, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_RESET_CAUSE, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_MPPT_TIME, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_MPPT_PERIOD, new PoolEntry<uint16_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICES, new PoolEntry<uint8_t>(8));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICES_STATUS, new PoolEntry<uint8_t>(8));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
|
||||
|
||||
poolManager.subscribeForDiagPeriodicPacket(
|
||||
subdp::DiagnosticsHkPeriodicParams(coreHk.getSid(), enableHkSets, 30.0));
|
||||
poolManager.subscribeForRegularPeriodicPacket(
|
||||
subdp::RegularHkPeriodicParams(auxHk.getSid(), enableHkSets, 6000.0));
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
LocalPoolDataSetBase *AcuDummy::getDataSetHandle(sid_t sid) {
|
||||
if (sid == coreHk.getSid()) {
|
||||
return &coreHk;
|
||||
} else if (sid == auxHk.getSid()) {
|
||||
return &auxHk;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define DUMMIES_ACUDUMMY_H_
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <mission/power/gsDefs.h>
|
||||
|
||||
class AcuDummy : public DeviceHandlerBase {
|
||||
public:
|
||||
@ -11,10 +12,14 @@ class AcuDummy : public DeviceHandlerBase {
|
||||
static const uint8_t SIMPLE_COMMAND_DATA = 1;
|
||||
static const uint8_t PERIODIC_REPLY_DATA = 2;
|
||||
|
||||
AcuDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
|
||||
AcuDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie, bool enableHkSets);
|
||||
virtual ~AcuDummy();
|
||||
|
||||
protected:
|
||||
ACU::CoreHk coreHk;
|
||||
ACU::AuxHk auxHk;
|
||||
bool enableHkSets;
|
||||
|
||||
void doStartUp() override;
|
||||
void doShutDown() override;
|
||||
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
|
||||
@ -28,6 +33,7 @@ class AcuDummy : public DeviceHandlerBase {
|
||||
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) override;
|
||||
LocalPoolDataSetBase *getDataSetHandle(sid_t sid) override;
|
||||
};
|
||||
|
||||
#endif /* DUMMIES_ACUDUMMY_H_ */
|
||||
|
@ -80,9 +80,9 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
|
||||
imtqDummy->enableThermalModule(ThermalStateCfg());
|
||||
imtqDummy->connectModeTreeParent(*imtqAssy);
|
||||
if (cfg.addOnlyAcuDummy) {
|
||||
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy, enableHkSets);
|
||||
} else if (cfg.addPowerDummies) {
|
||||
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy, enableHkSets);
|
||||
new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||
new PduDummy(objects::PDU2_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||
new P60DockDummy(objects::P60DOCK_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||
|
Loading…
Reference in New Issue
Block a user