Go to the documentation of this file.00001 '''
00002 Created on Sep 10, 2013
00003 \todo Add license information here
00004 @author: dnad
00005 '''
00006 import os
00007
00008 from qt_gui.plugin import Plugin
00009 from python_qt_binding import loadUi, QtCore
00010 from emonitor_gui import EMonitorGui
00011 from emonitor_rqt import EMonitorRqt
00012
00013 class EMonitorRqt(Plugin):
00014
00015 def __init__(self, context):
00016 super(EMonitorRqt, self).__init__(context)
00017
00018 self.setObjectName('EMonitorRqt')
00019
00020
00021 from argparse import ArgumentParser
00022 parser = ArgumentParser()
00023
00024 parser.add_argument("-q", "--quiet", action="store_true",
00025 dest="quiet",
00026 help="Put plugin in silent mode")
00027 args, unknowns = parser.parse_known_args(context.argv())
00028 if not args.quiet:
00029 print 'arguments: ', args
00030 print 'unknowns: ', unknowns
00031
00032
00033 self._gui = EMonitorGUI()
00034 self._ros = EMonitorROS()
00035
00036
00037 ui_file = os.path.join(os.path.dirname(
00038 os.path.realpath(__file__)), 'resource/EMonitor.ui')
00039
00040 loadUi(ui_file, self._gui)
00041
00042 self._ros.setup()
00043 self._gui.setup("EMonitorRqt", self._ros)
00044
00045
00046
00047
00048
00049
00050 if context.serial_number() > 1:
00051 self._widget.setWindowTitle(self._widget.windowTitle() +
00052 (' (%d)' % context.serial_number()))
00053
00054 context.add_widget(self._gui._widget)
00055
00056 def shutdown_plugin(self):
00057
00058 self._gui.unload();
00059 self._ros.unload()
00060 pass
00061
00062 def save_settings(self, plugin_settings, instance_settings):
00063
00064
00065 pass
00066
00067 def restore_settings(self, plugin_settings, instance_settings):
00068
00069
00070 pass
00071
00072
00073
00074
00075