From f1cd3e4d2dcda95816d9f3a41ce1862e9b869e4b Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sat, 30 Mar 2013 18:44:27 -0400 Subject: [PATCH] python api --- python/devsup/_nullapi.py | 16 +++++++++++++++- python/devsup/interfaces.py | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 python/devsup/interfaces.py diff --git a/python/devsup/_nullapi.py b/python/devsup/_nullapi.py index 7699ad9..49ef52e 100644 --- a/python/devsup/_nullapi.py +++ b/python/devsup/_nullapi.py @@ -17,6 +17,9 @@ class Record(object): def name(self): """Record name """ + def isPyRecord(self): + """Is this record using Python Device. + """ def info(self, key): """info(key) info(key, default) @@ -30,7 +33,7 @@ class Record(object): for this record """ - def scan(self, sync=False): + def scan(self, sync=False, reason=None, force=0): """scan(sync=False) Scan this record. If sync is False then a @@ -38,10 +41,17 @@ class Record(object): is scannined immidately on the current thread. """ + def asyncStart(self): + pass + def asyncFinish(self, reason=None): + pass + def Field(object): """Handle for field operations f = Field("rec:name.HOPR") + + Field objects implement the buffer protocol. """ def __init__(self, fld): pass @@ -67,3 +77,7 @@ def Field(object): Must be an Int, Float or str """ + + def getarray(self): + """Return a numpy ndarray refering to this field for in-place operations. + """ diff --git a/python/devsup/interfaces.py b/python/devsup/interfaces.py new file mode 100644 index 0000000..5be1b0a --- /dev/null +++ b/python/devsup/interfaces.py @@ -0,0 +1,18 @@ + +from zope.interface import Interface + +class DeviceSupport(Interface): + def detach(record): + """Disconnect from the record. + + This is the last method called. + """ + + def allowScan(record): + """Return True to allow SCAN='I/O Intr' + or False to prevent this. + """ + + def process(record, reason): + """Callback for record processing action. + """