From 595abf38992d3fbeed1f8d6e0cbc5a46a563feb5 Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Sat, 12 Jun 2021 15:45:24 +0200 Subject: [PATCH] IMTQ positive x dipole test --- bsp_q7s/InitMission.cpp | 1 + fsfw | 2 +- mission/devices/IMTQHandler.cpp | 193 ++++++++++-------- mission/devices/IMTQHandler.h | 1 + .../IMTQHandlerDefinitions.h | 87 ++++---- tmtc | 2 +- 6 files changed, 162 insertions(+), 124 deletions(-) diff --git a/bsp_q7s/InitMission.cpp b/bsp_q7s/InitMission.cpp index 6f1c209e..9a475a11 100644 --- a/bsp_q7s/InitMission.cpp +++ b/bsp_q7s/InitMission.cpp @@ -31,6 +31,7 @@ ServiceInterfaceStream sif::error("ERROR", true, false, true); ObjectManagerIF *objectManager = nullptr; void initmission::initMission() { + sif::info << "Building global objects.." << std::endl; /* Instantiate global object manager and also create all objects */ ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); diff --git a/fsfw b/fsfw index 4b095eea..16306825 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 4b095eea8991d3e9a48fa8945c86339cfdad26d5 +Subproject commit 1630682548a8775bd0c293b3c76c29e120de5bf0 diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index 2e26e0a0..35f0169f 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -3,6 +3,7 @@ #include #include +#include IMTQHandler::IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) : @@ -255,6 +256,25 @@ void IMTQHandler::setNormalDatapoolEntriesInvalid(){ } +LocalPoolDataSetBase* IMTQHandler::getDataSetHandle(sid_t sid) { + if (sid == engHkDataset.getSid()) { + return &engHkDataset; + } + else if (sid== calMtmMeasurementSet.getSid()) { + return &calMtmMeasurementSet; + } + else if (sid== rawMtmMeasurementSet.getSid()) { + return &rawMtmMeasurementSet; + } + else if (sid== posXselfTestDataset.getSid()) { + return &posXselfTestDataset; + } + else { + sif::error << "IMTQHandler::getDataSetHandle: Invalid sid" << std::endl; + return nullptr; + } +} + uint32_t IMTQHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo){ return 5000; } @@ -289,43 +309,43 @@ ReturnValue_t IMTQHandler::initializeLocalDataPool(localpool::DataPool& localDat /** Entries of dataset for self test results of positive X axis test */ localDataPoolMap.emplace(IMTQ::INIT_POS_X_ERR, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::INIT_POS_X_RAW_MAG_X, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::INIT_POS_X_RAW_MAG_Y, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::INIT_POS_X_RAW_MAG_Z, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::INIT_POS_X_CAL_MAG_X, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::INIT_POS_X_CAL_MAG_Y, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::INIT_POS_X_CAL_MAG_Z, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::INIT_POS_X_COIL_X_CURRENT, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::INIT_POS_X_COIL_Y_CURRENT, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::INIT_POS_X_COIL_Z_CURRENT, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::INIT_POS_X_RAW_MAG_X, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::INIT_POS_X_RAW_MAG_Y, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::INIT_POS_X_RAW_MAG_Z, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::INIT_POS_X_CAL_MAG_X, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::INIT_POS_X_CAL_MAG_Y, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::INIT_POS_X_CAL_MAG_Z, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::INIT_POS_X_COIL_X_CURRENT, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::INIT_POS_X_COIL_Y_CURRENT, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::INIT_POS_X_COIL_Z_CURRENT, new PoolEntry( { 0 })); localDataPoolMap.emplace(IMTQ::INIT_POS_X_COIL_X_TEMPERATURE, new PoolEntry( { 0 })); localDataPoolMap.emplace(IMTQ::INIT_POS_X_COIL_Y_TEMPERATURE, new PoolEntry( { 0 })); localDataPoolMap.emplace(IMTQ::INIT_POS_X_COIL_Z_TEMPERATURE, new PoolEntry( { 0 })); localDataPoolMap.emplace(IMTQ::POS_X_ERR, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::POS_X_RAW_MAG_X, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::POS_X_RAW_MAG_Y, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::POS_X_RAW_MAG_Z, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::POS_X_CAL_MAG_X, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::POS_X_CAL_MAG_Y, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::POS_X_CAL_MAG_Z, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::POS_X_COIL_X_CURRENT, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::POS_X_COIL_Y_CURRENT, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::POS_X_COIL_Z_CURRENT, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::POS_X_RAW_MAG_X, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::POS_X_RAW_MAG_Y, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::POS_X_RAW_MAG_Z, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::POS_X_CAL_MAG_X, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::POS_X_CAL_MAG_Y, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::POS_X_CAL_MAG_Z, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::POS_X_COIL_X_CURRENT, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::POS_X_COIL_Y_CURRENT, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::POS_X_COIL_Z_CURRENT, new PoolEntry( { 0 })); localDataPoolMap.emplace(IMTQ::POS_X_COIL_X_TEMPERATURE, new PoolEntry( { 0 })); localDataPoolMap.emplace(IMTQ::POS_X_COIL_Y_TEMPERATURE, new PoolEntry( { 0 })); localDataPoolMap.emplace(IMTQ::POS_X_COIL_Z_TEMPERATURE, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::INIT_POS_X_ERR, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::FINA_POS_X_RAW_MAG_X, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::FINA_POS_X_RAW_MAG_Y, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::FINA_POS_X_RAW_MAG_Z, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::FINA_POS_X_CAL_MAG_X, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::FINA_POS_X_CAL_MAG_Y, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::FINA_POS_X_CAL_MAG_Z, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::FINA_POS_X_COIL_X_CURRENT, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::FINA_POS_X_COIL_Y_CURRENT, new PoolEntry( { 0 })); - localDataPoolMap.emplace(IMTQ::FINA_POS_X_COIL_Z_CURRENT, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::FINA_POS_X_ERR, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::FINA_POS_X_RAW_MAG_X, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::FINA_POS_X_RAW_MAG_Y, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::FINA_POS_X_RAW_MAG_Z, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::FINA_POS_X_CAL_MAG_X, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::FINA_POS_X_CAL_MAG_Y, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::FINA_POS_X_CAL_MAG_Z, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::FINA_POS_X_COIL_X_CURRENT, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::FINA_POS_X_COIL_Y_CURRENT, new PoolEntry( { 0 })); + localDataPoolMap.emplace(IMTQ::FINA_POS_X_COIL_Z_CURRENT, new PoolEntry( { 0 })); localDataPoolMap.emplace(IMTQ::FINA_POS_X_COIL_X_TEMPERATURE, new PoolEntry( { 0 })); localDataPoolMap.emplace(IMTQ::FINA_POS_X_COIL_Y_TEMPERATURE, new PoolEntry( { 0 })); localDataPoolMap.emplace(IMTQ::FINA_POS_X_COIL_Z_TEMPERATURE, new PoolEntry( { 0 })); @@ -611,14 +631,14 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { /** Init measurements */ posXselfTestDataset.initErr = *(packet + offset); offset += 2; // STEP byte will not be stored - posXselfTestDataset.initRawMagX = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 - | *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.initRawMagX = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 + | *(packet + offset + 1) << 8 | *(packet + offset)) * 7.5; offset += 4; - posXselfTestDataset.initRawMagY = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 - | *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.initRawMagY = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 + | *(packet + offset + 1) << 8 | *(packet + offset)) * 7.5; offset += 4; - posXselfTestDataset.initRawMagZ = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 - | *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.initRawMagZ = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 + | *(packet + offset + 1) << 8 | *(packet + offset)) * 7.5; offset += 4; posXselfTestDataset.initCalMagX = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); @@ -629,11 +649,14 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { posXselfTestDataset.initCalMagZ = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; - posXselfTestDataset.initCoilXCurrent = *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.initCoilXCurrent = (*(packet + offset + 1) << 8 | *(packet + offset)) + * 0.1; offset += 2; - posXselfTestDataset.initCoilYCurrent = *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.initCoilYCurrent = (*(packet + offset + 1) << 8 | *(packet + offset)) + * 0.1; offset += 2; - posXselfTestDataset.initCoilZCurrent = *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.initCoilZCurrent = (*(packet + offset + 1) << 8 | *(packet + offset)) + * 0.1; offset += 2; posXselfTestDataset.initCoilXTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 2; @@ -646,14 +669,14 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { checkErrorByte(*(packet + offset), *(packet + offset + 1)); posXselfTestDataset.err = *(packet + offset); offset += 2; // STEP byte will not be stored - posXselfTestDataset.rawMagX = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 - | *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.rawMagX = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 + | *(packet + offset + 1) << 8 | *(packet + offset)) * 7.5; offset += 4; - posXselfTestDataset.rawMagY = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 - | *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.rawMagY = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 + | *(packet + offset + 1) << 8 | *(packet + offset)) * 7.5; offset += 4; - posXselfTestDataset.rawMagZ = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 - | *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.rawMagZ = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 + | *(packet + offset + 1) << 8 | *(packet + offset)) * 7.5; offset += 4; posXselfTestDataset.calMagX = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); @@ -664,11 +687,14 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { posXselfTestDataset.calMagZ = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; - posXselfTestDataset.coilXCurrent = *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.coilXCurrent = (*(packet + offset + 1) << 8 | *(packet + offset)) + * 0.1; offset += 2; - posXselfTestDataset.coilYCurrent = *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.coilYCurrent = (*(packet + offset + 1) << 8 | *(packet + offset)) + * 0.1; offset += 2; - posXselfTestDataset.coilZCurrent = *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.coilZCurrent = (*(packet + offset + 1) << 8 | *(packet + offset)) + * 0.1; offset += 2; posXselfTestDataset.coilXTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 2; @@ -681,14 +707,14 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { checkErrorByte(*(packet + offset), *(packet + offset + 1)); posXselfTestDataset.finaErr = *(packet + offset); offset += 2; // STEP byte will not be stored - posXselfTestDataset.finaRawMagX = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 - | *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.finaRawMagX = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 + | *(packet + offset + 1) << 8 | *(packet + offset)) * 7.5; offset += 4; - posXselfTestDataset.finaRawMagY = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 - | *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.finaRawMagY = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 + | *(packet + offset + 1) << 8 | *(packet + offset)) * 7.5; offset += 4; - posXselfTestDataset.finaRawMagZ = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 - | *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.finaRawMagZ = (*(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 + | *(packet + offset + 1) << 8 | *(packet + offset)) * 7.5; offset += 4; posXselfTestDataset.finaCalMagX = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); @@ -699,11 +725,14 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { posXselfTestDataset.finaCalMagZ = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; - posXselfTestDataset.finaCoilXCurrent = *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.finaCoilXCurrent = (*(packet + offset + 1) << 8 | *(packet + offset)) + * 0.1; offset += 2; - posXselfTestDataset.finaCoilYCurrent = *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.finaCoilYCurrent = (*(packet + offset + 1) << 8 | *(packet + offset)) + * 0.1; offset += 2; - posXselfTestDataset.finaCoilZCurrent = *(packet + offset + 1) << 8 | *(packet + offset); + posXselfTestDataset.finaCoilZCurrent = (*(packet + offset + 1) << 8 | *(packet + offset)) + * 0.1; offset += 2; posXselfTestDataset.finaCoilXTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 2; @@ -716,23 +745,23 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { sif::info << "IMTQ self test (INIT) err: " << static_cast(posXselfTestDataset.initErr.value) << std::endl; sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posXselfTestDataset.initRawMagX - << " 7.5 * 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << posXselfTestDataset.initRawMagY - << " 7.5 * 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << posXselfTestDataset.initRawMagZ - << " 7.5 * 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " << posXselfTestDataset.initCalMagX - << " 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " << posXselfTestDataset.initCalMagY - << " 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " << posXselfTestDataset.initCalMagZ - << " 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (INIT) coil X current: " << posXselfTestDataset.initCoilXCurrent - << " * 10^-4 A" << std::endl; + << " mA" << std::endl; sif::info << "IMTQ self test (INIT) coil Y current: " << posXselfTestDataset.initCoilYCurrent - << " * 10^-4 A" << std::endl; + << " mA" << std::endl; sif::info << "IMTQ self test (INIT) coil Z current: " << posXselfTestDataset.initCoilZCurrent - << " * 10^-4 A" << std::endl; + << " mA" << std::endl; sif::info << "IMTQ self test (INIT) coil X temperature: " << posXselfTestDataset.initCoilXTemperature << " °C" << std::endl; sif::info << "IMTQ self test (INIT) coil Y temperature: " @@ -743,23 +772,23 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { sif::info << "IMTQ self test (+X) err: " << static_cast(posXselfTestDataset.err.value) << std::endl; sif::info << "IMTQ self test (+X) raw magnetic field X: " << posXselfTestDataset.rawMagX - << " 7.5 * 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (+X) raw magnetic field Y: " << posXselfTestDataset.rawMagY - << " 7.5 * 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (+X) raw magnetic field Z: " << posXselfTestDataset.rawMagZ - << " 7.5 * 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (+X) calibrated magnetic field X: " << posXselfTestDataset.calMagX - << " 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (+X) calibrated magnetic field Y: " << posXselfTestDataset.calMagY - << " 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (+X) calibrated magnetic field Z: " << posXselfTestDataset.calMagZ - << " 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (+X) coil X current: " << posXselfTestDataset.coilXCurrent - << " * 10^-4 A" << std::endl; + << " mA" << std::endl; sif::info << "IMTQ self test (+X) coil Y current: " << posXselfTestDataset.coilYCurrent - << " * 10^-4 A" << std::endl; + << " mA" << std::endl; sif::info << "IMTQ self test (+X) coil Z current: " << posXselfTestDataset.coilZCurrent - << " * 10^-4 A" << std::endl; + << " mA" << std::endl; sif::info << "IMTQ self test (+X) coil X temperature: " << posXselfTestDataset.coilXTemperature << " °C" << std::endl; sif::info << "IMTQ self test (+X) coil Y temperature: " @@ -770,23 +799,23 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { sif::info << "IMTQ self test (FINA) err: " << static_cast(posXselfTestDataset.finaErr.value) << std::endl; sif::info << "IMTQ self test (FINA) raw magnetic field X: " << posXselfTestDataset.finaRawMagX - << " 7.5 * 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << posXselfTestDataset.finaRawMagY - << " 7.5 * 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << posXselfTestDataset.finaRawMagZ - << " 7.5 * 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " << posXselfTestDataset.finaCalMagX - << " 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " << posXselfTestDataset.finaCalMagY - << " 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " << posXselfTestDataset.finaCalMagZ - << " 10^-9 T" << std::endl; + << " nT" << std::endl; sif::info << "IMTQ self test (FINA) coil X current: " << posXselfTestDataset.finaCoilXCurrent - << " * 10^-4 A" << std::endl; + << " mA" << std::endl; sif::info << "IMTQ self test (FINA) coil Y current: " << posXselfTestDataset.finaCoilYCurrent - << " * 10^-4 A" << std::endl; + << " mA" << std::endl; sif::info << "IMTQ self test (FINA) coil Z current: " << posXselfTestDataset.finaCoilZCurrent - << " * 10^-4 A" << std::endl; + << " mA" << std::endl; sif::info << "IMTQ self test (FINA) coil X temperature: " << posXselfTestDataset.finaCoilXTemperature << " °C" << std::endl; sif::info << "IMTQ self test (FINA) coil Y temperature: " diff --git a/mission/devices/IMTQHandler.h b/mission/devices/IMTQHandler.h index 2522cfe5..92d24a46 100644 --- a/mission/devices/IMTQHandler.h +++ b/mission/devices/IMTQHandler.h @@ -34,6 +34,7 @@ protected: ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; void setNormalDatapoolEntriesInvalid() override; + virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; diff --git a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h index e57f39d2..d90a41b0 100644 --- a/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/IMTQHandlerDefinitions.h @@ -1,6 +1,8 @@ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_IMTQDEFINITIONS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_IMTQDEFINITIONS_H_ +#include + namespace IMTQ { static const DeviceCommandId_t NONE = 0x0; @@ -16,18 +18,23 @@ namespace IMTQ { static const DeviceCommandId_t POS_X_SELF_TEST = 0x7; static const DeviceCommandId_t NEG_X_SELF_TEST = 0x8; static const DeviceCommandId_t POS_Y_SELF_TEST = 0x9; - static const DeviceCommandId_t NEG_Y_SELF_TEST = 0x10; - static const DeviceCommandId_t POS_Z_SELF_TEST = 0x11; - static const DeviceCommandId_t NEG_Z_SELF_TEST = 0x12; - static const DeviceCommandId_t GET_SELF_TEST_RESULT = 0x13; + static const DeviceCommandId_t NEG_Y_SELF_TEST = 0xA; + static const DeviceCommandId_t POS_Z_SELF_TEST = 0xB; + static const DeviceCommandId_t NEG_Z_SELF_TEST = 0xC; + static const DeviceCommandId_t GET_SELF_TEST_RESULT = 0xD; static const uint8_t GET_TEMP_REPLY_SIZE = 2; static const uint8_t CFGR_CMD_SIZE = 3; static const uint8_t POINTER_REG_SIZE = 1; - static const uint32_t ENG_HK_DATA_SET_ID = GET_ENG_HK_DATA; - static const uint32_t CAL_MTM_SET = GET_CAL_MTM_MEASUREMENT; - static const uint32_t SELF_TEST_DATA_SET = GET_SELF_TEST_RESULT; + static const uint32_t ENG_HK_DATA_SET_ID = 1; + static const uint32_t CAL_MTM_SET = 2; + static const uint32_t POS_X_TEST_DATASET = 3; + static const uint32_t NEG_X_TEST_DATASET = 4; + static const uint32_t POS_Y_TEST_DATASET = 5; + static const uint32_t NEG_Y_TEST_DATASET = 6; + static const uint32_t POS_Z_TEST_DATASET = 7; + static const uint32_t NEG_Z_TEST_DATASET = 8; static const uint8_t SIZE_ENG_HK_COMMAND = 1; static const uint8_t SIZE_STATUS_REPLY = 2; @@ -35,7 +42,7 @@ namespace IMTQ { static const uint8_t SIZE_GET_COMMANDED_DIPOLE_REPLY = 8; static const uint8_t SIZE_GET_CAL_MTM_MEASUREMENT = 15; static const uint8_t SIZE_GET_RAW_MTM_MEASUREMENT = 15; - static const uint16_t SIZE_SELF_TEST_RESULTS = 320; + static const uint16_t SIZE_SELF_TEST_RESULTS = 120; static const uint16_t MAX_REPLY_SIZE = SIZE_SELF_TEST_RESULTS; static const uint8_t MAX_COMMAND_SIZE = 9; @@ -447,9 +454,9 @@ public: * @brief This dataset can be used to store the self test results of the positve X axis test. * * @details Units of measurements: - * Currents: [10^-4 A] - * Raw MTM data: [7.5 * 10^-9 T] - * Calibrated MTM data: [10^-9 T] + * Raw magnetic field: [nT] + * Calibrated magnetic field: [nT] + * Coil currents: [mA] * Temperature: [°C] * The self test generates for each axis the positive and negative dipole and measures * the magnetic field with the built-in MTM. The procedure of the test is as follows: @@ -461,26 +468,26 @@ class PosXselfTestSet: public StaticLocalDataSet { public: PosXselfTestSet(HasLocalDataPoolIF* owner) : - StaticLocalDataSet(owner, SELF_TEST_DATA_SET) { + StaticLocalDataSet(owner, POS_X_TEST_DATASET) { } PosXselfTestSet(object_id_t objectId) : - StaticLocalDataSet(sid_t(objectId, SELF_TEST_DATA_SET)) { + StaticLocalDataSet(sid_t(objectId, POS_X_TEST_DATASET)) { } /** INIT block */ lp_var_t initErr = lp_var_t(sid.objectId, INIT_POS_X_ERR, this); - lp_var_t initRawMagX = lp_var_t(sid.objectId, INIT_POS_X_RAW_MAG_X, this); - lp_var_t initRawMagY = lp_var_t(sid.objectId, INIT_POS_X_RAW_MAG_Y, this); - lp_var_t initRawMagZ = lp_var_t(sid.objectId, INIT_POS_X_RAW_MAG_Z, this); - lp_var_t initCalMagX = lp_var_t(sid.objectId, INIT_POS_X_CAL_MAG_X, this); - lp_var_t initCalMagY = lp_var_t(sid.objectId, INIT_POS_X_CAL_MAG_Y, this); - lp_var_t initCalMagZ = lp_var_t(sid.objectId, INIT_POS_X_CAL_MAG_Z, this); - lp_var_t initCoilXCurrent = lp_var_t(sid.objectId, INIT_POS_X_COIL_X_CURRENT, + lp_var_t initRawMagX = lp_var_t(sid.objectId, INIT_POS_X_RAW_MAG_X, this); + lp_var_t initRawMagY = lp_var_t(sid.objectId, INIT_POS_X_RAW_MAG_Y, this); + lp_var_t initRawMagZ = lp_var_t(sid.objectId, INIT_POS_X_RAW_MAG_Z, this); + lp_var_t initCalMagX = lp_var_t(sid.objectId, INIT_POS_X_CAL_MAG_X, this); + lp_var_t initCalMagY = lp_var_t(sid.objectId, INIT_POS_X_CAL_MAG_Y, this); + lp_var_t initCalMagZ = lp_var_t(sid.objectId, INIT_POS_X_CAL_MAG_Z, this); + lp_var_t initCoilXCurrent = lp_var_t(sid.objectId, INIT_POS_X_COIL_X_CURRENT, this); - lp_var_t initCoilYCurrent = lp_var_t(sid.objectId, INIT_POS_X_COIL_Y_CURRENT, + lp_var_t initCoilYCurrent = lp_var_t(sid.objectId, INIT_POS_X_COIL_Y_CURRENT, this); - lp_var_t initCoilZCurrent = lp_var_t(sid.objectId, INIT_POS_X_COIL_Z_CURRENT, + lp_var_t initCoilZCurrent = lp_var_t(sid.objectId, INIT_POS_X_COIL_Z_CURRENT, this); lp_var_t initCoilXTemperature = lp_var_t(sid.objectId, INIT_POS_X_COIL_X_TEMPERATURE, this); @@ -491,17 +498,17 @@ public: /** +X block */ lp_var_t err = lp_var_t(sid.objectId, POS_X_ERR, this); - lp_var_t rawMagX = lp_var_t(sid.objectId, POS_X_RAW_MAG_X, this); - lp_var_t rawMagY = lp_var_t(sid.objectId, POS_X_RAW_MAG_Y, this); - lp_var_t rawMagZ = lp_var_t(sid.objectId, POS_X_RAW_MAG_Z, this); - lp_var_t calMagX = lp_var_t(sid.objectId, POS_X_CAL_MAG_X, this); - lp_var_t calMagY = lp_var_t(sid.objectId, POS_X_CAL_MAG_Y, this); - lp_var_t calMagZ = lp_var_t(sid.objectId, POS_X_CAL_MAG_Z, this); - lp_var_t coilXCurrent = lp_var_t(sid.objectId, POS_X_COIL_X_CURRENT, + lp_var_t rawMagX = lp_var_t(sid.objectId, POS_X_RAW_MAG_X, this); + lp_var_t rawMagY = lp_var_t(sid.objectId, POS_X_RAW_MAG_Y, this); + lp_var_t rawMagZ = lp_var_t(sid.objectId, POS_X_RAW_MAG_Z, this); + lp_var_t calMagX = lp_var_t(sid.objectId, POS_X_CAL_MAG_X, this); + lp_var_t calMagY = lp_var_t(sid.objectId, POS_X_CAL_MAG_Y, this); + lp_var_t calMagZ = lp_var_t(sid.objectId, POS_X_CAL_MAG_Z, this); + lp_var_t coilXCurrent = lp_var_t(sid.objectId, POS_X_COIL_X_CURRENT, this); - lp_var_t coilYCurrent = lp_var_t(sid.objectId, POS_X_COIL_Y_CURRENT, + lp_var_t coilYCurrent = lp_var_t(sid.objectId, POS_X_COIL_Y_CURRENT, this); - lp_var_t coilZCurrent = lp_var_t(sid.objectId, POS_X_COIL_Z_CURRENT, + lp_var_t coilZCurrent = lp_var_t(sid.objectId, POS_X_COIL_Z_CURRENT, this); lp_var_t coilXTemperature = lp_var_t(sid.objectId, POS_X_COIL_X_TEMPERATURE, this); @@ -512,17 +519,17 @@ public: /** FINA block */ lp_var_t finaErr = lp_var_t(sid.objectId, FINA_POS_X_ERR, this); - lp_var_t finaRawMagX = lp_var_t(sid.objectId, FINA_POS_X_RAW_MAG_X, this); - lp_var_t finaRawMagY = lp_var_t(sid.objectId, FINA_POS_X_RAW_MAG_Y, this); - lp_var_t finaRawMagZ = lp_var_t(sid.objectId, FINA_POS_X_RAW_MAG_Z, this); - lp_var_t finaCalMagX = lp_var_t(sid.objectId, FINA_POS_X_CAL_MAG_X, this); - lp_var_t finaCalMagY = lp_var_t(sid.objectId, FINA_POS_X_CAL_MAG_Y, this); - lp_var_t finaCalMagZ = lp_var_t(sid.objectId, FINA_POS_X_CAL_MAG_Z, this); - lp_var_t finaCoilXCurrent = lp_var_t(sid.objectId, FINA_POS_X_COIL_X_CURRENT, + lp_var_t finaRawMagX = lp_var_t(sid.objectId, FINA_POS_X_RAW_MAG_X, this); + lp_var_t finaRawMagY = lp_var_t(sid.objectId, FINA_POS_X_RAW_MAG_Y, this); + lp_var_t finaRawMagZ = lp_var_t(sid.objectId, FINA_POS_X_RAW_MAG_Z, this); + lp_var_t finaCalMagX = lp_var_t(sid.objectId, FINA_POS_X_CAL_MAG_X, this); + lp_var_t finaCalMagY = lp_var_t(sid.objectId, FINA_POS_X_CAL_MAG_Y, this); + lp_var_t finaCalMagZ = lp_var_t(sid.objectId, FINA_POS_X_CAL_MAG_Z, this); + lp_var_t finaCoilXCurrent = lp_var_t(sid.objectId, FINA_POS_X_COIL_X_CURRENT, this); - lp_var_t finaCoilYCurrent = lp_var_t(sid.objectId, FINA_POS_X_COIL_Y_CURRENT, + lp_var_t finaCoilYCurrent = lp_var_t(sid.objectId, FINA_POS_X_COIL_Y_CURRENT, this); - lp_var_t finaCoilZCurrent = lp_var_t(sid.objectId, FINA_POS_X_COIL_Z_CURRENT, + lp_var_t finaCoilZCurrent = lp_var_t(sid.objectId, FINA_POS_X_COIL_Z_CURRENT, this); lp_var_t finaCoilXTemperature = lp_var_t(sid.objectId, FINA_POS_X_COIL_X_TEMPERATURE, this); diff --git a/tmtc b/tmtc index 58c20e31..fe1e6a28 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 58c20e31cc38f04229f1016b6810205aaaa9922d +Subproject commit fe1e6a287710ebd90fa78c22feea5b82523b2324