Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Trace Type SOLID_LANE join all points
Trace Type SOLID_LANE join all points [message #1478529] Tue, 18 November 2014 19:19 Go to next message
Esteban Avila is currently offline Esteban AvilaFriend
Messages: 49
Registered: June 2012
Member
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 #1478569 is a reply to message #1478529] Tue, 18 November 2014 20:01 Go to previous messageGo to next message
Xihui Chen is currently offline Xihui ChenFriend
Messages: 8
Registered: December 2013
Junior Member
It should not. Could you attach an example to reproduce it?
Re: Trace Type SOLID_LANE join all points [message #1478598 is a reply to message #1478569] Tue, 18 November 2014 20:35 Go to previous messageGo to next message
Esteban Avila is currently offline Esteban AvilaFriend
Messages: 49
Registered: June 2012
Member
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:

index.php/fa/19937/0/

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.

  • Attachment: trace_bug.png
    (Size: 50.35KB, Downloaded 528 times)

[Updated on: Wed, 19 November 2014 19:31]

Report message to a moderator

Re: Trace Type SOLID_LANE join all points [message #1482292 is a reply to message #1478598] Fri, 21 November 2014 17:03 Go to previous messageGo to next message
Xihui Chen is currently offline Xihui ChenFriend
Messages: 8
Registered: December 2013
Junior Member
The reason is that you set the same data twice in the for loop, so the second time when you set the same data, they are appended to the previous data, which will connect the last and first point.
Why are you using a for loop here? Could you just remove the for loop? You did help me find another bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=452686 . I have fixed it.

for (int i = 0; i < 2; i++)
{
dataProvider.setCurrentXDataArray(datax);
dataProvider.setCurrentYDataArray(datay);
}

Thanks,
Xihui
Re: Trace Type SOLID_LANE join all points [message #1482406 is a reply to message #1482292] Fri, 21 November 2014 19:19 Go to previous message
Esteban Avila is currently offline Esteban AvilaFriend
Messages: 49
Registered: June 2012
Member
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.
Previous Topic:Radio Group / Listener
Next Topic:Moving GridColumnGroup in Grid
Goto Forum:
  


Current Time: Thu Mar 28 18:37:30 GMT 2024

Powered by FUDForum. Page generated in 0.02148 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top