cache maps
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Robin Müller 2023-02-06 15:59:30 +01:00
parent f4f0796459
commit 64e1355e06
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 16 additions and 14 deletions

View File

@ -5,23 +5,22 @@
#include <cmath>
#include <cstdlib>
TemperatureSensorInserter::TemperatureSensorInserter(
object_id_t objectId, const std::map<object_id_t, Max31865Dummy*>& tempSensorDummies_,
const std::map<object_id_t, Tmp1075Dummy*>& tempTmpSensorDummies_)
: SystemObject(objects::THERMAL_TEMP_INSERTER) {}
TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId,
const Max31865DummyMap& tempSensorDummies_,
const Tmp1075DummyMap& tempTmpSensorDummies_)
: SystemObject(objects::THERMAL_TEMP_INSERTER),
max31865DummyMap(tempSensorDummies_),
tmp1075DummyMap(tempTmpSensorDummies_) {}
ReturnValue_t TemperatureSensorInserter::initialize() {
if (performTest) {
if (testCase == TestCase::OVERCOOL_SYRLINKS) {
if (testCase == TestCase::COOL_SYRLINKS) {
}
}
return returnvalue::OK;
}
ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) {
iteration++;
value = sin(iteration / 80. * M_PI) * 10;
/*
ReturnValue_t result = max31865PlocHeatspreaderSet.read();
if (result != returnvalue::OK) {

View File

@ -8,9 +8,11 @@
class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject {
public:
explicit TemperatureSensorInserter(
object_id_t objectId, const std::map<object_id_t, Max31865Dummy*>& tempSensorDummies_,
const std::map<object_id_t, Tmp1075Dummy*>& tempTmpSensorDummies_);
using Max31865DummyMap = std::map<object_id_t, Max31865Dummy*>;
using Tmp1075DummyMap = std::map<object_id_t, Tmp1075Dummy*>;
explicit TemperatureSensorInserter(object_id_t objectId,
const Max31865DummyMap& tempSensorDummies_,
const Tmp1075DummyMap& tempTmpSensorDummies_);
ReturnValue_t initialize() override;
@ -18,11 +20,12 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject
ReturnValue_t performOperation(uint8_t opCode) override;
private:
enum TestCase { OVERCOOL_SYRLINKS = 0 };
Max31865DummyMap max31865DummyMap;
Tmp1075DummyMap tmp1075DummyMap;
enum TestCase { NONE = 0, COOL_SYRLINKS = 1 };
int iteration = 0;
bool performTest = false;
float value = 0;
TestCase testCase;
TestCase testCase = TestCase::NONE;
// void noise();
};