add setTime to test IOC
This commit is contained in:
@ -46,3 +46,11 @@ record(ai, "$(P):A-RB") {
|
||||
field(DTYP, "Python Device")
|
||||
field(INP , "@test5 hello none")
|
||||
}
|
||||
|
||||
|
||||
record(longin, "$(P)li:time") {
|
||||
field(DTYP, "Python Device")
|
||||
field(INP , "@timetest")
|
||||
field(SCAN, "1 second")
|
||||
field(TSEL, "-2")
|
||||
}
|
||||
|
15
testApp/timetest.py
Normal file
15
testApp/timetest.py
Normal file
@ -0,0 +1,15 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import datetime
|
||||
|
||||
class MySup(object):
|
||||
def __init__(self, rec, args):
|
||||
pass
|
||||
def process(self, rec, reason):
|
||||
rec.VAL = 1+rec.VAL
|
||||
# could also pass in float or tuple (sec, nanosec)
|
||||
rec.setTime(datetime.datetime.now())
|
||||
def detach(self, rec):
|
||||
pass
|
||||
|
||||
build = MySup
|
Reference in New Issue
Block a user