DbcSignal.cpp
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 #include <dbc/DbcSignal.h>
36 
37 namespace NewEagle
38 {
40  uint8_t dlc,
41  double gain,
42  double offset,
43  uint8_t startBit,
44  ByteOrder endianness,
45  uint8_t length,
46  SignType sign,
47  std::string name,
48  MultiplexerMode multiplexerMode)
49  {
50  _dlc = dlc;
51  _gain = gain;
52  _offset = offset;
53  _startBit = startBit;
54  _endianness = endianness;
55  _length = length;
56  _sign = sign;
57  _name = name;
58  _multiplexerMode = multiplexerMode;
59  }
60 
62  uint8_t dlc,
63  double gain,
64  double offset,
65  uint8_t startBit,
66  ByteOrder endianness,
67  uint8_t length,
68  SignType sign,
69  std::string name,
70  MultiplexerMode multiplexerMode,
71  int32_t multiplexerSwitch)
72  {
73  _dlc = dlc;
74  _gain = gain;
75  _offset = offset;
76  _startBit = startBit;
77  _endianness = endianness;
78  _length = length;
79  _sign = sign;
80  _name = name;
81  _multiplexerMode = multiplexerMode;
82  _multiplexerSwitch = multiplexerSwitch;
83  }
84 
86  {
87  }
88 
89  uint8_t DbcSignal::GetDlc() const
90  {
91  return _dlc;
92  }
93 
94  double DbcSignal::GetResult() const
95  {
96  return _result;
97  }
98 
99  double DbcSignal::GetGain() const
100  {
101  return _gain;
102  }
103 
104  double DbcSignal::GetOffset() const
105  {
106  return _offset;
107  }
108 
109  uint8_t DbcSignal::GetStartBit() const
110  {
111  return _startBit;
112  }
113 
115  {
116  return _endianness;
117  }
118 
119  uint8_t DbcSignal::GetLength() const
120  {
121  return _length;
122  }
123 
125  {
126  return _sign;
127  }
128 
129  std::string DbcSignal::GetName() const
130  {
131  return _name;
132  }
133 
134  void DbcSignal::SetResult(double result)
135  {
136  _result = result;
137  }
138 
140  {
141  _comment = comment;
142  }
143 
144  void DbcSignal::SetInitialValue(double value)
145  {
146  _initialValue = value;
147  }
149  {
150  return _initialValue;
151  }
152 
154  {
155  _type = type;
156  }
157 
159  {
160  return _type;
161  }
162 
164  {
165  return _multiplexerMode;
166  }
167 
169  {
170  return _multiplexerSwitch;
171  }
172 }
int32_t GetMultiplexerSwitch() const
Definition: DbcSignal.cpp:168
uint8_t GetLength() const
Definition: DbcSignal.cpp:119
Definition: Dbc.h:45
double GetOffset() const
Definition: DbcSignal.cpp:104
ByteOrder _endianness
Definition: DbcSignal.h:128
MultiplexerMode _multiplexerMode
Definition: DbcSignal.h:135
ByteOrder GetEndianness() const
Definition: DbcSignal.cpp:114
int32_t _multiplexerSwitch
Definition: DbcSignal.h:136
MultiplexerMode
Definition: DbcSignal.h:70
double GetInitialValue()
Definition: DbcSignal.cpp:148
uint8_t GetStartBit() const
Definition: DbcSignal.cpp:109
void SetDataType(DataType type)
Definition: DbcSignal.cpp:153
double GetResult() const
Definition: DbcSignal.cpp:94
SignType GetSign() const
Definition: DbcSignal.cpp:124
void SetComment(NewEagle::DbcSignalComment comment)
Definition: DbcSignal.cpp:139
DbcSignal(uint8_t dlc, double gain, double offset, uint8_t startBit, ByteOrder endianness, uint8_t length, SignType sign, std::string name, MultiplexerMode multiplexerMode)
Definition: DbcSignal.cpp:39
MultiplexerMode GetMultiplexerMode() const
Definition: DbcSignal.cpp:163
std::string _name
Definition: DbcSignal.h:131
uint8_t GetDlc() const
Definition: DbcSignal.cpp:89
void SetResult(double result)
Definition: DbcSignal.cpp:134
double GetGain() const
Definition: DbcSignal.cpp:99
NewEagle::DbcSignalComment _comment
Definition: DbcSignal.h:132
DataType GetDataType()
Definition: DbcSignal.cpp:158
void SetInitialValue(double value)
Definition: DbcSignal.cpp:144
std::string GetName() const
Definition: DbcSignal.cpp:129


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