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 import rospy
00025 import os
00026 from roslib.packages import get_pkg_dir
00027 from python_qt_binding.QtGui import *
00028 from python_qt_binding.QtCore import *
00029 from python_qt_binding import loadUi
00030
00031
00032
00033
00034
00035 DIR_PLUGINNODEMANAGER_RESOURCES = os.path.join(get_pkg_dir('airbus_plugin_node_manager'),'resources')
00036 DIR_PLUGINNODEMANAGER_IMAGES = DIR_PLUGINNODEMANAGER_RESOURCES+'/images'
00037 DIR_PLUGINNODEMANAGER_LAYOUTS = DIR_PLUGINNODEMANAGER_RESOURCES+'/layouts'
00038 DIR_PLUGINNODEMANAGER_VALUES = DIR_PLUGINNODEMANAGER_RESOURCES+'/values'
00039
00040
00041
00042
00043
00044 class PluginNodeManagerImages():
00045 def __init__(self):
00046 self.uuid = self.__class__.__name__
00047 self.dir = DIR_PLUGINNODEMANAGER_IMAGES
00048 self.icon_launch_ = DIR_PLUGINNODEMANAGER_IMAGES+'/icon_launch_.png'
00049 self.stop = DIR_PLUGINNODEMANAGER_IMAGES+'/stop.png'
00050 self.icon_launch_old = DIR_PLUGINNODEMANAGER_IMAGES+'/icon_launch_old.png'
00051 self.start = DIR_PLUGINNODEMANAGER_IMAGES+'/start.png'
00052 self.launch = DIR_PLUGINNODEMANAGER_IMAGES+'/launch.png'
00053 self.icon_node_manager = DIR_PLUGINNODEMANAGER_IMAGES+'/icon_node_manager.png'
00054 def findById(self, id=""):
00055 try:
00056 return getattr(self,id)
00057 except:
00058 return None
00059
00060 class PluginNodeManagerLayouts():
00061 def __init__(self):
00062 self.uuid = self.__class__.__name__
00063 self.dir = DIR_PLUGINNODEMANAGER_LAYOUTS
00064 self.mainwindow = DIR_PLUGINNODEMANAGER_LAYOUTS+'/mainwindow.ui'
00065 def findById(self, id=""):
00066 try:
00067 return getattr(self,id)
00068 except:
00069 return None
00070
00071 class PluginNodeManagerValues():
00072 def __init__(self):
00073 class PluginNodeManagerStrings():
00074 def __init__(self):
00075 self.uuid = self.__class__.__name__
00076 def findById(self, id=""):
00077 try:
00078 return getattr(self,id)
00079 except:
00080 return None
00081 def nodes_manager_title(self, lng="en"):
00082 if lng == "en":
00083 return "Nodes manager".decode('utf-8')
00084 elif lng == "fr":
00085 return "Gestionnaire de noeuds".decode('utf-8')
00086 else:
00087 return "Nodes manager".decode('utf-8')
00088
00089 def cleanup(self, lng="en"):
00090 if lng == "en":
00091 return "Cleanup".decode('utf-8')
00092 elif lng == "fr":
00093 return "Nettoyer".decode('utf-8')
00094 else:
00095 return "Cleanup".decode('utf-8')
00096
00097 def machine(self, lng="en"):
00098 if lng == "en":
00099 return "Machine".decode('utf-8')
00100 elif lng == "fr":
00101 return "Machine".decode('utf-8')
00102 else:
00103 return "Machine".decode('utf-8')
00104
00105 def node(self, lng="en"):
00106 if lng == "en":
00107 return "Node".decode('utf-8')
00108 elif lng == "fr":
00109 return "Noeud".decode('utf-8')
00110 else:
00111 return "Node".decode('utf-8')
00112
00113 def status(self, lng="en"):
00114 if lng == "en":
00115 return "Status".decode('utf-8')
00116 elif lng == "fr":
00117 return "Statut".decode('utf-8')
00118 else:
00119 return "Status".decode('utf-8')
00120
00121 def ping(self, lng="en"):
00122 if lng == "en":
00123 return "Ping (ms)".decode('utf-8')
00124 elif lng == "fr":
00125 return "Ping (ms)".decode('utf-8')
00126 else:
00127 return "Ping (ms)".decode('utf-8')
00128
00129 def start_stop(self, lng="en"):
00130 if lng == "en":
00131 return "Start/Stop".decode('utf-8')
00132 elif lng == "fr":
00133 return "DĂ©marrer/ArrĂȘtez".decode('utf-8')
00134 else:
00135 return "Start/Stop".decode('utf-8')
00136
00137 class PluginNodeManagerStyles():
00138 def __init__(self):
00139 self.uuid = self.__class__.__name__
00140 self.label = "background-color:#d9d9d9;border-radius: 5px;font-size: 14pt;color: #7c7c7c;"
00141 def findById(self, id=""):
00142 try:
00143 return getattr(self,id)
00144 except:
00145 return None
00146 self.uuid = self.__class__.__name__
00147 self.dir = DIR_PLUGINNODEMANAGER_VALUES
00148 self.strings = PluginNodeManagerStrings()
00149 self.styles = PluginNodeManagerStyles()
00150 def findById(self, id=""):
00151 try:
00152 return getattr(self,id)
00153 except:
00154 return None
00155
00156 class R:
00157 DIR = DIR_PLUGINNODEMANAGER_RESOURCES
00158 images = PluginNodeManagerImages()
00159 layouts = PluginNodeManagerLayouts()
00160 values = PluginNodeManagerValues()
00161 @staticmethod
00162 def getPixmapById(id=""):
00163 return QPixmap(R.images.findById(id))
00164 @staticmethod
00165 def getIconById(id=""):
00166 return QIcon(R.images.findById(id))
00167
00168
00169