384 views
in GUI Development by
Hi Team,

 I'm plotting a graph of temperature with multi color line using 2 Data paths & 2 Stroke paths . This data is continuously been polled through sensors using timer.

I'm initializing the data path using InitSubPath(),configured begin() scale()  API's  respectively. The issue I'm facing is once the entire cycle is completed

The plot on 1st stroke path gets automatically closed(i,e joins start & end points) even though I'm not using Close() API at the same time the other stroke path disappears . Also some times the both the plots are disappeared

 

what can be the reason to close the graph

1 Answer

0 votes
by

Hello Kunal,

The plot on 1st stroke path gets automatically closed(i,e joins start & end points) even though I'm not using Close() API at the same time the other stroke path disappears .

Is it possible that the last coordinate pair does match the start coordinates? Generally there should not be any automatic Close() operation. I think there is something wrong with the coordinates you provide when the cycle is completed.

Since your application case is to plot a continues path, the following section can be useful for you: Evaluate and modify the coordinates stored in the Path Data object. Note the usage of the there described ShiftNodes() method when the path is full. The method removes the oldest value from the path object and shifts the entire content (the coordinates) of the path by given pixel offset. Then you can again append a new value. In this manner the path can continuously display new data.

Also some times the both the plots are disappeared.

Do you observe the behavior in the target system? If yes, check the console outputs. I suppose, there are too many data entries in the path to fit within the so called issue buffer. If this is the case, you will need to increase the configuration EW_MAX_ISSUE_TASKS in your Build Environment. See also: Optimizing the Data Memory (RAM) usage

Best regards

Paul Banach

by
Hi Paul,

Thanks for the update

I have following queries.

 1.I want to implement a graph  with values beginning from 60-100 on X axis .I'm using Begin() API accordingly.

 Let me  know how to scale it for exact same bandwidth

XBounds = (float)((float)StrokePath.Bounds.w/(float)40);    //to accomodate (60-100) point on X Axis

Path.Scale(XBounds,YBounds);

Path.Begin(0,60,500);

with the above scale I'm not able to see the curve.I think its scaling X-axis from  0-40 only

After this I changed XBounds = (float)((float)StrokePath.Bounds.w/(float)100);   

Now the curve is visible as I'm scaling it from 0-100

I want to scale/plot only for intermediate values eg  60 - 100 how it can be done

Regards

Kunal
by
2.

how can we implement Auto Scaling such that if a the values exceeds the current scale it should upscale it

 Using Scale() API it can be done but its observed this afftects Begin() , AddLine()

how to reinitialize the data path such that it should maintain the previously added data points in the data path.

And plot it again with reference to new scaling

can it be done by InitMatrix()

need your input
by
3.

The Plot disappear issue which I have mentioned above I was polling the data from the device at the rate of 50ms with

InitSubPath(0,1000) & within 3 secs it disappears ; Initially thought  I'm running out of data points/edges so I increased the Data points to InitSubPath(0,3000); but it didn't made any difference

I increase the polling frequency to ~200ms it works fine with InitSubPath(0,1000);

Again if I choose a longer duration process & poll the data with 200ms & same no of edges the curve disappears

What might be the issue

if we increase the no of edges will it exhaust the memory
by

Hello Kunal,

... with values beginning from 60-100 on X axis ...

I do not really understand the above case. However, for special scaling you have always the possibility to calculate the values in advance before feeding them into the path. You don't depend on the Scale() method.

how can we implement Auto Scaling such that if a the values exceeds the current scale it should upscale it 
 

Similar is true for the 'auto-scaling'. You have to evaluate the range of all available values and knowing it calculate from this range the appropriate scaling factors. The consequence: when the scaling factors change, you have to reload the path data with new (scaled) values. For this purpose you will need to store a copy of the data without any scaling and use it in your evaluation. The path stores only the already scaled data. The path data object does not implement any auto-scaling functionality. Its a detail of your implementation.

What might be the issue

Have you checked the console outputs for evtl. error messages? Possibly, the issue buffer is too small for the path data. See also my first answer above.

Best regards

Paul Banach

by

Hi Paul,

I have changed the issue buffer size from 100 to 300 after this I'm not able to see the plot missing.

But I have observed that while plotting ,below distortions are seen. How can we handle such distortions in EW. Are they buffer related/RAM related issues 

I'm curious to find out what is causing such excessive increment of CG value. I'm using a timer 2 stroke paths, data paths.

How to define an accurate value that needs to be set for issue buffer.

  

by

Hello Kunal,

without knowing your implementation it is difficult to deduce the cause of the distorted image. Possibly it is an arithmetic or an overflow error? Can you isolate the issue in a simple project running directly in the Embedded Wizard Studio? If yes, please upload the project so I can investigate the cause of the issue.

I'm curious to find out what is causing such excessive increment of CG value. I'm using a timer 2 stroke paths, data paths.

What do you mean with CG value?

How to define an accurate value that needs to be set for issue buffer.

The recommended approach is to run/test the application in the integrated Prototyper. Then you can open the Memory (RAM) usage window and while you test the application you observe in the window the minimum configuration values.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...