|
| 1 | +/*------------------------------------------------------------------------------ |
| 2 | +-- The MIT License (MIT) |
| 3 | +-- |
| 4 | +-- Copyright © 2025, Laboratory of Plasma Physics- CNRS |
| 5 | +-- |
| 6 | +-- Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | +-- of this software and associated documentation files (the “Software”), to deal |
| 8 | +-- in the Software without restriction, including without limitation the rights |
| 9 | +-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
| 10 | +-- of the Software, and to permit persons to whom the Software is furnished to do |
| 11 | +-- so, subject to the following conditions: |
| 12 | +-- |
| 13 | +-- The above copyright notice and this permission notice shall be included in all |
| 14 | +-- copies or substantial portions of the Software. |
| 15 | +-- |
| 16 | +-- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
| 17 | +-- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A |
| 18 | +-- PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 19 | +-- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| 20 | +-- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 21 | +-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 22 | +-------------------------------------------------------------------------------*/ |
| 23 | +/*-- Author : Alexis Jeandet |
| 24 | + |
| 25 | +----------------------------------------------------------------------------*/ |
| 26 | +#include "rpws.hpp" |
| 27 | +#include <cpp_utils/reflexion/reflection.hpp> |
| 28 | +#include <cpp_utils/serde/serde.hpp> |
| 29 | + |
| 30 | +namespace ouija_boards::cassini::rpws |
| 31 | +{ |
| 32 | + |
| 33 | +struct TIME_TABLE |
| 34 | +{ |
| 35 | + using endianness = cpp_utils::endianness::big_endian_t; |
| 36 | + RPWS_SCLK_SCET sclk_scet; |
| 37 | + uint32_t spare; |
| 38 | + cpp_utils::serde::static_array<float, 224> TIME_OFFSET; |
| 39 | +}; |
| 40 | +// static_assert(cpp_utils::reflexion::composite_size<TIME_TABLE>() == 912); |
| 41 | + |
| 42 | +struct FREQUENCY_TABLE |
| 43 | +{ |
| 44 | + using endianness = cpp_utils::endianness::big_endian_t; |
| 45 | + RPWS_SCLK_SCET sclk_scet; |
| 46 | + uint32_t spare; |
| 47 | + cpp_utils::serde::static_array<float, 224> FREQUENCY; |
| 48 | +}; |
| 49 | +// static_assert(cpp_utils::reflexion::composite_size<FREQUENCY_TABLE>() == 912); |
| 50 | + |
| 51 | +struct LRFC_DATA_QUALITY |
| 52 | +{ |
| 53 | + using endianness = cpp_utils::endianness::big_endian_t; |
| 54 | + uint32_t value; |
| 55 | + /*inline bool VALID_DATA_FLAG() { return value & 0x1; } |
| 56 | + inline bool HFR_SOUNDER_ACTIVE() { return value & 0x2; } |
| 57 | + inline bool LP_RAW_SWEEP_ACTIVE() { return value & 0x4; } |
| 58 | + inline bool GROUND_PRODUCED_DATA() { return value & 0x8; } |
| 59 | + inline uint8_t SENSOR_NUMBER() { return (value & 0xF000'0000) >> 4; }*/ |
| 60 | +}; |
| 61 | + |
| 62 | +struct SPECTRAL_DENSITY_TABLE |
| 63 | +{ |
| 64 | + using endianness = cpp_utils::endianness::big_endian_t; |
| 65 | + RPWS_SCLK_SCET sclk_scet; |
| 66 | + LRFC_DATA_QUALITY data_quality; |
| 67 | + cpp_utils::serde::static_array<float, 224> DENSITY; |
| 68 | +}; |
| 69 | +// static_assert(cpp_utils::reflexion::composite_size<SPECTRAL_DENSITY_TABLE>() == 912); |
| 70 | + |
| 71 | +struct RPWS_LOW_RATE_FULL_MFR0 |
| 72 | +{ |
| 73 | + using endianness = cpp_utils::endianness::big_endian_t; |
| 74 | + LRFULL_TABLE<sizeof(TIME_TABLE)> lrfull_table; |
| 75 | + TIME_TABLE time_table; |
| 76 | + FREQUENCY_TABLE frequency_table; |
| 77 | + cpp_utils::serde::dynamic_array<0, SPECTRAL_DENSITY_TABLE> spectral_density_table; |
| 78 | + inline std::size_t field_size( |
| 79 | + const cpp_utils::serde::dynamic_array<0, SPECTRAL_DENSITY_TABLE>&) const |
| 80 | + { |
| 81 | + return lrfull_table.RECORDS - 3; |
| 82 | + } |
| 83 | +}; |
| 84 | +} |
0 commit comments