create temp sensor dummies
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Robin Müller 2022-11-25 10:13:24 +01:00
parent 1f687ffc38
commit 43ed7d4bc5
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
18 changed files with 157 additions and 39 deletions

View File

@ -109,11 +109,11 @@ void ObjectFactory::produce(void* args) {
dummy::createDummies(cfg, *dummySwitcher);
HeaterHandler* heaterHandler = nullptr;
//new ThermalController(objects::THERMAL_CONTROLLER);
// new ThermalController(objects::THERMAL_CONTROLLER);
ObjectFactory::createGenericHeaterComponents(*dummyGpioIF, *dummySwitcher, heaterHandler);
if(heaterHandler == nullptr){
if (heaterHandler == nullptr) {
sif::error << "HeaterHandler could not be created" << std::endl;
}else{
} else {
ObjectFactory::createThermalController(*heaterHandler);
}
new TestTask(objects::TEST_TASK);

View File

@ -6,6 +6,7 @@ target_sources(
ComIFDummy.cpp
ComCookieDummy.cpp
RwDummy.cpp
Max31865Dummy.cpp
StarTrackerDummy.cpp
SyrlinksDummy.cpp
ImtqDummy.cpp
@ -20,4 +21,5 @@ target_sources(
CoreControllerDummy.cpp
helpers.cpp
MgmRm3100Dummy.cpp
DummyHeaterHandler.cpp)
Tmp1075Dummy.cpp
DummyHeaterHandler.cpp)

View File

@ -2,5 +2,3 @@
// Created by irini on 24.11.22.
//
#include "DummyHeaterHandler.h"

View File

@ -6,8 +6,8 @@
#define EIVE_OBSW_DUMMYHEATERHANDLER_H
#include "mission/devices/HeaterHandler.h"
class DummyHeaterHandler: public HeaterHandler{
class DummyHeaterHandler : public HeaterHandler {
public:
//DummyHeaterHandler();
// DummyHeaterHandler();
};
#endif // EIVE_OBSW_DUMMYHEATERHANDLER_H

View File

@ -5,7 +5,7 @@
ImtqDummy::ImtqDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
ImtqDummy::~ImtqDummy() {}
ImtqDummy::~ImtqDummy() = default;
void ImtqDummy::doStartUp() {}

View File

@ -12,7 +12,7 @@ class ImtqDummy : public DeviceHandlerBase {
static const uint8_t PERIODIC_REPLY_DATA = 2;
ImtqDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
virtual ~ImtqDummy();
~ImtqDummy() override;
protected:
void doStartUp() override;

30
dummies/Max31865Dummy.cpp Normal file
View File

@ -0,0 +1,30 @@
#include "Max31865Dummy.h"
using namespace returnvalue;
Max31865Dummy::Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie), set(this, EiveMax31855::EXCHANGE_SET_ID) {}
void Max31865Dummy::doStartUp() { setMode(MODE_ON); }
void Max31865Dummy::doShutDown() { setMode(_MODE_POWER_DOWN); }
ReturnValue_t Max31865Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t Max31865Dummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return OK; }
ReturnValue_t Max31865Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData,
size_t commandDataLen) {
return 0;
}
ReturnValue_t Max31865Dummy::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) {
return 0;
}
ReturnValue_t Max31865Dummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
return 0;
}
void Max31865Dummy::fillCommandAndReplyMap() {}
uint32_t Max31865Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 0; }
ReturnValue_t Max31865Dummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager);
}

29
dummies/Max31865Dummy.h Normal file
View File

@ -0,0 +1,29 @@
#ifndef EIVE_OBSW_MAX31865DUMMY_H
#define EIVE_OBSW_MAX31865DUMMY_H
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
class Max31865Dummy : public DeviceHandlerBase {
public:
Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
private:
MAX31865::PrimarySet set;
void doStartUp() override;
void doShutDown() override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData,
size_t commandDataLen) override;
ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override;
void fillCommandAndReplyMap() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override;
};
#endif // EIVE_OBSW_MAX31865DUMMY_H

View File

@ -15,8 +15,8 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject
private:
int iteration = 0;
float value = 0;
MAX31865::Max31865Set max31865PlocHeatspreaderSet;
MAX31865::Max31865Set max31865PlocMissionboardSet;
MAX31865::PrimarySet max31865PlocHeatspreaderSet;
MAX31865::PrimarySet max31865PlocMissionboardSet;
void noise();
};

30
dummies/Tmp1075Dummy.cpp Normal file
View File

@ -0,0 +1,30 @@
#include "Tmp1075Dummy.h"
using namespace returnvalue;
Tmp1075Dummy::Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
void Tmp1075Dummy::doStartUp() { setMode(MODE_ON); }
void Tmp1075Dummy::doShutDown() { setMode(_MODE_POWER_DOWN); }
ReturnValue_t Tmp1075Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t Tmp1075Dummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return OK; }
ReturnValue_t Tmp1075Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData,
size_t commandDataLen) {
return 0;
}
ReturnValue_t Tmp1075Dummy::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) {
return 0;
}
ReturnValue_t Tmp1075Dummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
return 0;
}
void Tmp1075Dummy::fillCommandAndReplyMap() {}
uint32_t Tmp1075Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 0; }
ReturnValue_t Tmp1075Dummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager);
}

26
dummies/Tmp1075Dummy.h Normal file
View File

@ -0,0 +1,26 @@
#ifndef EIVE_OBSW_TMP1075DUMMY_H
#define EIVE_OBSW_TMP1075DUMMY_H
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
class Tmp1075Dummy : public DeviceHandlerBase {
public:
Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
private:
void doStartUp() override;
void doShutDown() override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData,
size_t commandDataLen) override;
ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override;
void fillCommandAndReplyMap() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override;
};
#endif // EIVE_OBSW_TMP1075DUMMY_H

View File

@ -62,22 +62,22 @@ class ThermalController : public ExtendedControllerBase {
thermalControllerDefinitions::DeviceTemperatures deviceTemperatures;
// Temperature Sensors
MAX31865::Max31865Set max31865Set0;
MAX31865::Max31865Set max31865Set1;
MAX31865::Max31865Set max31865Set2;
MAX31865::Max31865Set max31865Set3;
MAX31865::Max31865Set max31865Set4;
MAX31865::Max31865Set max31865Set5;
MAX31865::Max31865Set max31865Set6;
MAX31865::Max31865Set max31865Set7;
MAX31865::Max31865Set max31865Set8;
MAX31865::Max31865Set max31865Set9;
MAX31865::Max31865Set max31865Set10;
MAX31865::Max31865Set max31865Set11;
MAX31865::Max31865Set max31865Set12;
MAX31865::Max31865Set max31865Set13;
MAX31865::Max31865Set max31865Set14;
MAX31865::Max31865Set max31865Set15;
MAX31865::PrimarySet max31865Set0;
MAX31865::PrimarySet max31865Set1;
MAX31865::PrimarySet max31865Set2;
MAX31865::PrimarySet max31865Set3;
MAX31865::PrimarySet max31865Set4;
MAX31865::PrimarySet max31865Set5;
MAX31865::PrimarySet max31865Set6;
MAX31865::PrimarySet max31865Set7;
MAX31865::PrimarySet max31865Set8;
MAX31865::PrimarySet max31865Set9;
MAX31865::PrimarySet max31865Set10;
MAX31865::PrimarySet max31865Set11;
MAX31865::PrimarySet max31865Set12;
MAX31865::PrimarySet max31865Set13;
MAX31865::PrimarySet max31865Set14;
MAX31865::PrimarySet max31865Set15;
TMP1075::Tmp1075Dataset tmp1075SetTcs0;
TMP1075::Tmp1075Dataset tmp1075SetTcs1;
TMP1075::Tmp1075Dataset tmp1075SetPlPcdu0;

View File

@ -184,7 +184,8 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun
#endif
}
void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, HeaterHandler*& heaterHandler) {
void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher,
HeaterHandler*& heaterHandler) {
HeaterHelper helper({{
{new HealthDevice(objects::HEATER_0_PLOC_PROC_BRD, MessageQueueIF::NO_QUEUE),
gpioIds::HEATER_0},
@ -197,7 +198,7 @@ void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF&
{new HealthDevice(objects::HEATER_7_HPA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7},
}});
heaterHandler = new HeaterHandler(objects::HEATER_HANDLER, &gpioIF, helper, &pwrSwitcher,
pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V);
pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V);
}
void ObjectFactory::createThermalController(HeaterHandler& heaterHandler) {

View File

@ -1,8 +1,8 @@
#ifndef MISSION_CORE_GENERICFACTORY_H_
#define MISSION_CORE_GENERICFACTORY_H_
#include "fsfw_hal/common/gpio/GpioIF.h"
#include "fsfw/power/PowerSwitchIF.h"
#include "fsfw_hal/common/gpio/GpioIF.h"
class HeaterHandler;
class HealthTableIF;
@ -13,9 +13,10 @@ namespace ObjectFactory {
void produceGenericObjects(HealthTableIF** healthTable, PusTmFunnel** pusFunnel,
CfdpTmFunnel** cfdpFunnel);
void createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, HeaterHandler*& heaterHandler);
void createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher,
HeaterHandler*& heaterHandler);
void createThermalController(HeaterHandler& heaterHandler);
}
} // namespace ObjectFactory
#endif /* MISSION_CORE_GENERICFACTORY_H_ */

View File

@ -29,7 +29,8 @@ using HeaterPair = std::pair<HealthDevice*, gpioId_t>;
struct HeaterHelper {
public:
HeaterHelper(std::array<HeaterPair, heater::NUMBER_OF_SWITCHES> heaters) : heaters(std::move(heaters)) {}
HeaterHelper(std::array<HeaterPair, heater::NUMBER_OF_SWITCHES> heaters)
: heaters(std::move(heaters)) {}
std::array<HeaterPair, heater::NUMBER_OF_SWITCHES> heaters = {};
};
/**

View File

@ -38,7 +38,7 @@ class Max31865EiveHandler : public DeviceHandlerBase {
bool debugMode = false;
size_t structLen = 0;
bool instantNormal = false;
MAX31865::Max31865Set sensorDataset;
MAX31865::PrimarySet sensorDataset;
PeriodicOperationDivider debugDivider;
enum class InternalState { NONE, ON, ACTIVE, INACTIVE } state = InternalState::NONE;
bool transitionOk = false;

View File

@ -114,7 +114,7 @@ class Max31865PT1000Handler : public DeviceHandlerBase {
uint8_t deviceIdx = 0;
std::array<uint8_t, 3> commandBuffer{0};
MAX31865::Max31865Set sensorDataset;
MAX31865::PrimarySet sensorDataset;
sid_t sensorDatasetSid;
#if OBSW_VERBOSE_LEVEL >= 1

View File

@ -56,20 +56,20 @@ static constexpr uint8_t CLEAR_FAULT_BIT_VAL = 0b0000'0010;
static constexpr size_t MAX_REPLY_SIZE = 5;
class Max31865Set : public StaticLocalDataSet<4> {
class PrimarySet : public StaticLocalDataSet<4> {
public:
/**
* Constructor used by owner and data creators like device handlers.
* @param owner
* @param setId
*/
Max31865Set(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {}
PrimarySet(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {}
/**
* Constructor used by data users like controllers.
* @param sid
*/
Max31865Set(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {}
PrimarySet(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {}
lp_var_t<float> rtdValue =
lp_var_t<float>(sid.objectId, static_cast<lp_id_t>(PoolIds::RTD_VALUE), this);