542 views
in GUI Development by

Hi Team,

I am doing an application using realtime value and i need to display them in a way of a seismograph, meaning I have a needle on the right "following" the actual value, and the strokePath goes from right to left.

My logic was to initiate the subpath with the first value, and then translate the path by a fixed speed value when I receive a new value (and I would display the sample value on the Y axis).

My issue is that the application draws from left to right, how can I make the new value to always appears on the right of the stroke path, plus having all the values translate to the left when a new value happen ? (to make this effect, in other words : https://www.youtube.com/watch?v=jNL0FITZiKI)

Edit : I found something similar to what I want but it use a Canvas and I cannot use this in my application : https://ask.embedded-wizard.de/389/examples_mosaic20-solardemo_fantactic
 

1 Answer

+1 vote
by
 
Best answer

Hello Velas,

please see the method ShiftNodes() in section Evaluate and modify the coordinates stored in the Path Data object. In practice you would need to distinguish between two operating modes:

1. As long as there are few data available you simply append the new data (via AddLine()) to the existing path and adjust the offset in the Stroke Path View. In this manner the curve is moved and new data are appended to the curve.

2. As soon as the entire screen is full with curve, Stop adjusting the offset in Stroke Path View. Instead, use ShiftNodes() to discard the oldest value and append new value while additionally moving all remaining values by an offset.

I hope it helps you further.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...