fixes for IMTQ mgm reading
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2022-08-18 18:18:44 +02:00
parent 3d0d10dc32
commit 726e448af9
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 33 additions and 18 deletions

View File

@ -48,7 +48,7 @@ class AcsController : public ExtendedControllerBase {
PoolEntry<float> mgm1PoolVec = PoolEntry<float>(3);
PoolEntry<float> mgm2PoolVec = PoolEntry<float>(3);
PoolEntry<float> mgm3PoolVec = PoolEntry<float>(3);
PoolEntry<int32_t> imtqMgmPoolVec = PoolEntry<int32_t>(3);
PoolEntry<float> imtqMgmPoolVec = PoolEntry<float>(3);
PoolEntry<uint8_t> imtqCalActStatus = PoolEntry<uint8_t>();
void copyMgmData();

View File

@ -778,22 +778,37 @@ void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) {
void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) {
PoolReadGuard rg(&rawMtmMeasurementSet);
int8_t offset = 2;
rawMtmMeasurementSet.mtmRawNt[0] = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 |
*(packet + offset + 1) << 8 | *(packet + offset)) *
7.5;
offset += 4;
rawMtmMeasurementSet.mtmRawNt[1] = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 |
*(packet + offset + 1) << 8 | *(packet + offset)) *
7.5;
offset += 4;
rawMtmMeasurementSet.mtmRawNt[2] = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 |
*(packet + offset + 1) << 8 | *(packet + offset)) *
7.5;
offset += 4;
rawMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) |
(*(packet + offset + 2) << 16) |
(*(packet + offset + 1) << 8) | (*(packet + offset));
unsigned int offset = 2;
size_t deSerLen = 16;
const uint8_t* dataStart = packet + offset;
int32_t xRaw = 0;
int32_t yRaw = 0;
int32_t zRaw = 0;
uint32_t coilActStatus = 0;
auto res = SerializeAdapter::deSerialize(&xRaw, &dataStart, &deSerLen,
SerializeIF::Endianness::LITTLE);
if(res != HasReturnvaluesIF::RETURN_OK) {
return;
}
res = SerializeAdapter::deSerialize(&yRaw, &dataStart, &deSerLen,
SerializeIF::Endianness::LITTLE);
if(res != HasReturnvaluesIF::RETURN_OK) {
return;
}
res = SerializeAdapter::deSerialize(&zRaw, &dataStart, &deSerLen,
SerializeIF::Endianness::LITTLE);
if(res != HasReturnvaluesIF::RETURN_OK) {
return;
}
res = SerializeAdapter::deSerialize(&coilActStatus, &dataStart, &deSerLen,
SerializeIF::Endianness::LITTLE);
if(res != HasReturnvaluesIF::RETURN_OK) {
return;
}
rawMtmMeasurementSet.mtmRawNt[0] = xRaw * 7.5;
rawMtmMeasurementSet.mtmRawNt[1] = yRaw * 7.5;
rawMtmMeasurementSet.mtmRawNt[2] = zRaw * 7.5;
rawMtmMeasurementSet.coilActuationStatus = static_cast<uint8_t>(coilActStatus);
rawMtmMeasurementSet.setValidity(true, true);
if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1

2
tmtc

@ -1 +1 @@
Subproject commit 7a309b4dc1cfb02626bb0b4b3d4e4d06f8192506
Subproject commit 7e2ea08277148873cfa541a872b5cc52bf06ee5e