summaryrefslogtreecommitdiffstats
path: root/xml/test_pywrap
diff options
context:
space:
mode:
Diffstat (limited to 'xml/test_pywrap')
-rw-r--r--xml/test_pywrap/props.xml10
-rw-r--r--xml/test_pywrap/test_prop2.py11
2 files changed, 13 insertions, 8 deletions
diff --git a/xml/test_pywrap/props.xml b/xml/test_pywrap/props.xml
index 137ad04..59d593c 100644
--- a/xml/test_pywrap/props.xml
+++ b/xml/test_pywrap/props.xml
@@ -1,12 +1,16 @@
<?xml version="1.0"?>
<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <transform path="/test/prop1" register="test_prop1" unit="C" read_from_register="(503975./1024000)*${/registers/fpga/reg1} + 28715./100" description="formula to get real fpga temperature from the fpga_temperature register in decimal"/>
- <script path="/test/prop2"
+ <transform path="/test/prop1"
+ register="test_prop1"
+ unit="C"
+ read_from_register="(503975./1024000)*${/registers/fpga/reg1} + 28715./100"
+ description="formula to get real fpga temperature from the fpga_temperature register in decimal"/>
+ <transform path="/test/prop2"
register="test_prop2"
unit="C"
script="test_prop2.py"
description="test python script #1"/>
- <script path="/test/prop3"
+ <transform path="/test/prop3"
register="test_prop3"
unit="C"
script="test_prop3.py"
diff --git a/xml/test_pywrap/test_prop2.py b/xml/test_pywrap/test_prop2.py
index e9a3364..68c6f1e 100644
--- a/xml/test_pywrap/test_prop2.py
+++ b/xml/test_pywrap/test_prop2.py
@@ -1,7 +1,8 @@
import pcipywrap
-import os
-def read_from_register():
- reg1_val = pcipywrap.read_register('reg1');
- test_prop1_val = pcipywrap.read_register('test_prop3');
- return test_prop1_val - reg1_val;
+def read_from_register():
+ return pcipywrap.get_property('/registers/fpga/reg1') / 3
+
+def write_to_register(value):
+ pcipywrap.set_property('/registers/fpga/reg1', value*3)
+