From e7cbcee8732930cdf452a19c736f6a1e99c617f4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 24 Aug 2022 16:29:24 +0200 Subject: [PATCH] re-run auto-formatter --- mission/controller/AcsController.cpp | 20 +++++++++---------- mission/controller/AcsController.h | 18 +++++++++++------ .../AcsCtrlDefinitions.h | 18 ++++++++--------- mission/devices/IMTQHandler.cpp | 6 +++--- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 4aea53a0..41eb835a 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -1,9 +1,9 @@ -#include #include "AcsController.h" +#include + AcsController::AcsController(object_id_t objectId) - : ExtendedControllerBase(objectId, objects::NO_OBJECT), - mgmData(this) {} + : ExtendedControllerBase(objectId, objects::NO_OBJECT), mgmData(this) {} ReturnValue_t AcsController::handleCommandMessage(CommandMessage *message) { return HasReturnvaluesIF::RETURN_OK; @@ -32,7 +32,7 @@ void AcsController::performControlOperation() { { PoolReadGuard pg(&mgmData); if (pg.getReadResult() == RETURN_OK) { - copyMgmData(); + copyMgmData(); } } } @@ -45,7 +45,7 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3PoolVec); localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmPoolVec); localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); - poolManager.subscribeForPeriodicPacket(mgmData.getSid(), false, 5.0, false); + poolManager.subscribeForPeriodicPacket(mgmData.getSid(), false, 5.0, false); return HasReturnvaluesIF::RETURN_OK; } @@ -64,31 +64,31 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, void AcsController::copyMgmData() { { PoolReadGuard pg(&mgm0Lis3Set); - if(pg.getReadResult() == RETURN_OK) { + if (pg.getReadResult() == RETURN_OK) { std::memcpy(mgmData.mgm0Lis3.value, mgm0Lis3Set.fieldStrengths.value, 3 * sizeof(float)); } } { PoolReadGuard pg(&mgm1Rm3100Set); - if(pg.getReadResult() == RETURN_OK) { + if (pg.getReadResult() == RETURN_OK) { std::memcpy(mgmData.mgm1Rm3100.value, mgm1Rm3100Set.fieldStrengths.value, 3 * sizeof(float)); } } { PoolReadGuard pg(&mgm2Lis3Set); - if(pg.getReadResult() == RETURN_OK) { + if (pg.getReadResult() == RETURN_OK) { std::memcpy(mgmData.mgm2Lis3.value, mgm2Lis3Set.fieldStrengths.value, 3 * sizeof(float)); } } { PoolReadGuard pg(&mgm3Rm3100Set); - if(pg.getReadResult() == RETURN_OK) { + if (pg.getReadResult() == RETURN_OK) { std::memcpy(mgmData.mgm3Rm3100.value, mgm3Rm3100Set.fieldStrengths.value, 3 * sizeof(float)); } } { PoolReadGuard pg(&imtqMgmSet); - if(pg.getReadResult() == RETURN_OK) { + if (pg.getReadResult() == RETURN_OK) { std::memcpy(mgmData.imtqCal.value, imtqMgmSet.mgmXyz.value, 3 * sizeof(int32_t)); mgmData.actuationCalStatus.value = imtqMgmSet.coilActuationStatus.value; } diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 8dbe38aa..9a75a5c3 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -2,8 +2,9 @@ #define MISSION_CONTROLLER_ACSCONTROLLER_H_ #include -#include "controllerdefinitions/AcsCtrlDefinitions.h" #include + +#include "controllerdefinitions/AcsCtrlDefinitions.h" #include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h" #include "fsfw_hal/devicehandlers/MgmRM3100Handler.h" #include "mission/devices/devicedefinitions/IMTQHandlerDefinitions.h" @@ -33,11 +34,16 @@ class AcsController : public ExtendedControllerBase { // MGMs acsctrl::MgmData mgmData; - MGMLIS3MDL::MgmPrimaryDataset mgm0Lis3Set = MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_0_LIS3_HANDLER); - RM3100::Rm3100PrimaryDataset mgm1Rm3100Set = RM3100::Rm3100PrimaryDataset(objects::MGM_1_RM3100_HANDLER); - MGMLIS3MDL::MgmPrimaryDataset mgm2Lis3Set = MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_2_LIS3_HANDLER); - RM3100::Rm3100PrimaryDataset mgm3Rm3100Set = RM3100::Rm3100PrimaryDataset(objects::MGM_3_RM3100_HANDLER); - IMTQ::CalibratedMtmMeasurementSet imtqMgmSet = IMTQ::CalibratedMtmMeasurementSet(objects::IMTQ_HANDLER); + MGMLIS3MDL::MgmPrimaryDataset mgm0Lis3Set = + MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_0_LIS3_HANDLER); + RM3100::Rm3100PrimaryDataset mgm1Rm3100Set = + RM3100::Rm3100PrimaryDataset(objects::MGM_1_RM3100_HANDLER); + MGMLIS3MDL::MgmPrimaryDataset mgm2Lis3Set = + MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_2_LIS3_HANDLER); + RM3100::Rm3100PrimaryDataset mgm3Rm3100Set = + RM3100::Rm3100PrimaryDataset(objects::MGM_3_RM3100_HANDLER); + IMTQ::CalibratedMtmMeasurementSet imtqMgmSet = + IMTQ::CalibratedMtmMeasurementSet(objects::IMTQ_HANDLER); PoolEntry mgm0PoolVec = PoolEntry(3); PoolEntry mgm1PoolVec = PoolEntry(3); diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index f2913943..cec18a63 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -1,15 +1,14 @@ #ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ #define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ -#include #include +#include + #include namespace acsctrl { -enum SetIds : uint32_t { - MGM_SENSOR_DATA -}; +enum SetIds : uint32_t { MGM_SENSOR_DATA }; enum PoolIds : lp_id_t { MGM_0_LIS3_UT, @@ -20,14 +19,13 @@ enum PoolIds : lp_id_t { MGM_IMTQ_CAL_ACT_STATUS }; - static constexpr uint8_t MGM_SET_ENTRIES = 10; /** * @brief This dataset can be used to store the collected temperatures of all temperature sensors */ class MgmData : public StaticLocalDataSet { -public: + public: MgmData(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, MGM_SENSOR_DATA) {} // The ACS board measurement are in floating point uT @@ -37,12 +35,12 @@ public: lp_vec_t mgm3Rm3100 = lp_vec_t(sid.objectId, MGM_3_RM3100_UT, this); // The IMTQ measurements are in integer nT lp_vec_t imtqCal = lp_vec_t(sid.objectId, MGM_IMTQ_CAL_NT, this); - lp_var_t actuationCalStatus = lp_var_t(sid.objectId, - MGM_IMTQ_CAL_ACT_STATUS, this); -private: + lp_var_t actuationCalStatus = + lp_var_t(sid.objectId, MGM_IMTQ_CAL_ACT_STATUS, this); + private: }; -} +} // namespace acsctrl #endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ */ diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index ea7a3177..b3483ff2 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -750,13 +750,13 @@ void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) { calMtmMeasurementSet.setValidity(true, true); int8_t offset = 2; calMtmMeasurementSet.mgmXyz[0] = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | - *(packet + offset + 1) << 8 | *(packet + offset); + *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; calMtmMeasurementSet.mgmXyz[1] = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | - *(packet + offset + 1) << 8 | *(packet + offset); + *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; calMtmMeasurementSet.mgmXyz[2] = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | - *(packet + offset + 1) << 8 | *(packet + offset); + *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; calMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) | (*(packet + offset + 2) << 16) |