Issue FDA-79

Removed restriction for manipulation
This commit is contained in:
2013-09-23 09:55:41 +02:00
parent bd4b9f9290
commit 21d935e35e
4 changed files with 66 additions and 3 deletions

View File

@@ -28,6 +28,10 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -261,7 +261,8 @@ public class JythonManipulation implements Manipulation{
return(((Integer)r).doubleValue());
}
else{
return Double.NaN;
// return Double.NaN;
return r;
}
}
} catch (ScriptException e) {

View File

@@ -141,7 +141,22 @@ public class Visualizer {
// XYSeriesP series = ((LinePlot) xyfilter.getPlot()).getData().getSeries(xyfilter.getCount()); // TODO Does not work with multiple series filter per plot !!!!
XYSeriesP series = xyfilter.getActualSeries(); // TODO Does not work with multiple series filter per plot !!!!
// series.add((Double) m.getData().get(xyfilter.getIndexX()), (Double) m.getData().get(xyfilter.getIndexY()));
series.add((Double) m.getData().get(xyfilter.getIndexX()), (Double) m.getData().get(xyfilter.getIndexY()), updateAtStreamElement);
// There might be other values than double in the data, therefore we have to check for it
Object dX = m.getData().get(xyfilter.getIndexX());
Object dY = m.getData().get(xyfilter.getIndexY());
Double dataX = Double.NaN;
Double dataY = Double.NaN;
if(dX instanceof Double){
dataX = (Double) dX;
}
if(dY instanceof Double){
dataY = (Double) dY;
}
// Add Data to the series
series.add(dataX , dataY, updateAtStreamElement);
}
if(filter instanceof XYSeriesArrayDataFilter){
final XYSeriesArrayDataFilter xyfilter = (XYSeriesArrayDataFilter) filter;

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration numberOfExecution="0" xmlns="http://www.psi.ch/~ebner/models/scan/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.psi.ch/~ebner/models/scan/1.0 ../../src/model-v1.xsd">
<!--
1D Scan reading out scalar channels and the timestamp for each point
-->
<data format="txt"/>
<scan id="">
<dimension zigzag="true">
<positioner id="id0" name="MTEST-HW3:MOT1" settlingTime="0.1" xsi:type="LinearPositioner">
<start>0.0</start>
<end>8.0</end>
<stepSize>0.5</stepSize>
</positioner>
<detector id="idD0" xsi:type="ScalarDetector" name="MTEST-HW3:MOT1.RRBV"/>
<detector id="idD1" xsi:type="ScalarDetector" name="MTEST-HW3:MOT1.RBV"/>
<detector xsi:type="Timestamp" id="timestamp"/>
</dimension>
<manipulation id="man1" xsi:type="ScriptManipulation">
<mapping xsi:type="IDParameterMapping" variable="a" refid="idD1"/>
<script>
def process(a):
return [1,a]
</script>
</manipulation>
<manipulation id="man2" xsi:type="ScriptManipulation">
<mapping xsi:type="IDParameterMapping" variable="a" refid="man1"/>
<script>
def process(a):
print a[1]
return 1.0
</script>
</manipulation>
</scan>
<visualization title="Line Plot One" xsi:type="LinePlot" x="id0" y="idD0"/>
<visualization title="Line Plot Two" xsi:type="LinePlot" x="id0" y="idD1"/>
<visualization title="Line Plot Two" xsi:type="LinePlot" x="id0" y="man1"/>
<visualization title="Line Plot Two" xsi:type="LinePlot" x="id0" y="man2"/>
<visualization xsi:type="LinePlot" x="id0" y="timestamp" title="Timestamp" />
</configuration>