diff --git a/.gitmodules b/.gitmodules index 1f3dc6ec..d309e0f5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "etl"] - path = thirdparty/etl - url = https://github.com/ETLCPP/etl.git [submodule "arduino"] path = arduino url = https://egit.irs.uni-stuttgart.de/eive/eive_arduino_interface.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 79017dda..ff73e3f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,27 +9,19 @@ ################################################################################ cmake_minimum_required(VERSION 3.13) -# set(CMAKE_VERBOSE TRUE) set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0) set(OBSW_VERSION_MINOR_IF_GIT_FAILS 0) set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +# set(CMAKE_VERBOSE TRUE) -option(EIVE_ADD_ETL_LIB "Add ETL library" ON) -option(EIVE_ADD_JSON_LIB "Add JSON library" ON) option(EIVE_HARDCODED_TOOLCHAIN_FILE "\ For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \ if a different toolchain file is set externally" ON ) -option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF) -option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON) - -set(OBSW_ADD_STAR_TRACKER 0) -set(OBSW_DEBUG_STARTRACKER 0) if(NOT FSFW_OSAL) - set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") + set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") endif() if(TGT_BSP) @@ -39,13 +31,35 @@ if(TGT_BSP) elseif(TGT_BSP MATCHES "arm/q7s") option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON) endif() + option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON) +else() + option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" OFF) endif() +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # Perform steps like loading toolchain files where applicable. include(PreProjectConfig) -include(EiveHelpers) pre_project_config() +# Project Name +project(eive-obsw) + +# Specify the C++ standard +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +include(EiveHelpers) + +option(EIVE_ADD_ETL_LIB "Add ETL library" ON) +option(EIVE_ADD_JSON_LIB "Add JSON library" ON) + +set(OBSW_ADD_STAR_TRACKER 0) +set(OBSW_DEBUG_STARTRACKER 0) + +################################################################################ +# Pre-Sources preparation +################################################################################ + # Version handling set(GIT_VER_HANDLING_OK FALSE) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) @@ -77,21 +91,6 @@ if(NOT GIT_VER_HANDLING_OK) set(OBSW_VERSION_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS}) endif() -# Check whether the user has already installed Catch2 first. This has to come before -# the project call. We could also exclude doing this when the Q7S primary OBSW is built.. -find_package(Catch2 3 CONFIG QUIET) - -# Project Name -project(eive-obsw) - -################################################################################ -# Pre-Sources preparation -################################################################################ - -# Specify the C++ standard -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED True) - # Set names and variables set(OBSW_NAME ${CMAKE_PROJECT_NAME}) set(WATCHDOG_NAME eive-watchdog) @@ -250,30 +249,8 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(COMPILER_FLAGS "/permissive-") endif() -if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s")) -# Not installed, so use FetchContent to download and provide Catch2 -if(NOT Catch2_FOUND) - message(STATUS "Did not find a valid Catch2 installation. Using FetchContent to install it") - include(FetchContent) - - FetchContent_Declare( - Catch2 - GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v3.0.0-preview4 - ) - - FetchContent_MakeAvailable(Catch2) - #fixes regression -preview4, to be confirmed in later releases - set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "") - set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true") - set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true") -endif() -endif() - - add_library(${LIB_EIVE_MISSION}) - # Add main executable add_executable(${OBSW_NAME}) if(EIVE_CREATE_UNIQUE_OBSW_BIN) @@ -298,14 +275,15 @@ target_include_directories(${WATCHDOG_NAME} PUBLIC ${CMAKE_BINARY_DIR} ) -#unittests +# unittests add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL) +if(EIVE_ADD_ETL_LIB) +endif() + if(EIVE_ADD_JSON_LIB) add_subdirectory(${LIB_JSON_PATH}) endif() - - if(EIVE_ADD_LINUX_FILES) add_subdirectory(${LIB_ARCSEC_PATH}) @@ -316,26 +294,52 @@ if(ADD_CSP_LIB) add_subdirectory(${LIB_CSP_PATH}) endif() - add_subdirectory(${COMMON_PATH}) - - add_subdirectory(${LIB_LWGPS_PATH}) add_subdirectory(${FSFW_PATH}) add_subdirectory(${LIB_EIVE_MISSION_PATH}) add_subdirectory(${TEST_PATH}) - add_subdirectory(${UNITTEST_PATH}) +# This should have already been downloaded by the FSFW +# Still include it to be safe +include(FetchContent) +FetchContent_Declare( + etl + GIT_REPOSITORY https://github.com/ETLCPP/etl + GIT_TAG ${FSFW_ETL_LIB_VERSION} +) +FetchContent_MakeAvailable(etl) + +# Use same Catch2 version as framework +if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s")) + # Check whether the user has already installed Catch2 first + find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET) + # Not installed, so use FetchContent to download and provide Catch2 + if(NOT Catch2_FOUND) + message(STATUS "${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent") + include(FetchContent) + + FetchContent_Declare( + Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG ${FSFW_CATCH2_LIB_VERSION} + ) + + FetchContent_MakeAvailable(Catch2) + #fixes regression -preview4, to be confirmed in later releases + set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "") + set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true") + set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true") + endif() +endif() ################################################################################ # Post-Sources preparation ################################################################################ - - # Add libraries target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_FSFW_NAME} @@ -374,7 +378,7 @@ endif() if(EIVE_ADD_ETL_LIB) target_link_libraries(${LIB_EIVE_MISSION} PUBLIC - ${LIB_ETL_NAME} + etl ) endif() diff --git a/bsp_hosted/fsfwconfig/OBSWConfig.h.in b/bsp_hosted/fsfwconfig/OBSWConfig.h.in index a2353947..69029c23 100644 --- a/bsp_hosted/fsfwconfig/OBSWConfig.h.in +++ b/bsp_hosted/fsfwconfig/OBSWConfig.h.in @@ -8,11 +8,13 @@ #include "commonConfig.h" -#define OBSW_ADD_TEST_CODE 1 +#define OBSW_PRINT_MISSED_DEADLINES 1 + +#define OBSW_ADD_TEST_CODE 1 /* These defines should be disabled for mission code but are useful for debugging. */ -#define OBSW_VEBOSE_LEVEL 1 +#define OBSW_VEBOSE_LEVEL 1 #define OBSW_USE_CCSDS_IP_CORE 0 // Set to 1 if all telemetry should be sent to the PTME IP Core @@ -20,6 +22,12 @@ debugging. */ // Set to 1 if telecommands are received via the PDEC IP Core #define OBSW_TC_FROM_PDEC 0 +#define OBSW_SYRLINKS_SIMULATED 0 + +#define OBSW_INITIALIZE_SWITCHES 0 + +#define OBSW_TCP_SERVER_WIRETAPPING 0 + #ifdef __cplusplus #include "objects/systemObjectList.h" diff --git a/bsp_hosted/main.cpp b/bsp_hosted/main.cpp index b7ebc422..938adb76 100644 --- a/bsp_hosted/main.cpp +++ b/bsp_hosted/main.cpp @@ -1,7 +1,7 @@ #include #include "InitMission.h" -#include "OBSWVersion.h" +#include "commonConfig.h" #include "fsfw/FSFWVersion.h" #include "fsfw/tasks/TaskFactory.h" #ifdef WIN32 @@ -19,9 +19,9 @@ static const char* COMPILE_PRINTOUT = "unknown OS"; int main(void) { std::cout << "-- EIVE OBSW --" << std::endl; std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl; - std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "." - << SW_REVISION << ", FSFW v" << FSFW_VERSION << "." << FSFW_SUBVERSION << "." - << FSFW_REVISION << "--" << std::endl; + std::cout << "-- OBSW " + << " v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --" + << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; initmission::initMission(); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index d830fa77..6c7d31a1 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -168,6 +168,9 @@ void ObjectFactory::produce(void* args) { imtqHandler->setStartUpImmediately(); imtqHandler->setToGoToNormal(true); #endif +#if OBSW_DEBUG_IMTQ == 1 + imtqHandler->setDebugMode(true); +#endif #endif createReactionWheelComponents(gpioComIF); @@ -177,6 +180,9 @@ void ObjectFactory::produce(void* args) { new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie); bpxHandler->setStartUpImmediately(); bpxHandler->setToGoToNormalMode(true); +#if OBSW_DEBUG_BPX_BATT == 1 + bpxHandler->setDebugMode(true); +#endif #endif new FileSystemHandler(objects::FILE_SYSTEM_HANDLER); @@ -266,6 +272,12 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI if (pwrSwitcher != nullptr) { *pwrSwitcher = pcduHandler; } +#if OBSW_DEBUG_P60DOCK == 1 + p60dockhandler->setDebugMode(true); +#endif +#if OBSW_DEBUG_ACU == 1 + acuhandler->setDebugMode(true); +#endif } void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { @@ -632,6 +644,9 @@ void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) { auto syrlinksHandler = new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, pcdu::PDU1_CH1_SYRLINKS_12V); syrlinksHandler->setPowerSwitcher(pwrSwitcher); +#if OBSW_DEBUG_SYRLINKS == 1 + syrlinksHandler->setDebugMode(true); +#endif } void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { @@ -732,32 +747,35 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) { auto rwHandler1 = new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF, gpioIds::EN_RW1); + rw1SpiCookie->setCallbackArgs(rwHandler1); #if OBSW_DEBUG_RW == 1 rwHandler1->setStartUpImmediately(); + rwHandler1->setDebugMode(true); #endif - rw1SpiCookie->setCallbackArgs(rwHandler1); - rwHandler1->setStartUpImmediately(); auto rwHandler2 = new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF, gpioIds::EN_RW2); + rw2SpiCookie->setCallbackArgs(rwHandler2); #if OBSW_DEBUG_RW == 1 rwHandler2->setStartUpImmediately(); + rwHandler2->setDebugMode(true); #endif - rw2SpiCookie->setCallbackArgs(rwHandler2); auto rwHandler3 = new RwHandler(objects::RW3, objects::SPI_COM_IF, rw3SpiCookie, gpioComIF, gpioIds::EN_RW3); + rw3SpiCookie->setCallbackArgs(rwHandler3); #if OBSW_DEBUG_RW == 1 rwHandler3->setStartUpImmediately(); + rwHandler3->setDebugMode(true); #endif - rw3SpiCookie->setCallbackArgs(rwHandler3); auto rwHandler4 = new RwHandler(objects::RW4, objects::SPI_COM_IF, rw4SpiCookie, gpioComIF, gpioIds::EN_RW4); + rw4SpiCookie->setCallbackArgs(rwHandler4); #if OBSW_DEBUG_RW == 1 rwHandler4->setStartUpImmediately(); + rwHandler4->setDebugMode(true); #endif - rw4SpiCookie->setCallbackArgs(rwHandler4); #endif /* OBSW_ADD_RW == 1 */ } diff --git a/common/config/commonConfig.h.in b/common/config/commonConfig.h.in index 737b0d0e..528342b1 100644 --- a/common/config/commonConfig.h.in +++ b/common/config/commonConfig.h.in @@ -4,16 +4,20 @@ #include #include "fsfw/version.h" -#define OBSW_ADD_LWGPS_TEST 0 +/* These defines should be disabled for mission code but are useful for +debugging. */ +#define OBSW_VERBOSE_LEVEL 1 + +#define OBSW_ADD_LWGPS_TEST 0 // Disable this for mission code. It allows exchanging TMTC packets via the Ethernet port -#define OBSW_ADD_TCPIP_BRIDGE 1 +#define OBSW_ADD_TCPIP_BRIDGE 1 // Use TCP instead of UDP for the TMTC bridge. This allows using the TMTC client locally // because UDP packets are not allowed in the VPN // This will cause the OBSW to initialize the TMTC bridge responsible for exchanging data with the // CCSDS IP Cores. -#define OBSW_USE_TMTC_TCP_BRIDGE 1 +#define OBSW_USE_TMTC_TCP_BRIDGE 1 namespace common { diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 7811fdbe..d6e53005 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -267,6 +267,9 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, rtdFdir = new RtdFdir(rtdIds[idx]); rtds[idx]->setCustomFdir(rtdFdir); rtds[idx]->setDeviceIdx(idx + 3); +#if OBSW_DEBUG_RTD == 1 + rtds[idx]->setDebugMode(true); +#endif } #if OBSW_TEST_RTD == 1 diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 4d26f463..356570e5 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -14,10 +14,6 @@ #include "commonConfig.h" #include "OBSWVersion.h" - -/* These defines should be disabled for mission code but are useful for -debugging. */ -#define OBSW_VERBOSE_LEVEL 1 #define Q7S_EM 0 @@ -187,7 +183,7 @@ debugging. */ #endif // RASPBERRY_PI -#define TCP_SERVER_WIRETAPPING 0 +#define OBSW_TCP_SERVER_WIRETAPPING 0 /*******************************************************************/ /** CMake Defines */ diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 4b17865d..d2db67fd 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -111,9 +111,9 @@ void ObjectFactory::produceGenericObjects() { tcpServer->setSpacePacketParsingOptions({common::PUS_PACKET_ID}); sif::info << "Created TCP server for TMTC commanding with listener port " << tcpServer->getTcpPort() << std::endl; -#if TCP_SERVER_WIRETAPPING == 1 +#if OBSW_TCP_SERVER_WIRETAPPING == 1 tcpServer->enableWiretapping(true); -#endif /* TCP_SERVER_WIRETAPPING == 1 */ +#endif /* OBSW_TCP_SERVER_WIRETAPPING == 1 */ #endif /* OBSW_USE_TMTC_TCP_BRIDGE == 0 */ tmtcBridge->setMaxNumberOfPacketsStored(70); #endif /* OBSW_ADD_TCPIP_BRIDGE == 1 */ diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index afdbec35..0fdad639 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -23,20 +23,22 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack parseHkTableReply(packet); handleDeviceTM(&acuHkTableDataset, id, true); -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_ACU == 1 - acuHkTableDataset.read(); - float temperatureC_1 = acuHkTableDataset.temperature1.value * 0.1; - float temperatureC_2 = acuHkTableDataset.temperature2.value * 0.1; - float temperatureC_3 = acuHkTableDataset.temperature3.value * 0.1; - sif::info << "ACU: Temperature 1: " << temperatureC_1 << " °C" << std::endl; - sif::info << "ACU: Temperature 2: " << temperatureC_2 << " °C" << std::endl; - sif::info << "ACU: Temperature 3: " << temperatureC_3 << " °C" << std::endl; - sif::info << "ACU: Ground Watchdog Timer Count: " << acuHkTableDataset.wdtCntGnd.value - << std::endl; - sif::info << "ACU: Ground watchdog timer, seconds left before reboot: " - << acuHkTableDataset.wdtGndLeft.value << std::endl; - acuHkTableDataset.commit(); + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + acuHkTableDataset.read(); + float temperatureC_1 = acuHkTableDataset.temperature1.value * 0.1; + float temperatureC_2 = acuHkTableDataset.temperature2.value * 0.1; + float temperatureC_3 = acuHkTableDataset.temperature3.value * 0.1; + sif::info << "ACU: Temperature 1: " << temperatureC_1 << " °C" << std::endl; + sif::info << "ACU: Temperature 2: " << temperatureC_2 << " °C" << std::endl; + sif::info << "ACU: Temperature 3: " << temperatureC_3 << " °C" << std::endl; + sif::info << "ACU: Ground Watchdog Timer Count: " << acuHkTableDataset.wdtCntGnd.value + << std::endl; + sif::info << "ACU: Ground watchdog timer, seconds left before reboot: " + << acuHkTableDataset.wdtGndLeft.value << std::endl; + acuHkTableDataset.commit(); #endif + } } LocalPoolDataSetBase *ACUHandler::getDataSetHandle(sid_t sid) { @@ -317,3 +319,5 @@ void ACUHandler::printChannelStats() { << static_cast(acuHkTableDataset.currentInChannel5.value) << std::setw(15) << std::right << acuHkTableDataset.voltageInChannel5.value << std::endl; } + +void ACUHandler::setDebugMode(bool enable) { this->debugMode = enable; } diff --git a/mission/devices/ACUHandler.h b/mission/devices/ACUHandler.h index 3b1feaf3..fdaf184a 100644 --- a/mission/devices/ACUHandler.h +++ b/mission/devices/ACUHandler.h @@ -15,6 +15,8 @@ class ACUHandler : public GomspaceDeviceHandler { ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); virtual ~ACUHandler(); + void setDebugMode(bool enable); + virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; @@ -37,6 +39,7 @@ class ACUHandler : public GomspaceDeviceHandler { static const DeviceCommandId_t PRINT_CHANNEL_STATS = 51; ACU::HkTableDataset acuHkTableDataset; + bool debugMode = false; /** * @brief Function extracts the hk table information from the received csp packet and stores diff --git a/mission/devices/BpxBatteryHandler.cpp b/mission/devices/BpxBatteryHandler.cpp index 9da04207..4ae7b962 100644 --- a/mission/devices/BpxBatteryHandler.cpp +++ b/mission/devices/BpxBatteryHandler.cpp @@ -197,19 +197,19 @@ ReturnValue_t BpxBatteryHandler::interpretDeviceReply(DeviceCommandId_t id, cons if (result != HasReturnvaluesIF::RETURN_OK) { return result; } -#if OBSW_DEBUG_BPX_BATT == 1 - sif::info << "BPX Battery HK output:" << std::endl; - sif::info << "Charge current [mA]: " << hkSet.chargeCurrent << std::endl; - sif::info << "Discharge current [mA]: " << hkSet.dischargeCurrent << std::endl; - sif::info << "Heater current [mA]: " << hkSet.heaterCurrent << std::endl; - sif::info << "Battery voltage [mV]: " << hkSet.battVoltage << std::endl; - sif::info << "Battery Temperature 1 [C]: " << hkSet.battTemp1 << std::endl; - sif::info << "Battery Temperature 2 [C]: " << hkSet.battTemp2 << std::endl; - sif::info << "Battery Temperature 3 [C]: " << hkSet.battTemp3 << std::endl; - sif::info << "Battery Temperature 4 [C]: " << hkSet.battTemp4 << std::endl; - sif::info << "Battery Reboot Counter: " << hkSet.rebootCounter << std::endl; - sif::info << "Battery Boot Cause: " << static_cast(hkSet.bootcause.value) << std::endl; -#endif + if (debugMode) { + sif::info << "BPX Battery HK output:" << std::endl; + sif::info << "Charge current [mA]: " << hkSet.chargeCurrent << std::endl; + sif::info << "Discharge current [mA]: " << hkSet.dischargeCurrent << std::endl; + sif::info << "Heater current [mA]: " << hkSet.heaterCurrent << std::endl; + sif::info << "Battery voltage [mV]: " << hkSet.battVoltage << std::endl; + sif::info << "Battery Temperature 1 [C]: " << hkSet.battTemp1 << std::endl; + sif::info << "Battery Temperature 2 [C]: " << hkSet.battTemp2 << std::endl; + sif::info << "Battery Temperature 3 [C]: " << hkSet.battTemp3 << std::endl; + sif::info << "Battery Temperature 4 [C]: " << hkSet.battTemp4 << std::endl; + sif::info << "Battery Reboot Counter: " << hkSet.rebootCounter << std::endl; + sif::info << "Battery Boot Cause: " << static_cast(hkSet.bootcause.value) << std::endl; + } break; } case (BpxBattery::PING): { @@ -277,3 +277,5 @@ ReturnValue_t BpxBatteryHandler::initializeLocalDataPool(localpool::DataPool& lo void BpxBatteryHandler::setToGoToNormalMode(bool enable) { this->goToNormalModeImmediately = enable; } + +void BpxBatteryHandler::setDebugMode(bool enable) { this->debugMode = enable; } diff --git a/mission/devices/BpxBatteryHandler.h b/mission/devices/BpxBatteryHandler.h index eb75fe2c..ceb0ff8d 100644 --- a/mission/devices/BpxBatteryHandler.h +++ b/mission/devices/BpxBatteryHandler.h @@ -11,6 +11,7 @@ class BpxBatteryHandler : public DeviceHandlerBase { virtual ~BpxBatteryHandler(); void setToGoToNormalMode(bool enable); + void setDebugMode(bool enable); protected: enum class States { @@ -20,6 +21,7 @@ class BpxBatteryHandler : public DeviceHandlerBase { States state = States::CHECK_COM; bool commandExecuted = false; + bool debugMode = false; bool goToNormalModeImmediately = false; uint8_t sentPingByte = BpxBattery::DEFAULT_PING_SENT_BYTE; BpxBatteryHk hkSet; diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index ad6beb0a..403adece 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -687,19 +687,21 @@ void IMTQHandler::fillEngHkDataset(const uint8_t* packet) { offset += 2; engHkDataset.mcuTemperature = (*(packet + offset + 1) << 8 | *(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 - sif::info << "IMTQ digital voltage: " << engHkDataset.digitalVoltageMv << " mV" << std::endl; - sif::info << "IMTQ analog voltage: " << engHkDataset.analogVoltageMv << " mV" << std::endl; - sif::info << "IMTQ digital current: " << engHkDataset.digitalCurrentmA << " mA" << std::endl; - sif::info << "IMTQ analog current: " << engHkDataset.analogCurrentmA << " mA" << std::endl; - sif::info << "IMTQ coil X current: " << engHkDataset.coilXCurrentmA << " mA" << std::endl; - sif::info << "IMTQ coil Y current: " << engHkDataset.coilYCurrentmA << " mA" << std::endl; - sif::info << "IMTQ coil Z current: " << engHkDataset.coilZCurrentmA << " mA" << std::endl; - sif::info << "IMTQ coil X temperature: " << engHkDataset.coilXTemperature << " °C" << std::endl; - sif::info << "IMTQ coil Y temperature: " << engHkDataset.coilYTemperature << " °C" << std::endl; - sif::info << "IMTQ coil Z temperature: " << engHkDataset.coilZTemperature << " °C" << std::endl; - sif::info << "IMTQ coil MCU temperature: " << engHkDataset.mcuTemperature << " °C" << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "IMTQ digital voltage: " << engHkDataset.digitalVoltageMv << " mV" << std::endl; + sif::info << "IMTQ analog voltage: " << engHkDataset.analogVoltageMv << " mV" << std::endl; + sif::info << "IMTQ digital current: " << engHkDataset.digitalCurrentmA << " mA" << std::endl; + sif::info << "IMTQ analog current: " << engHkDataset.analogCurrentmA << " mA" << std::endl; + sif::info << "IMTQ coil X current: " << engHkDataset.coilXCurrentmA << " mA" << std::endl; + sif::info << "IMTQ coil Y current: " << engHkDataset.coilYCurrentmA << " mA" << std::endl; + sif::info << "IMTQ coil Z current: " << engHkDataset.coilZCurrentmA << " mA" << std::endl; + sif::info << "IMTQ coil X temperature: " << engHkDataset.coilXTemperature << " °C" << std::endl; + sif::info << "IMTQ coil Y temperature: " << engHkDataset.coilYTemperature << " °C" << std::endl; + sif::info << "IMTQ coil Z temperature: " << engHkDataset.coilZTemperature << " °C" << std::endl; + sif::info << "IMTQ coil MCU temperature: " << engHkDataset.mcuTemperature << " °C" << std::endl; #endif + } } void IMTQHandler::setToGoToNormal(bool enable) { this->goToNormalMode = enable; } @@ -755,16 +757,18 @@ void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) { calMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) | (*(packet + offset + 2) << 16) | (*(packet + offset + 1) << 8) | (*(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 - sif::info << "IMTQ calibrated MTM measurement X: " << calMtmMeasurementSet.mtmXnT << " nT" - << std::endl; - sif::info << "IMTQ calibrated MTM measurement Y: " << calMtmMeasurementSet.mtmYnT << " nT" - << std::endl; - sif::info << "IMTQ calibrated MTM measurement Z: " << calMtmMeasurementSet.mtmZnT << " nT" - << std::endl; - sif::info << "IMTQ coil actuation status during MTM measurement: " - << (unsigned int)calMtmMeasurementSet.coilActuationStatus.value << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "IMTQ calibrated MTM measurement X: " << calMtmMeasurementSet.mtmXnT << " nT" + << std::endl; + sif::info << "IMTQ calibrated MTM measurement Y: " << calMtmMeasurementSet.mtmYnT << " nT" + << std::endl; + sif::info << "IMTQ calibrated MTM measurement Z: " << calMtmMeasurementSet.mtmZnT << " nT" + << std::endl; + sif::info << "IMTQ coil actuation status during MTM measurement: " + << (unsigned int)calMtmMeasurementSet.coilActuationStatus.value << std::endl; #endif + } } void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) { @@ -785,13 +789,18 @@ void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) { rawMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) | (*(packet + offset + 2) << 16) | (*(packet + offset + 1) << 8) | (*(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 - sif::info << "IMTQ raw MTM measurement X: " << rawMtmMeasurementSet.mtmXnT << " nT" << std::endl; - sif::info << "IMTQ raw MTM measurement Y: " << rawMtmMeasurementSet.mtmYnT << " nT" << std::endl; - sif::info << "IMTQ raw MTM measurement Z: " << rawMtmMeasurementSet.mtmZnT << " nT" << std::endl; - sif::info << "IMTQ coil actuation status during MTM measurement: " - << (unsigned int)rawMtmMeasurementSet.coilActuationStatus.value << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "IMTQ raw MTM measurement X: " << rawMtmMeasurementSet.mtmXnT << " nT" + << std::endl; + sif::info << "IMTQ raw MTM measurement Y: " << rawMtmMeasurementSet.mtmYnT << " nT" + << std::endl; + sif::info << "IMTQ raw MTM measurement Z: " << rawMtmMeasurementSet.mtmZnT << " nT" + << std::endl; + sif::info << "IMTQ coil actuation status during MTM measurement: " + << (unsigned int)rawMtmMeasurementSet.coilActuationStatus.value << std::endl; #endif + } } void IMTQHandler::handleSelfTestReply(const uint8_t* packet) { @@ -954,88 +963,90 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) { posXselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 - 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 - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << posXselfTestDataset.initRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << posXselfTestDataset.initRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " - << posXselfTestDataset.initCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " - << posXselfTestDataset.initCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " - << posXselfTestDataset.initCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) coil X current: " << posXselfTestDataset.initCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y current: " << posXselfTestDataset.initCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z current: " << posXselfTestDataset.initCoilZCurrent - << " 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: " - << posXselfTestDataset.initCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z temperature: " - << posXselfTestDataset.initCoilZTemperature << " °C" << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + 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 + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << posXselfTestDataset.initRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << posXselfTestDataset.initRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " + << posXselfTestDataset.initCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " + << posXselfTestDataset.initCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " + << posXselfTestDataset.initCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) coil X current: " << posXselfTestDataset.initCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y current: " << posXselfTestDataset.initCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z current: " << posXselfTestDataset.initCoilZCurrent + << " 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: " + << posXselfTestDataset.initCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z temperature: " + << posXselfTestDataset.initCoilZTemperature << " °C" << std::endl; - 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 << " nT" - << std::endl; - sif::info << "IMTQ self test (+X) raw magnetic field Y: " << posXselfTestDataset.rawMagY << " nT" - << std::endl; - sif::info << "IMTQ self test (+X) raw magnetic field Z: " << posXselfTestDataset.rawMagZ << " nT" - << std::endl; - sif::info << "IMTQ self test (+X) calibrated magnetic field X: " << posXselfTestDataset.calMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (+X) calibrated magnetic field Y: " << posXselfTestDataset.calMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (+X) calibrated magnetic field Z: " << posXselfTestDataset.calMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (+X) coil X current: " << posXselfTestDataset.coilXCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (+X) coil Y current: " << posXselfTestDataset.coilYCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (+X) coil Z current: " << posXselfTestDataset.coilZCurrent << " 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: " << posXselfTestDataset.coilYTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (+X) coil Z temperature: " << posXselfTestDataset.coilZTemperature - << " °C" << std::endl; + 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 + << " nT" << std::endl; + sif::info << "IMTQ self test (+X) raw magnetic field Y: " << posXselfTestDataset.rawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (+X) raw magnetic field Z: " << posXselfTestDataset.rawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (+X) calibrated magnetic field X: " << posXselfTestDataset.calMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (+X) calibrated magnetic field Y: " << posXselfTestDataset.calMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (+X) calibrated magnetic field Z: " << posXselfTestDataset.calMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (+X) coil X current: " << posXselfTestDataset.coilXCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (+X) coil Y current: " << posXselfTestDataset.coilYCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (+X) coil Z current: " << posXselfTestDataset.coilZCurrent << " 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: " << posXselfTestDataset.coilYTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (+X) coil Z temperature: " << posXselfTestDataset.coilZTemperature + << " °C" << std::endl; - 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 - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << posXselfTestDataset.finaRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << posXselfTestDataset.finaRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " - << posXselfTestDataset.finaCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " - << posXselfTestDataset.finaCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " - << posXselfTestDataset.finaCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) coil X current: " << posXselfTestDataset.finaCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y current: " << posXselfTestDataset.finaCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z current: " << posXselfTestDataset.finaCoilZCurrent - << " 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: " - << posXselfTestDataset.finaCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z temperature: " - << posXselfTestDataset.finaCoilZTemperature << " °C" << std::endl; + 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 + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << posXselfTestDataset.finaRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << posXselfTestDataset.finaRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " + << posXselfTestDataset.finaCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " + << posXselfTestDataset.finaCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " + << posXselfTestDataset.finaCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) coil X current: " << posXselfTestDataset.finaCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y current: " << posXselfTestDataset.finaCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z current: " << posXselfTestDataset.finaCoilZCurrent + << " 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: " + << posXselfTestDataset.finaCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z temperature: " + << posXselfTestDataset.finaCoilZTemperature << " °C" << std::endl; #endif + } } void IMTQHandler::handleNegativeXSelfTestReply(const uint8_t* packet) { @@ -1164,88 +1175,90 @@ void IMTQHandler::handleNegativeXSelfTestReply(const uint8_t* packet) { negXselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 - sif::info << "IMTQ self test (INIT) err: " - << static_cast(negXselfTestDataset.initErr.value) << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negXselfTestDataset.initRawMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << negXselfTestDataset.initRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << negXselfTestDataset.initRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " - << negXselfTestDataset.initCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " - << negXselfTestDataset.initCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " - << negXselfTestDataset.initCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) coil X current: " << negXselfTestDataset.initCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y current: " << negXselfTestDataset.initCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z current: " << negXselfTestDataset.initCoilZCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil X temperature: " - << negXselfTestDataset.initCoilXTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y temperature: " - << negXselfTestDataset.initCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z temperature: " - << negXselfTestDataset.initCoilZTemperature << " °C" << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "IMTQ self test (INIT) err: " + << static_cast(negXselfTestDataset.initErr.value) << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negXselfTestDataset.initRawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << negXselfTestDataset.initRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << negXselfTestDataset.initRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " + << negXselfTestDataset.initCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " + << negXselfTestDataset.initCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " + << negXselfTestDataset.initCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) coil X current: " << negXselfTestDataset.initCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y current: " << negXselfTestDataset.initCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z current: " << negXselfTestDataset.initCoilZCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil X temperature: " + << negXselfTestDataset.initCoilXTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y temperature: " + << negXselfTestDataset.initCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z temperature: " + << negXselfTestDataset.initCoilZTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (-X) err: " - << static_cast(negXselfTestDataset.err.value) << std::endl; - sif::info << "IMTQ self test (-X) raw magnetic field X: " << negXselfTestDataset.rawMagX << " nT" - << std::endl; - sif::info << "IMTQ self test (-X) raw magnetic field Y: " << negXselfTestDataset.rawMagY << " nT" - << std::endl; - sif::info << "IMTQ self test (-X) raw magnetic field Z: " << negXselfTestDataset.rawMagZ << " nT" - << std::endl; - sif::info << "IMTQ self test (-X) calibrated magnetic field X: " << negXselfTestDataset.calMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (-X) calibrated magnetic field Y: " << negXselfTestDataset.calMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (-X) calibrated magnetic field Z: " << negXselfTestDataset.calMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (-X) coil X current: " << negXselfTestDataset.coilXCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (-X) coil Y current: " << negXselfTestDataset.coilYCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (-X) coil Z current: " << negXselfTestDataset.coilZCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (-X) coil X temperature: " << negXselfTestDataset.coilXTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (-X) coil Y temperature: " << negXselfTestDataset.coilYTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (-X) coil Z temperature: " << negXselfTestDataset.coilZTemperature - << " °C" << std::endl; + sif::info << "IMTQ self test (-X) err: " + << static_cast(negXselfTestDataset.err.value) << std::endl; + sif::info << "IMTQ self test (-X) raw magnetic field X: " << negXselfTestDataset.rawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (-X) raw magnetic field Y: " << negXselfTestDataset.rawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (-X) raw magnetic field Z: " << negXselfTestDataset.rawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (-X) calibrated magnetic field X: " << negXselfTestDataset.calMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (-X) calibrated magnetic field Y: " << negXselfTestDataset.calMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (-X) calibrated magnetic field Z: " << negXselfTestDataset.calMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (-X) coil X current: " << negXselfTestDataset.coilXCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (-X) coil Y current: " << negXselfTestDataset.coilYCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (-X) coil Z current: " << negXselfTestDataset.coilZCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (-X) coil X temperature: " << negXselfTestDataset.coilXTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (-X) coil Y temperature: " << negXselfTestDataset.coilYTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (-X) coil Z temperature: " << negXselfTestDataset.coilZTemperature + << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) err: " - << static_cast(negXselfTestDataset.finaErr.value) << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field X: " << negXselfTestDataset.finaRawMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << negXselfTestDataset.finaRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << negXselfTestDataset.finaRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " - << negXselfTestDataset.finaCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " - << negXselfTestDataset.finaCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " - << negXselfTestDataset.finaCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) coil X current: " << negXselfTestDataset.finaCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y current: " << negXselfTestDataset.finaCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z current: " << negXselfTestDataset.finaCoilZCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil X temperature: " - << negXselfTestDataset.finaCoilXTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y temperature: " - << negXselfTestDataset.finaCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z temperature: " - << negXselfTestDataset.finaCoilZTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) err: " + << static_cast(negXselfTestDataset.finaErr.value) << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field X: " << negXselfTestDataset.finaRawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << negXselfTestDataset.finaRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << negXselfTestDataset.finaRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " + << negXselfTestDataset.finaCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " + << negXselfTestDataset.finaCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " + << negXselfTestDataset.finaCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) coil X current: " << negXselfTestDataset.finaCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y current: " << negXselfTestDataset.finaCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z current: " << negXselfTestDataset.finaCoilZCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil X temperature: " + << negXselfTestDataset.finaCoilXTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y temperature: " + << negXselfTestDataset.finaCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z temperature: " + << negXselfTestDataset.finaCoilZTemperature << " °C" << std::endl; #endif + } } void IMTQHandler::handlePositiveYSelfTestReply(const uint8_t* packet) { @@ -1374,88 +1387,90 @@ void IMTQHandler::handlePositiveYSelfTestReply(const uint8_t* packet) { posYselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 - sif::info << "IMTQ self test (INIT) err: " - << static_cast(posYselfTestDataset.initErr.value) << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posYselfTestDataset.initRawMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << posYselfTestDataset.initRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << posYselfTestDataset.initRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " - << posYselfTestDataset.initCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " - << posYselfTestDataset.initCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " - << posYselfTestDataset.initCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) coil X current: " << posYselfTestDataset.initCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y current: " << posYselfTestDataset.initCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z current: " << posYselfTestDataset.initCoilZCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil X temperature: " - << posYselfTestDataset.initCoilXTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y temperature: " - << posYselfTestDataset.initCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z temperature: " - << posYselfTestDataset.initCoilZTemperature << " °C" << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "IMTQ self test (INIT) err: " + << static_cast(posYselfTestDataset.initErr.value) << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posYselfTestDataset.initRawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << posYselfTestDataset.initRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << posYselfTestDataset.initRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " + << posYselfTestDataset.initCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " + << posYselfTestDataset.initCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " + << posYselfTestDataset.initCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) coil X current: " << posYselfTestDataset.initCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y current: " << posYselfTestDataset.initCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z current: " << posYselfTestDataset.initCoilZCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil X temperature: " + << posYselfTestDataset.initCoilXTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y temperature: " + << posYselfTestDataset.initCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z temperature: " + << posYselfTestDataset.initCoilZTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (+Y) err: " - << static_cast(posYselfTestDataset.err.value) << std::endl; - sif::info << "IMTQ self test (+Y) raw magnetic field X: " << posYselfTestDataset.rawMagX << " nT" - << std::endl; - sif::info << "IMTQ self test (+Y) raw magnetic field Y: " << posYselfTestDataset.rawMagY << " nT" - << std::endl; - sif::info << "IMTQ self test (+Y) raw magnetic field Z: " << posYselfTestDataset.rawMagZ << " nT" - << std::endl; - sif::info << "IMTQ self test (+Y) calibrated magnetic field X: " << posYselfTestDataset.calMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (+Y) calibrated magnetic field Y: " << posYselfTestDataset.calMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (+Y) calibrated magnetic field Z: " << posYselfTestDataset.calMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (+Y) coil X current: " << posYselfTestDataset.coilXCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (+Y) coil Y current: " << posYselfTestDataset.coilYCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (+Y) coil Z current: " << posYselfTestDataset.coilZCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (+Y) coil X temperature: " << posYselfTestDataset.coilXTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (+Y) coil Y temperature: " << posYselfTestDataset.coilYTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (+Y) coil Z temperature: " << posYselfTestDataset.coilZTemperature - << " °C" << std::endl; + sif::info << "IMTQ self test (+Y) err: " + << static_cast(posYselfTestDataset.err.value) << std::endl; + sif::info << "IMTQ self test (+Y) raw magnetic field X: " << posYselfTestDataset.rawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (+Y) raw magnetic field Y: " << posYselfTestDataset.rawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (+Y) raw magnetic field Z: " << posYselfTestDataset.rawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (+Y) calibrated magnetic field X: " << posYselfTestDataset.calMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (+Y) calibrated magnetic field Y: " << posYselfTestDataset.calMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (+Y) calibrated magnetic field Z: " << posYselfTestDataset.calMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (+Y) coil X current: " << posYselfTestDataset.coilXCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (+Y) coil Y current: " << posYselfTestDataset.coilYCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (+Y) coil Z current: " << posYselfTestDataset.coilZCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (+Y) coil X temperature: " << posYselfTestDataset.coilXTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (+Y) coil Y temperature: " << posYselfTestDataset.coilYTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (+Y) coil Z temperature: " << posYselfTestDataset.coilZTemperature + << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) err: " - << static_cast(posYselfTestDataset.finaErr.value) << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field X: " << posYselfTestDataset.finaRawMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << posYselfTestDataset.finaRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << posYselfTestDataset.finaRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " - << posYselfTestDataset.finaCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " - << posYselfTestDataset.finaCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " - << posYselfTestDataset.finaCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) coil X current: " << posYselfTestDataset.finaCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y current: " << posYselfTestDataset.finaCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z current: " << posYselfTestDataset.finaCoilZCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil X temperature: " - << posYselfTestDataset.finaCoilXTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y temperature: " - << posYselfTestDataset.finaCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z temperature: " - << posYselfTestDataset.finaCoilZTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) err: " + << static_cast(posYselfTestDataset.finaErr.value) << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field X: " << posYselfTestDataset.finaRawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << posYselfTestDataset.finaRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << posYselfTestDataset.finaRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " + << posYselfTestDataset.finaCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " + << posYselfTestDataset.finaCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " + << posYselfTestDataset.finaCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) coil X current: " << posYselfTestDataset.finaCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y current: " << posYselfTestDataset.finaCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z current: " << posYselfTestDataset.finaCoilZCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil X temperature: " + << posYselfTestDataset.finaCoilXTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y temperature: " + << posYselfTestDataset.finaCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z temperature: " + << posYselfTestDataset.finaCoilZTemperature << " °C" << std::endl; #endif + } } void IMTQHandler::handleNegativeYSelfTestReply(const uint8_t* packet) { @@ -1584,88 +1599,90 @@ void IMTQHandler::handleNegativeYSelfTestReply(const uint8_t* packet) { negYselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 - sif::info << "IMTQ self test (INIT) err: " - << static_cast(negYselfTestDataset.initErr.value) << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negYselfTestDataset.initRawMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << negYselfTestDataset.initRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << negYselfTestDataset.initRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " - << negYselfTestDataset.initCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " - << negYselfTestDataset.initCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " - << negYselfTestDataset.initCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) coil X current: " << negYselfTestDataset.initCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y current: " << negYselfTestDataset.initCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z current: " << negYselfTestDataset.initCoilZCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil X temperature: " - << negYselfTestDataset.initCoilXTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y temperature: " - << negYselfTestDataset.initCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z temperature: " - << negYselfTestDataset.initCoilZTemperature << " °C" << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "IMTQ self test (INIT) err: " + << static_cast(negYselfTestDataset.initErr.value) << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negYselfTestDataset.initRawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << negYselfTestDataset.initRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << negYselfTestDataset.initRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " + << negYselfTestDataset.initCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " + << negYselfTestDataset.initCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " + << negYselfTestDataset.initCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) coil X current: " << negYselfTestDataset.initCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y current: " << negYselfTestDataset.initCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z current: " << negYselfTestDataset.initCoilZCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil X temperature: " + << negYselfTestDataset.initCoilXTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y temperature: " + << negYselfTestDataset.initCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z temperature: " + << negYselfTestDataset.initCoilZTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (-Y) err: " - << static_cast(negYselfTestDataset.err.value) << std::endl; - sif::info << "IMTQ self test (-Y) raw magnetic field X: " << negYselfTestDataset.rawMagX << " nT" - << std::endl; - sif::info << "IMTQ self test (-Y) raw magnetic field Y: " << negYselfTestDataset.rawMagY << " nT" - << std::endl; - sif::info << "IMTQ self test (-Y) raw magnetic field Z: " << negYselfTestDataset.rawMagZ << " nT" - << std::endl; - sif::info << "IMTQ self test (-Y) calibrated magnetic field X: " << negYselfTestDataset.calMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (-Y) calibrated magnetic field Y: " << negYselfTestDataset.calMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (-Y) calibrated magnetic field Z: " << negYselfTestDataset.calMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (-Y) coil X current: " << negYselfTestDataset.coilXCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (-Y) coil Y current: " << negYselfTestDataset.coilYCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (-Y) coil Z current: " << negYselfTestDataset.coilZCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (-Y) coil X temperature: " << negYselfTestDataset.coilXTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (-Y) coil Y temperature: " << negYselfTestDataset.coilYTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (-Y) coil Z temperature: " << negYselfTestDataset.coilZTemperature - << " °C" << std::endl; + sif::info << "IMTQ self test (-Y) err: " + << static_cast(negYselfTestDataset.err.value) << std::endl; + sif::info << "IMTQ self test (-Y) raw magnetic field X: " << negYselfTestDataset.rawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (-Y) raw magnetic field Y: " << negYselfTestDataset.rawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (-Y) raw magnetic field Z: " << negYselfTestDataset.rawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (-Y) calibrated magnetic field X: " << negYselfTestDataset.calMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (-Y) calibrated magnetic field Y: " << negYselfTestDataset.calMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (-Y) calibrated magnetic field Z: " << negYselfTestDataset.calMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (-Y) coil X current: " << negYselfTestDataset.coilXCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (-Y) coil Y current: " << negYselfTestDataset.coilYCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (-Y) coil Z current: " << negYselfTestDataset.coilZCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (-Y) coil X temperature: " << negYselfTestDataset.coilXTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (-Y) coil Y temperature: " << negYselfTestDataset.coilYTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (-Y) coil Z temperature: " << negYselfTestDataset.coilZTemperature + << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) err: " - << static_cast(negYselfTestDataset.finaErr.value) << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field X: " << negYselfTestDataset.finaRawMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << negYselfTestDataset.finaRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << negYselfTestDataset.finaRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " - << negYselfTestDataset.finaCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " - << negYselfTestDataset.finaCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " - << negYselfTestDataset.finaCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) coil X current: " << negYselfTestDataset.finaCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y current: " << negYselfTestDataset.finaCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z current: " << negYselfTestDataset.finaCoilZCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil X temperature: " - << negYselfTestDataset.finaCoilXTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y temperature: " - << negYselfTestDataset.finaCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z temperature: " - << negYselfTestDataset.finaCoilZTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) err: " + << static_cast(negYselfTestDataset.finaErr.value) << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field X: " << negYselfTestDataset.finaRawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << negYselfTestDataset.finaRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << negYselfTestDataset.finaRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " + << negYselfTestDataset.finaCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " + << negYselfTestDataset.finaCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " + << negYselfTestDataset.finaCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) coil X current: " << negYselfTestDataset.finaCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y current: " << negYselfTestDataset.finaCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z current: " << negYselfTestDataset.finaCoilZCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil X temperature: " + << negYselfTestDataset.finaCoilXTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y temperature: " + << negYselfTestDataset.finaCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z temperature: " + << negYselfTestDataset.finaCoilZTemperature << " °C" << std::endl; #endif + } } void IMTQHandler::handlePositiveZSelfTestReply(const uint8_t* packet) { @@ -1794,88 +1811,90 @@ void IMTQHandler::handlePositiveZSelfTestReply(const uint8_t* packet) { posZselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 - sif::info << "IMTQ self test (INIT) err: " - << static_cast(posZselfTestDataset.initErr.value) << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posZselfTestDataset.initRawMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << posZselfTestDataset.initRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << posZselfTestDataset.initRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " - << posZselfTestDataset.initCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " - << posZselfTestDataset.initCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " - << posZselfTestDataset.initCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) coil X current: " << posZselfTestDataset.initCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y current: " << posZselfTestDataset.initCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z current: " << posZselfTestDataset.initCoilZCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil X temperature: " - << posZselfTestDataset.initCoilXTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y temperature: " - << posZselfTestDataset.initCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z temperature: " - << posZselfTestDataset.initCoilZTemperature << " °C" << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "IMTQ self test (INIT) err: " + << static_cast(posZselfTestDataset.initErr.value) << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posZselfTestDataset.initRawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << posZselfTestDataset.initRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << posZselfTestDataset.initRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " + << posZselfTestDataset.initCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " + << posZselfTestDataset.initCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " + << posZselfTestDataset.initCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) coil X current: " << posZselfTestDataset.initCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y current: " << posZselfTestDataset.initCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z current: " << posZselfTestDataset.initCoilZCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil X temperature: " + << posZselfTestDataset.initCoilXTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y temperature: " + << posZselfTestDataset.initCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z temperature: " + << posZselfTestDataset.initCoilZTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (+Z) err: " - << static_cast(posZselfTestDataset.err.value) << std::endl; - sif::info << "IMTQ self test (+Z) raw magnetic field X: " << posZselfTestDataset.rawMagX << " nT" - << std::endl; - sif::info << "IMTQ self test (+Z) raw magnetic field Y: " << posZselfTestDataset.rawMagY << " nT" - << std::endl; - sif::info << "IMTQ self test (+Z) raw magnetic field Z: " << posZselfTestDataset.rawMagZ << " nT" - << std::endl; - sif::info << "IMTQ self test (+Z) calibrated magnetic field X: " << posZselfTestDataset.calMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (+Z) calibrated magnetic field Y: " << posZselfTestDataset.calMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (+Z) calibrated magnetic field Z: " << posZselfTestDataset.calMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (+Z) coil X current: " << posZselfTestDataset.coilXCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (+Z) coil Y current: " << posZselfTestDataset.coilYCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (+Z) coil Z current: " << posZselfTestDataset.coilZCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (+Z) coil X temperature: " << posZselfTestDataset.coilXTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (+Z) coil Y temperature: " << posZselfTestDataset.coilYTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (+Z) coil Z temperature: " << negYselfTestDataset.coilZTemperature - << " °C" << std::endl; + sif::info << "IMTQ self test (+Z) err: " + << static_cast(posZselfTestDataset.err.value) << std::endl; + sif::info << "IMTQ self test (+Z) raw magnetic field X: " << posZselfTestDataset.rawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (+Z) raw magnetic field Y: " << posZselfTestDataset.rawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (+Z) raw magnetic field Z: " << posZselfTestDataset.rawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (+Z) calibrated magnetic field X: " << posZselfTestDataset.calMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (+Z) calibrated magnetic field Y: " << posZselfTestDataset.calMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (+Z) calibrated magnetic field Z: " << posZselfTestDataset.calMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (+Z) coil X current: " << posZselfTestDataset.coilXCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (+Z) coil Y current: " << posZselfTestDataset.coilYCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (+Z) coil Z current: " << posZselfTestDataset.coilZCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (+Z) coil X temperature: " << posZselfTestDataset.coilXTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (+Z) coil Y temperature: " << posZselfTestDataset.coilYTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (+Z) coil Z temperature: " << negYselfTestDataset.coilZTemperature + << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) err: " - << static_cast(posZselfTestDataset.finaErr.value) << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field X: " << posZselfTestDataset.finaRawMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << posZselfTestDataset.finaRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << posZselfTestDataset.finaRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " - << posZselfTestDataset.finaCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " - << posZselfTestDataset.finaCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " - << posZselfTestDataset.finaCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) coil X current: " << posZselfTestDataset.finaCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y current: " << posZselfTestDataset.finaCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z current: " << posZselfTestDataset.finaCoilZCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil X temperature: " - << posZselfTestDataset.finaCoilXTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y temperature: " - << posZselfTestDataset.finaCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z temperature: " - << posZselfTestDataset.finaCoilZTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) err: " + << static_cast(posZselfTestDataset.finaErr.value) << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field X: " << posZselfTestDataset.finaRawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << posZselfTestDataset.finaRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << posZselfTestDataset.finaRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " + << posZselfTestDataset.finaCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " + << posZselfTestDataset.finaCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " + << posZselfTestDataset.finaCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) coil X current: " << posZselfTestDataset.finaCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y current: " << posZselfTestDataset.finaCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z current: " << posZselfTestDataset.finaCoilZCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil X temperature: " + << posZselfTestDataset.finaCoilXTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y temperature: " + << posZselfTestDataset.finaCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z temperature: " + << posZselfTestDataset.finaCoilZTemperature << " °C" << std::endl; #endif + } } void IMTQHandler::handleNegativeZSelfTestReply(const uint8_t* packet) { @@ -2004,90 +2023,94 @@ void IMTQHandler::handleNegativeZSelfTestReply(const uint8_t* packet) { negZselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 - sif::info << "IMTQ self test (INIT) err: " - << static_cast(negZselfTestDataset.initErr.value) << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negZselfTestDataset.initRawMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << negZselfTestDataset.initRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << negZselfTestDataset.initRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " - << negZselfTestDataset.initCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " - << negZselfTestDataset.initCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " - << negZselfTestDataset.initCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (INIT) coil X current: " << negZselfTestDataset.initCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y current: " << negZselfTestDataset.initCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z current: " << negZselfTestDataset.initCoilZCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (INIT) coil X temperature: " - << negZselfTestDataset.initCoilXTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Y temperature: " - << negZselfTestDataset.initCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (INIT) coil Z temperature: " - << negZselfTestDataset.initCoilZTemperature << " °C" << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "IMTQ self test (INIT) err: " + << static_cast(negZselfTestDataset.initErr.value) << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negZselfTestDataset.initRawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Y: " << negZselfTestDataset.initRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) raw magnetic field Z: " << negZselfTestDataset.initRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field X: " + << negZselfTestDataset.initCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Y: " + << negZselfTestDataset.initCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) calibrated magnetic field Z: " + << negZselfTestDataset.initCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (INIT) coil X current: " << negZselfTestDataset.initCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y current: " << negZselfTestDataset.initCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z current: " << negZselfTestDataset.initCoilZCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (INIT) coil X temperature: " + << negZselfTestDataset.initCoilXTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Y temperature: " + << negZselfTestDataset.initCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (INIT) coil Z temperature: " + << negZselfTestDataset.initCoilZTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (-Z) err: " - << static_cast(negZselfTestDataset.err.value) << std::endl; - sif::info << "IMTQ self test (-Z) raw magnetic field X: " << negZselfTestDataset.rawMagX << " nT" - << std::endl; - sif::info << "IMTQ self test (-Z) raw magnetic field Y: " << negZselfTestDataset.rawMagY << " nT" - << std::endl; - sif::info << "IMTQ self test (-Z) raw magnetic field Z: " << negZselfTestDataset.rawMagZ << " nT" - << std::endl; - sif::info << "IMTQ self test (-Z) calibrated magnetic field X: " << negZselfTestDataset.calMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (-Z) calibrated magnetic field Y: " << negZselfTestDataset.calMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (-Z) calibrated magnetic field Z: " << negZselfTestDataset.calMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (-Z) coil X current: " << negZselfTestDataset.coilXCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (-Z) coil Y current: " << negZselfTestDataset.coilYCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (-Z) coil Z current: " << negZselfTestDataset.coilZCurrent << " mA" - << std::endl; - sif::info << "IMTQ self test (-Z) coil X temperature: " << negZselfTestDataset.coilXTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (-Z) coil Y temperature: " << negZselfTestDataset.coilYTemperature - << " °C" << std::endl; - sif::info << "IMTQ self test (-Z) coil Z temperature: " << negYselfTestDataset.coilZTemperature - << " °C" << std::endl; + sif::info << "IMTQ self test (-Z) err: " + << static_cast(negZselfTestDataset.err.value) << std::endl; + sif::info << "IMTQ self test (-Z) raw magnetic field X: " << negZselfTestDataset.rawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (-Z) raw magnetic field Y: " << negZselfTestDataset.rawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (-Z) raw magnetic field Z: " << negZselfTestDataset.rawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (-Z) calibrated magnetic field X: " << negZselfTestDataset.calMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (-Z) calibrated magnetic field Y: " << negZselfTestDataset.calMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (-Z) calibrated magnetic field Z: " << negZselfTestDataset.calMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (-Z) coil X current: " << negZselfTestDataset.coilXCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (-Z) coil Y current: " << negZselfTestDataset.coilYCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (-Z) coil Z current: " << negZselfTestDataset.coilZCurrent << " mA" + << std::endl; + sif::info << "IMTQ self test (-Z) coil X temperature: " << negZselfTestDataset.coilXTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (-Z) coil Y temperature: " << negZselfTestDataset.coilYTemperature + << " °C" << std::endl; + sif::info << "IMTQ self test (-Z) coil Z temperature: " << negYselfTestDataset.coilZTemperature + << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) err: " - << static_cast(negZselfTestDataset.finaErr.value) << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field X: " << negZselfTestDataset.finaRawMagX - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << negZselfTestDataset.finaRawMagY - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << negZselfTestDataset.finaRawMagZ - << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " - << negZselfTestDataset.finaCalMagX << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " - << negZselfTestDataset.finaCalMagY << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " - << negZselfTestDataset.finaCalMagZ << " nT" << std::endl; - sif::info << "IMTQ self test (FINA) coil X current: " << negZselfTestDataset.finaCoilXCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y current: " << negZselfTestDataset.finaCoilYCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z current: " << negZselfTestDataset.finaCoilZCurrent - << " mA" << std::endl; - sif::info << "IMTQ self test (FINA) coil X temperature: " - << negZselfTestDataset.finaCoilXTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Y temperature: " - << negZselfTestDataset.finaCoilYTemperature << " °C" << std::endl; - sif::info << "IMTQ self test (FINA) coil Z temperature: " - << negZselfTestDataset.finaCoilZTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) err: " + << static_cast(negZselfTestDataset.finaErr.value) << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field X: " << negZselfTestDataset.finaRawMagX + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Y: " << negZselfTestDataset.finaRawMagY + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) raw magnetic field Z: " << negZselfTestDataset.finaRawMagZ + << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field X: " + << negZselfTestDataset.finaCalMagX << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Y: " + << negZselfTestDataset.finaCalMagY << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) calibrated magnetic field Z: " + << negZselfTestDataset.finaCalMagZ << " nT" << std::endl; + sif::info << "IMTQ self test (FINA) coil X current: " << negZselfTestDataset.finaCoilXCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y current: " << negZselfTestDataset.finaCoilYCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z current: " << negZselfTestDataset.finaCoilZCurrent + << " mA" << std::endl; + sif::info << "IMTQ self test (FINA) coil X temperature: " + << negZselfTestDataset.finaCoilXTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Y temperature: " + << negZselfTestDataset.finaCoilYTemperature << " °C" << std::endl; + sif::info << "IMTQ self test (FINA) coil Z temperature: " + << negZselfTestDataset.finaCoilZTemperature << " °C" << std::endl; #endif + } } +void IMTQHandler::setDebugMode(bool enable) { this->debugMode = enable; } + void IMTQHandler::checkErrorByte(const uint8_t errorByte, const uint8_t step) { std::string stepString(""); if (step < 8) { diff --git a/mission/devices/IMTQHandler.h b/mission/devices/IMTQHandler.h index 8a5695cd..03c044cb 100644 --- a/mission/devices/IMTQHandler.h +++ b/mission/devices/IMTQHandler.h @@ -21,6 +21,8 @@ class IMTQHandler : public DeviceHandlerBase { */ void setToGoToNormal(bool enable); + void setDebugMode(bool enable); + protected: void doStartUp() override; void doShutDown() override; @@ -99,6 +101,7 @@ class IMTQHandler : public DeviceHandlerBase { uint8_t commandBuffer[IMTQ::MAX_COMMAND_SIZE]; bool goToNormalMode = false; + bool debugMode = false; enum class CommunicationStep { GET_ENG_HK_DATA, diff --git a/mission/devices/Max31865PT1000Handler.cpp b/mission/devices/Max31865PT1000Handler.cpp index 3bb3e911..580c8637 100644 --- a/mission/devices/Max31865PT1000Handler.cpp +++ b/mission/devices/Max31865PT1000Handler.cpp @@ -399,20 +399,21 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id, // calculate approximation float approxTemp = adcCode / 32.0 - 256.0; -#if OBSW_DEBUG_RTD == 1 + if (debugMode) { #if OBSW_VERBOSE_LEVEL >= 1 - if (debugDivider->checkAndIncrement()) { + if (debugDivider->checkAndIncrement()) { #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::info << "Max31865: ObjID " << std::hex << this->getObjectId() << " | RTD " << std::dec - << static_cast(deviceIdx) << ": R[Ohm] " << rtdValue - << " Ohms | Approx T[C]: " << approxTemp << std::endl; + sif::info << "Max31865: ObjID " << std::hex << this->getObjectId() << " | RTD " + << std::dec << static_cast(deviceIdx) << ": R[Ohm] " << rtdValue + << " Ohms | Approx T[C]: " << approxTemp << std::endl; #else - sif::printInfo("Max31685: Measured resistance is %f Ohms\n", rtdValue); - sif::printInfo("Approximated temperature is %f C\n", approxTemp); + sif::printInfo("Max31685: Measured resistance is %f Ohms\n", rtdValue); + sif::printInfo("Approximated temperature is %f C\n", approxTemp); +#endif + } #endif } -#endif -#endif + PoolReadGuard pg(&sensorDataset); if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) { // Configuration error @@ -530,3 +531,5 @@ void Max31865PT1000Handler::modeChanged() { } void Max31865PT1000Handler::setDeviceIdx(uint8_t idx) { deviceIdx = idx; } + +void Max31865PT1000Handler::setDebugMode(bool enable) { this->debugMode = enable; } diff --git a/mission/devices/Max31865PT1000Handler.h b/mission/devices/Max31865PT1000Handler.h index 17657bcf..4f617b9d 100644 --- a/mission/devices/Max31865PT1000Handler.h +++ b/mission/devices/Max31865PT1000Handler.h @@ -33,6 +33,8 @@ class Max31865PT1000Handler : public DeviceHandlerBase { Max31865PT1000Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie); virtual ~Max31865PT1000Handler(); + void setDebugMode(bool enable); + // Configuration in 8 digit code: // 1. 1 for V_BIAS enabled, 0 for disabled // 2. 1 for Auto-conversion, 0 for off @@ -85,6 +87,7 @@ class Max31865PT1000Handler : public DeviceHandlerBase { private: uint8_t switchId = 0; bool instantNormal = false; + bool debugMode = false; bool warningSwitch = true; enum class InternalState { diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 83275e37..8436044e 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -24,50 +24,6 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t * * P60DockHandler itself. */ handleDeviceTM(&coreHk, id, true); - -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_P60DOCK == 1 - p60dockHkTableDataset.read(); - sif::info << "P60 Dock: ACU VCC switch: " - << static_cast(p60dockHkTableDataset.outputEnableStateAcuVcc.value) - << std::endl; - sif::info << "P60 Dock: PDU1 VCC switch: " - << static_cast(p60dockHkTableDataset.outputEnableStatePdu1Vcc.value) - << std::endl; - sif::info << "P60 Dock: PDU2 VCC switch: " - << static_cast(p60dockHkTableDataset.outputEnableStatePdu2Vcc.value) - << std::endl; - sif::info << "P60 Dock: ACU VBAT switch: " - << static_cast(p60dockHkTableDataset.outputEnableStateAcuVbat.value) - << std::endl; - sif::info << "P60 Dock: PDU1 VBAT switch: " - << static_cast(p60dockHkTableDataset.outputEnableStatePdu1Vbat.value) - << std::endl; - sif::info << "P60 Dock: PDU2 VBAT switch: " - << static_cast(p60dockHkTableDataset.outputEnableStatePdu2Vbat.value) - << std::endl; - sif::info << "P60 Dock: Stack VBAT switch: " - << static_cast(p60dockHkTableDataset.outputEnableStateStackVbat.value) - << std::endl; - sif::info << "P60 Dock: Stack 3V3 switch: " - << static_cast(p60dockHkTableDataset.outputEnableStateStack3V3.value) - << std::endl; - sif::info << "P60 Dock: Stack 5V switch: " - << static_cast(p60dockHkTableDataset.outputEnableStateStack5V.value) - << std::endl; - - float temperatureC = p60dockHkTableDataset.temperature1.value * 0.1; - sif::info << "P60 Dock: Temperature 1: " << temperatureC << " °C" << std::endl; - temperatureC = p60dockHkTableDataset.temperature2.value * 0.1; - sif::info << "P60 Dock: Temperature 2: " << temperatureC << " °C" << std::endl; - sif::info << "P60 Dock: Watchdog Timer seconds left before reboot: " - << p60dockHkTableDataset.wdtGndLeft << " seconds" << std::endl; - sif::info << "P60 Dock: CSP 1, pings left before reboot: " - << (int)p60dockHkTableDataset.wdtCspLeft1.value << std::endl; - sif::info << "P60 Dock: CSP 2, pings left before reboot: " - << (int)p60dockHkTableDataset.wdtCspLeft1.value << std::endl; - - p60dockHkTableDataset.commit(); -#endif } void P60DockHandler::parseHkTableReply(const uint8_t *packet) { @@ -362,3 +318,5 @@ void P60DockHandler::printHkTableLatchups() { genericPrintoutHandler("X3 VBAT", hk::X3_IDLE_VBAT); genericPrintoutHandler("X3 VCC", hk::X3_IDLE_VCC); } + +void P60DockHandler::setDebugMode(bool enable) { this->debugMode = enable; } diff --git a/mission/devices/P60DockHandler.h b/mission/devices/P60DockHandler.h index d08a46e0..3834bb6b 100644 --- a/mission/devices/P60DockHandler.h +++ b/mission/devices/P60DockHandler.h @@ -24,6 +24,8 @@ class P60DockHandler : public GomspaceDeviceHandler { P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); virtual ~P60DockHandler(); + void setDebugMode(bool enable); + virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; @@ -50,6 +52,7 @@ class P60DockHandler : public GomspaceDeviceHandler { P60Dock::CoreHkSet coreHk; P60Dock::HkTableDataset auxHk; bool firstHk = true; + bool debugMode = false; static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16; PoolEntry hkCurrents = PoolEntry(P60Dock::hk::CHNLS_LEN); diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index a13b7ba6..28ce0772 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -2,7 +2,9 @@ #include -#ifdef FSFW_OSAL_LINUX +#include "OBSWConfig.h" + +#ifdef XIPHOS_Q7S #include #include #include @@ -663,7 +665,7 @@ ReturnValue_t PayloadPcduHandler::handleDoubleParamUpdate(std::string key, return params.writeJsonFile(); } -#ifdef FSFW_OSAL_LINUX +#ifdef XIPHOS_Q7S ReturnValue_t PayloadPcduHandler::extConvAsTwoCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData, size_t sendLen, void* args) { diff --git a/mission/devices/PayloadPcduHandler.h b/mission/devices/PayloadPcduHandler.h index dba5b4ef..6a9334ca 100644 --- a/mission/devices/PayloadPcduHandler.h +++ b/mission/devices/PayloadPcduHandler.h @@ -68,10 +68,9 @@ class PayloadPcduHandler : public DeviceHandlerBase { void setToGoToNormalModeImmediately(bool enable); void enablePeriodicPrintout(bool enable, uint8_t divider); +#ifdef XIPHOS_Q7S static ReturnValue_t extConvAsTwoCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData, size_t sendLen, void* args); - -#ifdef FSFW_OSAL_LINUX static ReturnValue_t transferAsTwo(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData, size_t sendLen, bool tempOnly); #endif diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index 99cd341c..9ceeab79 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -341,12 +341,15 @@ void RwHandler::handleResetStatusReply(const uint8_t* packet) { lastResetStatusSet.lastResetStatus = resetStatus; } lastResetStatusSet.currentResetStatus = resetStatus; -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 - sif::info << "RwHandler::handleResetStatusReply: Last reset status: " - << static_cast(lastResetStatusSet.lastResetStatus.value) << std::endl; - sif::info << "RwHandler::handleResetStatusReply: Current reset status: " - << static_cast(lastResetStatusSet.currentResetStatus.value) << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "RwHandler::handleResetStatusReply: Last reset status: " + << static_cast(lastResetStatusSet.lastResetStatus.value) << std::endl; + sif::info << "RwHandler::handleResetStatusReply: Current reset status: " + << static_cast(lastResetStatusSet.currentResetStatus.value) + << std::endl; #endif + } } void RwHandler::handleGetRwStatusReply(const uint8_t* packet) { @@ -371,16 +374,18 @@ void RwHandler::handleGetRwStatusReply(const uint8_t* packet) { sif::error << "RwHandler::handleGetRwStatusReply: Reaction wheel in error state" << std::endl; } -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 - sif::info << "RwHandler::handleGetRwStatusReply: Current speed is: " << statusSet.currSpeed - << " * 0.1 RPM" << std::endl; - sif::info << "RwHandler::handleGetRwStatusReply: Reference speed is: " << statusSet.referenceSpeed - << " * 0.1 RPM" << std::endl; - sif::info << "RwHandler::handleGetRwStatusReply: State is: " - << (unsigned int)statusSet.state.value << std::endl; - sif::info << "RwHandler::handleGetRwStatusReply: clc mode is: " - << (unsigned int)statusSet.clcMode.value << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "RwHandler::handleGetRwStatusReply: Current speed is: " << statusSet.currSpeed + << " * 0.1 RPM" << std::endl; + sif::info << "RwHandler::handleGetRwStatusReply: Reference speed is: " + << statusSet.referenceSpeed << " * 0.1 RPM" << std::endl; + sif::info << "RwHandler::handleGetRwStatusReply: State is: " + << (unsigned int)statusSet.state.value << std::endl; + sif::info << "RwHandler::handleGetRwStatusReply: clc mode is: " + << (unsigned int)statusSet.clcMode.value << std::endl; #endif + } } void RwHandler::handleTemperatureReply(const uint8_t* packet) { @@ -388,10 +393,12 @@ void RwHandler::handleTemperatureReply(const uint8_t* packet) { uint8_t offset = 2; temperatureSet.temperatureCelcius = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 - sif::info << "RwHandler::handleTemperatureReply: Temperature: " - << temperatureSet.temperatureCelcius << " °C" << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "RwHandler::handleTemperatureReply: Temperature: " + << temperatureSet.temperatureCelcius << " °C" << std::endl; #endif + } } void RwHandler::handleGetTelemetryReply(const uint8_t* packet) { @@ -468,53 +475,57 @@ void RwHandler::handleGetTelemetryReply(const uint8_t* packet) { offset += 4; tmDataset.spiTotalNumOfErrors = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | *(packet + offset + 1) << 8 | *(packet + offset); -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 - sif::info << "RwHandler::handleGetTelemetryReply: Last reset status: " - << static_cast(tmDataset.lastResetStatus.value) << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: MCU temperature: " << tmDataset.mcuTemperature - << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: Pressure sensor temperature: " - << tmDataset.pressureSensorTemperature << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: Pressure " << tmDataset.pressure << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: State: " - << static_cast(tmDataset.rwState.value) << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: CLC mode: " - << static_cast(tmDataset.rwClcMode.value) << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: Current speed: " << tmDataset.rwCurrSpeed - << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: Reference speed: " << tmDataset.rwRefSpeed - << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid CRC packets: " - << tmDataset.numOfInvalidCrcPackets << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid length packets: " - << tmDataset.numOfInvalidLenPackets << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid command packets: " - << tmDataset.numOfInvalidCmdPackets << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: Number of command executed replies: " - << tmDataset.numOfCmdExecutedReplies << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: Number of command replies: " - << tmDataset.numOfCmdReplies << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: UART number of bytes written: " - << tmDataset.uartNumOfBytesWritten << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: UART number of bytes read: " - << tmDataset.uartNumOfBytesRead << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: UART number of parity errors: " - << tmDataset.uartNumOfParityErrors << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: UART number of noise errors: " - << tmDataset.uartNumOfNoiseErrors << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: UART number of frame errors: " - << tmDataset.uartNumOfFrameErrors << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: UART number of register overrun errors: " - << tmDataset.uartNumOfRegisterOverrunErrors << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: UART number of total errors: " - << tmDataset.uartTotalNumOfErrors << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: SPI number of bytes written: " - << tmDataset.spiNumOfBytesWritten << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: SPI number of bytes read: " - << tmDataset.spiNumOfBytesRead << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: SPI number of register overrun errors: " - << tmDataset.spiNumOfRegisterOverrunErrors << std::endl; - sif::info << "RwHandler::handleGetTelemetryReply: SPI number of register total errors: " - << tmDataset.spiTotalNumOfErrors << std::endl; + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "RwHandler::handleGetTelemetryReply: Last reset status: " + << static_cast(tmDataset.lastResetStatus.value) << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: MCU temperature: " << tmDataset.mcuTemperature + << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: Pressure sensor temperature: " + << tmDataset.pressureSensorTemperature << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: Pressure " << tmDataset.pressure << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: State: " + << static_cast(tmDataset.rwState.value) << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: CLC mode: " + << static_cast(tmDataset.rwClcMode.value) << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: Current speed: " << tmDataset.rwCurrSpeed + << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: Reference speed: " << tmDataset.rwRefSpeed + << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid CRC packets: " + << tmDataset.numOfInvalidCrcPackets << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid length packets: " + << tmDataset.numOfInvalidLenPackets << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid command packets: " + << tmDataset.numOfInvalidCmdPackets << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: Number of command executed replies: " + << tmDataset.numOfCmdExecutedReplies << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: Number of command replies: " + << tmDataset.numOfCmdReplies << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: UART number of bytes written: " + << tmDataset.uartNumOfBytesWritten << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: UART number of bytes read: " + << tmDataset.uartNumOfBytesRead << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: UART number of parity errors: " + << tmDataset.uartNumOfParityErrors << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: UART number of noise errors: " + << tmDataset.uartNumOfNoiseErrors << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: UART number of frame errors: " + << tmDataset.uartNumOfFrameErrors << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: UART number of register overrun errors: " + << tmDataset.uartNumOfRegisterOverrunErrors << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: UART number of total errors: " + << tmDataset.uartTotalNumOfErrors << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: SPI number of bytes written: " + << tmDataset.spiNumOfBytesWritten << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: SPI number of bytes read: " + << tmDataset.spiNumOfBytesRead << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: SPI number of register overrun errors: " + << tmDataset.spiNumOfRegisterOverrunErrors << std::endl; + sif::info << "RwHandler::handleGetTelemetryReply: SPI number of register total errors: " + << tmDataset.spiTotalNumOfErrors << std::endl; #endif + } } + +void RwHandler::setDebugMode(bool enable) { this->debugMode = enable; } diff --git a/mission/devices/RwHandler.h b/mission/devices/RwHandler.h index 31b88e01..425753db 100644 --- a/mission/devices/RwHandler.h +++ b/mission/devices/RwHandler.h @@ -30,6 +30,9 @@ class RwHandler : public DeviceHandlerBase { */ RwHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, LinuxLibgpioIF* gpioComIF, gpioId_t enableGpio); + + void setDebugMode(bool enable); + virtual ~RwHandler(); static const uint8_t INTERFACE_ID = CLASS_ID::RW_HANDLER; @@ -86,6 +89,7 @@ class RwHandler : public DeviceHandlerBase { LinuxLibgpioIF* gpioComIF = nullptr; gpioId_t enableGpio = gpio::NO_GPIO; + bool debugMode = false; RwDefinitions::TemperatureSet temperatureSet; RwDefinitions::StatusSet statusSet; diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 43888724..2cc506dc 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -166,12 +166,12 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic return RETURN_OK; } case (syrlinks::ENABLE_DEBUG): { - debug = true; + debugMode = true; rawPacketLen = 0; return RETURN_OK; } case (syrlinks::DISABLE_DEBUG): { - debug = false; + debugMode = false; rawPacketLen = 0; return RETURN_OK; } @@ -363,7 +363,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons tempBasebandBoard = calcTempVal(rawTempBasebandBoard); temperatureSet.temperatureBasebandBoard = tempBasebandBoard; PoolReadGuard rg(&temperatureSet); - if (debug) { + if (debugMode) { sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" << std::endl; } @@ -394,7 +394,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier); PoolReadGuard rg(&temperatureSet); temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier; - if (debug) { + if (debugMode) { sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" << std::endl; } @@ -540,8 +540,8 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { offset += 6; rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 - if (debug) { + if (debugMode) { +#if OBSW_VERBOSE_LEVEL >= 1 sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value << std::endl; sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl; @@ -551,14 +551,14 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl; sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl; sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl; - } #endif + } } void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) { uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast(packet + offset)); - if (debug) { + if (debugMode) { sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " << static_cast(lclConfig) << std::endl; } @@ -568,24 +568,20 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txStatus = convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_DEBUG_SYRLINKS == 1 - if (debug) { + if (debugMode) { sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value << std::endl; } -#endif } void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_DEBUG_SYRLINKS == 1 - if (debug) { + if (debugMode) { sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value << std::endl; } -#endif } void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { @@ -593,11 +589,9 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txAgcValue = agcValueHighByte << 8 | convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_DEBUG_SYRLINKS == 1 - if (debug) { + if (debugMode) { sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; } -#endif } void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) { @@ -654,3 +648,5 @@ void SyrlinksHkHandler::prepareCommand(std::string command, DeviceCommandId_t co rememberCommandId = commandId; rawPacket = commandBuffer; } + +void SyrlinksHkHandler::setDebugMode(bool enable) { this->debugMode = enable; } diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 78ae6d99..0237e8c3 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -28,6 +28,8 @@ class SyrlinksHkHandler : public DeviceHandlerBase { */ void setModeNormal(); + void setDebugMode(bool enable); + protected: void doStartUp() override; void doShutDown() override; @@ -95,6 +97,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { const power::Switch_t powerSwitch = power::NO_SWITCH; + bool debugMode = false; uint8_t agcValueHighByte = 0; uint16_t rawTempPowerAmplifier = 0; uint16_t rawTempBasebandBoard = 0; @@ -107,8 +110,6 @@ class SyrlinksHkHandler : public DeviceHandlerBase { StartupState startupState = StartupState::OFF; - bool debug = false; - /** * This object is used to store the id of the next command to execute. This controls the * read out of multiple registers which can not be fetched with one single command. diff --git a/thirdparty/etl b/thirdparty/etl deleted file mode 160000 index c308dc42..00000000 --- a/thirdparty/etl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c308dc427b7a34e54f33860fb2e244564b2740b4