1.9k views
in GUI Development by

Hello,

I'm trying to use the Arc path as a RPM indication of a dashboard, 

I setup a timer to trigger a "ChangeRpm" slot every 100ms, below is my "ChangeRpm" code,

if ( 0 == ReverseFlag )
{
  RpmArc.EndAngle += 5;

  if ( RpmArc.EndAngle >= 320.0)
  {
    ReverseFlag = 1;
  }
}
else
{
  RpmArc.EndAngle -= 5;
  if ( RpmArc.EndAngle <= 90.0 )
  {
    ReverseFlag = 0;    
  }
}

Then when I start the prototyper, the front end of rpm arc is like jumping back and forth, please see the footage below.

https://ask.embedded-wizard.de/?qa=blob&qa_blobid=18363368457057052073

Could you advise how to solve this issue?

Regards,

Noah

1 Answer

0 votes
by
 
Best answer

Hello Noah,

I do not see any problems with your implementation and the video. What do you mean with "jumping back and forth"? What I observe is that the arc moves with large steps. This is caused because the single step is 5 degree. Maybe you can explain better the problem?

Best regards

Paul Banach

by
Hi Paul,

I would like to confirm one thing, when I reset the EndAngle of a arc, does the EW redraw the whole arc again?

Regards,

Noah
by

Hello Noah,

I'm not sure what you mean with 'reset', but each time after the value of the property EndAngle has been changed, the entire arc is recalculated again and the area occupied by the Stroked Path view is redrawn automatically. Does it answer your question?

Best regards

Paul Banach 

by
Hi Paul,

Thank you for your explanation, now I understand a large step would result in not smooth arc animation.

Regards,

Noah
by
Hi Paul,

Is the Gauge widget able to be configured to a non-circular appearance? maybe like an oval?

Regards,

Noah
by
Hello Noah,

the generic Gauge widget is restricted to be circular.

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

...