Skip to content
Snippets Groups Projects
Commit 5c96056d authored by Adrian Knobloch's avatar Adrian Knobloch
Browse files

Fix clearing outdated values in history

parent f2a16472
No related branches found
No related tags found
1 merge request!17Kinematic unit GUI
......@@ -1190,15 +1190,18 @@ void KinematicUnitWidgetController::reportJointMotorTemperatures(const NameValue
void KinematicUnitWidgetController::reportJointStatuses(const NameStatusMap& jointStatuses, Ice::Long timestamp, bool aValueChanged, const Ice::Current&)
{
if (!aValueChanged && reportedJointStatuses.size() > 0)
boost::recursive_mutex::scoped_lock lock(mutexNodeSet);
if (aValueChanged && jointCurrents.size() > 0)
{
return;
jointCurrentHistory.push_back(std::pair<Ice::Long, NameValueMap>(timestamp, jointCurrents));
}
boost::recursive_mutex::scoped_lock lock(mutexNodeSet);
reportedJointStatuses = jointStatuses;
while (jointCurrentHistory.back().first - jointCurrentHistory.front().first > historyTime && jointCurrentHistory.size() > 1)
{
jointCurrentHistory.pop_front();
}
emit jointStatusesReported();
emit jointCurrentsReported();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment