Skip to content

Commit

Permalink
Added wpilib extensions docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
computer-whisperer committed Jan 2, 2015
1 parent fa76d79 commit e95d309
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
8 changes: 7 additions & 1 deletion docs/yeti_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Two different Interfaces are default to yeti -- events and datastreams.
.. autosummary::
yeti.interfaces

Yeti also comes with a set of convenient extensions to wpilib, which are designed to make module programming easier.

.. autosummary::
yeti.wpilib_extensions

.. toctree::
:hidden:

Expand All @@ -31,4 +36,5 @@ Two different Interfaces are default to yeti -- events and datastreams.
yeti_api/Context
yeti_api/ModuleLoader
yeti_api/ConfigManager
yeti_api/Interfaces
yeti_api/Interfaces
yeti_api/WpilibExtensions
13 changes: 11 additions & 2 deletions docs/yeti_api/Interfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Module Interfaces

Interfaces are the primary method for inter-module communication. They store data in
the current :class:`yeti.Context` using it's :meth:`yeti.Context.get_interface_data()` method. Yeti comes
with two default Interfaces, which should be sufficient for most uses. However, more may easily
with a few default Interfaces, which should be sufficient for most uses. However, more may easily
be created to expand Yeti's functionality.

Events
Expand All @@ -22,9 +22,18 @@ asyncio events by name.
Datastreams
-----------

interfaces.datastreams is the second default interface mechanism. It provides a system for passing
interfaces.datastreams is another default interface mechanism. It provides a system for passing
around data, and triggering asyncio events upon certain conditions.

.. automodule:: yeti.interfaces.datastreams
:members:
:undoc-members:

Gamemode
--------

interfaces.gamemode is an interface mechanisim designed for communicating game mode between modules.

.. automodule:: yeti.interfaces.gamemode
:members:
:undoc-members:
25 changes: 25 additions & 0 deletions docs/yeti_api/WpilibExtensions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

WPILIB Extensions
=================

.. automodule:: yeti.wpilib_extensions

This is a set of extensions to 2015 RoboPy to aid development with Yeti.

Buttons
-------

Buttons is a utility class designed to make joystick-triggered actions easy to implement.

.. autoclass:: yeti.wpilib_extensions.Button
:members:
:undoc-members:

Referee
-------

This is a utility class designed to watch created wpilib objects and cleanly deallocate them upon module unload.

.. autoclass:: yeti.wpilib_extensions.Referee
:members:
:undoc-members:
10 changes: 10 additions & 0 deletions yeti/interfaces/gamemode.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def wait_for_gamemode(modes, context=None):
"""
Waits until one of the indicated modes is set.
This is an asyncio coroutine.
:param modes: One or more modes to wait for.
:param context: The optional context to use for data storage. If none, the current
thread’s context will be used.
Expand Down Expand Up @@ -77,6 +79,8 @@ def wait_for_disabled(context=None):
"""
Waits until the disabled mode is set.
This is an asyncio coroutine.
:param context: The optional context to use for data storage. If none, the current
thread’s context will be used.
"""
Expand All @@ -87,6 +91,8 @@ def wait_for_teleop(context=None):
"""
Waits until the teleoperated mode is set.
This is an asyncio coroutine.
:param context: The optional context to use for data storage. If none, the current
thread’s context will be used.
"""
Expand All @@ -97,6 +103,8 @@ def wait_for_autonomous(context=None):
"""
Waits until the autonomous mode is set.
This is an asyncio coroutine.
:param context: The optional context to use for data storage. If none, the current
thread’s context will be used.
"""
Expand All @@ -107,6 +115,8 @@ def wait_for_enabled(context=None):
"""
Waits until either the autonomous mode or the teleoperated mode is set.
This is an asyncio coroutine.
:param context: The optional context to use for data storage. If none, the current
thread’s context will be used.
"""
Expand Down

0 comments on commit e95d309

Please sign in to comment.