Line data Source code
1 : /**
2 : * @file signal_info.h
3 : * @brief Parsed CAN signal metadata.
4 : *
5 : * Created: 2026-03-13
6 : * Author: Deeaitch (Dim. Himro)
7 : *
8 : * Licensed under the MIT License.
9 : * See LICENSE file in the project root for full license text.
10 : */
11 :
12 : #ifndef SIGNAL_INFO_H
13 : #define SIGNAL_INFO_H
14 :
15 : #include "attributes.h"
16 : #include "multiplexing.h"
17 : #include "value_descriptions.h"
18 : #include <cstdint>
19 : #include <string>
20 : #include <vector>
21 :
22 : /**
23 : * @brief Describes one signal inside a DBC frame.
24 : */
25 : struct SignalInfo {
26 : Multiplexing multiplexing; /**< Selector role and branch value. */
27 : std::string name; /**< Signal name. */
28 : std::uint32_t startBit = 0U; /**< Start bit in DBC notation. */
29 : std::uint32_t length = 0U; /**< Signal length in bits. */
30 : bool isLittleEndian = true; /**< true for Intel, false for Motorola. */
31 : bool isSigned = false; /**< true if signal is signed. */
32 : double factor = 1.0; /**< Scaling factor. */
33 : double offset = 0.0; /**< Physical offset. */
34 : double minimum = 0.0; /**< Minimum physical value. */
35 : double maximum = 0.0; /**< Maximum physical value. */
36 : std::string unit; /**< Physical unit. */
37 : std::vector<std::string> receivers; /**< Signal receivers. */
38 : ValueDescriptions valueDescriptions; /**< Raw integer state descriptions. */
39 : std::string comment; /**< Optional signal comment. */
40 :
41 : AttributeMap attributes; /**< Effective attributes after defaults and overrides. */ /**< Effective values, including defaults. */
42 :
43 592 : SignalInfo() = default;
44 : };
45 :
46 : #endif /* SIGNAL_INFO_H */
|