Utility decorators¶
The deocrator module provides several decorators to make certain things
easier or possible.
-
marsutils.decorator.with_ctrl_manager(klass)[source]¶ A decorator to be used with
MagicRobotrobot classes which automatically processesControlInterfacemembersAny
ControlInterfacewith a_DISPLAY_NAMEvariable defined will be added to a chooser on the dashboard and its associated methods will be automatically calledIf the
_CONTROL_CHOOSER_KEYclass variable is set, that value will be provided to theControlManager
-
marsutils.decorator.with_setup(klass)[source]¶ As the
MagicRobotclass uses therobotInit()method, this decorator providesMagicRobotclasses with asetup()function that is called after thecreateObjects()function is calledFor more information, see robotpy/robotpy-wpilib-utilities#21