Changeset 66:f7c8521991df in xplra for src/client/python


Ignore:
Timestamp:
04/09/13 15:41:24 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added the Doxygen configuration file and updated the documentation to eliminate the warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/client/python/xplra.py

    r64 r66  
    88#-------------------------------------------------------------------------------
    99
     10## @package xplra
     11#
     12# Python client module and C/C++ client library for the X-Plane Remote
     13# Access plugin
     14
     15#-------------------------------------------------------------------------------
     16
     17## Protocol command: query the value of a single dataref
    1018COMMAND_GET_SINGLE = 0x01
    1119
     20## Protocol command: set the value of a single dataref
    1221COMMAND_SET_SINGLE = 0x02
    1322
     23## Protocol command: query the value of several datarefs
    1424COMMAND_GET_MULTI = 0x03
    1525
     26## Protocol command: set the value of several datarefs
    1627COMMAND_SET_MULTI = 0x04
    1728
     29## Protocol command: register a multi-dataref getter
    1830COMMAND_REGISTER_GET_MULTI = 0x11
    1931
     32## Protocol command: unregister a multi-dataref getter
    2033COMMAND_UNREGISTER_GET_MULTI = 0x12
    2134
     35## Protocol command: execute a registered multi-dataref getter
    2236COMMAND_EXECUTE_GET_MULTI = 0x13
    2337
     38## Protocol command: register a multi-dataref setter
    2439COMMAND_REGISTER_SET_MULTI = 0x21
    2540
     41## Protocol command: unregister a multi-dataref setter
    2642COMMAND_UNREGISTER_SET_MULTI = 0x22
    2743
     44## Protocol command: execute a registered multi-dataref setter
    2845COMMAND_EXECUTE_SET_MULTI = 0x23
    2946
     47## Protocol command: get the versions of X-Plane, XPLM and XPLRA
    3048COMMAND_GET_VERSIONS = 0x31
    3149
     50## Protocol command: reload all plugins
    3251COMMAND_RELOAD_PLUGINS = 0x32
    3352
     53## Protocol command: show a message to the pilot
    3454COMMAND_SHOW_MESSAGE = 0x41
    3555
     56## Protocol command: register hotkeys
    3657COMMAND_REGISTER_HOTKEYS = 0x51
    3758
     59## Protocol command: query the status of registered hotkeys
    3860COMMAND_QUERY_HOTKEYS = 0x52
    3961
     62## Protocol command: unregister hotkeys
    4063COMMAND_UNREGISTER_HOTKEYS = 0x53
    4164
     65## Protocol type constant: integer
    4266TYPE_INT = 0x01
    4367
     68## Protocol type constant: single-precision floating point
    4469TYPE_FLOAT = 0x02
    4570
     71## Protocol type constant: double-precision floating point
    4672TYPE_DOUBLE = 0x03
    4773
     74## Protocol type constant: array of single-precision floating point values
    4875TYPE_FLOAT_ARRAY = 0x11
    4976
     77## Protocol type constant: array of integers
    5078TYPE_INT_ARRAY = 0x12
    5179
     80## Protocol type constant: array of bytes
    5281TYPE_BYTE_ARRAY = 0x13
    5382
     83## Protocol result: OK
    5484RESULT_OK = 0x00
    5585
     86## Protocol result: an invalid command was sent
    5687RESULT_INVALID_COMMAND = 0x01
    5788
     89## Protocol result: an unknown dataref was attempted to query or set
    5890RESULT_UNKNOWN_DATAREF = 0x02
    5991
     92## Protocol result: invalid type
    6093RESULT_INVALID_TYPE = 0x03
    6194
     95## Protocol result: invalid length
    6296RESULT_INVALID_LENGTH = 0x04
    6397
     98## Protocol result: invalid offset
    6499RESULT_INVALID_OFFSET = 0x05
    65100
     101## Protocol result: invalid count
    66102RESULT_INVALID_COUNT = 0x06
    67103
     104## Protocol result: invalid ID
    68105RESULT_INVALID_ID = 0x07
    69106
     107## Protocol result: invalid duration
    70108RESULT_INVALID_DURATION = 0x08
    71109
     110## Protocol result: other error
    72111RESULT_OTHER_ERROR = 0xff
    73112
     113## Hotkey modifier: Shift
    74114HOTKEY_MODIFIER_SHIFT = 0x0100
    75115
     116## Hotkey modifier: Control
    76117HOTKEY_MODIFIER_CONTROL = 0x0200
    77118
     
    80121class ProtocolException(Exception):
    81122    """Exception to signify protocol errors."""
     123
     124    ## mapping from result codes to their string representation
    82125    _message = { RESULT_INVALID_COMMAND : "invalid command",
    83126                 RESULT_UNKNOWN_DATAREF : "unknown dataref",
     
    90133                 RESULT_OTHER_ERROR : "other error" }
    91134
     135    ## @var resultCode
     136    # the result code, one of the RESULT_XXX constants
     137    ## @var parameter
     138    # an optional parameter for the result
     139
    92140    @staticmethod
    93141    def getMessage(resultCode):
     
    99147
    100148    def __init__(self, resultCode, parameter = None):
     149        """Construct the exception."""
    101150        message = "xplra.ProtocolException: " + self.getMessage(resultCode)
    102151        if parameter is not None:
     
    116165    class Win32NamedPipe(io.RawIOBase):
    117166        """A stream object to represent a Win32 named pipe."""
     167        ## @var _handle
     168        # the Windows file handle for the pipe
     169
    118170        def __init__(self, name):
    119171            """Construct the pipe with the given name."""
     
    211263class XPlane(object):
    212264    """The main class representing the connection to X-Plane."""
     265
     266    ## @var _stream
     267    # the data stream used to communicate with the plugin
     268    ## @var _multiBuffers
     269    # the list of multi-dataref buffers belonging to this object
    213270
    214271    @staticmethod
     
    574631class MultiBuffer(object):
    575632    """Buffer for querying or setting multi-dataref values."""
     633
     634    ## @var _xplane
     635    # the \ref XPlane object this buffer belongs to
     636
     637    ## @var _registerCommand
     638    # the command used to perform the registration of this buffer
     639    # (\ref COMMAND_REGISTER_GET_MULTI or \ref COMMAND_REGISTER_SET_MULTI)
     640
     641    ## @var _unregisterCommand
     642    # the command used to perform the registration of this buffer
     643    # (\ref COMMAND_UNREGISTER_GET_MULTI or \ref COMMAND_UNREGISTER_SET_MULTI)
     644
     645    ## @var _dataRefs
     646    # the datarefs belonging to the buffer
     647
     648    ## @var _values
     649    # the value of the datarefs before setting or after querying
     650
     651    ## @var _registeredID
     652    # the ID with which the buffer is registered in X-Plane
     653
    576654    @staticmethod
    577655    def _getDefault(type, length):
Note: See TracChangeset for help on using the changeset viewer.