Skip to content

Commit 4a756ea

Browse files
committed
2 parents 5222053 + a94bf40 commit 4a756ea

File tree

6 files changed

+75
-5
lines changed

6 files changed

+75
-5
lines changed

apstools/synApps/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#-----------------------------------------------------------------------------
3434

3535

36+
from .asyn import *
3637
from .busy import *
3738
from .calcout import *
3839
from .epid import *
@@ -42,6 +43,7 @@
4243
from .transform import *
4344

4445
__all__ = """
46+
AsynRecord
4547
BusyRecord
4648
BusyStatus
4749
CalcoutRecord

apstools/synApps/asyn.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
"""
3+
Ophyd support for the EPICS asyn record
4+
5+
6+
Public Structures
7+
8+
.. autosummary::
9+
10+
~AsynRecord
11+
12+
:see: https://github.com/epics-modules/asyn
13+
"""
14+
15+
#-----------------------------------------------------------------------------
16+
# :author: Pete R. Jemian
17+
18+
# :copyright: (c) 2017-2019, UChicago Argonne, LLC
19+
#
20+
# Distributed under the terms of the Creative Commons Attribution 4.0 International Public License.
21+
#
22+
# The full license is in the file LICENSE.txt, distributed with this software.
23+
#-----------------------------------------------------------------------------
24+
25+
from ophyd.device import Component
26+
from ophyd import EpicsSignal, EpicsSignalRO
27+
from ._common import EpicsRecordDeviceCommonAll
28+
29+
30+
__all__ = ["AsynRecord", ]
31+
32+
33+
class AsynRecord(EpicsRecordDeviceCommonAll):
34+
"""
35+
EPICS asyn record support in ophyd
36+
37+
:see: https://epics.anl.gov/modules/soft/asyn/R4-36/asynRecord.html
38+
:see: https://github.com/epics-modules/asyn
39+
:see: https://epics.anl.gov/modules/soft/asyn/
40+
"""
41+
ascii_output = Component(EpicsSignal, ".AOUT")
42+
binary_output = Component(EpicsSignal, ".BOUT")
43+
binary_output_maxlength = Component(EpicsSignal, ".BMAX")
44+
end_of_message_reason = Component(EpicsSignalRO, ".EOMR")
45+
input_format = Component(EpicsSignalRO, ".IFMT")
46+
interface = Component(EpicsSignal, ".IFACE")
47+
number_bytes_actually_read = Component(EpicsSignalRO, ".NRRD")
48+
number_bytes_actually_written = Component(EpicsSignalRO, ".NAWT")
49+
number_bytes_to_read = Component(EpicsSignal, ".NORD")
50+
number_bytes_to_write = Component(EpicsSignal, ".NOWT")
51+
octet_is_valid = Component(EpicsSignalRO, ".OCTETIV")
52+
output_format = Component(EpicsSignalRO, ".OFMT")
53+
terminator_input = Component(EpicsSignal, ".IEOS")
54+
terminator_output = Component(EpicsSignal, ".OEOS")
55+
timeout = Component(EpicsSignal, ".TMOT")
56+
transaction_mode = Component(EpicsSignal, ".TMOD")
57+
translated_input = Component(EpicsSignal, ".TINP")

apstools/synApps/calcout.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class UserCalcoutDevice(Device):
176176
calcout9 = Cpt(CalcoutRecord, 'userCalcOut9')
177177
calcout10 = Cpt(CalcoutRecord, 'userCalcOut10')
178178

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

283283

284-
def setup_lorentzian_calcout(calcout, ref_signal,
285-
center=0, width=1, scale=1, noise=0.05):
284+
def setup_lorentzian_calcout(calcout, ref_signal,
285+
center=0, width=1,
286+
scale=1, noise=0.05): # lgtm [py/similar-function]
286287
"""
287288
setup calcout record for noisy Lorentzian
288289

apstools/synApps/swait.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class UserCalcsDevice(Device):
167167
calc9 = Cpt(SwaitRecord, 'userCalc9')
168168
calc10 = Cpt(SwaitRecord, 'userCalc10')
169169

170-
def reset(self):
170+
def reset(self): # lgtm [py/similar-function]
171171
"""set all fields to default values"""
172172
self.calc1.reset()
173173
self.calc2.reset()

apstools/synApps/transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class UserTransformsDevice(Device):
143143
transform9 = Cpt(TransformRecord, 'userTran9')
144144
transform10 = Cpt(TransformRecord, 'userTran10')
145145

146-
def reset(self):
146+
def reset(self): # lgtm [py/similar-function]
147147
"""set all fields to default values"""
148148
self.transform1.reset()
149149
self.transform2.reset()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
synApps asyn record
3+
-------------------
4+
5+
see the synApps ``asyn`` module suppport:
6+
https://github.com/epics-modules/asyn
7+
8+
.. automodule:: apstools.synApps.asyn
9+
:members:
10+

0 commit comments

Comments
 (0)