Changeset 66:f7c8521991df in xplra for src/client


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

Location:
src/client
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc

    r57 r66  
    259259//------------------------------------------------------------------------------
    260260
    261 size_t MultiBuffer::addInt(const string& name) throw()
     261size_t MultiBuffer::addInt(const std::string& name) throw()
    262262{
    263263    unfinalize();
     
    268268//------------------------------------------------------------------------------
    269269
    270 size_t MultiBuffer::addFloat(const string& name) throw()
     270size_t MultiBuffer::addFloat(const std::string& name) throw()
    271271{
    272272    unfinalize();
     
    277277//------------------------------------------------------------------------------
    278278
    279 size_t MultiBuffer::addDouble(const string& name) throw()
     279size_t MultiBuffer::addDouble(const std::string& name) throw()
    280280{
    281281    unfinalize();
     
    286286//------------------------------------------------------------------------------
    287287
    288 size_t MultiBuffer::addFloatArray(const string& name, size_t length,
     288size_t MultiBuffer::addFloatArray(const std::string& name, size_t length,
    289289                                  size_t offset) throw()
    290290{
     
    297297//------------------------------------------------------------------------------
    298298
    299 size_t MultiBuffer::addIntArray(const string& name, size_t length,
     299size_t MultiBuffer::addIntArray(const std::string& name, size_t length,
    300300                                size_t offset) throw()
    301301{
     
    308308//------------------------------------------------------------------------------
    309309
    310 size_t MultiBuffer::addByteArray(const string& name, size_t length,
     310size_t MultiBuffer::addByteArray(const std::string& name, size_t length,
    311311                                 size_t offset) throw()
    312312{
  • src/client/c/hu/varadiistvan/xplra/MultiBuffer.h

    r57 r66  
    329329     * Set the value of the float array dataref with the given ID.
    330330     *
     331     * @param id the ID of the float array dataref
     332     * @param value the source buffer
    331333     * @param length the amount of data, i.e. you can set only a part
    332334     * of the data in the buffer. If 0, it is assumed to be the length
     
    344346     * Get the value of the float array dataref with the given ID
    345347     *
     348     * @param id the ID of the float array dataref
     349     * @param value the destination buffer
    346350     * @param length the size of the buffer. If 0, it is assumed to be
    347351     * the length of the data in the buffer minus the offset (see
     
    360364     * buffer.
    361365     *
     366     * @param id the ID of the float array dataref
    362367     * @param offset the offset within the buffer. If it is not less
    363368     * than the length of the buffer, 0 is returned.
     
    369374     * Set the value of the integer array dataref with the given ID.
    370375     *
     376     * @param id the ID of the integer array dataref
     377     * @param value the source buffer
    371378     * @param length the amount of data, i.e. you can set only a part
    372379     * of the data in the buffer. If 0, it is assumed to be the length
     
    384391     * Get the value of the integer array dataref with the given ID
    385392     *
     393     * @param id the ID of the integer array dataref
     394     * @param value the destination buffer
    386395     * @param length the size of the buffer. If 0, it is assumed to be
    387396     * the length of the data in the buffer minus the offset (see
     
    399408     * Get the array of integer values as a directly readable buffer.
    400409     *
     410     * @param id the ID of the float array dataref
    401411     * @param offset the offset within the buffer. If it is not less
    402412     * than the length of the buffer, 0 is returned.
     
    409419     * Set the value of the byte array dataref with the given ID.
    410420     *
     421     * @param id the ID of the byte array dataref
     422     * @param value the source buffer
    411423     * @param length the amount of data, i.e. you can set only a part
    412424     * of the data in the buffer. If 0, it is assumed to be the length
     
    424436     * Get the value of the byte array dataref with the given ID
    425437     *
     438     * @param id the ID of the byte array dataref
     439     * @param value the destination buffer
    426440     * @param length the size of the buffer. If 0, it is assumed to be
    427441     * the length of the data in the buffer minus the offset (see
     
    433447     */
    434448    size_t getByteArray(size_t id, uint8_t* value,
    435                        size_t length = 0, size_t offset = 0) const
     449                        size_t length = 0, size_t offset = 0) const
    436450        throw(InvalidIDException, TypeMismatchException);
    437451
     
    439453     * Get the array of byte values as a directly readable buffer.
    440454     *
     455     * @param id the ID of the byte array dataref
    441456     * @param offset the offset within the buffer. If it is not less
    442457     * than the length of the buffer, 0 is returned.
  • src/client/c/hu/varadiistvan/xplra/XPlane.h

    r54 r66  
    173173     * Get a possibly partial array of floats.
    174174     *
     175     * @param name the name of the dataref
     176     * @param dest the destination buffer
    175177     * @param length the length of the destination buffer
    176178     * @param offset the offset from which to get the array
     
    185187     * be created with a length needed to hold the returned value.
    186188     *
     189     * @param name the name of the dataref
     190     * @param length will contain the number of floats read
    187191     * @param offset the offset from which to get the array
    188192     */
     
    193197     * Get a possibly partial array of integers.
    194198     *
     199     * @param name the name of the dataref
     200     * @param dest the destination buffer
    195201     * @param length the length of the destination buffer
    196202     * @param offset the offset from which to get the array
     
    205211     * be created with a length needed to hold the returned value.
    206212     *
     213     * @param name the name of the dataref
     214     * @param length will contain the number of integers read
    207215     * @param offset the offset from which to get the array
    208216     */
     
    213221     * Get a possibly partial array of bytes.
    214222     *
     223     * @param name the name of the dataref
     224     * @param dest the destination buffer
    215225     * @param length the length of the destination buffer
    216226     * @param offset the offset from which to get the array
     
    225235     * be created with a length needed to hold the returned value.
    226236     *
    227      * @param offset the offset from which to get the array
    228      */
    229     uint8_t* getByteArray(const char* name, size_t& lengyh,
     237     * @param name the name of the dataref
     238     * @param length will contain the number of bytes read on return
     239     * @param offset the offset from which to get the array
     240     */
     241    uint8_t* getByteArray(const char* name, size_t& length,
    230242                          size_t offset = 0) throw(Exception);
    231243
  • 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.