Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #69 #74

Merged
merged 1 commit into from
Oct 15, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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