# Path: robot_designer_plugin/interface/model.py
# @LogFunction
# def check_armature(layout, context):
#     """
#     Helper function that checks whether a :ref:`armature` is selected. If not it draws a selection box.
# 
#     :param layout: Current GUI element (e.g., collapsible box, row, etc.)
#     :param context: Blender context
#     :return: Whether a robot model is selected (Bool).
#     """
#     if context.active_object is not None and context.active_object.type == "ARMATURE":
#         return True
#     else:
#         layout.menu(menus.ModelMenu.bl_idname, text="Select Robot")
#         return False
# 
# Path: robot_designer_plugin/interface/helpers.py
# class ControllerBox(CollapsibleBase):
#     property_name = "controller_box"
# 
# Path: robot_designer_plugin/core/logfile.py
# def LogFunction(func):
#     """
#     Logging / exception handling decorator for functions (use for draw function for instance).
# 
#     :param func: The function to decorate
#     :return: A :term:`decorator`
#     """
# 
#     def func_logger(self, context):
# 
#         # Execute the Operator
#         try:
#             return func(self, context)
# 
#         except Exception as e:
#             gui_logger.error("Draw function in {} module threw an exception:\n {} {} {} {} {}".format(
#                              func.__module__, EXCEPTION_MESSAGE, type(e).__name__, e, log_callstack(), log_callstack(back_trace=True)))
#             InfoBox.global_messages.append(e)
# 
#     return func_logger


from .model import check_armature
from .helpers import ControllerBox
from ..core.logfile import LogFunction
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####

# #####
#
# Copyright (c) 2015, Karlsruhe Institute of Technology (KIT)
# Copyright (c) 2016, FZI Forschungszentrum Informatik
#
# Changes:
#   2015:       Stefan Ulbrich (FZI), Gui redesigned
#   2015-01-16: Stefan Ulbrich (FZI), Major refactoring. Integrated into complex plugin framework.
#
# ######

# RobotDesigner imports


@LogFunction
def draw(layout, context):
    """
    Draws the user interface for modifying the joint controller of a segment.

    :param layout: Current GUI element (e.g., collapsible box, row, etc.)
    :param context: Blender context
    """


# Path: robot_designer_plugin/interface/model.py
# @LogFunction
# def check_armature(layout, context):
#     """
#     Helper function that checks whether a :ref:`armature` is selected. If not it draws a selection box.
# 
#     :param layout: Current GUI element (e.g., collapsible box, row, etc.)
#     :param context: Blender context
#     :return: Whether a robot model is selected (Bool).
#     """
#     if context.active_object is not None and context.active_object.type == "ARMATURE":
#         return True
#     else:
#         layout.menu(menus.ModelMenu.bl_idname, text="Select Robot")
#         return False
# 
# Path: robot_designer_plugin/interface/helpers.py
# class ControllerBox(CollapsibleBase):
#     property_name = "controller_box"
# 
# Path: robot_designer_plugin/core/logfile.py
# def LogFunction(func):
#     """
#     Logging / exception handling decorator for functions (use for draw function for instance).
# 
#     :param func: The function to decorate
#     :return: A :term:`decorator`
#     """
# 
#     def func_logger(self, context):
# 
#         # Execute the Operator
#         try:
#             return func(self, context)
# 
#         except Exception as e:
#             gui_logger.error("Draw function in {} module threw an exception:\n {} {} {} {} {}".format(
#                              func.__module__, EXCEPTION_MESSAGE, type(e).__name__, e, log_callstack(), log_callstack(back_trace=True)))
#             InfoBox.global_messages.append(e)
# 
#     return func_logger


# Path: robot_designer_plugin/interface/controllers.py
from .model import check_armature
from .helpers import ControllerBox
from ..core.logfile import LogFunction

#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####

# #####
#
# Copyright (c) 2015, Karlsruhe Institute of Technology (KIT)
# Copyright (c) 2016, FZI Forschungszentrum Informatik
#
# Changes:
#   2015:       Stefan Ulbrich (FZI), Gui redesigned
#   2015-01-16: Stefan Ulbrich (FZI), Major refactoring. Integrated into complex plugin framework.
#
# ######

# RobotDesigner imports


@LogFunction
def draw(layout, context):
    """
    Draws the user interface for modifying the joint controller of a segment.

    :param layout: Current GUI element (e.g., collapsible box, row, etc.)
    :param context: Blender context
    """


    if not check_armature(layout, context):