summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-11-08 11:09:22 -0500
committerScott Murray <scott.murray@konsulko.com>2022-11-08 16:18:08 +0000
commitcbfe4ddd1ea58e410f7d546330e03b2c88b507c9 (patch)
tree7f91780446b091c73eddfa1a098a5b028c2ba7c5
parent261d50bb043e76a736a1736bb21438f9ac6df464 (diff)
Update message data type handlingneedlefish
KUKSA.val 0.2.1 always returned numeric values as floating point, this has changed with 0.2.5 and support is required to handle data points actually having integer or unsigned integer types. Bug-AGL: SPEC-4598 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Ia37a52e1dee6726ef56f5e9d7efe445b112c344d
-rw-r--r--src/vis-session.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vis-session.cpp b/src/vis-session.cpp
index 880e3ae..53a554c 100644
--- a/src/vis-session.cpp
+++ b/src/vis-session.cpp
@@ -288,6 +288,12 @@ bool VisSession::parseData(const json &message, std::string &path, std::string &
} else if (dp["value"].is_number_float()) {
double num = dp["value"];
value = std::to_string(num);
+ } else if (dp["value"].is_number_unsigned()) {
+ unsigned int num = dp["value"];
+ value = std::to_string(num);
+ } else if (dp["value"].is_number_integer()) {
+ int num = dp["value"];
+ value = std::to_string(num);
} else if (dp["value"].is_boolean()) {
value = dp["value"] ? "true" : "false";
} else {