emonitor_gui.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 sys
00008 from python_qt_binding import QtCore, QtGui
00009 from dot_graph import DotGraph
00010 
00011 class EMonitorGui(QtGui.QWidget):
00012     def __init__(self):
00013         #Init the base class
00014         QtGui.QWidget.__init__(self)
00015         
00016         self._depGraph = DotGraph()
00017         self._pnGraph = DotGraph()
00018         
00019         self._dep_view = QtGui.QGraphicsView(self._depGraph)
00020         self._pn_view = QtGui.QGraphicsView(self._pnGraph)
00021                      
00022         pass
00023 
00024     def setup(self, name, ros):
00025         self.setObjectName(name);
00026         pass
00027     
00028     def unload(self):
00029         pass
00030 
00031     def drawDepGraph(self,data):
00032         self._depGraph.drawDot(data)
00033         self._dep_view.show();
00034         
00035     def drawPNGraph(self,data):
00036         self._pnGraph.drawDot(data)
00037         self._pn_view.show();
00038 
00039 
00040 if __name__ == '__main__':
00041     import rospy
00042     import os
00043     from emonitor_ros import EMonitorROS
00044     import python_qt_binding as pyqt
00045     app = QtGui.QApplication(sys.argv)
00046     rospy.init_node("emonitor")
00047     gui = EMonitorGui()
00048     ros = EMonitorROS()
00049     
00050     #Get file path
00051     ui_file = os.path.join(
00052                 os.path.dirname(
00053                   os.path.realpath(__file__)), 
00054                          'resource/EMonitor.ui')
00055     #Load the UI
00056     pyqt.loadUi(ui_file, gui)   
00057     #Connect the user interface and ROS
00058     ros.setup(gui)
00059     gui.setup("EMonitor", ros)
00060     #Start GUI
00061     gui.show()
00062     
00063     sys.exit(app.exec_())


labust_gui
Author(s): Gyula Nagy
autogenerated on Fri Feb 7 2014 11:36:55