emonitor_ros.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 '''
00003 Created on Sep 10, 2013
00004  \todo Add license information here
00005 @author: dnad
00006 '''
00007 import rospy
00008 from python_qt_binding import QtCore
00009 from std_msgs.msg import String
00010 
00011 class EMonitorROS(QtCore.QObject):
00012         def __init__(self):
00013             QtCore.QObject.__init__(self)
00014         
00015         def setup(self, gui):
00016             self._connect_signals(gui)
00017             self._subscribe()
00018             pass
00019         
00020         def unload(self):
00021             pass
00022 
00023         def _connect_signals(self, gui):
00024             QtCore.QObject.connect(self, 
00025                 QtCore.SIGNAL("onDepGraph"), gui.drawDepGraph)
00026             QtCore.QObject.connect(self, 
00027                 QtCore.SIGNAL("onPNGraph"), gui.drawPNGraph)
00028             
00029         def _subscribe(self):
00030             
00031             self._depGraph = rospy.Subscriber("dependency_graph", String,
00032                                 lambda data:
00033                                     self.emit(QtCore.SIGNAL("onDepGraph"), 
00034                                           data.data))
00035             self._pnGraph = rospy.Subscriber("petri_net_graph", String,
00036                                 lambda data:
00037                                     self.emit(QtCore.SIGNAL("onPNGraph"), 
00038                                           data.data))
00039             pass
00040         
00041         def _unsubscribe(self):
00042             self._depGraph.unregister()
00043             self._pnGraph.unregister()
00044             
00045             
00046             


labust_gui
Author(s): Gyula Nagy
autogenerated on Sun Mar 1 2015 12:12:46