33 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

ago 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
ago 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
ago 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
ago 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

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

...