X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fopenxc%2Fsignal.hpp;h=ce0a2e10030e57d848612b88778bfbc31e1c5c96;hb=HEAD;hp=e0124c352a4e16033827e22999a922ea034a4741;hpb=014ba2dd29eaadb4d61948ca417c25112f76ee0e;p=src%2Flow-level-can-generator.git diff --git a/src/openxc/signal.hpp b/src/openxc/signal.hpp index e0124c3..ce0a2e1 100755 --- a/src/openxc/signal.hpp +++ b/src/openxc/signal.hpp @@ -8,24 +8,38 @@ namespace openxc { + enum sign_t + { + UNSIGNED = 0, + SIGN_BIT = 1, + ONES_COMPLEMENT = 2, + TWOS_COMPLEMENT = 3, + SIGN_BIT_EXTERN = 4 + }; + class signal { private: std::string id_; std::string generic_name_; - std::uint32_t bit_position_; - std::uint32_t bit_size_; + std::uint32_t bit_position_; + std::uint32_t bit_size_; float factor_; float offset_; std::string decoder_; bool ignore_; bool enabled_; - std::map> states_; - float max_frequency_; + std::map> states_; + float max_frequency_; bool send_same_; bool force_send_changed_; bool writable_; std::string encoder_; + std::pair multiplex_; + sign_t sign_; + std::int32_t bit_sign_position_; + std::string unit_; + public: std::string id() const; void id(const std::string& id); @@ -43,7 +57,11 @@ namespace openxc bool force_send_changed() const; bool writable() const; std::string encoder() const; - + std::pair multiplex() const; + sign_t sign() const; + std::int32_t bit_sign_position() const; + std::string unit() const; + void from_json(const nlohmann::json& j); nlohmann::json to_json() const; };