60 std::istringstream
f(dbcFile);
62 uint32_t lineNumber = 0;
68 while (std::getline(f, line,
'\n'))
75 std::string identifier;
80 catch(std::exception& ex)
82 identifier = std::string();
95 ROS_WARN(
"LineParser Exception: [%s]", exlp.what());
97 catch(std::exception& ex)
99 ROS_ERROR(
"DBC Message Parser Exception: [%s]", ex.what());
113 ROS_WARN(
"LineParser Exception: [%s]", exlp.what());
115 catch(std::exception& ex)
117 ROS_ERROR(
"DBC Signal Parser Exception: [%s]", ex.what());
130 std::map<std::string, NewEagle::DbcMessage>::iterator it;
136 if (it->second.GetRawId() == dbcMessageComment.
Id)
138 it->second.SetComment(dbcMessageComment);
147 std::map<std::string, NewEagle::DbcMessage>::iterator it;
150 if (it->second.GetRawId() == dbcSignalComment.
Id)
153 std::map<std::string, NewEagle::DbcSignal>::iterator its;
157 if (its->second.GetName() == dbcSignalComment.
SignalName)
169 ROS_WARN(
"LineParser Exception: [%s]", exlp.what());
171 catch(std::exception& ex)
173 ROS_ERROR(
"DBC Comment Parser Exception: [%s]", ex.what());
184 std::map<std::string, NewEagle::DbcMessage>::iterator it;
187 if (it->second.GetRawId() == dbcAttribute.
Id)
189 std::map<std::string, NewEagle::DbcSignal>::iterator its;
193 if (its->second.GetName() == dbcAttribute.
SignalName)
202 std::stringstream ss;
203 ss << dbcAttribute.
Value;
206 double val = gain * f + offset;
217 ROS_WARN(
"LineParser Exception: [%s]", exlp.what());
219 catch(std::exception& ex)
221 ROS_ERROR(
"DBC Signal Value Type Parser Exception: [%s]", ex.what());
236 std::map<std::string, NewEagle::DbcMessage>::iterator it;
239 if (it->second.GetRawId() == dbcSignalValueType.
Id)
241 std::map<std::string, NewEagle::DbcSignal>::iterator its;
245 if (its->second.GetName() == dbcSignalValueType.
SignalName)
258 ROS_WARN(
"LineParser Exception: [%s]", exlp.what());
260 catch(std::exception& ex)
262 ROS_ERROR(
"DBC Signal Value Type Parser Exception: [%s]", ex.what());
std::string EnumValueToken
static NewEagle::DbcMessageComment ReadMessageComment(NewEagle::LineParser parser)
static NewEagle::DbcMessage ReadMessage(NewEagle::LineParser parser)
void SetRawText(std::string rawText)
NewEagle::Dbc NewDbc(const std::string &dbcFile)
static NewEagle::DbcSignal ReadSignal(NewEagle::LineParser parser)
void AddMessage(std::string messageName, NewEagle::DbcMessage message)
static NewEagle::DbcAttribute ReadAttribute(NewEagle::LineParser parser)
void SetDataType(DataType type)
std::string ReadCIdentifier()
NewEagle::DbcMessage * GetMessage(std::string messageName)
static NewEagle::DbcSignalComment ReadSignalComment(NewEagle::LineParser parser)
std::map< std::string, NewEagle::DbcSignal > * GetSignals()
void AddSignal(std::string signalName, NewEagle::DbcSignal signal)
std::string SignalValueTypeToken
std::map< std::string, NewEagle::DbcMessage > * GetMessages()
static NewEagle::DbcSignalValueType ReadSignalValueType(NewEagle::LineParser parser)
std::string AttributeToken
uint16_t GetMessageCount()
void SetInitialValue(double value)
void SetComment(NewEagle::DbcMessageComment comment)
std::string GetName() const