Skip to content

Commit

Permalink
Merge branch 'develop' into feature/sdsm-json-to-cstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
willjohnsonk authored Sep 11, 2023
2 parents 39550fe + a8c58fe commit 2e5eb8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,17 @@ void CARMAStreetsPlugin::OnConfigChanged(const char *key, const char *value) {
void CARMAStreetsPlugin::HandleTimeSyncMessage(tmx::messages::TimeSyncMessage &msg, routeable_message &routeableMsg ) {
PluginClientClockAware::HandleTimeSyncMessage(msg, routeableMsg);
if ( isSimulationMode()) {
PLOG(logINFO) << "Handling TimeSync messages!" << std::endl;
produce_kafka_msg(msg.to_string(), "time_sync");
// TODO: This is a temporary fix for tmx message container property tree
// serializing all attributes as strings. This issue needs to be fixed but
// is currently out of scope. TMX Messages should be correctly serialize to
// and from json. This temporary fix simply using regex to look for numeric,
// null, and bool values and removes the quotations around them.
boost::regex exp("\"(null|true|false|[0-9]+(\\.[0-9]+)?)\"");
std::stringstream ss;
std::string rv = boost::regex_replace(msg.to_string(), exp, "$1");
PLOG(logINFO) << "Sending Time Sync Message " << rv << std::endl;

produce_kafka_msg(rv, "time_sync");
}
}
void CARMAStreetsPlugin::HandleMobilityOperationMessage(tsm3Message &msg, routeable_message &routeableMsg ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,5 @@ namespace CARMAStreetsPlugin

}
}

//std::cout << SDSMDataJson.toStyledString() << std::endl;
}
}

0 comments on commit 2e5eb8d

Please sign in to comment.