Skip to content

Commit

Permalink
[occ] Special case autoBind to be pushed as bool
Browse files Browse the repository at this point in the history
  • Loading branch information
teo committed Jun 27, 2023
1 parent 63f13c3 commit 41f3ddd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions occ/plugin/OccFMQCommon.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,14 @@ std::tuple<OccLite::nopb::TransitionResponse, ::grpc::Status> doTransition(fair:
boost::split(split, key, std::bind(std::equal_to<>(), '.', std::placeholders::_1));
if (std::find(intKeys.begin(), intKeys.end(), split.back()) != intKeys.end()) {
auto intValue = std::stoi(value);
m_pluginServices->SetProperty(key, intValue);
OLOG(debug) << "SetProperty(chan int) called " << key << ":" << intValue;
if (boost::ends_with(key, "autoBind")) {
auto boolValue = static_cast<bool>(intValue);
m_pluginServices->SetProperty(key, boolValue);
OLOG(debug) << "SetProperty(chan bool) called " << key << ":" << intValue;
} else {
m_pluginServices->SetProperty(key, intValue);
OLOG(debug) << "SetProperty(chan int) called " << key << ":" << intValue;
}
} else {
m_pluginServices->SetProperty(key, value);
OLOG(debug) << "SetProperty(chan string) called " << key << ":" << value;
Expand Down

0 comments on commit 41f3ddd

Please sign in to comment.