more TCS tests

This commit is contained in:
2023-04-06 12:13:24 +02:00
parent d8ec121131
commit 397e23f1da
13 changed files with 155 additions and 111 deletions

View File

@ -1,5 +1,6 @@
#include "TemperatureSensorInserter.h"
#include <fsfw/datapool/PoolReadGuard.h>
#include <objects/systemObjectList.h>
#include <cmath>
@ -14,10 +15,7 @@ TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId,
tmp1075DummyMap(std::move(tempTmpSensorDummies_)) {}
ReturnValue_t TemperatureSensorInserter::initialize() {
if (performTest) {
if (testCase == TestCase::COOL_SYRLINKS) {
}
}
testCase = TestCase::COOL_MGT;
return returnvalue::OK;
}
@ -33,35 +31,46 @@ ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) {
tempsWereInitialized = true;
}
if (cycles == 10) {
max31865DummyMap[objects::RTD_9_IC12_HPA]->setTemperature(-100, true);
max31865DummyMap[objects::RTD_11_IC14_MPA]->setTemperature(-100, true);
switch (testCase) {
case (TestCase::NONE): {
break;
}
case (TestCase::COOL_SYRLINKS): {
// TODO: How do I insert this?
// Does not work on EM, where a real syrlinks device is connected.
if (cycles == 15) {
lp_var_t<float> tempSyrlinksBasebandBoard =
lp_var_t<float>(objects::SYRLINKS_HANDLER, syrlinks::TEMP_BASEBAND_BOARD);
PoolReadGuard pg(&tempSyrlinksBasebandBoard);
tempSyrlinksBasebandBoard.value = -50;
}
if (cycles == 30) {
lp_var_t<float> tempSyrlinksBasebandBoard =
lp_var_t<float>(objects::SYRLINKS_HANDLER, syrlinks::TEMP_BASEBAND_BOARD);
PoolReadGuard pg(&tempSyrlinksBasebandBoard);
tempSyrlinksBasebandBoard.value = 0;
}
break;
}
case (TestCase::COOL_HPA): {
if (cycles == 15) {
max31865DummyMap[objects::RTD_9_IC12_HPA]->setTemperature(-60, true);
}
if (cycles == 30) {
max31865DummyMap[objects::RTD_9_IC12_HPA]->setTemperature(0, true);
}
break;
}
case (TestCase::COOL_MGT): {
if (cycles == 15) {
max31865DummyMap[objects::RTD_15_IC18_IMTQ]->setTemperature(-60, true);
}
if (cycles == 30) {
max31865DummyMap[objects::RTD_15_IC18_IMTQ]->setTemperature(0, true);
}
break;
}
}
if (cycles == 35) {
max31865DummyMap[objects::RTD_9_IC12_HPA]->setTemperature(0, true);
max31865DummyMap[objects::RTD_11_IC14_MPA]->setTemperature(0, true);
max31865DummyMap[objects::RTD_2_IC5_4K_CAMERA]->setTemperature(-100, true);
}
if (cycles == 60) {
max31865DummyMap[objects::RTD_9_IC12_HPA]->setTemperature(-100, true);
max31865DummyMap[objects::RTD_11_IC14_MPA]->setTemperature(0, 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;
}