eive-obsw/dummies/TemperatureSensorInserter.cpp
Irini Kosmidou b9a6425078
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
dummy change
2023-02-22 17:50:03 +01:00

61 lines
1.8 KiB
C++

#include "TemperatureSensorInserter.h"
#include <objects/systemObjectList.h>
#include <cmath>
#include <cstdlib>
#include <utility>
TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId,
Max31865DummyMap tempSensorDummies_,
Tmp1075DummyMap tempTmpSensorDummies_)
: SystemObject(objectId),
max31865DummyMap(std::move(tempSensorDummies_)),
tmp1075DummyMap(std::move(tempTmpSensorDummies_)) {}
ReturnValue_t TemperatureSensorInserter::initialize() {
if (performTest) {
if (testCase == TestCase::COOL_SYRLINKS) {
}
}
return returnvalue::OK;
}
ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) {
if(not tempsWereInitialized) {
for(auto& rtdDummy: max31865DummyMap) {
rtdDummy.second->setTemperature(10, true);
}
for(auto& tmpDummy: tmp1075DummyMap) {
tmpDummy.second->setTemperature(10, true);
}
tempsWereInitialized = true;
}
if(cycles == 10) {
max31865DummyMap[objects::RTD_14_IC17_TCS_BOARD]->setTemperature(-100, true);
}
/*
ReturnValue_t result = max31865PlocHeatspreaderSet.read();
if (result != returnvalue::OK) {
sif::warning << "Failed to read temperature from MAX31865 dataset" << std::endl;
}
max31865PlocHeatspreaderSet.rtdValue = value - 5;
max31865PlocHeatspreaderSet.temperatureCelcius = value;
if ((iteration % 100) < 20) {
max31865PlocHeatspreaderSet.setValidity(false, true);
} else {
max31865PlocHeatspreaderSet.setValidity(true, true);
}
max31865PlocHeatspreaderSet.commit();
*/
cycles++;
return returnvalue::OK;
}
ReturnValue_t TemperatureSensorInserter::initializeAfterTaskCreation() {
return returnvalue::OK;
}