aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-config-generator/src/openxc
diff options
context:
space:
mode:
Diffstat (limited to 'CAN-config-generator/src/openxc')
-rwxr-xr-xCAN-config-generator/src/openxc/can_message.cpp6
-rwxr-xr-xCAN-config-generator/src/openxc/message_set.cpp2
-rwxr-xr-xCAN-config-generator/src/openxc/signal.cpp6
-rwxr-xr-xCAN-config-generator/src/openxc/signal.hpp4
4 files changed, 9 insertions, 9 deletions
diff --git a/CAN-config-generator/src/openxc/can_message.cpp b/CAN-config-generator/src/openxc/can_message.cpp
index fab5a85f..40e897b2 100755
--- a/CAN-config-generator/src/openxc/can_message.cpp
+++ b/CAN-config-generator/src/openxc/can_message.cpp
@@ -69,8 +69,8 @@ namespace openxc
name_ = j.count("name") ? j["name"].get<std::string>() : "";
handlers_ = j.count("handlers") ? j["handlers"].get<std::vector<std::string>>() : std::vector<std::string>();
enabled_ = j.count("enabled") ? j["enabled"].get<bool>() : true;
- max_frequency_ = j.count("max_frequency") ? j["max_frequency"].get<float>() : 0;
- max_signal_frequency_ = j.count("max_signal_frequency") ? j["max_signal_frequency"].get<float>() : 0;
+ max_frequency_ = (float)j.count("max_frequency") ? j["max_frequency"].get<float>() : 5;
+ max_signal_frequency_ = j.count("max_signal_frequency") ? j["max_signal_frequency"].get<float>() : 5;
force_send_changed_ = j.count("force_send_changed") ? j["force_send_changed"].get<bool>() : true;
force_send_changed_signals_ = j.count("force_send_changed_signals") ? j["force_send_changed_signals"].get<bool>() : false;
@@ -89,7 +89,7 @@ namespace openxc
std::uint32_t can_message::get_signals_count() const
{
- return signals_.size();
+ return (uint32_t)signals_.size();
}
nlohmann::json can_message::to_json() const
diff --git a/CAN-config-generator/src/openxc/message_set.cpp b/CAN-config-generator/src/openxc/message_set.cpp
index c47c45f8..d6745bfc 100755
--- a/CAN-config-generator/src/openxc/message_set.cpp
+++ b/CAN-config-generator/src/openxc/message_set.cpp
@@ -89,7 +89,7 @@ namespace openxc
{
name_ = j["name"].get<std::string>();
bit_numbering_inverted_ = j.count("bit_numbering_inverted") ? j["bit_numbering_inverted"].get<bool>() : false; // TODO: should be true by default if database-backed.
- max_message_frequency_ = j.count("max_message_frequency") ? j["max_message_frequency"].get<std::uint32_t>() : 0;
+ max_message_frequency_ = j.count("max_message_frequency") ? j["max_message_frequency"].get<float>() : 0.0f;
raw_can_mode_ = j.count("raw_can_mode") ? j["raw_can_mode"].get<can_bus_mode>() : can_bus_mode::off;
parents_ = j.count("parents") ? j["parents"].get<std::vector<std::string>>() : std::vector<std::string>();
initializers_ = j.count("initializers") ? j["initializers"].get<std::vector<std::string>>() : std::vector<std::string>();
diff --git a/CAN-config-generator/src/openxc/signal.cpp b/CAN-config-generator/src/openxc/signal.cpp
index 6c3ff82a..e9c1088b 100755
--- a/CAN-config-generator/src/openxc/signal.cpp
+++ b/CAN-config-generator/src/openxc/signal.cpp
@@ -34,7 +34,7 @@ namespace openxc
return factor_;
}
- std::uint32_t signal::offset() const
+ float signal::offset() const
{
return offset_;
}
@@ -90,11 +90,11 @@ namespace openxc
bit_position_ = j.count("bit_position") ? j["bit_position"].get<std::uint32_t>() : 0;
bit_size_ = j.count("bit_size") ? j["bit_size"].get<std::uint32_t>() : 0;
factor_ = j.count("factor") ? j["factor"].get<float>() : 1.0f;
- offset_ = j.count("offset") ? j["offset"].get<std::uint32_t>() : 0;
+ offset_ = j.count("offset") ? j["offset"].get<float>() : 0.0f;
decoder_ = j.count("decoder") ? j["decoder"].get<std::string>() : "";
ignore_ = j.count("ignore") ? j["ignore"].get<bool>() : false;
enabled_ = j.count("enabled") ? j["enabled"].get<bool>() : true;
- max_frequency_ = j.count("max_frequency") ? j["max_frequency"].get<std::uint32_t>() : 0;
+ max_frequency_ = j.count("max_frequency") ? j["max_frequency"].get<float>() : 0.0f;
send_same_ = j.count("send_same") ? j["send_same"].get<bool>() : true;
force_send_changed_ = j.count("force_send_changed") ? j["force_send_changed"].get<bool>() : false;
writable_ = j.count("writable") ? j["writable"].get<bool>() : false;
diff --git a/CAN-config-generator/src/openxc/signal.hpp b/CAN-config-generator/src/openxc/signal.hpp
index 64dba75e..e0124c35 100755
--- a/CAN-config-generator/src/openxc/signal.hpp
+++ b/CAN-config-generator/src/openxc/signal.hpp
@@ -16,7 +16,7 @@ namespace openxc
std::uint32_t bit_position_;
std::uint32_t bit_size_;
float factor_;
- std::uint32_t offset_;
+ float offset_;
std::string decoder_;
bool ignore_;
bool enabled_;
@@ -33,7 +33,7 @@ namespace openxc
std::uint32_t bit_position() const;
std::uint32_t bit_size() const;
float factor() const;
- std::uint32_t offset() const;
+ float offset() const;
std::string decoder() const;
bool ignore() const;
bool enabled() const;