Changeset - 346c34ac1aee
[Not reviewed]
tip default
0 2 0
John Kemp - 4 years ago 2020-10-06 22:49:26

Updates to neovi module documentation, including adding details to NeoDevice.get_settings.
Tweaks to Sphinx conf.py.
2 files changed with 33 insertions and 12 deletions:
0 comments (0 inline, 0 general)
doc/conf.py
Show inline comments
...
 
@@ -50,7 +50,7 @@ master_doc = 'index'
 

	
 
# General information about the project.
 
project = u'pyneovi'
 
copyright = u'2016, John Kemp'
 
copyright = u'2016-2020, John Kemp'
 

	
 
# The version info for the project you're documenting, acts as replacement for
 
# |version| and |release|, also used in various other places throughout the
...
 
@@ -84,7 +84,7 @@ exclude_patterns = ['_build']
 

	
 
# If true, the current module name will be prepended to all description
 
# unit titles (such as .. function::).
 
#add_module_names = True
 
add_module_names = False
 

	
 
# If true, sectionauthor and moduleauthor directives will be shown in the
 
# output. They are ignored by default.
neovi/neodevice.py
Show inline comments
...
 
@@ -2,7 +2,9 @@
 
# For license information see LICENSE.txt.
 
"""
 
This module provides classes representing neoVI devices, all derived from core
 
functionality in the :py:class:`.NeoDevice` class.
 
functionality in the :py:class:`.NeoDevice` class. These classes form a layer
 
of abstraction on top of the wrapper functions for the ICS DLL API defined in
 
:py:mod:`~neovi.neovi`.
 

 
.. Author: John Kemp <kemp@kempj.co.uk>
 

...
 
@@ -49,10 +51,9 @@ def find_devices(types=neovi.NEODEVICE_A
 
    :param int types: Filter the results to given types of devices. The
 
        NEODEVICE_* constants defined in :py:mod:`~neovi.neovi` can be OR'd
 
        together.
 
    :param bool auto_open: Determines whether each device should be
 
    :param bool auto_open: Determines whether the discovered devices should be
 
        automatically opened. If this is False then you must call
 
        :py:meth:`.NeoDevice.open` in order to open a given device before
 
        using it.
 
        :py:meth:`.NeoDevice.open` on any devices that are to be used.
 
    """
 
    return [device_class_lookup[device.DeviceType](device, auto_open) for device in neovi.FindNeoDevices(types)]
 
    
...
 
@@ -75,11 +76,13 @@ class NeoDevice:
 
    """
 
    Represents a generic neoVI device, providing an interface for transmitting
 
    and receiving messages as well as configuring the device.
 

 
    Typically these objects would be created via a call to
 
    :py:func:`.find_devices`, which returns a list of pre-constructed
 
    NeoDevice objects.
 
    
 
    :param structures.NeoDevice device: Device identifier, as returned by
 
        :py:func:`.neovi.FindNeoDevices` for example. See also
 
        :py:func:`.find_devices` which returns a list of pre-constructed
 
        NeoDevice objects.
 
        :py:func:`.neovi.FindNeoDevices`.
 
    :param bool auto_open: Determines whether the device should be
 
        automatically opened. If this is False then you must call
 
        :py:meth:`.NeoDevice.open` in order to open the device.
...
 
@@ -87,7 +90,8 @@ class NeoDevice:
 
        thread to receive incoming messages. If this is False then you must
 
        process the message queue via the
 
        :py:meth:`.NeoDevice._process_msg_queue` method or fetch the
 
        messages via the :py:meth:`.NeoDevice.get_messages` method.
 
        messages via the :py:meth:`.NeoDevice.get_messages` method. Only
 
        applicable if auto_open = True.
 
    """
 
    def __init__(self, device, auto_open=False, launch_msg_queue_thread=True):
 
        self._device = device
...
 
@@ -133,7 +137,9 @@ class NeoDevice:
 
        """
 
        Get the current device configuration.
 

 
        :return:
 
        :return: A 2-tuple of i) either SUCCESS or an error code (see
 
            `Error Messages <https://cdn.intrepidcs.net/support/neoVIDLL/apiErrorMessages.htm>`_
 
            in the ICS API documentation) and ii) a device-specific configuration object.
 
        """
 
        raise NotImplementedError
 
        
...
 
@@ -379,6 +385,14 @@ class NeoFire(NeoDevice):
 
        NeoDevice.__init__(self, device, auto_open, launch_msg_queue_thread)
 
       
 
    def get_settings(self):
 
        """
 
        Get the current device configuration.
 

 
        :return: A 2-tuple of i) either SUCCESS or an error code (see
 
            `Error Messages <https://cdn.intrepidcs.net/support/neoVIDLL/apiErrorMessages.htm>`_
 
            in the ICS API documentation) and ii) a
 
            :py:class:`.structures.SFireSettings` object.
 
        """
 
        return neovi.GetFireSettings(self._handle)
 
    
 
    def set_settings(self, settings, save_to_eeprom=False):
...
 
@@ -415,6 +429,14 @@ class NeoVCAN3(NeoDevice):
 
        NeoDevice.__init__(self, device, auto_open, launch_msg_queue_thread)
 
       
 
    def get_settings(self):
 
        """
 
        Get the current device configuration.
 

 
        :return: A 2-tuple of i) either SUCCESS or an error code (see
 
            `Error Messages <https://cdn.intrepidcs.net/support/neoVIDLL/apiErrorMessages.htm>`_
 
            in the ICS API documentation) and ii) a
 
            :py:class:`.structures.SVCAN3Settings` object.
 
        """
 
        return neovi.GetVCAN3Settings(self._handle)
 
    
 
    def set_settings(self, settings, save_to_eeprom=False):
...
 
@@ -470,4 +492,3 @@ device_class_lookup = {
 
    neovi.NEODEVICE_BLUE    : NeoBlue,
 
    neovi.NEODEVICE_DW_VCAN : NeoDWVCAN
 
}
 

0 comments (0 inline, 0 general)