This is a migrated thread and some comments may be shown as answers.

Setting values on animated marker

2 Answers 77 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 16 Apr 2009, 11:46 PM
Hi,

I found an interesting thing.
By working on an example project i found out that Min and Max of ranges is compared.
So I must take care with assignment that min does not become larger than max (proper sequence).
The "safe way" is to set all min values to 0 (or what ever is the possible minimum) and than set max followed by min.

Anyhow - I also was afraid that you also check value against LinearScale.Max.
You don't I found out - look interesting if value exceeds max :)

Anyhow - I thought you do this and since LinearScale.Max is dynamic (can be less than last value) I set value to 0.
After this I set LinearScale.Max followed by value.

Next I was investigating if I have a locking problem with my service :))

The reason - every second call the marker shows 0 - and at the next call the correct value.

I only guess the following occurs (pseudocode):
if (value != oldValue)
   StartAnimation()

void StartAnimation() {
  if (AnimationIsRunning) return;
if(curPosition!=newValue)
  AnimateMarker();
}

I do:
linMarker.Value=0;    // avoid exceed of max
linScale.Max=newMax;
...//set all the other values (min, ranges and so on)
linMarker.Value=newVal;
This code is fast enough (of course) to finish while the animation is still running the result is an animation to the "first different value".
So setting the marker to zero does (at initial call) nothing - the marker is at zero.
Since the animation is not running - the next set of value starts the animation. (in this case newVal).
At the next call I assign 0 - the logic detects - ah, different value - animate.
When I then set newVal - it does nothing because an animation is already running.
The next call - setting to 0 does nothing (it's 0 from the last "mistake") - no animation.
newVal is assigned - animation not running....

I guess this is not intended.
Of course - in my scenario (since I learned that linearScale.Max can be less than value) it is not needed to set value to 0 initial.
But imagine some "fast data input" (multiple simultaneous service calls, replay of a queue...) - I guess it is possible, that data arrives faster than the animation duration - and this would result in the same problem.

Regards

Manfred

2 Answers, 1 is accepted

Sort by
0
ManniAT
Top achievements
Rank 2
answered on 17 Apr 2009, 01:56 AM
Just a follow up - I thought the problem could have something to do with this post:
http://www.telerik.com/community/forums/silverlight/gauge/needle-value-property-binding-not-working.aspx#765596
But - I use the latest version - and also found that the marker makes problems with binding too.
0
Andrey
Telerik team
answered on 20 Apr 2009, 12:34 PM
Hello Manfred,

You can change duration of the internal indicator’s animation using the Duration property of the indicator. It should be less then interval between arriving of 2 indicator values.

We are currently researching the new feature which will allow setting indicator value using sequential list of values using the so called “refresh rate”. If there are several updates per second, it becomes difficult to read the values as they flash by. Increasing the refresh rate will restrict the number of display updates, thus giving the user a chance to read the values as they change.

Greetings,
Andrey Murzov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Gauge
Asked by
ManniAT
Top achievements
Rank 2
Answers by
ManniAT
Top achievements
Rank 2
Andrey
Telerik team
Share this question
or