From e5d5af68c148c5248bfc7e260fb2550a08c963fd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 21 Apr 2022 09:35:02 +0200 Subject: [PATCH 01/32] Important bugfix and improvement for PCDU Handler - Fixed out of bounds error - Handle multiple messages in queue handler - PCDU Handler now only called once in PST --- fsfw | 2 +- .../pollingSequenceFactory.cpp | 1 - mission/devices/PCDUHandler.cpp | 33 +++++++++++-------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/fsfw b/fsfw index e949368b..cec12c00 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e949368b062e8703c35d2043ece8d7258cd2608b +Subproject commit cec12c007336441ea0f5ce912c181c3f14e574ca diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 0f9232e0..942404d3 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -514,7 +514,6 @@ ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) { #if Q7S_EM != 1 // PCDU handlers receives two messages and both must be handled thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::P60DOCK_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::PDU1_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index bc302bac..10d12cf8 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -81,27 +81,34 @@ ReturnValue_t PCDUHandler::initialize() { void PCDUHandler::initializeSwitchStates() { using namespace pcdu; - for (uint8_t idx = 0; idx < NUMBER_OF_SWITCHES; idx++) { - if (idx < PDU::CHANNELS_LEN) { - switchStates[idx] = INIT_SWITCHES_PDU1[idx]; - } else { - switchStates[idx] = INIT_SWITCHES_PDU2[idx]; + try { + for (uint8_t idx = 0; idx < NUMBER_OF_SWITCHES; idx++) { + if (idx < PDU::CHANNELS_LEN) { + switchStates[idx] = INIT_SWITCHES_PDU1.at(idx); + } else { + switchStates[idx] = INIT_SWITCHES_PDU2.at(idx - PDU::CHANNELS_LEN); + } } + } catch (const std::out_of_range& err) { + sif::error << "PCDUHandler::initializeSwitchStates: " << err.what() << std::endl; } } void PCDUHandler::readCommandQueue() { - ReturnValue_t result; + ReturnValue_t result = RETURN_OK; CommandMessage command; - result = commandQueue->receiveMessage(&command); - if (result != RETURN_OK) { - return; - } + for (result = commandQueue->receiveMessage(&command); result == RETURN_OK; + result = commandQueue->receiveMessage(&command)) { + result = commandQueue->receiveMessage(&command); + if (result != RETURN_OK) { + return; + } - result = poolManager.handleHousekeepingMessage(&command); - if (result == RETURN_OK) { - return; + result = poolManager.handleHousekeepingMessage(&command); + if (result == RETURN_OK) { + return; + } } } From 6b08659a690a8e9f50d5318ed72e072d0ddf8555 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 21 Apr 2022 11:50:47 +0200 Subject: [PATCH 02/32] disable -Wformat-truncation error --- thirdparty/libcsp/src/csp_iflist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/thirdparty/libcsp/src/csp_iflist.c b/thirdparty/libcsp/src/csp_iflist.c index 2bfef422..b17dca44 100644 --- a/thirdparty/libcsp/src/csp_iflist.c +++ b/thirdparty/libcsp/src/csp_iflist.c @@ -77,7 +77,10 @@ static int csp_bytesize(char *buf, int len, unsigned long int n) { postfix = 'B'; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-truncation" return snprintf(buf, len, "%.1f%c", size, postfix); +#pragma GCC diagnostic pop } void csp_iflist_print(void) { From c4b1703b8e718f886b5becccdc63a9a6ad4b2ce9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 10:48:31 +0200 Subject: [PATCH 03/32] update README --- README.md | 72 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 7f9e9d72..b83e9498 100644 --- a/README.md +++ b/README.md @@ -39,12 +39,14 @@ Target systems: the [Xiphos Traq Platform](https://trac2.xiphos.ca/eive-q7). Press on index to find all relevant pages. The most recent datasheet can be found [here](https://trac2.xiphos.ca/manual/wiki/Q7RevB/UserManual). - * Linux OS built with Yocto 2.5 + * Linux OS built with Yocto 2.5. SDK and root filesystem can be rebuilt with + [yocto](https://egit.irs.uni-stuttgart.de/eive/q7s-yocto) * [Linux Kernel](https://github.com/XiphosSystemsCorp/linux-xlnx.git) . EIVE version can be found [here](https://github.com/spacefisch/linux-xlnx) . Pre-compiled files can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/q7s-linux-components&fileid=777299). * Q7S base project can be found [here](https://egit.irs.uni-stuttgart.de/eive/q7s-base) - * Minimal base project files can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/xiphos-q7s-sdk&fileid=510908) + * Minimal base project files and Xiphos SDK can be found + [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/xiphos-q7s-sdk&fileid=510908) * Host System * Generic software components which are not dependant on hardware can also be run on a host system. All host code is contained in the `bsp_hosted` folder @@ -55,7 +57,8 @@ Target systems: The steps in the primary README are related to the main OBC target Q7S. The CMake build system can be used to generate build systems as well (see helper scripts in `cmake/scripts`: -- Linux (Raspberry Pi): See special section below. +- Linux Raspberry Pi: See special section below. Uses the `bsp_linux_board` folder +- Linux Trenz TE7020_1CFA: Uses the `bsp_te0720_1cfa` folder - Linux Host: Uses the `bsp_hosted` BSP folder and the CMake Unix Makefiles generator. - Windows Host: Uses the `bsp_hosted` BSP folder, the CMake MinGW Makefiles generator and MSYS2. @@ -68,7 +71,7 @@ prerequisites. 1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or as a [separate download](#arm-toolchain) -2. [Q7S sysroot](#q7s-sysroot) on local development machine +2. [Q7S sysroot](#sysroot) on local development machine 3. Recommended: Eclipse or [Vivado 2018.2 SDK](#vivado) for OBSW development 3. [TCF agent](https://wiki.eclipse.org/TCF) running on Q7S @@ -96,11 +99,9 @@ When using Windows, run theses steps in MSYS2. git submodule update ``` -3. Ensure that the cross-compiler is working with `arm-linux-gnueabihf-gcc --version`. - It is recommended to set up a shell script which takes care of setting up the environment - for convenience or to set up the - [PATH and the CROSS_COMPILE variable permanently](https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path) - in the `.profile` file. +3. Ensure that the cross-compiler is working with `arm-linux-gnueabihf-gcc --version` and that + the sysroot environmental variables have been set like specified in the + [root filesystem chapter](#sysroot). 4. Run the CMake configuration to create the build system in a `build-Debug-Q7S` folder. Add `-G "MinGW Makefiles` in MinGW64 on Windows. @@ -261,7 +262,7 @@ Other useful tmux commands: You can use the following command to connect to the Q7S with `ssh`: ```sh -q7s_ssh +q7s-fm-ssh ``` ## Port forwarding for connection to TCF agent @@ -310,6 +311,25 @@ There is also a shell script called `q7s-port.sh` which can be used to achieve t # Setting up prerequisites +## Getting system root for Linux cross-compilation + +Cross-compiling any program for an embedded Linux board generally required parts of the target root +file system on the development/host computer. For the Q7S, you can install the cross-compilation +root file system by simply installing the SDK. You can find the most recent SDK +[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/xiphos-q7s-sdk). + +If you are compiling for the Q7S or the TE7020, the `ZYNQ_7020_SYSROOT` environment variable +must be set to the location of the SDK compile sysroot. Here is an example on how to do this +in Ubuntu, assuming the SDK was installed in the default location + +```sh +export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi" +``` + +If you are comiling for the Raspberry Pi, you have to set the `LINUX_ROOTFS` environmental +variable instead. You can find a base root filesystem for the Raspberry Pi +[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs). + ## Installing Vivado the the Xilinx development tools It's also possible to perform debugging with a normal Eclipse installation by installing @@ -348,7 +368,9 @@ twice) and generate this list manually with the following commands, according to sudo apt install libncurses5 ``` -2. ```sh +2. Execute the following command + + ```sh sudo /Vivado/2018.2/bin/vivado -nolog -nojournal -mode batch -source /.xinstall/Vivado_2018.2/scripts/xlpartinfo.tcl -tclargs /Vivado/2018.2/data/parts/installed_devices.txt @@ -422,21 +444,6 @@ You can download the toolchains for Windows and Linux ```sh sudo apt-get install cmake ```` - -## Getting the Q7S system root - -It is necessary to copy the Q7S system root to your local development machine for libraries -like `libgpio`. You can find the system root for the Q7S, the Raspberry Pi and the -Beagle Bone Black for download here -[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs&fileid=831849). -Download it and unzip it somewhere in the Xilinx installation folder. -You can use the following command if `wget` can be used or for CI/CD: - -```sh -wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/SyXpdBBQX32xPgE/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz -``` - -Then, create a new environmental variables `Q7S_SYSROOT` and set it to the local system root path. ### Updating system root for CI @@ -727,7 +734,10 @@ More detailed information about the used q7s commands can be found in the Q7S us # Q7S OBC -## Launching an application at start-up +## Launching an application at start-up - deprecated + +This way to enable auto-startup is deprecated. It is instead recommended to tweak the yocto +recipes file for the related `systemd` service to enable auto-startup with `SYSTEMD_AUTO_ENABLE`. You can also do the steps performed here on a host computer inside the `q7s-rootfs` directory of the [Q7S base repository](https://egit.irs.uni-stuttgart.de/eive/q7s-base). This might @@ -829,10 +839,9 @@ If a timeout occurs, this special file will be deleted as well. The watchdog and its configuration will be directly integrated into this repostory, which makes adaptions easy. -### `tcfagent` +### `tcf-agent` -This starts the `/usr/bin/agent` program to allows remote debugging. Might not be part of -the mission code +This starts the `/usr/bin/tcf-agent` program to allows remote debugging ### `eive-early-config` @@ -1196,8 +1205,11 @@ Alternatively, changes from other upstreams (forks) and branches can be merged l in the same way. # Coding Style + * the formatting is based on the clang-format tools + ## Setting up eclipse auto-fromatter with clang-format + 1. Help → Install New Software → Add 2. In location insert the link http://www.cppstyle.com/luna 3. The software package CppStyle should now be available for installation From d1814f9a496d87b95313aeb445e298e1d180039d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 10:50:40 +0200 Subject: [PATCH 04/32] submodule update --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 613dbe95..befaca78 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 613dbe9592c30d9acf4cdb95d81d9f216f07374b +Subproject commit befaca78c660f232c312667202f2bbd5da95c235 diff --git a/tmtc b/tmtc index 45470f8c..28983d38 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 45470f8c05ef214eb41940878ef0bfabf36a4891 +Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 From 1485b14c7d7fe85286068fb84c57a5def1faeda0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 10:55:52 +0200 Subject: [PATCH 05/32] some more README updates --- README.md | 55 ++++++++++++++++--------------------------------------- 1 file changed, 16 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index b83e9498..32670771 100644 --- a/README.md +++ b/README.md @@ -231,18 +231,19 @@ A serial console session is up permanently in a `tmux` session ### Serial console -You can check whether the sessions exist with `tmux ls` +You can check whether the sessions exist with `tmux ls`. +This is the command to connect to the serial interface of the FM using the +RS422 interface of the flight preparation panel: ```sh -tmux a -t q7s-serial +tmux a -t q7s-fm-fpp ``` If the session does not exist, you can create it like this ```sh -tmux new -s q7s-serial -/bin/bash -q7s_serial +tmux new -s q7s-fm-fpp -t /bin/bash +launch-q7s-fpp ``` Other useful tmux commands: @@ -265,46 +266,22 @@ You can use the following command to connect to the Q7S with `ssh`: q7s-fm-ssh ``` -## Port forwarding for connection to TCF agent - -This is a required step to connect to the `tcf-agent` on the Q7S, which is required for convenient -remote debugging. Assuming the IPv6 - -```sh -ssh -L 1534:192.168.133.10:1534 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 -t /bin/bash -``` - -You then need to connect to `localhost` with port `1534`. - -## Port forwarding for file transfers with `scp` - -```sh -ssh -L 1535:192.168.133.10:22 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 -t /bin/bash -``` - -You then need to run `scp` with the `-P 1535` flag with `localhost` as the target IP address. - -## Port forwarding for TMTC commanding - -You can enable port forwarding for TMTC commanding with the following command: - -```sh -ssh -L 1536:192.168.133.10:7301 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 -t /bin/bash -``` - -This forwards TMTC packets on port `1536` of localhost to the TMTC reception port of the Q7S. - ## Set up all port forwarding at once +Port forwarding is necessary for remote-debugging using the `tcf-agent`, copying files +with `scp` & `q7s-cp.py` and sending TMTC commands. You can specify the `-L` option multiple times to set up all port forwarding at once. -Example for using the UDP communication interface: ```sh -ssh -L 1534:192.168.133.10:1534 \ - -L 1535:192.168.133.10:22 \ - -L 1536:192.168.133.10:7301 \ +ssh -L 1534:192.168.155.55:1534 \ + -L 1535:192.168.155.55:22 \ + -L 1536:192.168.155.55:7301 \ + -L 1537:127.0.0.1:7100 \ + -L 1538:192.168.133.10:1534 \ + -L 1539:192.168.133.10:22 \ + -L 1540:192.168.133.10:7301 \ eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 \ - -t 'export CONSOLE_PREFIX="[Q7S Tunnel] /bin/bash' + -t 'CONSOLE_PREFIX="[Q7S Tunnel]" /bin/bash' ``` There is also a shell script called `q7s-port.sh` which can be used to achieve the same. From 4a5ea4450f75b0d9975d9017f3a241185ac0227e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 10:59:43 +0200 Subject: [PATCH 06/32] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17d29e7b..7982b2ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ list yields a list of all related PRs for each release. ## Changed +- PCDU handler only called once in PST, but can handle multiple messages now - Update rootfs base of Linux, all related OBSW changes - Use gpsd version 3.17 now. Includes API changes - Add `/usr/local/bin` to PATH. All shell scripts are there now From 0da74f1bf9eb0ac69707d5099bf783ad72f4b309 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 11:08:27 +0200 Subject: [PATCH 07/32] bump submodules, add some more devices by default --- fsfw | 2 +- linux/fsfwconfig/OBSWConfig.h.in | 4 ++-- tmtc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fsfw b/fsfw index 613dbe95..befaca78 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 613dbe9592c30d9acf4cdb95d81d9f216f07374b +Subproject commit befaca78c660f232c312667202f2bbd5da95c235 diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 55e6e8c5..a18d3b93 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -49,10 +49,10 @@ debugging. */ #define OBSW_ADD_ACS_HANDLERS 1 #define OBSW_ADD_RW 0 #define OBSW_ADD_RTD_DEVICES 1 -#define OBSW_ADD_TMP_DEVICES 0 +#define OBSW_ADD_TMP_DEVICES 1 #define OBSW_ADD_RAD_SENSORS 1 #define OBSW_ADD_PL_PCDU 1 -#define OBSW_ADD_SYRLINKS 0 +#define OBSW_ADD_SYRLINKS 1 #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 #define OBSW_STAR_TRACKER_GROUND_CONFIG 1 diff --git a/tmtc b/tmtc index 45470f8c..28983d38 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 45470f8c05ef214eb41940878ef0bfabf36a4891 +Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 From 737d18135fb853cc074da3195776a1625a73b20e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 11:09:06 +0200 Subject: [PATCH 08/32] test flag for RW --- linux/fsfwconfig/OBSWConfig.h.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index a18d3b93..4d26f463 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -129,6 +129,8 @@ debugging. */ #define OBSW_DEBUG_BPX_BATT 0 #define OBSW_TEST_IMTQ 0 #define OBSW_DEBUG_IMTQ 0 +#define OBSW_TEST_RW 0 +#define OBSW_DEBUG_RW 0 #define OBSW_TEST_LIBGPIOD 0 #define OBSW_TEST_PLOC_HANDLER 0 @@ -145,7 +147,7 @@ debugging. */ #define OBSW_DEBUG_GPS 0 #define OBSW_DEBUG_ACU 0 #define OBSW_DEBUG_SYRLINKS 0 -#define OBSW_DEBUG_RW 0 + #define OBSW_DEBUG_PDEC_HANDLER 0 #ifdef TE0720_1CFA From aa84175382fe3583e33e3cacf4ffd762460dc5e9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 11:29:19 +0200 Subject: [PATCH 09/32] pass power switcher for syrlinks handler creation --- bsp_q7s/core/ObjectFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index ecc88ede..d830fa77 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -152,7 +152,7 @@ void ObjectFactory::produce(void* args) { createSolarArrayDeploymentComponents(); createPlPcduComponents(gpioComIF, spiComIF, pwrSwitcher); #if OBSW_ADD_SYRLINKS == 1 - createSyrlinksComponents(); + createSyrlinksComponents(pwrSwitcher); #endif /* OBSW_ADD_SYRLINKS == 1 */ createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher); createPayloadComponents(gpioComIF); From baf2e5fb39274b6ec8df77c85b19953c8d215100 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 23 Apr 2022 12:29:29 +0200 Subject: [PATCH 10/32] submodule updates --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 24ef96d1..280b641c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 24ef96d1b802e768d395f94b69f9f81a3c6d1e66 +Subproject commit 280b641cbc621d0c00c89851aaffbb64d5e5f40b diff --git a/tmtc b/tmtc index 28983d38..b1aaef90 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 +Subproject commit b1aaef90c72874f501c6524ec967827f17e8cedf From 9ac5d0da6770e158a586aeb7f3973a951755b4a6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 23 Apr 2022 12:30:20 +0200 Subject: [PATCH 11/32] submodule updates --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 24ef96d1..280b641c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 24ef96d1b802e768d395f94b69f9f81a3c6d1e66 +Subproject commit 280b641cbc621d0c00c89851aaffbb64d5e5f40b diff --git a/tmtc b/tmtc index 28983d38..b1aaef90 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 +Subproject commit b1aaef90c72874f501c6524ec967827f17e8cedf From ba2589c8d52200398886312bec6c12428769273c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 23 Apr 2022 12:30:49 +0200 Subject: [PATCH 12/32] submodule updates --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 24ef96d1..280b641c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 24ef96d1b802e768d395f94b69f9f81a3c6d1e66 +Subproject commit 280b641cbc621d0c00c89851aaffbb64d5e5f40b diff --git a/tmtc b/tmtc index 28983d38..b1aaef90 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 +Subproject commit b1aaef90c72874f501c6524ec967827f17e8cedf From 2b33d8772c94a5d8bf12fdbff646ef5ba29f6f78 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 26 Apr 2022 10:37:25 +0200 Subject: [PATCH 13/32] fixes most warnings for host build --- CMakeLists.txt | 5 +- bsp_hosted/fsfwconfig/OBSWConfig.h.in | 12 +- bsp_hosted/main.cpp | 8 +- bsp_q7s/core/ObjectFactory.cpp | 28 +- common/config/commonConfig.h.in | 10 +- fsfw | 2 +- linux/ObjectFactory.cpp | 3 + linux/fsfwconfig/OBSWConfig.h.in | 6 +- mission/core/GenericFactory.cpp | 4 +- mission/devices/ACUHandler.cpp | 30 +- mission/devices/ACUHandler.h | 3 + mission/devices/BpxBatteryHandler.cpp | 28 +- mission/devices/BpxBatteryHandler.h | 2 + mission/devices/IMTQHandler.cpp | 1025 +++++++++++---------- mission/devices/IMTQHandler.h | 3 + mission/devices/Max31865PT1000Handler.cpp | 21 +- mission/devices/Max31865PT1000Handler.h | 3 + mission/devices/P60DockHandler.cpp | 46 +- mission/devices/P60DockHandler.h | 3 + mission/devices/PayloadPcduHandler.cpp | 6 +- mission/devices/PayloadPcduHandler.h | 3 +- mission/devices/RwHandler.cpp | 141 +-- mission/devices/RwHandler.h | 4 + mission/devices/SyrlinksHkHandler.cpp | 30 +- mission/devices/SyrlinksHkHandler.h | 5 +- tmtc | 2 +- 26 files changed, 741 insertions(+), 692 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9291e0db..529bffbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ For Linux Board Target BSPs, a default toolchain file will be set. Should be set 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) @@ -39,6 +39,9 @@ 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() # Perform steps like loading toolchain files where applicable. 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 ecc88ede..0bdbd12e 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/fsfw b/fsfw index 24ef96d1..1739edd9 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 24ef96d1b802e768d395f94b69f9f81a3c6d1e66 +Subproject commit 1739edd9b07933ddbdfcbfd19cf98146815ebe3f 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 55e6e8c5..d7ad4c8b 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 @@ -185,7 +181,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/tmtc b/tmtc index 28983d38..b1aaef90 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 +Subproject commit b1aaef90c72874f501c6524ec967827f17e8cedf From 49b3120adad98dec50ce239f41e5d38687d4773f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 26 Apr 2022 11:15:35 +0200 Subject: [PATCH 14/32] remove etl submodule , want to use the one provided by the fsfw --- .gitmodules | 3 --- CMakeLists.txt | 2 +- fsfw | 2 +- thirdparty/etl | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) delete mode 160000 thirdparty/etl 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 529bffbb..18a16e72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -307,7 +307,7 @@ add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL) if(EIVE_ADD_ETL_LIB) - add_subdirectory(${LIB_ETL_PATH}) + # add_subdirectory(${LIB_ETL_PATH}) endif() if(EIVE_ADD_JSON_LIB) diff --git a/fsfw b/fsfw index 1739edd9..3d047f96 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 1739edd9b07933ddbdfcbfd19cf98146815ebe3f +Subproject commit 3d047f9629c3a6fe25514f92dd008bd34d0784dd 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 From 00bbc86d3976d717e3a2b6172f8b8ae02d4978dc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 26 Apr 2022 20:10:09 +0200 Subject: [PATCH 15/32] update CMakeLists.txt file --- CMakeLists.txt | 114 +++++++++++++++++++++++-------------------------- fsfw | 2 +- 2 files changed, 55 insertions(+), 61 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18a16e72..49647a11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,23 +10,23 @@ 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") - -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) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +# Perform steps like loading toolchain files where applicable. +include(PreProjectConfig) +pre_project_config() -set(OBSW_ADD_STAR_TRACKER 0) -set(OBSW_DEBUG_STARTRACKER 0) +# Project Name +project(eive-obsw) + +set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0) +set(OBSW_VERSION_MINOR_IF_GIT_FAILS 0) +set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) if(NOT FSFW_OSAL) set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") @@ -44,10 +44,21 @@ else() option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" OFF) endif() -# Perform steps like loading toolchain files where applicable. -include(PreProjectConfig) include(EiveHelpers) -pre_project_config() + +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 +################################################################################ + +# Specify the C++ standard +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) # Version handling set(GIT_VER_HANDLING_OK FALSE) @@ -80,20 +91,27 @@ 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) +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) -# Project Name -project(eive-obsw) + FetchContent_Declare( + Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG ${FSFW_CATCH2_LIB_VERSION} + ) -################################################################################ -# Pre-Sources preparation -################################################################################ - -# Specify the C++ standard -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED True) + 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() # Set names and variables set(OBSW_NAME ${CMAKE_PROJECT_NAME}) @@ -253,30 +271,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) @@ -301,20 +297,15 @@ target_include_directories(${WATCHDOG_NAME} PUBLIC ${CMAKE_BINARY_DIR} ) -#unittests +# unittests add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL) - - if(EIVE_ADD_ETL_LIB) - # add_subdirectory(${LIB_ETL_PATH}) endif() if(EIVE_ADD_JSON_LIB) add_subdirectory(${LIB_JSON_PATH}) endif() - - if(EIVE_ADD_LINUX_FILES) add_subdirectory(${LIB_ARCSEC_PATH}) @@ -325,26 +316,29 @@ 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) ################################################################################ # Post-Sources preparation ################################################################################ - - # Add libraries target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_FSFW_NAME} @@ -383,7 +377,7 @@ endif() if(EIVE_ADD_ETL_LIB) target_link_libraries(${LIB_EIVE_MISSION} PUBLIC - ${LIB_ETL_NAME} + etl ) endif() diff --git a/fsfw b/fsfw index 3d047f96..c1be1fe2 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 3d047f9629c3a6fe25514f92dd008bd34d0784dd +Subproject commit c1be1fe2320eed167e808eecf3e582c87b688cde From b3f0d19bb91721cb8e5b1cd3b738abc3e2b8eb23 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 26 Apr 2022 20:20:56 +0200 Subject: [PATCH 16/32] CMakeLists.txt order fixes --- CMakeLists.txt | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49647a11..ee958033 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,10 @@ ################################################################################ cmake_minimum_required(VERSION 3.13) +set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0) +set(OBSW_VERSION_MINOR_IF_GIT_FAILS 0) +set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) + # set(CMAKE_VERBOSE TRUE) option(EIVE_HARDCODED_TOOLCHAIN_FILE "\ @@ -16,20 +20,8 @@ For Linux Board Target BSPs, a default toolchain file will be set. Should be set if a different toolchain file is set externally" ON ) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -# Perform steps like loading toolchain files where applicable. -include(PreProjectConfig) -pre_project_config() - -# Project Name -project(eive-obsw) - -set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0) -set(OBSW_VERSION_MINOR_IF_GIT_FAILS 0) -set(OBSW_VERSION_REVISION_IF_GIT_FAILS 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) @@ -44,6 +36,18 @@ 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) +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) @@ -56,10 +60,6 @@ set(OBSW_DEBUG_STARTRACKER 0) # Pre-Sources preparation ################################################################################ -# Specify the C++ standard -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED True) - # Version handling set(GIT_VER_HANDLING_OK FALSE) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) From 5b2239cee65b1360861ea4b00bd475d035fdde5d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 27 Apr 2022 08:55:21 +0200 Subject: [PATCH 17/32] repoint fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index c1be1fe2..d61fe7db 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit c1be1fe2320eed167e808eecf3e582c87b688cde +Subproject commit d61fe7db93b37dd6652dbfee5b7c93f400ac5a11 From bed58a45e5e79d282333d8a199e510f4c67930d8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 27 Apr 2022 09:02:12 +0200 Subject: [PATCH 18/32] move catch2 load directive to bottom --- CMakeLists.txt | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee958033..ff73e3f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,28 +91,6 @@ if(NOT GIT_VER_HANDLING_OK) set(OBSW_VERSION_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS}) endif() -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() - # Set names and variables set(OBSW_NAME ${CMAKE_PROJECT_NAME}) set(WATCHDOG_NAME eive-watchdog) @@ -335,6 +313,29 @@ FetchContent_Declare( ) 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 ################################################################################ From ab85ebf83e9d3e547e2346230c08df45d9e8f4e2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 11:37:06 +0200 Subject: [PATCH 19/32] update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ef8a06..d5c50046 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ list yields a list of all related PRs for each release. - Use gpsd version 3.17 now. Includes API changes - Add `/usr/local/bin` to PATH. All shell scripts are there now - Rename GPS device to `/dev/gps0` +- Add Syrlinks and TMP devices to Software by default # [v1.10.1] From b4a54804dfbbefbeea06028f50a391bcaf78a164 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 13:07:28 +0200 Subject: [PATCH 20/32] submodule update --- generators/fsfwgen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/fsfwgen b/generators/fsfwgen index d2bdabbf..2a408e8c 160000 --- a/generators/fsfwgen +++ b/generators/fsfwgen @@ -1 +1 @@ -Subproject commit d2bdabbf0f213747efc18cb45fcf2a2294b14bc8 +Subproject commit 2a408e8c7dd2ebe974b9699fb5aee0889aa86392 From 40b84b0576cd3fac16a2788ac17a70254fd20392 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 13:08:19 +0200 Subject: [PATCH 21/32] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ef8a06..e1b7d3cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ list yields a list of all related PRs for each release. # [v1.11.0] +## Added + +- ACS Subsystem + ## Changed - Update rootfs base of Linux, all related OBSW changes From 7e2a993211995e5bb09fa1fb032bc25c07eb4f45 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 15:25:03 +0200 Subject: [PATCH 22/32] create rudimentary syrlinks fdir --- common/config/commonSubsystemIds.h | 1 + .../devicedefinitions/SyrlinksDefinitions.h | 6 + .../devicedefinitions/powerDefinitions.h | 2 + mission/system/CMakeLists.txt | 4 +- mission/system/{ => fdir}/AcsBoardFdir.cpp | 0 mission/system/{ => fdir}/AcsBoardFdir.h | 0 mission/system/{ => fdir}/RtdFdir.cpp | 0 mission/system/{ => fdir}/RtdFdir.h | 0 mission/system/{ => fdir}/SusFdir.cpp | 0 mission/system/{ => fdir}/SusFdir.h | 0 mission/system/fdir/SyrlinksFdir.cpp | 107 ++++++++++++++++++ mission/system/fdir/SyrlinksFdir.h | 14 +++ 12 files changed, 133 insertions(+), 1 deletion(-) rename mission/system/{ => fdir}/AcsBoardFdir.cpp (100%) rename mission/system/{ => fdir}/AcsBoardFdir.h (100%) rename mission/system/{ => fdir}/RtdFdir.cpp (100%) rename mission/system/{ => fdir}/RtdFdir.h (100%) rename mission/system/{ => fdir}/SusFdir.cpp (100%) rename mission/system/{ => fdir}/SusFdir.h (100%) create mode 100644 mission/system/fdir/SyrlinksFdir.cpp create mode 100644 mission/system/fdir/SyrlinksFdir.h diff --git a/common/config/commonSubsystemIds.h b/common/config/commonSubsystemIds.h index cd692231..c3e6c5a2 100644 --- a/common/config/commonSubsystemIds.h +++ b/common/config/commonSubsystemIds.h @@ -30,6 +30,7 @@ enum: uint8_t { PDU1_HANDLER = 133, PDU2_HANDLER = 134, ACU_HANDLER = 135, + SYRLINKS = 136, COMMON_SUBSYSTEM_ID_END }; } diff --git a/mission/devices/devicedefinitions/SyrlinksDefinitions.h b/mission/devices/devicedefinitions/SyrlinksDefinitions.h index a816dc29..7e3b6a20 100644 --- a/mission/devices/devicedefinitions/SyrlinksDefinitions.h +++ b/mission/devices/devicedefinitions/SyrlinksDefinitions.h @@ -1,8 +1,14 @@ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_ +#include + namespace syrlinks { +static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SYRLINKS; + +static constexpr Event FDIR_REACTION_IGNORED = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); + static const DeviceCommandId_t NONE = 0; static const DeviceCommandId_t RESET_UNIT = 1; /** Reads out all status registers */ diff --git a/mission/devices/devicedefinitions/powerDefinitions.h b/mission/devices/devicedefinitions/powerDefinitions.h index 746bda34..1cffa835 100644 --- a/mission/devices/devicedefinitions/powerDefinitions.h +++ b/mission/devices/devicedefinitions/powerDefinitions.h @@ -15,6 +15,8 @@ static constexpr Event SWITCH_CMD_SENT = event::makeEvent(SUBSYSTEM_ID, 0, sever static constexpr Event SWITCH_HAS_CHANGED = event::makeEvent(SUBSYSTEM_ID, 1, severity::INFO); static constexpr Event SWITCHING_Q7S_DENIED = event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM); +static constexpr Event FDIR_REACTION_IGNORED = event::makeEvent(SUBSYSTEM_ID, 3, severity::MEDIUM); + } // namespace power #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_POWERDEFINITIONS_H_ */ diff --git a/mission/system/CMakeLists.txt b/mission/system/CMakeLists.txt index 59418a07..24ecaafb 100644 --- a/mission/system/CMakeLists.txt +++ b/mission/system/CMakeLists.txt @@ -14,4 +14,6 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE AcsBoardFdir.cpp SusFdir.cpp RtdFdir.cpp -) \ No newline at end of file +) + +add_subdirectory(fdir) diff --git a/mission/system/AcsBoardFdir.cpp b/mission/system/fdir/AcsBoardFdir.cpp similarity index 100% rename from mission/system/AcsBoardFdir.cpp rename to mission/system/fdir/AcsBoardFdir.cpp diff --git a/mission/system/AcsBoardFdir.h b/mission/system/fdir/AcsBoardFdir.h similarity index 100% rename from mission/system/AcsBoardFdir.h rename to mission/system/fdir/AcsBoardFdir.h diff --git a/mission/system/RtdFdir.cpp b/mission/system/fdir/RtdFdir.cpp similarity index 100% rename from mission/system/RtdFdir.cpp rename to mission/system/fdir/RtdFdir.cpp diff --git a/mission/system/RtdFdir.h b/mission/system/fdir/RtdFdir.h similarity index 100% rename from mission/system/RtdFdir.h rename to mission/system/fdir/RtdFdir.h diff --git a/mission/system/SusFdir.cpp b/mission/system/fdir/SusFdir.cpp similarity index 100% rename from mission/system/SusFdir.cpp rename to mission/system/fdir/SusFdir.cpp diff --git a/mission/system/SusFdir.h b/mission/system/fdir/SusFdir.h similarity index 100% rename from mission/system/SusFdir.h rename to mission/system/fdir/SusFdir.h diff --git a/mission/system/fdir/SyrlinksFdir.cpp b/mission/system/fdir/SyrlinksFdir.cpp new file mode 100644 index 00000000..2c14d904 --- /dev/null +++ b/mission/system/fdir/SyrlinksFdir.cpp @@ -0,0 +1,107 @@ +#include "SyrlinksFdir.h" + +#include "fsfw/devicehandlers/DeviceHandlerIF.h" +#include "fsfw/health/HealthTableIF.h" +#include "fsfw/modes/HasModesIF.h" +#include "fsfw/objectmanager/ObjectManager.h" +#include "fsfw/power/Fuse.h" +#include "fsfw/serviceinterface/ServiceInterfaceStream.h" +#include "fsfw/thermal/ThermalComponentIF.h" +#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" + +SyrlinksFdir::SyrlinksFdir(object_id_t syrlinksId) {} + +ReturnValue_t SyrlinksFdir::eventReceived(EventMessage* event) { + if (isFdirInActionOrAreWeFaulty(event)) { + return RETURN_OK; + } + ReturnValue_t result = RETURN_FAILED; + switch (event->getEvent()) { + case HasModesIF::MODE_TRANSITION_FAILED: + case HasModesIF::OBJECT_IN_INVALID_MODE: + case DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT: + // We'll try a recovery as long as defined in MAX_REBOOT. + // Might cause some AssemblyBase cycles, so keep number low. + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + break; + case DeviceHandlerIF::DEVICE_INTERPRETING_REPLY_FAILED: + case DeviceHandlerIF::DEVICE_READING_REPLY_FAILED: + case DeviceHandlerIF::DEVICE_UNREQUESTED_REPLY: + case DeviceHandlerIF::DEVICE_UNKNOWN_REPLY: // Some DH's generate generic reply-ids. + case DeviceHandlerIF::DEVICE_BUILDING_COMMAND_FAILED: + // These faults all mean that there were stupid replies from a device. + if (strangeReplyCount.incrementAndCheck()) { + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + } + break; + case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED: + case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED: + // The two above should never be confirmed. + case DeviceHandlerIF::DEVICE_MISSED_REPLY: + result = sendConfirmationRequest(event); + if (result == HasReturnvaluesIF::RETURN_OK) { + break; + } + // else + if (missedReplyCount.incrementAndCheck()) { + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + } + break; + case StorageManagerIF::GET_DATA_FAILED: + case StorageManagerIF::STORE_DATA_FAILED: + // Rather strange bugs, occur in RAW mode only. Ignore. + break; + case DeviceHandlerIF::INVALID_DEVICE_COMMAND: + // Ignore, is bad configuration. We can't do anything in flight. + break; + case HasHealthIF::HEALTH_INFO: + case HasModesIF::MODE_INFO: + case HasModesIF::CHANGING_MODE: + // Do nothing, but mark as handled. + break; + //****Power***** + case PowerSwitchIF::SWITCH_WENT_OFF: + if (powerConfirmation != MessageQueueIF::NO_QUEUE) { + result = sendConfirmationRequest(event, powerConfirmation); + if (result == RETURN_OK) { + setFdirState(DEVICE_MIGHT_BE_OFF); + } + } + break; + case Fuse::FUSE_WENT_OFF: + // Not so good, because PCDU reacted. + case Fuse::POWER_ABOVE_HIGH_LIMIT: + // Better, because software detected over-current. + setFaulty(event->getEvent()); + break; + case Fuse::POWER_BELOW_LOW_LIMIT: + // Device might got stuck during boot, retry. + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + break; + //****Thermal***** + case ThermalComponentIF::COMPONENT_TEMP_LOW: + case ThermalComponentIF::COMPONENT_TEMP_HIGH: + case ThermalComponentIF::COMPONENT_TEMP_OOL_LOW: + case ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH: + // Well, the device is not really faulty, but it is required to stay off as long as possible. + setFaulty(event->getEvent()); + break; + case ThermalComponentIF::TEMP_NOT_IN_OP_RANGE: + // Ignore, is information only. + break; + //*******Default monitoring variables. Are currently not used.***** + // case DeviceHandlerIF::MONITORING_LIMIT_EXCEEDED: + // setFaulty(event->getEvent()); + // break; + // case DeviceHandlerIF::MONITORING_AMBIGUOUS: + // break; + default: + // We don't know the event, someone else should handle it. + return RETURN_FAILED; + } + return RETURN_OK; +} diff --git a/mission/system/fdir/SyrlinksFdir.h b/mission/system/fdir/SyrlinksFdir.h new file mode 100644 index 00000000..bafd8a48 --- /dev/null +++ b/mission/system/fdir/SyrlinksFdir.h @@ -0,0 +1,14 @@ +#ifndef MISSION_DEVICES_SYRLINKSFDIR_H_ +#define MISSION_DEVICES_SYRLINKSFDIR_H_ + +#include + +class SyrlinksFdir: public DeviceHandlerFailureIsolation { + public: + SyrlinksFdir(object_id_t syrlinksId); + private: + ReturnValue_t eventReceived(EventMessage* event); +}; + + +#endif /* MISSION_DEVICES_SYRLINKSFDIR_H_ */ From 7e230b64ea98602376ea7a2d655abcbdbcfdd2c8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 15:29:57 +0200 Subject: [PATCH 23/32] create and add syrlinks fdir --- bsp_q7s/core/ObjectFactory.cpp | 14 +- linux/ObjectFactory.cpp | 4 +- mission/devices/SyrlinksHkHandler.cpp | 4 +- mission/devices/SyrlinksHkHandler.h | 2 +- mission/system/CMakeLists.txt | 4 - mission/system/fdir/CMakeLists.txt | 6 + mission/system/fdir/SyrlinksFdir.cpp | 183 +++++++++++++------------- mission/system/fdir/SyrlinksFdir.h | 4 +- 8 files changed, 114 insertions(+), 107 deletions(-) create mode 100644 mission/system/fdir/CMakeLists.txt diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index ecc88ede..f0204cb4 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -1,5 +1,7 @@ #include "ObjectFactory.h" +#include + #include "OBSWConfig.h" #include "bsp_q7s/boardtest/Q7STestTask.h" #include "bsp_q7s/callbacks/gnssCallback.h" @@ -37,11 +39,11 @@ #include "linux/obc/PdecHandler.h" #include "linux/obc/Ptme.h" #include "linux/obc/PtmeConfig.h" -#include "mission/system/AcsBoardFdir.h" -#include "mission/system/RtdFdir.h" #include "mission/system/SusAssembly.h" -#include "mission/system/SusFdir.h" #include "mission/system/TcsBoardAssembly.h" +#include "mission/system/fdir/AcsBoardFdir.h" +#include "mission/system/fdir/RtdFdir.h" +#include "mission/system/fdir/SusFdir.h" #include "tmtc/apid.h" #include "tmtc/pusIds.h" @@ -629,8 +631,10 @@ void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) { syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); syrlinksUartCookie->setParityEven(); - auto syrlinksHandler = new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, - syrlinksUartCookie, pcdu::PDU1_CH1_SYRLINKS_12V); + auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HK_HANDLER); + auto syrlinksHandler = + new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, + pcdu::PDU1_CH1_SYRLINKS_12V, syrlinksFdir); syrlinksHandler->setPowerSwitcher(pwrSwitcher); } diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 7811fdbe..816fa71d 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -9,10 +9,10 @@ #include #include #include -#include #include -#include #include +#include +#include #include "OBSWConfig.h" #include "devConf.h" diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 43888724..81a832e4 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -5,8 +5,8 @@ #include "OBSWConfig.h" SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - power::Switch_t powerSwitch) - : DeviceHandlerBase(objectId, comIF, comCookie), + power::Switch_t powerSwitch, FailureIsolationBase* customFdir) + : DeviceHandlerBase(objectId, comIF, comCookie, customFdir), rxDataset(this), txDataset(this), temperatureSet(this), diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 78ae6d99..7143327f 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -20,7 +20,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { public: SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - power::Switch_t powerSwitch); + power::Switch_t powerSwitch, FailureIsolationBase* customFdir); virtual ~SyrlinksHkHandler(); /** diff --git a/mission/system/CMakeLists.txt b/mission/system/CMakeLists.txt index 24ecaafb..b6f4baab 100644 --- a/mission/system/CMakeLists.txt +++ b/mission/system/CMakeLists.txt @@ -10,10 +10,6 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE PowerStateMachineBase.cpp DualLaneAssemblyBase.cpp TcsBoardAssembly.cpp - - AcsBoardFdir.cpp - SusFdir.cpp - RtdFdir.cpp ) add_subdirectory(fdir) diff --git a/mission/system/fdir/CMakeLists.txt b/mission/system/fdir/CMakeLists.txt new file mode 100644 index 00000000..cf99cfdf --- /dev/null +++ b/mission/system/fdir/CMakeLists.txt @@ -0,0 +1,6 @@ +target_sources(${LIB_EIVE_MISSION} PRIVATE + AcsBoardFdir.cpp + RtdFdir.cpp + SusFdir.cpp + SyrlinksFdir.cpp +) diff --git a/mission/system/fdir/SyrlinksFdir.cpp b/mission/system/fdir/SyrlinksFdir.cpp index 2c14d904..27e17293 100644 --- a/mission/system/fdir/SyrlinksFdir.cpp +++ b/mission/system/fdir/SyrlinksFdir.cpp @@ -9,99 +9,100 @@ #include "fsfw/thermal/ThermalComponentIF.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" -SyrlinksFdir::SyrlinksFdir(object_id_t syrlinksId) {} +SyrlinksFdir::SyrlinksFdir(object_id_t syrlinksId) + : DeviceHandlerFailureIsolation(syrlinksId, objects::NO_OBJECT) {} ReturnValue_t SyrlinksFdir::eventReceived(EventMessage* event) { if (isFdirInActionOrAreWeFaulty(event)) { - return RETURN_OK; - } - ReturnValue_t result = RETURN_FAILED; - switch (event->getEvent()) { - case HasModesIF::MODE_TRANSITION_FAILED: - case HasModesIF::OBJECT_IN_INVALID_MODE: - case DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT: - // We'll try a recovery as long as defined in MAX_REBOOT. - // Might cause some AssemblyBase cycles, so keep number low. - // handleRecovery(event->getEvent()); - triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); - break; - case DeviceHandlerIF::DEVICE_INTERPRETING_REPLY_FAILED: - case DeviceHandlerIF::DEVICE_READING_REPLY_FAILED: - case DeviceHandlerIF::DEVICE_UNREQUESTED_REPLY: - case DeviceHandlerIF::DEVICE_UNKNOWN_REPLY: // Some DH's generate generic reply-ids. - case DeviceHandlerIF::DEVICE_BUILDING_COMMAND_FAILED: - // These faults all mean that there were stupid replies from a device. - if (strangeReplyCount.incrementAndCheck()) { - // handleRecovery(event->getEvent()); - triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); - } - break; - case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED: - case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED: - // The two above should never be confirmed. - case DeviceHandlerIF::DEVICE_MISSED_REPLY: - result = sendConfirmationRequest(event); - if (result == HasReturnvaluesIF::RETURN_OK) { - break; - } - // else - if (missedReplyCount.incrementAndCheck()) { - // handleRecovery(event->getEvent()); - triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); - } - break; - case StorageManagerIF::GET_DATA_FAILED: - case StorageManagerIF::STORE_DATA_FAILED: - // Rather strange bugs, occur in RAW mode only. Ignore. - break; - case DeviceHandlerIF::INVALID_DEVICE_COMMAND: - // Ignore, is bad configuration. We can't do anything in flight. - break; - case HasHealthIF::HEALTH_INFO: - case HasModesIF::MODE_INFO: - case HasModesIF::CHANGING_MODE: - // Do nothing, but mark as handled. - break; - //****Power***** - case PowerSwitchIF::SWITCH_WENT_OFF: - if (powerConfirmation != MessageQueueIF::NO_QUEUE) { - result = sendConfirmationRequest(event, powerConfirmation); - if (result == RETURN_OK) { - setFdirState(DEVICE_MIGHT_BE_OFF); - } - } - break; - case Fuse::FUSE_WENT_OFF: - // Not so good, because PCDU reacted. - case Fuse::POWER_ABOVE_HIGH_LIMIT: - // Better, because software detected over-current. - setFaulty(event->getEvent()); - break; - case Fuse::POWER_BELOW_LOW_LIMIT: - // Device might got stuck during boot, retry. - // handleRecovery(event->getEvent()); - triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); - break; - //****Thermal***** - case ThermalComponentIF::COMPONENT_TEMP_LOW: - case ThermalComponentIF::COMPONENT_TEMP_HIGH: - case ThermalComponentIF::COMPONENT_TEMP_OOL_LOW: - case ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH: - // Well, the device is not really faulty, but it is required to stay off as long as possible. - setFaulty(event->getEvent()); - break; - case ThermalComponentIF::TEMP_NOT_IN_OP_RANGE: - // Ignore, is information only. - break; - //*******Default monitoring variables. Are currently not used.***** - // case DeviceHandlerIF::MONITORING_LIMIT_EXCEEDED: - // setFaulty(event->getEvent()); - // break; - // case DeviceHandlerIF::MONITORING_AMBIGUOUS: - // break; - default: - // We don't know the event, someone else should handle it. - return RETURN_FAILED; - } return RETURN_OK; + } + ReturnValue_t result = RETURN_FAILED; + switch (event->getEvent()) { + case HasModesIF::MODE_TRANSITION_FAILED: + case HasModesIF::OBJECT_IN_INVALID_MODE: + case DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT: + // We'll try a recovery as long as defined in MAX_REBOOT. + // Might cause some AssemblyBase cycles, so keep number low. + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + break; + case DeviceHandlerIF::DEVICE_INTERPRETING_REPLY_FAILED: + case DeviceHandlerIF::DEVICE_READING_REPLY_FAILED: + case DeviceHandlerIF::DEVICE_UNREQUESTED_REPLY: + case DeviceHandlerIF::DEVICE_UNKNOWN_REPLY: // Some DH's generate generic reply-ids. + case DeviceHandlerIF::DEVICE_BUILDING_COMMAND_FAILED: + // These faults all mean that there were stupid replies from a device. + if (strangeReplyCount.incrementAndCheck()) { + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + } + break; + case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED: + case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED: + // The two above should never be confirmed. + case DeviceHandlerIF::DEVICE_MISSED_REPLY: + result = sendConfirmationRequest(event); + if (result == HasReturnvaluesIF::RETURN_OK) { + break; + } + // else + if (missedReplyCount.incrementAndCheck()) { + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + } + break; + case StorageManagerIF::GET_DATA_FAILED: + case StorageManagerIF::STORE_DATA_FAILED: + // Rather strange bugs, occur in RAW mode only. Ignore. + break; + case DeviceHandlerIF::INVALID_DEVICE_COMMAND: + // Ignore, is bad configuration. We can't do anything in flight. + break; + case HasHealthIF::HEALTH_INFO: + case HasModesIF::MODE_INFO: + case HasModesIF::CHANGING_MODE: + // Do nothing, but mark as handled. + break; + //****Power***** + case PowerSwitchIF::SWITCH_WENT_OFF: + if (powerConfirmation != MessageQueueIF::NO_QUEUE) { + result = sendConfirmationRequest(event, powerConfirmation); + if (result == RETURN_OK) { + setFdirState(DEVICE_MIGHT_BE_OFF); + } + } + break; + case Fuse::FUSE_WENT_OFF: + // Not so good, because PCDU reacted. + case Fuse::POWER_ABOVE_HIGH_LIMIT: + // Better, because software detected over-current. + setFaulty(event->getEvent()); + break; + case Fuse::POWER_BELOW_LOW_LIMIT: + // Device might got stuck during boot, retry. + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + break; + //****Thermal***** + case ThermalComponentIF::COMPONENT_TEMP_LOW: + case ThermalComponentIF::COMPONENT_TEMP_HIGH: + case ThermalComponentIF::COMPONENT_TEMP_OOL_LOW: + case ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH: + // Well, the device is not really faulty, but it is required to stay off as long as possible. + setFaulty(event->getEvent()); + break; + case ThermalComponentIF::TEMP_NOT_IN_OP_RANGE: + // Ignore, is information only. + break; + //*******Default monitoring variables. Are currently not used.***** + // case DeviceHandlerIF::MONITORING_LIMIT_EXCEEDED: + // setFaulty(event->getEvent()); + // break; + // case DeviceHandlerIF::MONITORING_AMBIGUOUS: + // break; + default: + // We don't know the event, someone else should handle it. + return RETURN_FAILED; + } + return RETURN_OK; } diff --git a/mission/system/fdir/SyrlinksFdir.h b/mission/system/fdir/SyrlinksFdir.h index bafd8a48..79480924 100644 --- a/mission/system/fdir/SyrlinksFdir.h +++ b/mission/system/fdir/SyrlinksFdir.h @@ -3,12 +3,12 @@ #include -class SyrlinksFdir: public DeviceHandlerFailureIsolation { +class SyrlinksFdir : public DeviceHandlerFailureIsolation { public: SyrlinksFdir(object_id_t syrlinksId); + private: ReturnValue_t eventReceived(EventMessage* event); }; - #endif /* MISSION_DEVICES_SYRLINKSFDIR_H_ */ From b97604d7d25849c3ecbb2e5eb799454830476995 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 15:36:56 +0200 Subject: [PATCH 24/32] override event confirmed as well --- mission/system/fdir/SyrlinksFdir.cpp | 20 ++++++++++++++++++++ mission/system/fdir/SyrlinksFdir.h | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/mission/system/fdir/SyrlinksFdir.cpp b/mission/system/fdir/SyrlinksFdir.cpp index 27e17293..c35427db 100644 --- a/mission/system/fdir/SyrlinksFdir.cpp +++ b/mission/system/fdir/SyrlinksFdir.cpp @@ -106,3 +106,23 @@ ReturnValue_t SyrlinksFdir::eventReceived(EventMessage* event) { } return RETURN_OK; } + +void SyrlinksFdir::eventConfirmed(EventMessage* event) { + switch (event->getEvent()) { + case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED: + case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED: + case DeviceHandlerIF::DEVICE_MISSED_REPLY: + if (missedReplyCount.incrementAndCheck()) { + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + } + break; + case PowerSwitchIF::SWITCH_WENT_OFF: + // This means the switch went off only for one device. + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + break; + default: + break; + } +} diff --git a/mission/system/fdir/SyrlinksFdir.h b/mission/system/fdir/SyrlinksFdir.h index 79480924..e56714e9 100644 --- a/mission/system/fdir/SyrlinksFdir.h +++ b/mission/system/fdir/SyrlinksFdir.h @@ -8,7 +8,8 @@ class SyrlinksFdir : public DeviceHandlerFailureIsolation { SyrlinksFdir(object_id_t syrlinksId); private: - ReturnValue_t eventReceived(EventMessage* event); + ReturnValue_t eventReceived(EventMessage* event) override; + void eventConfirmed(EventMessage* event) override; }; #endif /* MISSION_DEVICES_SYRLINKSFDIR_H_ */ From d0b7531e4865e73f8cd3a15a82df7f7d9b54839d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 15:58:31 +0200 Subject: [PATCH 25/32] create and assign gomspace power fdir --- bsp_q7s/core/ObjectFactory.cpp | 19 +++- mission/devices/ACUHandler.cpp | 5 +- mission/devices/ACUHandler.h | 3 +- mission/devices/GomspaceDeviceHandler.cpp | 5 +- mission/devices/GomspaceDeviceHandler.h | 4 +- mission/devices/P60DockHandler.cpp | 8 +- mission/devices/P60DockHandler.h | 3 +- mission/devices/PDU1Handler.cpp | 5 +- mission/devices/PDU1Handler.h | 3 +- mission/devices/PDU2Handler.cpp | 5 +- mission/devices/PDU2Handler.h | 3 +- mission/system/fdir/CMakeLists.txt | 1 + mission/system/fdir/GomspacePowerFdir.cpp | 128 ++++++++++++++++++++++ mission/system/fdir/GomspacePowerFdir.h | 15 +++ 14 files changed, 185 insertions(+), 22 deletions(-) create mode 100644 mission/system/fdir/GomspacePowerFdir.cpp create mode 100644 mission/system/fdir/GomspacePowerFdir.h diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index f0204cb4..bd547615 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -1,5 +1,6 @@ #include "ObjectFactory.h" +#include #include #include "OBSWConfig.h" @@ -247,14 +248,22 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU1); CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU2); CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_LENGTH, addresses::ACU); - /* Device Handler */ + + auto p60Fdir = new GomspacePowerFdir(objects::P60DOCK_HANDLER); P60DockHandler* p60dockhandler = - new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie); + new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie, p60Fdir); + + auto pdu1Fdir = new GomspacePowerFdir(objects::PDU1_HANDLER); PDU1Handler* pdu1handler = - new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie); + new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie, pdu1Fdir); + + auto pdu2Fdir = new GomspacePowerFdir(objects::PDU2_HANDLER); PDU2Handler* pdu2handler = - new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie); - ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie); + new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie, pdu2Fdir); + + auto acuFdir = new GomspacePowerFdir(objects::ACU_HANDLER); + ACUHandler* acuhandler = + new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie, acuFdir); auto pcduHandler = new PCDUHandler(objects::PCDU_HANDLER, 50); /** diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index afdbec35..f9462542 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -2,8 +2,9 @@ #include "OBSWConfig.h" -ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) - : GomspaceDeviceHandler(objectId, comIF, comCookie, ACU::MAX_CONFIGTABLE_ADDRESS, +ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie, + FailureIsolationBase *customFdir) + : GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, ACU::MAX_CONFIGTABLE_ADDRESS, ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_REPLY_SIZE), acuHkTableDataset(this) {} diff --git a/mission/devices/ACUHandler.h b/mission/devices/ACUHandler.h index 3b1feaf3..36b835bb 100644 --- a/mission/devices/ACUHandler.h +++ b/mission/devices/ACUHandler.h @@ -12,7 +12,8 @@ */ class ACUHandler : public GomspaceDeviceHandler { public: - ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); + ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, + FailureIsolationBase* customFdir); virtual ~ACUHandler(); virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index d24abfe3..fca84cb6 100644 --- a/mission/devices/GomspaceDeviceHandler.cpp +++ b/mission/devices/GomspaceDeviceHandler.cpp @@ -7,9 +7,10 @@ #include "devicedefinitions/powerDefinitions.h" GomspaceDeviceHandler::GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF, - CookieIF* comCookie, uint16_t maxConfigTableAddress, + CookieIF* comCookie, FailureIsolationBase* customFdir, + uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableReplySize) - : DeviceHandlerBase(objectId, comIF, comCookie), + : DeviceHandlerBase(objectId, comIF, comCookie, customFdir), maxConfigTableAddress(maxConfigTableAddress), maxHkTableAddress(maxHkTableAddress), hkTableReplySize(hkTableReplySize) { diff --git a/mission/devices/GomspaceDeviceHandler.h b/mission/devices/GomspaceDeviceHandler.h index 7c1555bc..ea09b374 100644 --- a/mission/devices/GomspaceDeviceHandler.h +++ b/mission/devices/GomspaceDeviceHandler.h @@ -38,8 +38,8 @@ class GomspaceDeviceHandler : public DeviceHandlerBase { * device. */ GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie, - uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, - uint16_t hkTableReplySize); + FailureIsolationBase *customFdir, uint16_t maxConfigTableAddress, + uint16_t maxHkTableAddress, uint16_t hkTableReplySize); virtual ~GomspaceDeviceHandler(); /** diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 83275e37..48e531b3 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -4,9 +4,11 @@ #include "OBSWConfig.h" -P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) - : GomspaceDeviceHandler(objectId, comIF, comCookie, P60Dock::MAX_CONFIGTABLE_ADDRESS, - P60Dock::MAX_HKTABLE_ADDRESS, P60Dock::HK_TABLE_REPLY_SIZE), +P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie, + FailureIsolationBase *customFdir) + : GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, + P60Dock::MAX_CONFIGTABLE_ADDRESS, P60Dock::MAX_HKTABLE_ADDRESS, + P60Dock::HK_TABLE_REPLY_SIZE), coreHk(this), auxHk(this) {} diff --git a/mission/devices/P60DockHandler.h b/mission/devices/P60DockHandler.h index d08a46e0..de14f515 100644 --- a/mission/devices/P60DockHandler.h +++ b/mission/devices/P60DockHandler.h @@ -21,7 +21,8 @@ class P60DockHandler : public GomspaceDeviceHandler { //! [EXPORT] : [COMMENT] Battery mode has changed. P1: Old mode. P2: New mode static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM); - P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); + P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, + FailureIsolationBase* customFdir); virtual ~P60DockHandler(); virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index a466375f..44f8fb04 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -5,8 +5,9 @@ #include "devices/powerSwitcherList.h" -PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) - : GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, +PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie, + FailureIsolationBase *customFdir) + : GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, PDU::MAX_CONFIGTABLE_ADDRESS, PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE), coreHk(this), auxHk(this) {} diff --git a/mission/devices/PDU1Handler.h b/mission/devices/PDU1Handler.h index 845f57ec..d900bb15 100644 --- a/mission/devices/PDU1Handler.h +++ b/mission/devices/PDU1Handler.h @@ -21,7 +21,8 @@ */ class PDU1Handler : public GomspaceDeviceHandler { public: - PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); + PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, + FailureIsolationBase* customFdir); virtual ~PDU1Handler(); virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index e5d88644..1476f95d 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -5,8 +5,9 @@ #include "devices/powerSwitcherList.h" -PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) - : GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, +PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie, + FailureIsolationBase *customFdir) + : GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, PDU::MAX_CONFIGTABLE_ADDRESS, PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE), coreHk(this), auxHk(this) {} diff --git a/mission/devices/PDU2Handler.h b/mission/devices/PDU2Handler.h index 2680c80e..e16130fd 100644 --- a/mission/devices/PDU2Handler.h +++ b/mission/devices/PDU2Handler.h @@ -21,7 +21,8 @@ */ class PDU2Handler : public GomspaceDeviceHandler { public: - PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); + PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, + FailureIsolationBase* customFdir); virtual ~PDU2Handler(); virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, diff --git a/mission/system/fdir/CMakeLists.txt b/mission/system/fdir/CMakeLists.txt index cf99cfdf..c5414fe8 100644 --- a/mission/system/fdir/CMakeLists.txt +++ b/mission/system/fdir/CMakeLists.txt @@ -3,4 +3,5 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE RtdFdir.cpp SusFdir.cpp SyrlinksFdir.cpp + GomspacePowerFdir.cpp ) diff --git a/mission/system/fdir/GomspacePowerFdir.cpp b/mission/system/fdir/GomspacePowerFdir.cpp new file mode 100644 index 00000000..f7475491 --- /dev/null +++ b/mission/system/fdir/GomspacePowerFdir.cpp @@ -0,0 +1,128 @@ +#include "GomspacePowerFdir.h" + +#include "fsfw/devicehandlers/DeviceHandlerIF.h" +#include "fsfw/health/HealthTableIF.h" +#include "fsfw/modes/HasModesIF.h" +#include "fsfw/objectmanager/ObjectManager.h" +#include "fsfw/power/Fuse.h" +#include "fsfw/serviceinterface/ServiceInterfaceStream.h" +#include "fsfw/thermal/ThermalComponentIF.h" +#include "mission/devices/devicedefinitions/powerDefinitions.h" + +GomspacePowerFdir::GomspacePowerFdir(object_id_t devId, object_id_t parentId) + : DeviceHandlerFailureIsolation(devId, parentId) {} + +ReturnValue_t GomspacePowerFdir::eventReceived(EventMessage* event) { + if (isFdirInActionOrAreWeFaulty(event)) { + return RETURN_OK; + } + ReturnValue_t result = RETURN_FAILED; + switch (event->getEvent()) { + case HasModesIF::MODE_TRANSITION_FAILED: + case HasModesIF::OBJECT_IN_INVALID_MODE: + case DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT: + // We'll try a recovery as long as defined in MAX_REBOOT. + // Might cause some AssemblyBase cycles, so keep number low. + // handleRecovery(event->getEvent()); + triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0); + break; + case DeviceHandlerIF::DEVICE_INTERPRETING_REPLY_FAILED: + case DeviceHandlerIF::DEVICE_READING_REPLY_FAILED: + case DeviceHandlerIF::DEVICE_UNREQUESTED_REPLY: + case DeviceHandlerIF::DEVICE_UNKNOWN_REPLY: // Some DH's generate generic reply-ids. + case DeviceHandlerIF::DEVICE_BUILDING_COMMAND_FAILED: + // These faults all mean that there were stupid replies from a device. + if (strangeReplyCount.incrementAndCheck()) { + // handleRecovery(event->getEvent()); + triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0); + } + break; + case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED: + case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED: + // The two above should never be confirmed. + case DeviceHandlerIF::DEVICE_MISSED_REPLY: + result = sendConfirmationRequest(event); + if (result == HasReturnvaluesIF::RETURN_OK) { + break; + } + // else + if (missedReplyCount.incrementAndCheck()) { + // handleRecovery(event->getEvent()); + triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0); + } + break; + case StorageManagerIF::GET_DATA_FAILED: + case StorageManagerIF::STORE_DATA_FAILED: + // Rather strange bugs, occur in RAW mode only. Ignore. + break; + case DeviceHandlerIF::INVALID_DEVICE_COMMAND: + // Ignore, is bad configuration. We can't do anything in flight. + break; + case HasHealthIF::HEALTH_INFO: + case HasModesIF::MODE_INFO: + case HasModesIF::CHANGING_MODE: + // Do nothing, but mark as handled. + break; + //****Power***** + case PowerSwitchIF::SWITCH_WENT_OFF: + if (powerConfirmation != MessageQueueIF::NO_QUEUE) { + result = sendConfirmationRequest(event, powerConfirmation); + if (result == RETURN_OK) { + setFdirState(DEVICE_MIGHT_BE_OFF); + } + } + break; + case Fuse::FUSE_WENT_OFF: + // Not so good, because PCDU reacted. + case Fuse::POWER_ABOVE_HIGH_LIMIT: + // Better, because software detected over-current. + setFaulty(event->getEvent()); + break; + case Fuse::POWER_BELOW_LOW_LIMIT: + // Device might got stuck during boot, retry. + // handleRecovery(event->getEvent()); + triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0); + break; + //****Thermal***** + case ThermalComponentIF::COMPONENT_TEMP_LOW: + case ThermalComponentIF::COMPONENT_TEMP_HIGH: + case ThermalComponentIF::COMPONENT_TEMP_OOL_LOW: + case ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH: + // Well, the device is not really faulty, but it is required to stay off as long as possible. + setFaulty(event->getEvent()); + break; + case ThermalComponentIF::TEMP_NOT_IN_OP_RANGE: + // Ignore, is information only. + break; + //*******Default monitoring variables. Are currently not used.***** + // case DeviceHandlerIF::MONITORING_LIMIT_EXCEEDED: + // setFaulty(event->getEvent()); + // break; + // case DeviceHandlerIF::MONITORING_AMBIGUOUS: + // break; + default: + // We don't know the event, someone else should handle it. + return RETURN_FAILED; + } + return RETURN_OK; +} + +void GomspacePowerFdir::eventConfirmed(EventMessage* event) { + switch (event->getEvent()) { + case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED: + case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED: + case DeviceHandlerIF::DEVICE_MISSED_REPLY: + if (missedReplyCount.incrementAndCheck()) { + // handleRecovery(event->getEvent()); + triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0); + } + break; + case PowerSwitchIF::SWITCH_WENT_OFF: + // This means the switch went off only for one device. + // handleRecovery(event->getEvent()); + triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0); + break; + default: + break; + } +} diff --git a/mission/system/fdir/GomspacePowerFdir.h b/mission/system/fdir/GomspacePowerFdir.h new file mode 100644 index 00000000..1a9b4b97 --- /dev/null +++ b/mission/system/fdir/GomspacePowerFdir.h @@ -0,0 +1,15 @@ +#ifndef MISSION_SYSTEM_FDIR_GOMSPACEPOWERFDIR_H_ +#define MISSION_SYSTEM_FDIR_GOMSPACEPOWERFDIR_H_ + +#include + +class GomspacePowerFdir : public DeviceHandlerFailureIsolation { + public: + GomspacePowerFdir(object_id_t devId, object_id_t parentId = objects::NO_OBJECT); + + private: + ReturnValue_t eventReceived(EventMessage* event) override; + void eventConfirmed(EventMessage* event) override; +}; + +#endif /* MISSION_SYSTEM_FDIR_GOMSPACEPOWERFDIR_H_ */ From 5de45a7ae7d70a40387636813dc0c01f4bd6f641 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 16:05:01 +0200 Subject: [PATCH 26/32] more readable --- mission/system/tree/acsModeTree.cpp | 64 ++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index e5748f08..b78a5ff2 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -17,7 +17,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); // Alias for checker function -const auto CHK = checkInsert; +const auto check = checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; @@ -93,7 +93,7 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(table.insert(eh), ctxc); + check(table.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -101,11 +101,11 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // OFF Target table is empty - CHK(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build OFF transition iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); @@ -114,12 +114,12 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - CHK(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); // Build OFF sequence ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false); ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, + check(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, true), ctxc); } @@ -133,7 +133,7 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -141,14 +141,14 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build SAFE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build SAFE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); @@ -156,19 +156,19 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), + check(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), ctxc); // Build SAFE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), + check(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), ctxc); // Build SAFE sequence ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, + check(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, false, true), ctxc); } @@ -182,7 +182,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -190,14 +190,14 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build DETUMBLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), + check(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), ctxc); // Build DETUMBLE transition 0 @@ -206,13 +206,13 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, + check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true), ctxc); // Build DETUMBLE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, + check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true), ctxc); @@ -220,7 +220,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, + check(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, ACS_SEQUENCE_SAFE.first, false, true), ctxc); } @@ -234,7 +234,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -242,7 +242,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build IDLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TGT.second); @@ -281,7 +281,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -289,7 +289,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build IDLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, @@ -297,7 +297,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), ctxc); // Build IDLE transition 0 @@ -306,14 +306,14 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, true), ctxc); // Build IDLE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, ACS_TABLE_IDLE_CHRG_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, true), ctxc); @@ -321,7 +321,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true); ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, + check(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, ACS_SEQUENCE_SAFE.first, false, true), ctxc); } @@ -335,7 +335,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -343,7 +343,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build TARGET PT table @@ -353,7 +353,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), + check(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), ctxc); // Build TARGET PT transition 0 @@ -362,13 +362,13 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, + check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, true), ctxc); // Build TARGET PT transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, + check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, true), ctxc); @@ -376,7 +376,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true); ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, + check(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, ACS_SEQUENCE_IDLE.first, false, true), ctxc); } From e16f5e68d655c5b364c9e632c26e844f3e0bdc18 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 17:54:47 +0200 Subject: [PATCH 27/32] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0860e342..70783628 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ list yields a list of all related PRs for each release. # [v1.11.0] +## Added + +- Custom Syrlinks FDIR which disabled most of the default FDIR functionality + ## Changed - PCDU handler only called once in PST, but can handle multiple messages now From 3a03d6ca55db39094da916a2b841de87e546c543 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 17:56:06 +0200 Subject: [PATCH 28/32] update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0860e342..b674dc9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ list yields a list of all related PRs for each release. # [v1.11.0] +## Added + +- Gomspace Power Components FDIR which disables most of default FDIR functionality + ## Changed - PCDU handler only called once in PST, but can handle multiple messages now From 52bfcd70399b285963f9edfd89486b957612d71f Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 30 Apr 2022 15:55:45 +0200 Subject: [PATCH 29/32] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index e939f2b9..168b6622 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit e939f2b934b20f273a94a7c4d9665f7568cb9cee +Subproject commit 168b662288175f9db77a5796a02f38cb66911092 From e919d3b7efaea46d4fd472b3a6bb8c2c7ff5f868 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 30 Apr 2022 16:36:45 +0200 Subject: [PATCH 30/32] delete ETL submodule --- thirdparty/etl | 1 - 1 file changed, 1 deletion(-) delete mode 160000 thirdparty/etl 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 From c1fb7ce0df72a068136d507cef646c4f9ef713f2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 30 Apr 2022 16:38:43 +0200 Subject: [PATCH 31/32] update fsfw submodule --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 43aad118..d61fe7db 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 43aad11859d5ca772d4323b24626d7a94646f3fd +Subproject commit d61fe7db93b37dd6652dbfee5b7c93f400ac5a11 From aa9acef76a9e0593ad37ec92389a96da46f3627c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 May 2022 12:53:12 +0200 Subject: [PATCH 32/32] bump tmtc submodule --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 8d0a8312..0a47c17f 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8d0a83122932deb49a9e536bea1a0b5723b1cb2a +Subproject commit 0a47c17fa699dc571d2d3e63ec08c9f4cf513f65