Skip to content

Commit

Permalink
fix second field in generated PSM (#384)
Browse files Browse the repository at this point in the history
* fix second field in generated PSM

* code smell fix for broadcast psm functionality
  • Loading branch information
abey-yoseph authored Jun 6, 2022
1 parent 38f2034 commit ca393f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,15 @@ namespace PedestrianPlugin

std::string milliseconds = dateTimeStr.substr(0, dateTimeStr.find(delimiter2));
milliseconds.erase(0, std::min(milliseconds.find_first_not_of('0'), milliseconds.size()-1));


int millisecondsTotal = (std::stoi(sec) * 1000) + std::stoi(milliseconds);
parsedArr.push_back(std::stoi(year));
parsedArr.push_back(std::stoi(month));
parsedArr.push_back(std::stoi(day));
parsedArr.push_back(std::stoi(hour));
parsedArr.push_back(std::stoi(mins));
parsedArr.push_back(std::stoi(sec));
parsedArr.push_back(std::stoi(milliseconds));
parsedArr.push_back(millisecondsTotal);

return parsedArr;
}
Expand Down
13 changes: 6 additions & 7 deletions src/v2i-hub/PedestrianPlugin/src/PedestrianPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,12 @@ int PedestrianPlugin::checkXML()
//retrieve the PSM queue and send each one to be broadcast, then pop
std::queue<string> currentPSMQueue = flirSession->getPSMQueue();

if (currentPSMQueue.size() > 0)
{
for (int i = 0; i < currentPSMQueue.size(); i++)
{
BroadcastPsm(const_cast<char*>(currentPSMQueue.front().c_str()));
currentPSMQueue.pop();
}
while(!currentPSMQueue.empty())
{
char* char_arr = &currentPSMQueue.front()[0];

BroadcastPsm(char_arr);
currentPSMQueue.pop();
}
}

Expand Down

0 comments on commit ca393f1

Please sign in to comment.