Skip to content

Commit

Permalink
Merge pull request #74 from ablasdel/groovy-devel
Browse files Browse the repository at this point in the history
Fixes #69
  • Loading branch information
ablasdel committed Oct 15, 2014
2 parents ab61a50 + 9ff36b8 commit ad4f6ee
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ def __init__(self, topic="diagnostics"):

self._subscriber = rospy.Subscriber(topic, DiagnosticArray, self._diagnostics_callback)

self._previous_ros_time = rospy.Time.now()
self._timer = QTimer()
self._timer.timeout.connect(self._on_timer)
self._timer.start(5000)
self._timer.start(1000)

self._msg_timer = QTimer()
self._msg_timer.timeout.connect(self._update_messages)
Expand Down Expand Up @@ -314,6 +315,9 @@ def _on_key_press(self, event):
event.ignore()

def _on_timer(self):
if self._previous_ros_time + rospy.Duration(5) > rospy.Time.now():
return
self._previous_ros_time = rospy.Time.now()
for name, item in self._name_to_item.iteritems():
node = item.tree_node
if (item != None):
Expand All @@ -333,15 +337,6 @@ def _on_timer(self):
def set_new_errors_callback(self, callback):
self._new_errors_callback = callback

def get_num_errors(self):
return self._error_node.childCount() + self._stale_node.childCount()

def get_num_warnings(self):
return self._warning_node.childCount()

def get_num_ok(self):
return self._ok_node.childCount()

def _update_root_labels(self):
self._stale_node.setText(0, "Stale (%s)" % (self._stale_node.childCount()))
self._error_node.setText(0, "Errors (%s)" % (self._error_node.childCount()))
Expand Down

0 comments on commit ad4f6ee

Please sign in to comment.