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 {
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  {
60  BIG_END = 1
61  };
62 
63  enum DataType
64  {
65  INT = 0,
66  FLOAT = 1,
67  DOUBLE = 2
68  };
69 
71  {
72  NONE = 0,
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;
129  uint8_t _length;
131  std::string _name;
137  };
138 }
139 
140 #endif // _NEW_EAGLE_DBC_SIGNAL_H
Definition: Dbc.h:45
ByteOrder _endianness
Definition: DbcSignal.h:128
MultiplexerMode _multiplexerMode
Definition: DbcSignal.h:135
int32_t _multiplexerSwitch
Definition: DbcSignal.h:136
MultiplexerMode
Definition: DbcSignal.h:70
std::string _name
Definition: DbcSignal.h:131
NewEagle::DbcSignalComment _comment
Definition: DbcSignal.h:132


dbc
Author(s): Ryan Borchert
autogenerated on Fri Mar 20 2020 03:31:33