summaryrefslogtreecommitdiffstats
path: root/xml
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-02-08 11:55:33 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-02-08 11:55:33 +0100
commite10e102b8b0ff3bf35f16b5276d56059d242e1fd (patch)
treee5ae763aa808412523ee74d6c8cbdabf5b01695f /xml
parent5349163e93a107fdfea2ad58760f6149a8d749b0 (diff)
downloadpcitool-e10e102b8b0ff3bf35f16b5276d56059d242e1fd.tar.gz
pcitool-e10e102b8b0ff3bf35f16b5276d56059d242e1fd.tar.bz2
pcitool-e10e102b8b0ff3bf35f16b5276d56059d242e1fd.tar.xz
pcitool-e10e102b8b0ff3bf35f16b5276d56059d242e1fd.zip
Add support for setting register value to script transfrom. Add set_property and get_property functions to pcipywrap. Cleaning cmakelists from unused dependencies
Diffstat (limited to 'xml')
-rw-r--r--xml/model.xsd1
-rw-r--r--xml/references.xsd1
-rw-r--r--xml/test_pywrap/props.xml10
-rw-r--r--xml/test_pywrap/test_prop2.py11
-rw-r--r--xml/types.xsd10
5 files changed, 13 insertions, 20 deletions
diff --git a/xml/model.xsd b/xml/model.xsd
index f6f5ea3..164e887 100644
--- a/xml/model.xsd
+++ b/xml/model.xsd
@@ -7,7 +7,6 @@
<xsd:choice minOccurs="1" maxOccurs="unbounded">
<xsd:element name="bank" type="pcilib_bank_t" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="transform" type="pcilib_transform_view_t" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="script" type="pcilib_script_view_t" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="enum" type="pcilib_enum_view_t" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="unit" type="pcilib_unit_t" minOccurs="0" maxOccurs="unbounded" />
</xsd:choice>
diff --git a/xml/references.xsd b/xml/references.xsd
index 523daa2..4474141 100644
--- a/xml/references.xsd
+++ b/xml/references.xsd
@@ -6,7 +6,6 @@
<xsd:choice minOccurs="1" maxOccurs="unbounded">
<xsd:element name="bank" type="pcilib_bank_t" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="transform" type="pcilib_transform_view_t" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="script" type="pcilib_script_view_t" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="enum" type="pcilib_enum_view_t" minOccurs="0" maxOccurs="unbounded">
<xsd:key name="pcilib_value_name_key">
<xsd:selector xpath="name" />
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)
+
diff --git a/xml/types.xsd b/xml/types.xsd
index 239df8d..c9e5d2f 100644
--- a/xml/types.xsd
+++ b/xml/types.xsd
@@ -70,16 +70,6 @@
<xsd:attribute name="register" type="xsd:string" />
<xsd:attribute name="read_from_register" type="xsd:string" />
<xsd:attribute name="write_to_register" type="xsd:string" />
- <!-- xsd 1.1 <xsd:assert test="(@path and not(@name)) or (not(@path) and @name)"/> -->
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="pcilib_script_view_t">
- <xsd:complexContent>
- <xsd:extension base="pcilib_view_t">
- <xsd:attribute name="path" type="xsd:string" />
- <xsd:attribute name="register" type="xsd:string" />
<xsd:attribute name="script" type="xsd:string" />
<!-- xsd 1.1 <xsd:assert test="(@path and not(@name)) or (not(@path) and @name)"/> -->
</xsd:extension>