From 92cf6f34a102f912077d02c1893ec74458451e92 Mon Sep 17 00:00:00 2001 From: Enrico Faulhaber Date: Fri, 26 Aug 2016 14:06:38 +0200 Subject: [PATCH] [Test] Erik is testing SECoP with PVEPICS module Change-Id: Ie6124a5ab8a48efe16ab2970f337363e8f44a14d --- etc/test.cfg | 6 +++++- src/devices/test.py | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/etc/test.cfg b/etc/test.cfg index f30bb51..eac6fae 100644 --- a/etc/test.cfg +++ b/etc/test.cfg @@ -1,5 +1,5 @@ [server] -bindto=localhost +bindto=0.0.0.0 bindport=10767 interface = tcp framing=eol @@ -16,3 +16,7 @@ maxheaterpower=10 class=devices.test.Temp sensor="X34598T7" +[device epicspv] +class=devices.test.EPICS_PV +sensor="test_sensor" +max_rpm="very high" diff --git a/src/devices/test.py b/src/devices/test.py index c429868..613c13e 100644 --- a/src/devices/test.py +++ b/src/devices/test.py @@ -26,6 +26,7 @@ import random from devices.core import Readable, Driveable, PARAM from validators import floatrange +from epics import PV class LN2(Readable): """Just a readable. @@ -71,3 +72,23 @@ class Temp(Driveable): def write_target(self, target): pass + + + +class EPICS_PV(Driveable): + """pyepics test device.""" + + PARAMS = { + 'sensor': PARAM("Sensor number or calibration id", + validator=str, readonly=True), + 'max_rpm': PARAM("Maximum allowed rpm", + validator=str, readonly=True), + } + + def read_value(self, maxage=0): + p1 = PV('testpv.VAL') + return p1.value + + def write_target(self, target): + p1 = PV('test.VAL') + p1.value = target