only check validity if sensor itself is valid
All checks were successful
EIVE/eive-obsw/pipeline/pr-v3.1.1-reduced-to-bare-minimum This commit looks good

This commit is contained in:
Marius Eggert 2023-06-19 17:22:57 +02:00
parent a660d1d30a
commit dcf01d822b

View File

@ -212,20 +212,45 @@ void SensorProcessing::processSus(
sunIjkModel[2] = sin(eclipticLongitude) * sin(epsilon);
uint64_t susBrightness[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
if (sus0valid) {
susBrightness[0] = susConverter.checkSunSensorData(sus0Value);
}
if (sus1valid) {
susBrightness[1] = susConverter.checkSunSensorData(sus1Value);
}
if (sus2valid) {
susBrightness[2] = susConverter.checkSunSensorData(sus2Value);
}
if (sus3valid) {
susBrightness[3] = susConverter.checkSunSensorData(sus3Value);
}
if (sus4valid) {
susBrightness[4] = susConverter.checkSunSensorData(sus4Value);
}
if (sus5valid) {
susBrightness[5] = susConverter.checkSunSensorData(sus5Value);
}
if (sus6valid) {
susBrightness[6] = susConverter.checkSunSensorData(sus6Value);
}
if (sus7valid) {
susBrightness[7] = susConverter.checkSunSensorData(sus7Value);
}
if (sus8valid) {
susBrightness[8] = susConverter.checkSunSensorData(sus8Value);
}
if (sus9valid) {
susBrightness[9] = susConverter.checkSunSensorData(sus9Value);
}
if (sus10valid) {
susBrightness[10] = susConverter.checkSunSensorData(sus10Value);
}
if (sus11valid) {
susBrightness[11] = susConverter.checkSunSensorData(sus11Value);
}
bool susValid[12] = {true, true, true, true, true, true, true, true, true, true, true, true};
bool susValid[12] = {sus0valid, sus1valid, sus2valid, sus3valid, sus4valid, sus5valid,
sus6valid, sus7valid, sus8valid, sus9valid, sus10valid, sus11valid};
bool allInvalid =
susConverter.checkValidity(susValid, susBrightness, susParameters->susBrightnessThreshold);
@ -246,8 +271,8 @@ void SensorProcessing::processSus(
std::memcpy(susDataProcessed->sus9vec.value, zeroVec, 3 * sizeof(float));
std::memcpy(susDataProcessed->sus10vec.value, zeroVec, 3 * sizeof(float));
std::memcpy(susDataProcessed->sus11vec.value, zeroVec, 3 * sizeof(float));
std::memcpy(susDataProcessed->susVecTot.value, zeroVec, 3 * sizeof(float));
std::memcpy(susDataProcessed->susVecTotDerivative.value, zeroVec, 3 * sizeof(float));
std::memcpy(susDataProcessed->susVecTot.value, zeroVec, 3 * sizeof(double));
std::memcpy(susDataProcessed->susVecTotDerivative.value, zeroVec, 3 * sizeof(double));
susDataProcessed->setValidity(false, true);
std::memcpy(susDataProcessed->sunIjkModel.value, sunIjkModel, 3 * sizeof(double));
susDataProcessed->sunIjkModel.setValid(true);