Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 917 lines (859 sloc) 27.1 KB
<?xml version="1.0" encoding="UTF-8"?>
<display version="2.0.0">
<name>Spiral_plot2</name>
<width>1000</width>
<height>1000</height>
<widget type="xyplot" version="2.0.0">
<name>X/Y Plot_4</name>
<x>40</x>
<y>110</y>
<width>920</width>
<height>690</height>
<show_toolbar>true</show_toolbar>
<rules>
<rule name="Hide Point" prop_id="traces[0].color" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>
<color red="0" green="0" blue="255">
</color>
</value>
</exp>
<exp bool_exp="pv0 == 0">
<value>
<color name="Header_ForeGround" red="255" green="255" blue="255">
</color>
</value>
</exp>
<pv_name>loc://on</pv_name>
</rule>
<rule name="Hide Point 2" prop_id="traces[1].color" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>
<color name="OK" red="0" green="255" blue="0">
</color>
</value>
</exp>
<exp bool_exp="pv0 == 0">
<value>
<color name="Header_ForeGround" red="255" green="255" blue="255">
</color>
</value>
</exp>
<pv_name>loc://on2</pv_name>
</rule>
<rule name="Hide Point 3" prop_id="traces[2].color" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>
<color name="Attention" red="255" green="160" blue="0">
</color>
</value>
</exp>
<exp bool_exp="pv0 == 0">
<value>
<color name="Header_ForeGround" red="255" green="255" blue="255">
</color>
</value>
</exp>
<pv_name>loc://on3</pv_name>
</rule>
<rule name="Hide Point 4" prop_id="traces[3].color" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>
<color name="DISCONNECTED" red="200" green="0" blue="200" alpha="200">
</color>
</value>
</exp>
<exp bool_exp="pv0 == 0">
<value>
<color name="Background" red="255" green="255" blue="255">
</color>
</value>
</exp>
<pv_name>loc://on4</pv_name>
</rule>
<rule name="Hide Point 5" prop_id="traces[4].color" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>
<color name="MAJOR" red="255" green="0" blue="0">
</color>
</value>
</exp>
<exp bool_exp="pv0 == 0">
<value>
<color name="Background" red="255" green="255" blue="255">
</color>
</value>
</exp>
<pv_name>loc://on5</pv_name>
</rule>
<rule name="Hide Point 6" prop_id="traces[5].color" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>
<color red="0" green="255" blue="255">
</color>
</value>
</exp>
<exp bool_exp="pv0 == 0">
<value>
<color name="Background" red="255" green="255" blue="255">
</color>
</value>
</exp>
<pv_name>loc://on6</pv_name>
</rule>
<rule name="tracetype" prop_id="traces[0].trace_type" out_exp="false">
<exp bool_exp="pv0 == 0">
<value>0</value>
</exp>
<exp bool_exp="pv0 == 1">
<value>1</value>
</exp>
<exp bool_exp="pv0 == 3">
<value>3</value>
</exp>
<exp bool_exp="pv0 == 2">
<value>2</value>
</exp>
<exp bool_exp="pv0 == 4">
<value>4</value>
</exp>
<exp bool_exp="pv0 == 5">
<value>5</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="tracetype2" prop_id="traces[1].trace_type" out_exp="false">
<exp bool_exp="pv0 == 0">
<value>0</value>
</exp>
<exp bool_exp="pv0 == 1">
<value>1</value>
</exp>
<exp bool_exp="pv0 == 2">
<value>2</value>
</exp>
<exp bool_exp="pv0 == 3">
<value>3</value>
</exp>
<exp bool_exp="pv0 == 4">
<value>4</value>
</exp>
<exp bool_exp="pv0 == 5">
<value>5</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="tracetyp3" prop_id="traces[2].trace_type" out_exp="false">
<exp bool_exp="pv0 == 0">
<value>0</value>
</exp>
<exp bool_exp="pv0 == 1">
<value>1</value>
</exp>
<exp bool_exp="pv0 == 2">
<value>2</value>
</exp>
<exp bool_exp="pv0 == 3">
<value>3</value>
</exp>
<exp bool_exp="pv0 == 4">
<value>4</value>
</exp>
<exp bool_exp="pv0 == 5">
<value>5</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="tracetype4" prop_id="traces[3].trace_type" out_exp="false">
<exp bool_exp="pv0 == 0">
<value>0</value>
</exp>
<exp bool_exp="pv0 == 1">
<value>1</value>
</exp>
<exp bool_exp="pv0 == 2">
<value>2</value>
</exp>
<exp bool_exp="pv0 == 3">
<value>3</value>
</exp>
<exp bool_exp="pv0 == 4">
<value>4</value>
</exp>
<exp bool_exp="pv0 == 5">
<value>5</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="tracetype5" prop_id="traces[4].trace_type" out_exp="false">
<exp bool_exp="pv0 == 0">
<value>0</value>
</exp>
<exp bool_exp="pv0 == 1">
<value>1</value>
</exp>
<exp bool_exp="pv0 == 2">
<value>2</value>
</exp>
<exp bool_exp="pv0 == 3">
<value>3</value>
</exp>
<exp bool_exp="pv0 == 4">
<value>4</value>
</exp>
<exp bool_exp="pv0 == 5">
<value>5</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="tracetype6" prop_id="traces[5].trace_type" out_exp="false">
<exp bool_exp="pv0 == 0">
<value>0</value>
</exp>
<exp bool_exp="pv0 == 1">
<value>1</value>
</exp>
<exp bool_exp="pv0 == 2">
<value>2</value>
</exp>
<exp bool_exp="pv0 == 3">
<value>3</value>
</exp>
<exp bool_exp="pv0 == 4">
<value>4</value>
</exp>
<exp bool_exp="pv0 == 5">
<value>5</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="xautoscale" prop_id="x_axis.autoscale" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>false</value>
</exp>
<pv_name>loc://spiralcenter</pv_name>
</rule>
<rule name="yautoscale " prop_id="y_axes[0].autoscale" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>false</value>
</exp>
<pv_name>loc://spiralcenter</pv_name>
</rule>
<rule name="x axis minimum" prop_id="x_axis.minimum" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>-5000.0</value>
</exp>
<pv_name>loc://spiralcenter</pv_name>
</rule>
<rule name="y axis minimum" prop_id="y_axes[0].minimum" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>-5000.0</value>
</exp>
<pv_name>loc://spiralcenter</pv_name>
</rule>
<rule name="x axis maximum" prop_id="x_axis.maximum" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>5000.0</value>
</exp>
<pv_name>loc://spiralcenter</pv_name>
</rule>
<rule name="y axis maximum" prop_id="y_axes[0].maximum" out_exp="false">
<exp bool_exp="pv0 == 1">
<value>5000.0</value>
</exp>
<pv_name>loc://spiralcenter</pv_name>
</rule>
<rule name="point type" prop_id="traces[0].point_type" out_exp="false">
<exp bool_exp="pv0 == 3">
<value>1</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="point type2" prop_id="traces[1].point_type" out_exp="false">
<exp bool_exp="pv0 == 3">
<value>1</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="point type 3" prop_id="traces[2].point_type" out_exp="false">
<exp bool_exp="pv0 == 3">
<value>1</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="point type 4" prop_id="traces[3].point_type" out_exp="false">
<exp bool_exp="pv0 == 3">
<value>1</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="point type 5" prop_id="traces[4].point_type" out_exp="false">
<exp bool_exp="pv0 == 3">
<value>1</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
<rule name="point type 6" prop_id="traces[5].point_type" out_exp="false">
<exp bool_exp="pv0 == 3">
<value>1</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
</rules>
<x_axis>
<title>X</title>
<autoscale>true</autoscale>
<log_scale>false</log_scale>
<minimum>0.0</minimum>
<maximum>100.0</maximum>
<show_grid>false</show_grid>
<title_font>
<font name="Default Bold" family="Liberation Sans" style="BOLD" size="14.0">
</font>
</title_font>
<scale_font>
<font name="Default" family="Liberation Sans" style="REGULAR" size="14.0">
</font>
</scale_font>
<visible>true</visible>
</x_axis>
<y_axes>
<y_axis>
<title>Y</title>
<autoscale>true</autoscale>
<log_scale>false</log_scale>
<minimum>0.0</minimum>
<maximum>100.0</maximum>
<show_grid>false</show_grid>
<title_font>
<font name="Default Bold" family="Liberation Sans" style="BOLD" size="14.0">
</font>
</title_font>
<scale_font>
<font name="Default" family="Liberation Sans" style="REGULAR" size="14.0">
</font>
</scale_font>
<visible>true</visible>
</y_axis>
</y_axes>
<traces>
<trace>
<name>X</name>
<x_pv>loc://arrayx</x_pv>
<y_pv>loc://arrayy</y_pv>
<err_pv></err_pv>
<axis>0</axis>
<trace_type>1</trace_type>
<color>
<color red="0" green="0" blue="255">
</color>
</color>
<line_width>1</line_width>
<point_type>0</point_type>
<point_size>3</point_size>
</trace>
<trace>
<name>-X</name>
<x_pv>loc://arrayx1</x_pv>
<y_pv>loc://arrayy1</y_pv>
<err_pv></err_pv>
<axis>0</axis>
<trace_type>1</trace_type>
<color>
<color name="OK" red="0" green="255" blue="0">
</color>
</color>
<line_width>1</line_width>
<point_type>0</point_type>
<point_size>3</point_size>
</trace>
<trace>
<name>Y</name>
<x_pv>loc://arrayx2</x_pv>
<y_pv>loc://arrayy2</y_pv>
<err_pv></err_pv>
<axis>0</axis>
<trace_type>1</trace_type>
<color>
<color name="Attention" red="255" green="160" blue="0">
</color>
</color>
<line_width>1</line_width>
<point_type>0</point_type>
<point_size>3</point_size>
</trace>
<trace>
<name>-Y</name>
<x_pv>loc://arrayx3</x_pv>
<y_pv>loc://arrayy3</y_pv>
<err_pv></err_pv>
<axis>0</axis>
<trace_type>1</trace_type>
<color>
<color name="DISCONNECTED" red="200" green="0" blue="200" alpha="200">
</color>
</color>
<line_width>1</line_width>
<point_type>0</point_type>
<point_size>3</point_size>
</trace>
<trace>
<name>X Signal</name>
<x_pv>loc://arrayx4</x_pv>
<y_pv>loc://arrayy4</y_pv>
<err_pv></err_pv>
<axis>0</axis>
<trace_type>1</trace_type>
<color>
<color name="MAJOR" red="255" green="0" blue="0">
</color>
</color>
<line_width>1</line_width>
<point_type>0</point_type>
<point_size>3</point_size>
</trace>
<trace>
<name>Y Signal</name>
<x_pv>loc://arrayx5</x_pv>
<y_pv>loc://arrayy5</y_pv>
<err_pv></err_pv>
<axis>0</axis>
<trace_type>1</trace_type>
<color>
<color red="0" green="255" blue="255">
</color>
</color>
<line_width>1</line_width>
<point_type>0</point_type>
<point_size>3</point_size>
</trace>
</traces>
</widget>
<widget type="label" version="2.0.0">
<name>Label_43</name>
<text>Use toolbar to drag and zoom</text>
<x>490</x>
<y>120</y>
<width>270</width>
</widget>
<widget type="slide_button" version="2.0.0">
<name>Slide Button</name>
<pv_name>loc://x</pv_name>
<label>x</label>
<x>620</x>
<y>820</y>
</widget>
<widget type="slide_button" version="2.0.0">
<name>Slide Button_1</name>
<pv_name>loc://negx</pv_name>
<label>-x</label>
<x>700</x>
<y>820</y>
</widget>
<widget type="slide_button" version="2.0.0">
<name>Slide Button_2</name>
<pv_name>loc://y</pv_name>
<label>y</label>
<x>620</x>
<y>853</y>
</widget>
<widget type="slide_button" version="2.0.0">
<name>Slide Button_3</name>
<pv_name>loc://negy</pv_name>
<label>-y</label>
<x>700</x>
<y>853</y>
</widget>
<widget type="slide_button" version="2.0.0">
<name>Slide Button_4</name>
<pv_name>loc://xsignal</pv_name>
<label>x Signal</label>
<x>770</x>
<y>820</y>
</widget>
<widget type="slide_button" version="2.0.0">
<name>Slide Button_5</name>
<pv_name>loc://ysignal</pv_name>
<label>y Signal</label>
<x>770</x>
<y>853</y>
</widget>
<widget type="action_button" version="3.0.0">
<name>Action Button</name>
<actions execute_as_one="true">
<action type="execute">
<script file="EmbeddedPy">
<text><![CDATA[# Embedded python script
from org.csstudio.display.builder.runtime.script import PVUtil, ScriptUtil
# widget.setPropertyValue('text', PVUtil.getString(pvs[0]))
import time
import jarray
from jarray import array
import operator
on = PVUtil.createPV("loc://on" ,5000)
PVUtil.writePV("loc://on" ,0 ,200)
PVUtil.writePV("loc://on2" ,0 ,200)
PVUtil.writePV("loc://on3" ,0 ,200)
PVUtil.writePV("loc://on4" ,0 ,200)
PVUtil.writePV("loc://on5" ,0 ,200)
PVUtil.writePV("loc://on6" ,0 ,200)
xpv = PVUtil.createPV("CRYVISIL:AWG0:Channel0:wform" ,5000)
xxpv = PVUtil.createPV("CRYVISIL:AWG0:Channel1:wform" ,5000) #-x
ypv = PVUtil.createPV("CRYVISIL:AWG0:Channel2:wform" ,5000)
yypv = PVUtil.createPV("CRYVISIL:AWG0:Channel3:wform" ,5000) #-y
xarray = PVUtil.createPV("loc://arrayx" ,5000)
yarray = PVUtil.createPV("loc://arrayy" ,5000)
xcontrol = PVUtil.createPV("loc://x" ,5000)
negxcontrol = PVUtil.createPV("loc://negx" ,5000)
ycontrol = PVUtil.createPV("loc://y" ,5000)
negycontrol = PVUtil.createPV("loc://negy" ,5000)
xsignalcontrol = PVUtil.createPV("loc://xsignal" ,5000)
ysignalcontrol = PVUtil.createPV("loc://ysignal" ,5000)
appendPV = PVUtil.createPV("loc://append" ,5000)
xcontrolValue = PVUtil.getLong(xcontrol)
negxcontrolValue = PVUtil.getLong(negxcontrol)
ycontrolValue = PVUtil.getLong(ycontrol)
negycontrolValue = PVUtil.getLong(negycontrol)
xsignalcontrolValue = PVUtil.getLong(xsignalcontrol)
ysignalcontrolValue = PVUtil.getLong(ysignalcontrol)
append = PVUtil.getLong(appendPV)
zero = [0] * 65536
classic = range(65536)
aclassic = range(131072)
xpvValue= PVUtil.getDoubleArray(xpv)
xxpvValue = PVUtil.getDoubleArray(xxpv)
ypvValue = PVUtil.getDoubleArray(ypv)
yypvValue = PVUtil.getDoubleArray(yypv)
xfinal = list(map(operator.sub,xpvValue,xxpvValue))
yfinal = list(map(operator.sub,yypvValue,ypvValue))
PVUtil.writePV("loc://arrayx" ,zero ,200)
PVUtil.writePV("loc://arrayx1" ,zero ,200)
PVUtil.writePV("loc://arrayx2" ,zero ,200)
PVUtil.writePV("loc://arrayx3" ,zero ,200)
PVUtil.writePV("loc://arrayx4" ,zero ,200)
PVUtil.writePV("loc://arrayx5" ,zero ,200)
PVUtil.writePV("loc://arrayy" ,zero ,200)
PVUtil.writePV("loc://arrayy1" ,zero ,200)
PVUtil.writePV("loc://arrayy2" ,zero ,200)
PVUtil.writePV("loc://arrayy3" ,zero ,200)
PVUtil.writePV("loc://arrayy4" ,zero ,200)
PVUtil.writePV("loc://arrayy5" ,zero ,200)
if append == 1:
if xsignalcontrolValue == 1:
xfinal.extend(xfinal)
PVUtil.writePV("loc://arrayx4" ,aclassic ,200)
PVUtil.writePV("loc://arrayy4" ,xfinal ,200)
PVUtil.writePV("loc://on5" ,1 ,200)
if ysignalcontrolValue == 1:
yfinal.extend(yfinal)
PVUtil.writePV("loc://arrayx5" ,aclassic ,200)
PVUtil.writePV("loc://arrayy5" ,yfinal ,200)
PVUtil.writePV("loc://on6" ,1 ,200)
if xcontrolValue == 1:
xpvValue.extend(xpvValue)
PVUtil.writePV("loc://arrayx" ,aclassic ,200)
PVUtil.writePV("loc://arrayy" ,xpvValue ,200)
PVUtil.writePV("loc://on" ,1 ,200)
if negxcontrolValue == 1:
xxpvValue.extend(xxpvValue)
PVUtil.writePV("loc://arrayx1" ,aclassic ,200)
PVUtil.writePV("loc://arrayy1" ,xxpvValue ,200)
PVUtil.writePV("loc://on2" ,1 ,200)
if ycontrolValue == 1:
ypvValue.extend(ypvValue)
PVUtil.writePV("loc://arrayx2" ,aclassic ,200)
PVUtil.writePV("loc://arrayy2" ,ypvValue ,200)
PVUtil.writePV("loc://on3" ,1 ,200)
if negycontrolValue == 1:
yypvValue.extend(yypvValue)
PVUtil.writePV("loc://arrayx3" ,aclassic ,200)
PVUtil.writePV("loc://arrayy3" ,yypvValue ,200)
PVUtil.writePV("loc://on4" ,1 ,200)
if append == 0:
if xsignalcontrolValue == 1:
PVUtil.writePV("loc://arrayx4" ,classic ,200)
PVUtil.writePV("loc://arrayy4" ,xfinal ,200)
PVUtil.writePV("loc://on5" ,1 ,200)
if ysignalcontrolValue == 1:
PVUtil.writePV("loc://arrayx5" ,classic ,200)
PVUtil.writePV("loc://arrayy5" ,yfinal ,200)
PVUtil.writePV("loc://on6" ,1 ,200)
if xcontrolValue == 1:
PVUtil.writePV("loc://arrayx" ,classic ,200)
PVUtil.writePV("loc://arrayy" ,xpvValue ,200)
PVUtil.writePV("loc://on" ,1 ,200)
if negxcontrolValue == 1:
PVUtil.writePV("loc://arrayx1" ,classic ,200)
PVUtil.writePV("loc://arrayy1" ,xxpvValue ,200)
PVUtil.writePV("loc://on2" ,1 ,200)
if ycontrolValue == 1:
PVUtil.writePV("loc://arrayx2" ,classic ,200)
PVUtil.writePV("loc://arrayy2" ,ypvValue ,200)
PVUtil.writePV("loc://on3" ,1 ,200)
if negycontrolValue == 1:
PVUtil.writePV("loc://arrayx3" ,classic ,200)
PVUtil.writePV("loc://arrayy3" ,yypvValue ,200)
PVUtil.writePV("loc://on4" ,1 ,200)
]]></text>
</script>
<description>Execute Script</description>
</action>
<action type="write_pv">
<pv_name>loc://spiralcenter</pv_name>
<value>0</value>
<description>Write PV</description>
</action>
</actions>
<text>Plot</text>
<x>620</x>
<y>891</y>
<width>245</width>
<tooltip>$(actions)</tooltip>
</widget>
<widget type="action_button" version="3.0.0">
<name>Action Button_36</name>
<actions execute_as_one="true">
<action type="execute">
<script file="EmbeddedPy">
<text><![CDATA[# Embedded python script
from org.csstudio.display.builder.runtime.script import PVUtil, ScriptUtil
# widget.setPropertyValue('text', PVUtil.getString(pvs[0]))
import time
import jarray
from jarray import array
import operator
on = PVUtil.createPV("loc://on" ,5000)
PVUtil.writePV("loc://on" ,1 ,200)
xpv = PVUtil.createPV("CRYVISIL:AWG0:Channel0:wform" ,5000)
xxpv = PVUtil.createPV("CRYVISIL:AWG0:Channel1:wform" ,5000) #-x
ypv = PVUtil.createPV("CRYVISIL:AWG0:Channel2:wform" ,5000)
yypv = PVUtil.createPV("CRYVISIL:AWG0:Channel3:wform" ,5000) #-y
xarray = PVUtil.createPV("loc://arrayx" ,5000)
yarray = PVUtil.createPV("loc://arrayy" ,5000)
count = 0
zero = [0] * 65536
PVUtil.writePV("loc://arrayx1" ,zero ,200)
PVUtil.writePV("loc://arrayx2" ,zero ,200)
PVUtil.writePV("loc://arrayx3" ,zero ,200)
PVUtil.writePV("loc://arrayx4" ,zero ,200)
PVUtil.writePV("loc://arrayx5" ,zero ,200)
PVUtil.writePV("loc://arrayy1" ,zero ,200)
PVUtil.writePV("loc://arrayy2" ,zero ,200)
PVUtil.writePV("loc://arrayy3" ,zero ,200)
PVUtil.writePV("loc://arrayy4" ,zero ,200)
PVUtil.writePV("loc://arrayy5" ,zero ,200)
while count < 10:
time.sleep(0.1)
count += 1
xpvValue= PVUtil.getDoubleArray(xpv)
xxpvValue = PVUtil.getDoubleArray(xxpv)
xfinal = list(map(operator.sub,xpvValue,xxpvValue))
PVUtil.writePV("loc://arrayx" ,xfinal ,200)
ypvValue = PVUtil.getDoubleArray(ypv)
yypvValue = PVUtil.getDoubleArray(yypv)
yfinal = list(map(operator.sub,yypvValue,ypvValue))
PVUtil.writePV("loc://arrayy" ,yfinal ,200)
]]></text>
</script>
<description>Show Spiral</description>
</action>
<action type="write_pv">
<pv_name>loc://spiralcenter</pv_name>
<value>0</value>
<description>Write PV</description>
</action>
</actions>
<text> Spiral Plot</text>
<x>110</x>
<y>870</y>
<tooltip>$(actions)</tooltip>
</widget>
<widget type="action_button" version="3.0.0">
<name>Action Button_37</name>
<actions execute_as_one="true">
<action type="write_pv">
<pv_name>loc://spiralcenter</pv_name>
<value>1</value>
<description>Write PV</description>
</action>
<action type="execute">
<script file="EmbeddedPy">
<text><![CDATA[# Embedded python script
from org.csstudio.display.builder.runtime.script import PVUtil, ScriptUtil
# widget.setPropertyValue('text', PVUtil.getString(pvs[0]))
import time
import jarray
from jarray import array
import operator
on = PVUtil.createPV("loc://on" ,5000)
PVUtil.writePV("loc://on" ,1 ,200)
xpv = PVUtil.createPV("CRYVISIL:AWG0:Channel0:wform" ,5000)
xxpv = PVUtil.createPV("CRYVISIL:AWG0:Channel1:wform" ,5000) #-x
ypv = PVUtil.createPV("CRYVISIL:AWG0:Channel2:wform" ,5000)
yypv = PVUtil.createPV("CRYVISIL:AWG0:Channel3:wform" ,5000) #-y
xarray = PVUtil.createPV("loc://arrayx" ,5000)
yarray = PVUtil.createPV("loc://arrayy" ,5000)
count = 0
zero = [0] * 65536
PVUtil.writePV("loc://arrayx1" ,zero ,200)
PVUtil.writePV("loc://arrayx2" ,zero ,200)
PVUtil.writePV("loc://arrayx3" ,zero ,200)
PVUtil.writePV("loc://arrayx4" ,zero ,200)
PVUtil.writePV("loc://arrayx5" ,zero ,200)
PVUtil.writePV("loc://arrayy1" ,zero ,200)
PVUtil.writePV("loc://arrayy2" ,zero ,200)
PVUtil.writePV("loc://arrayy3" ,zero ,200)
PVUtil.writePV("loc://arrayy4" ,zero ,200)
PVUtil.writePV("loc://arrayy5" ,zero ,200)
while count < 10:
time.sleep(0.1)
count += 1
xpvValue= PVUtil.getDoubleArray(xpv)
xxpvValue = PVUtil.getDoubleArray(xxpv)
xfinal = list(map(operator.sub,xpvValue,xxpvValue))
PVUtil.writePV("loc://arrayx" ,xfinal ,200)
ypvValue = PVUtil.getDoubleArray(ypv)
yypvValue = PVUtil.getDoubleArray(yypv)
yfinal = list(map(operator.sub,yypvValue,ypvValue))
PVUtil.writePV("loc://arrayy" ,yfinal ,200)
]]></text>
</script>
<description>Show Spiral</description>
</action>
</actions>
<text> Spiral Center</text>
<x>250</x>
<y>870</y>
<tooltip>$(actions)</tooltip>
</widget>
<widget type="action_button" version="3.0.0">
<name>Action Button_38</name>
<actions execute_as_one="true">
<action type="execute">
<script file="EmbeddedPy">
<text><![CDATA[# Embedded python script
from org.csstudio.display.builder.runtime.script import PVUtil, ScriptUtil
print 'Hello'
# widget.setPropertyValue('text', PVUtil.getString(pvs[0]))
import time
import jarray
from jarray import array
import operator
xarray = PVUtil.createPV("loc://arrayx" ,5000)
yarray = PVUtil.createPV("loc://arrayy" ,5000)
on = PVUtil.createPV("loc://on" ,5000)
y = [0] * 65536
PVUtil.writePV("loc://arrayx" ,y ,200)
PVUtil.writePV("loc://arrayy" ,y ,200)
PVUtil.writePV("loc://arrayy1" ,y ,200)
PVUtil.writePV("loc://arrayy2" ,y ,200)
PVUtil.writePV("loc://arrayy3" ,y ,200)
PVUtil.writePV("loc://arrayy4" ,y ,200)
PVUtil.writePV("loc://arrayy5" ,y ,200)
PVUtil.writePV("loc://on" ,0 ,200)
PVUtil.writePV("loc://on6" ,0 ,200)
PVUtil.writePV("loc://on2" ,0 ,200)
PVUtil.writePV("loc://on3" ,0 ,200)
PVUtil.writePV("loc://on4" ,0 ,200)
PVUtil.writePV("loc://on5" ,0 ,200)
]]></text>
</script>
<description>Reset Sp.</description>
</action>
<action type="write_pv">
<pv_name>loc://spiralcenter</pv_name>
<value>0</value>
<description>Write PV</description>
</action>
</actions>
<text>Reset Spiral</text>
<x>390</x>
<y>870</y>
<tooltip>$(actions)</tooltip>
</widget>
<widget type="label" version="2.0.0">
<name>Label_53</name>
<text>Choose Trace Type</text>
<x>110</x>
<y>830</y>
<width>130</width>
</widget>
<widget type="action_button" version="3.0.0">
<name>Action Button_13</name>
<actions>
<action type="write_pv">
<pv_name>loc://tracetype</pv_name>
<value>0</value>
<description>None</description>
</action>
<action type="write_pv">
<pv_name>loc://tracetype</pv_name>
<value>1</value>
<description>Line</description>
</action>
<action type="write_pv">
<pv_name>loc://tracetype</pv_name>
<value>2</value>
<description>Step</description>
</action>
<action type="write_pv">
<pv_name>loc://tracetype</pv_name>
<value>3</value>
<description>Error Bars</description>
</action>
<action type="write_pv">
<pv_name>loc://tracetype</pv_name>
<value>4</value>
<description>Line &amp; Error bars</description>
</action>
<action type="write_pv">
<pv_name>loc://tracetype</pv_name>
<value>5</value>
<description>Bars</description>
</action>
</actions>
<text></text>
<x>250</x>
<y>830</y>
<width>140</width>
<height>21</height>
<tooltip>$(actions)</tooltip>
</widget>
<widget type="label" version="2.0.0">
<name>Label_131</name>
<x>259</x>
<y>833</y>
<width>110</width>
<rules>
<rule name="name" prop_id="text" out_exp="false">
<exp bool_exp="pv0 == 0">
<value>None</value>
</exp>
<exp bool_exp="pv0 == 1">
<value>Line</value>
</exp>
<exp bool_exp="pv0 == 2">
<value>Step</value>
</exp>
<exp bool_exp="pv0 == 3">
<value>Error bars</value>
</exp>
<exp bool_exp="pv0 == 4">
<value>Line &amp; Error bars</value>
</exp>
<exp bool_exp="pv0 == 5">
<value>Bars</value>
</exp>
<pv_name>loc://tracetype</pv_name>
</rule>
</rules>
</widget>
<widget type="checkbox" version="2.0.0">
<name>Check Box</name>
<pv_name>loc://append</pv_name>
<label>Append</label>
<x>410</x>
<y>833</y>
<width>80</width>
</widget>
</display>