plugin.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Copyright 2015 Airbus
00004 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00005 #
00006 # Licensed under the Apache License, Version 2.0 (the "License");
00007 # you may not use this file except in compliance with the License.
00008 # You may obtain a copy of the License at
00009 #
00010 #   http://www.apache.org/licenses/LICENSE-2.0
00011 #
00012 # Unless required by applicable law or agreed to in writing, software
00013 # distributed under the License is distributed on an "AS IS" BASIS,
00014 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015 # See the License for the specific language governing permissions and
00016 # limitations under the License.
00017 
00018 
00019 import rospy
00020 from wrapper_plugin import WrapperPlugin
00021 from airbus_cobot_gui.control_mode import ControlMode
00022 from PyQt4.Qt import QObject
00023 
00024 ## @package: plugin
00025 ##
00026 ## @version 4.0
00027 ## @author  Matignon Martin
00028 ## @date    Last modified 28/02/2014
00029 
00030 ## @class Plugin
00031 ## @brief Plugin interface..
00032 class Plugin(WrapperPlugin):
00033     
00034     def __init__(self, context):
00035         WrapperPlugin.__init__(self, context)
00036         
00037     def onCreate(self, param):
00038         self.logWarn("Plugin %s.onCreate not implemented !"%self.getPluginName())
00039     
00040     def onPause(self):
00041         self.logWarn("Plugin %s.onPause not implemented !"%self.getPluginName())
00042     
00043     def onResume(self):
00044         self.logWarn("Plugin %s.onResume not implemented !"%self.getPluginName())
00045     
00046     def onControlModeChanged(self, mode):
00047         # Default rules, you can custom this method to set your rules
00048         if mode == ControlMode.AUTOMATIC:
00049             self.setEnabled(False)
00050         else:
00051             self.setEnabled(True)
00052         
00053     def onUserChanged(self, user_info):
00054         self.logWarn("Plugin %s.onUserChanged not implemented !"%self.getPluginName())
00055     
00056     def onTranslate(self, lng):
00057         self.logWarn("Plugin %s.onTranslate not implemented !"%self.getPluginName())
00058     
00059     def onEmergencyStop(self, state):
00060         self.tryToPause()
00061     
00062     def onDestroy(self):
00063         self.tryToPause()
00064     
00065     
00066 #End of file
00067 


airbus_cobot_gui
Author(s): Martin Matignon
autogenerated on Thu Jun 6 2019 17:59:19