Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Sep 12, 2019
2 parents 5222053 + a94bf40 commit 4a756ea
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 5 deletions.
2 changes: 2 additions & 0 deletions apstools/synApps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#-----------------------------------------------------------------------------


from .asyn import *
from .busy import *
from .calcout import *
from .epid import *
Expand All @@ -42,6 +43,7 @@
from .transform import *

__all__ = """
AsynRecord
BusyRecord
BusyStatus
CalcoutRecord
Expand Down
57 changes: 57 additions & 0 deletions apstools/synApps/asyn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

"""
Ophyd support for the EPICS asyn record
Public Structures
.. autosummary::
~AsynRecord
:see: https://github.com/epics-modules/asyn
"""

#-----------------------------------------------------------------------------
# :author: Pete R. Jemian
# :email: jemian@anl.gov
# :copyright: (c) 2017-2019, UChicago Argonne, LLC
#
# Distributed under the terms of the Creative Commons Attribution 4.0 International Public License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-----------------------------------------------------------------------------

from ophyd.device import Component
from ophyd import EpicsSignal, EpicsSignalRO
from ._common import EpicsRecordDeviceCommonAll


__all__ = ["AsynRecord", ]


class AsynRecord(EpicsRecordDeviceCommonAll):
"""
EPICS asyn record support in ophyd
:see: https://epics.anl.gov/modules/soft/asyn/R4-36/asynRecord.html
:see: https://github.com/epics-modules/asyn
:see: https://epics.anl.gov/modules/soft/asyn/
"""
ascii_output = Component(EpicsSignal, ".AOUT")
binary_output = Component(EpicsSignal, ".BOUT")
binary_output_maxlength = Component(EpicsSignal, ".BMAX")
end_of_message_reason = Component(EpicsSignalRO, ".EOMR")
input_format = Component(EpicsSignalRO, ".IFMT")
interface = Component(EpicsSignal, ".IFACE")
number_bytes_actually_read = Component(EpicsSignalRO, ".NRRD")
number_bytes_actually_written = Component(EpicsSignalRO, ".NAWT")
number_bytes_to_read = Component(EpicsSignal, ".NORD")
number_bytes_to_write = Component(EpicsSignal, ".NOWT")
octet_is_valid = Component(EpicsSignalRO, ".OCTETIV")
output_format = Component(EpicsSignalRO, ".OFMT")
terminator_input = Component(EpicsSignal, ".IEOS")
terminator_output = Component(EpicsSignal, ".OEOS")
timeout = Component(EpicsSignal, ".TMOT")
transaction_mode = Component(EpicsSignal, ".TMOD")
translated_input = Component(EpicsSignal, ".TINP")
7 changes: 4 additions & 3 deletions apstools/synApps/calcout.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class UserCalcoutDevice(Device):
calcout9 = Cpt(CalcoutRecord, 'userCalcOut9')
calcout10 = Cpt(CalcoutRecord, 'userCalcOut10')

def reset(self):
def reset(self): # lgtm [py/similar-function]
"""set all fields to default values"""
self.calcout1.reset()
self.calcout2.reset()
Expand Down Expand Up @@ -281,8 +281,9 @@ def setup_gaussian_calcout(calcout, ref_signal, center=0, width=1, scale=1, nois
noise=noise)


def setup_lorentzian_calcout(calcout, ref_signal,
center=0, width=1, scale=1, noise=0.05):
def setup_lorentzian_calcout(calcout, ref_signal,
center=0, width=1,
scale=1, noise=0.05): # lgtm [py/similar-function]
"""
setup calcout record for noisy Lorentzian
Expand Down
2 changes: 1 addition & 1 deletion apstools/synApps/swait.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class UserCalcsDevice(Device):
calc9 = Cpt(SwaitRecord, 'userCalc9')
calc10 = Cpt(SwaitRecord, 'userCalc10')

def reset(self):
def reset(self): # lgtm [py/similar-function]
"""set all fields to default values"""
self.calc1.reset()
self.calc2.reset()
Expand Down
2 changes: 1 addition & 1 deletion apstools/synApps/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class UserTransformsDevice(Device):
transform9 = Cpt(TransformRecord, 'userTran9')
transform10 = Cpt(TransformRecord, 'userTran10')

def reset(self):
def reset(self): # lgtm [py/similar-function]
"""set all fields to default values"""
self.transform1.reset()
self.transform2.reset()
Expand Down
10 changes: 10 additions & 0 deletions docs/source/source/synApps/_asyn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

synApps asyn record
-------------------

see the synApps ``asyn`` module suppport:
https://github.com/epics-modules/asyn

.. automodule:: apstools.synApps.asyn
:members:

0 comments on commit 4a756ea

Please sign in to comment.