Trace Type SOLID_LANE join all points [message #1478529] |
Tue, 18 November 2014 14:19  |
Eclipse User |
|
|
|
I have a question, i am using a trace that have the default trace type (SOLID_LANE) but i have an issue, with this type the graph join all the points included the final with the first point, and i dont want this.
Thanks.
Regards.
|
|
|
|
Re: Trace Type SOLID_LANE join all points [message #1478598 is a reply to message #1478569] |
Tue, 18 November 2014 15:35   |
Eclipse User |
|
|
|
Here is the code....
public class FFEGeneral
{
protected XYGraph xyGraph = new XYGraph();
private Canvas can;
private int[] xRange = new int[2];
private int[] yRange = new int[2];
private String xLabel = "";
private String yLabel = "";
private String graphLabel = "";
protected Trace trace;
protected CircularBufferDataProvider dataProvider;
public FFEGeneral(Composite parent, int[] xRange, int[] yRange, String graphLabel, String xLabel, String yLabel)
{
this.xRange = xRange;
this.yRange = yRange;
this.graphLabel = graphLabel;
this.xLabel = xLabel;
this.yLabel = yLabel;
createPartControl(parent);
}
public void createPartControl(Composite parent)
{
dataProvider = new CircularBufferDataProvider(false);
dataProvider.setBufferSize(100);
Composite ffeComposite = new Composite(parent, SWT.NONE);
ffeComposite.setLayout(new FillLayout());
can = new Canvas(ffeComposite, SWT.NONE);
final LightweightSystem lws = new LightweightSystem(can);
xyGraph = new XYGraph();
xyGraph.primaryXAxis.setTitle(xLabel);
xyGraph.primaryYAxis.setTitle(yLabel);
xyGraph.primaryYAxis.setAutoScale(true);
xyGraph.primaryXAxis.setShowMajorGrid(true);
xyGraph.primaryYAxis.setShowMajorGrid(true);
xyGraph.primaryXAxis.setAutoScale(true);
xyGraph.primaryYAxis.setRange(yRange[0], yRange[1]);
xyGraph.primaryXAxis.setRange(xRange[0], xRange[1]);
xyGraph.setShowLegend(false);
lws.setContents(xyGraph);
CreateTrace();
}
protected void CreateTrace()
{
trace = new Trace("", xyGraph.primaryXAxis, xyGraph.primaryYAxis, dataProvider);
trace.setPointStyle(PointStyle.DIAMOND);
xyGraph.addTrace(trace);
}
public void UpdateGraph(double[] datax, double[] datay)
{
dataProvider.clearTrace();
for (int i = 0; i < 2; i++)
{
dataProvider.setCurrentXDataArray(datax);
dataProvider.setCurrentYDataArray(datay);
}
}
}
And the result image is:

The way that i load the dataprovider is:
dataProvider.setCurrentXDataArray(datax);
if i use:
dataProvider.setCurrentXData(datax[i]);
the problem doesn't appear, but i need use the first option for more faster drawing.
Thanks. Regards.
[Updated on: Wed, 19 November 2014 14:31] by Moderator
|
|
|
|
Re: Trace Type SOLID_LANE join all points [message #1482406 is a reply to message #1482292] |
Fri, 21 November 2014 14:19  |
Eclipse User |
|
|
|
The for cycle was because the graphic doesn't refresh all data from trace. But I test now without the for and in the second refresh join again the first with the last value.
How i can for get the last version of nebula with these bug fixes ?
Thanks.
Regards.
|
|
|
Powered by
FUDForum. Page generated in 0.04245 seconds