Main Page
Namespaces
Classes
Files
File List
include
dbc
DbcSignal.h
Go to the documentation of this file.
1
/*********************************************************************
2
* Software License Agreement (BSD License)
3
*
4
* Copyright (c) 2018 New Eagle
5
* All rights reserved.
6
*
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions
9
* are met:
10
*
11
* * Redistributions of source code must retain the above copyright
12
* notice, this list of conditions and the following disclaimer.
13
* * Redistributions in binary form must reproduce the above
14
* copyright notice, this list of conditions and the following
15
* disclaimer in the documentation and/or other materials provided
16
* with the distribution.
17
* * Neither the name of New Eagle nor the names of its
18
* contributors may be used to endorse or promote products derived
19
* from this software without specific prior written permission.
20
*
21
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
* POSSIBILITY OF SUCH DAMAGE.
33
*********************************************************************/
34
35
#ifndef _NEW_EAGLE_DBC_SIGNAL_H
36
#define _NEW_EAGLE_DBC_SIGNAL_H
37
38
#include <
ros/ros.h
>
39
40
#include <string>
41
42
namespace
NewEagle
43
{
44
struct
DbcSignalComment
45
{
46
uint32_t
Id
;
47
std::string
SignalName
;
48
std::string
Comment
;
49
};
50
51
enum
SignType
52
{
53
UNSIGNED
= 0,
54
SIGNED
= 1
55
};
56
57
enum
ByteOrder
58
{
59
LITTLE_END
= 0,
60
BIG_END
= 1
61
};
62
63
enum
DataType
64
{
65
INT
= 0,
66
FLOAT
= 1,
67
DOUBLE
= 2
68
};
69
70
enum
MultiplexerMode
71
{
72
NONE
= 0,
73
MUX_SWITCH
= 1,
74
MUX_SIGNAL
= 2
75
};
76
77
class
DbcSignal
{
78
public
:
79
DbcSignal
(
80
uint8_t dlc,
81
double
gain,
82
double
offset,
83
uint8_t startBit,
84
ByteOrder
endianness,
85
uint8_t length,
86
SignType
sign,
87
std::string name,
88
MultiplexerMode
multiplexerMode);
89
90
DbcSignal
(
91
uint8_t dlc,
92
double
gain,
93
double
offset,
94
uint8_t startBit,
95
ByteOrder
endianness,
96
uint8_t length,
97
SignType
sign,
98
std::string name,
99
MultiplexerMode
multiplexerMode,
100
int32_t multiplexerSwitch);
101
102
~
DbcSignal
();
103
104
uint8_t GetDlc()
const
;
105
double
GetResult()
const
;
106
double
GetGain()
const
;
107
double
GetOffset()
const
;
108
uint8_t GetStartBit()
const
;
109
ByteOrder
GetEndianness()
const
;
110
uint8_t GetLength()
const
;
111
SignType
GetSign()
const
;
112
std::string GetName()
const
;
113
void
SetResult(
double
result);
114
void
SetComment(
NewEagle::DbcSignalComment
comment);
115
void
SetInitialValue(
double
value);
116
double
GetInitialValue();
117
DataType
GetDataType();
118
void
SetDataType(
DataType
type);
119
MultiplexerMode
GetMultiplexerMode()
const
;
120
int32_t GetMultiplexerSwitch()
const
;
121
122
private
:
123
uint8_t
_dlc
;
124
double
_result
;
125
double
_gain
;
126
double
_offset
;
127
uint8_t
_startBit
;
128
ByteOrder
_endianness
;
129
uint8_t
_length
;
130
SignType
_sign
;
131
std::string
_name
;
132
NewEagle::DbcSignalComment
_comment
;
133
double
_initialValue
;
134
DataType
_type
;
135
MultiplexerMode
_multiplexerMode
;
136
int32_t
_multiplexerSwitch
;
137
};
138
}
139
140
#endif // _NEW_EAGLE_DBC_SIGNAL_H
NewEagle::DbcSignal::_offset
double _offset
Definition:
DbcSignal.h:126
NewEagle::DataType
DataType
Definition:
DbcSignal.h:63
NewEagle::DOUBLE
Definition:
DbcSignal.h:67
NewEagle::DbcSignal::_length
uint8_t _length
Definition:
DbcSignal.h:129
NewEagle::DbcSignal::_dlc
uint8_t _dlc
Definition:
DbcSignal.h:123
NewEagle::DbcSignalComment
Definition:
DbcSignal.h:44
NewEagle::DbcSignalComment::Id
uint32_t Id
Definition:
DbcSignal.h:46
NewEagle
Definition:
Dbc.h:45
NewEagle::FLOAT
Definition:
DbcSignal.h:66
NewEagle::SignType
SignType
Definition:
DbcSignal.h:51
NewEagle::DbcSignal::_endianness
ByteOrder _endianness
Definition:
DbcSignal.h:128
NewEagle::DbcSignal::_multiplexerMode
MultiplexerMode _multiplexerMode
Definition:
DbcSignal.h:135
NewEagle::DbcSignal::_multiplexerSwitch
int32_t _multiplexerSwitch
Definition:
DbcSignal.h:136
NewEagle::MultiplexerMode
MultiplexerMode
Definition:
DbcSignal.h:70
NewEagle::UNSIGNED
Definition:
DbcSignal.h:53
NewEagle::MUX_SWITCH
Definition:
DbcSignal.h:73
NewEagle::DbcSignal::_initialValue
double _initialValue
Definition:
DbcSignal.h:133
NewEagle::DbcSignalComment::Comment
std::string Comment
Definition:
DbcSignal.h:48
NewEagle::MUX_SIGNAL
Definition:
DbcSignal.h:74
NewEagle::DbcSignal::_startBit
uint8_t _startBit
Definition:
DbcSignal.h:127
NewEagle::DbcSignal::_name
std::string _name
Definition:
DbcSignal.h:131
NewEagle::INT
Definition:
DbcSignal.h:65
NewEagle::BIG_END
Definition:
DbcSignal.h:60
NewEagle::DbcSignal::_gain
double _gain
Definition:
DbcSignal.h:125
NewEagle::DbcSignal::_comment
NewEagle::DbcSignalComment _comment
Definition:
DbcSignal.h:132
ros.h
NewEagle::ByteOrder
ByteOrder
Definition:
DbcSignal.h:57
NewEagle::LITTLE_END
Definition:
DbcSignal.h:59
NewEagle::DbcSignalComment::SignalName
std::string SignalName
Definition:
DbcSignal.h:47
NewEagle::DbcSignal
Definition:
DbcSignal.h:77
NewEagle::DbcSignal::_sign
SignType _sign
Definition:
DbcSignal.h:130
NewEagle::DbcSignal::_result
double _result
Definition:
DbcSignal.h:124
NewEagle::NONE
Definition:
DbcSignal.h:72
NewEagle::DbcSignal::_type
DataType _type
Definition:
DbcSignal.h:134
NewEagle::SIGNED
Definition:
DbcSignal.h:54
dbc
Author(s): Ryan Borchert
autogenerated on Fri Mar 20 2020 03:31:33