update example
This commit is contained in:
22
testApp/Makefile
Normal file
22
testApp/Makefile
Normal 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
6
testApp/test1.db
Normal 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
13
testApp/test1.py
Normal 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)
|
||||
Reference in New Issue
Block a user