update example

This commit is contained in:
Michael Davidsaver
2013-03-30 13:00:26 -04:00
parent e3317d6f51
commit ab4ae9c50a
6 changed files with 47 additions and 13 deletions

22
testApp/Makefile Normal file
View File

@@ -0,0 +1,22 @@
TOP=..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#----------------------------------------------------
# Optimization of db files using dbst (DEFAULT: NO)
#DB_OPT = YES
#----------------------------------------------------
# Create and install (or just install) into <top>/db
# databases, templates, substitutions like this
DB += test1.db
#----------------------------------------------------
# If <anyname>.db template is not named <anyname>*.template add
# <anyname>_template = <templatename>
include $(TOP)/configure/RULES
#----------------------------------------
# ADD RULES AFTER THIS LINE

6
testApp/test1.db Normal file
View File

@@ -0,0 +1,6 @@
record(longin, "$(P)li:cnt") {
field(DTYP, "Python Device")
field(INP , "@test1 hello world")
field(SCAN, "1 second")
}

13
testApp/test1.py Normal file
View File

@@ -0,0 +1,13 @@
class MySup(object):
def __init__(self, rec):
self.val = rec.field('VAL')
def process(self, rec, reason):
print 'test1 proc',rec.name(),reason
self.val.putval(1+self.val.getval())
def detach(self, rec):
print 'test1 detach',rec.name()
def build(rec, args):
print 'test1 build for',rec.name()
return MySup(rec)