update documentation
This commit is contained in:
@ -16,12 +16,12 @@ devsup Package
|
||||
|
||||
.. module:: devsup.db
|
||||
|
||||
.. autofunction:: devsup.db.getRecord
|
||||
.. autofunction:: getRecord
|
||||
|
||||
:class:`Record` Class
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. class:: devsup.db.Record
|
||||
.. class:: Record
|
||||
|
||||
Allows access to a single record instance.
|
||||
*Record* instances can be created for any record in
|
||||
@ -65,7 +65,7 @@ devsup Package
|
||||
:class:`Field` Class
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. autoclass:: devsup.db.Field
|
||||
.. autoclass:: Field
|
||||
|
||||
.. automethod:: name
|
||||
|
||||
@ -77,18 +77,22 @@ devsup Package
|
||||
|
||||
.. automethod:: getarray
|
||||
|
||||
.. automethod:: getarraylen
|
||||
|
||||
.. automethod:: putarraylen
|
||||
|
||||
.. automethod:: fieldinfo
|
||||
|
||||
.. automethod:: getTime
|
||||
|
||||
.. automethod:: getAlarm
|
||||
|
||||
.. autoclass:: devsup.db.IOScanListBlock
|
||||
.. autoclass:: IOScanListBlock
|
||||
:members:
|
||||
:inherited-members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: devsup.db.IOScanListThread
|
||||
.. autoclass:: IOScanListThread
|
||||
:members: add, interrupt
|
||||
|
||||
|
||||
|
@ -62,8 +62,8 @@ The following should be added to individual EPICS Makefiles. ::
|
||||
include $(TOP)/configure/RULES
|
||||
include $(PYDEVSUP)/configure/RULES_PY
|
||||
|
||||
This will add or ammend several make variables. The ``USR_*FLAGS`` variables
|
||||
may be extended with approprate flags for building python modules. The ``PY_VER``
|
||||
This will add or amend several make variables. The ``USR_*FLAGS`` variables
|
||||
may be extended with appropriate flags for building python modules. The ``PY_VER``
|
||||
variable is defined with the Python version number found in install directories (eg "2.7").
|
||||
The ``PY_LD_VER`` variable is defined with the python library version number (eg "3.2mu"),
|
||||
which may be the same as ``PY_VER``.
|
||||
@ -94,7 +94,7 @@ Additional .py files can be installed as follows. ::
|
||||
Building extensions
|
||||
-------------------
|
||||
|
||||
For convienance, additional Python extensions can be build by the EPICS
|
||||
For convenience, additional Python extensions can be build by the EPICS
|
||||
build system. In this example the extension name is "_myextname" and
|
||||
the resulting library is expected to provide the an initialization function
|
||||
named "init_myextname". ::
|
||||
|
60
documentation/gettingstarted.rst
Normal file
60
documentation/gettingstarted.rst
Normal file
@ -0,0 +1,60 @@
|
||||
Getting Started
|
||||
===============
|
||||
|
||||
Counter
|
||||
-------
|
||||
|
||||
Consider a simple EPICS database with one record. Call it :download:`cntrec.db <../testApp/cntrec.db>`
|
||||
|
||||
.. literalinclude:: ../testApp/cntrec.db
|
||||
|
||||
This is creating a single record which will use the "Python Device" support code (aka this package).
|
||||
It will attempt to scan (call the process method) one a second.
|
||||
The *INP* field is parsed and the first work identifies the Python module which will provide
|
||||
the logic behind this record (everything after the first word is passed to the module :py:func:`build` function.
|
||||
|
||||
Now create :download:`cntrec.db <../testApp/cntmod.py>` with the following.
|
||||
|
||||
.. literalinclude:: ../testApp/cntmod.py
|
||||
|
||||
This module is expected to provide a special callable :py:func:`build`.
|
||||
We also provide a constructor and method :py:meth:`detach <DeviceSupport.detach>`
|
||||
which don't do anything.
|
||||
The :py:meth:`process <DeviceSupport.process>` method increments the *VAL* field of the attached :py:class:`Record <devsup.db.Record>`.
|
||||
|
||||
Start this IOC with. ::
|
||||
|
||||
$ ./bin/linux-x86_64/softIocPy2.7 -d cntrec.db
|
||||
Starting iocInit
|
||||
...
|
||||
iocRun: All initialization complete
|
||||
epics>dbl
|
||||
test:count
|
||||
epics>
|
||||
|
||||
Now in another terminal run.::
|
||||
|
||||
$ camonitor test:count
|
||||
...
|
||||
test:count 2014-06-16 16:48:22.891825 9
|
||||
test:count 2014-06-16 16:48:23.891967 10
|
||||
test:count 2014-06-16 16:48:24.892137 11
|
||||
test:count 2014-06-16 16:48:25.892286 12
|
||||
|
||||
It may be necessary to run *export EPICS_CA_ADDR_LIST=localhost* first.
|
||||
|
||||
Additional examples and applications
|
||||
------------------------------------
|
||||
|
||||
This module comes with several examples in *testApp* as well as three complete applications.
|
||||
|
||||
logApp
|
||||
Observes a line based text file as new lines are appended.
|
||||
Writes each line to a charactor array PV.
|
||||
Special handling of caPutLog files.
|
||||
|
||||
pidMonApp
|
||||
Monitors the PID file created by a UNIX daemon.
|
||||
|
||||
weatherApp
|
||||
Retreives weather reports via the *pymetar* module.
|
@ -15,6 +15,7 @@ Contents:
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
|
||||
gettingstarted
|
||||
environment
|
||||
devsup
|
||||
interfaces
|
||||
|
@ -55,7 +55,7 @@ and the string "some other string".
|
||||
of the methods which all Python device support instances must provide.
|
||||
These methods will be called during the course of IOC processing.
|
||||
|
||||
Execptions raised by these methods are printed to the IOC console,
|
||||
Exceptions raised by these methods are printed to the IOC console,
|
||||
but will otherwise be ignored.
|
||||
|
||||
The module :mod:`devsup.interfaces` provides a Zope Interface
|
||||
@ -76,7 +76,7 @@ and the string "some other string".
|
||||
:param reason: ``None`` or an object provided when processing was requested.
|
||||
|
||||
This method is called whenever the associated record needs to be updated
|
||||
in responce to a request. The source of this request is typically determined
|
||||
in response to a request. The source of this request is typically determined
|
||||
by the record's SCAN field.
|
||||
|
||||
The actions taken by this method will depend heavily on the application.
|
||||
@ -120,7 +120,7 @@ and the string "some other string".
|
||||
def allowScan(self, record):
|
||||
return self.a_scan.add(record)
|
||||
|
||||
Which is most cases can be abbriviated to ::
|
||||
Which in most cases can be abbriviated to ::
|
||||
|
||||
class MySup(object):
|
||||
def __init__(self):
|
||||
|
Reference in New Issue
Block a user