Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 from __future__ import division
00036 
00037 import dynamic_reconfigure.client
00038 from python_qt_binding.QtCore import Qt, QVariant
00039 import rospy
00040 from rqt_py_common.data_items import ReadonlyItem
00041 
00042 class ParameterItem(ReadonlyItem):
00043     """
00044     IMPORTANT: set_param_name method must be called right after 
00045     the constructor is called.
00046     """
00047         
00048     def __init__(self, *args):
00049         """
00050         :param param_name: A string formatted as GRN (Graph Resource Names, see  
00051                            http://www.ros.org/wiki/Names). 
00052                            Example: /paramname/subpara/subsubpara/...
00053         """
00054         
00055         super(ParameterItem, self).__init__(*args)
00056     
00057     def set_param_name(self, param_name):
00058         
00059         self._param_name_raw = param_name
00060         
00061         
00062         self._list_paramname = param_name.split('/')
00063         
00064         
00065         del self._list_paramname[0]  
00066         
00067         self._nodename = self._list_paramname[0]
00068         
00069         rospy.logdebug('ParameterItem.__init__ param_name=%s  self._list_paramname[-1]=%s',
00070                        param_name,
00071                        self._list_paramname[-1])
00072                         
00073     def get_param_name_toplv(self):
00074         """
00075         :rtype: String of the top level param name.
00076         """ 
00077 
00078         return self._name_top
00079     
00080     def get_raw_param_name(self):
00081         return self._param_name_raw
00082     
00083     def get_param_names(self):
00084         """
00085         :rtype: List of string. Null if param
00086         """
00087     
00088         
00089         return self._list_paramname
00090 
00091     def get_node_name(self):
00092         return self._nodename
00093         
00094     def type(self):
00095         return QStandardItem.UserType