cancel
Showing results for 
Search instead for 
Did you mean: 

The gauge widget needle does not display correctly on TouchGFX 4.19.1

OLync.1
Associate III

I'm using TouchGFX 4.19.1. My speedometer gauge worked fine originally, for a 390x390 display. I need it to work on a 480x480 display so scaled up the background image and needle image and resized the gauge widget. Now I struggle to centre the needle, and the actual image (in simulator and on target) differs from what TouchGFX displays. Changes to the needle rotation centre are not reflected in the simulator/target. This must be related to the relationship between image and widget sizes. Attached is a snip of the simulator (LHS) versus the TouchGFX image (RHS). Has anyone else experienced this?

0693W00000NqsuJQAR.jpgGauge widget size is 480 x 260. Needle and background images supplied. 

9 REPLIES 9
Yoann KLEIN
ST Employee

Hello @OLync.1​ ,

Could you please share your whole project or at least the UI ?

To do that, you can create a new TouchGFX project, and then click on Edit > Import GUI.

0693W00000Nquc2QAB.png 

That could be very helpful to try to reproduce the issue.

Thanks,

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX
OLync.1
Associate III

TouchGFX UI project attached

Hello,

Your issue come from these functions, located in RunningScreenView.cpp :

0693W00000Nqvl0QAB.pngI don't know what you are trying to do with that, but it apparently shifts your gauge background and needle, and then those widgets look misplaced on the display. After commenting these lines, both the needle and the gauge were displayed on simulator exactly like in the TouchGFXDesigner Canvas menu.

I also added a new screen to the project to check if everything worked fine if you add a default gauge to your project, which is the case, and I corrected the positioning of the needles in the Running Screen.

I will share the updated project back.

Let me know if that solved your issue,

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX

Thanks @Yoann KLEIN​ , that fixed it - I have inherited the project and did not notice that code. I have a follow up question regarding the needle rendering algorithm:

When Nearest Neighbor is chosen the moving needle has ragged edges. However when Bilinear Interpolation is chosen the moving needle has clean lines but there are occasional flickers of white in some pixels the gauge black background. Is there any way to remove these?

Hello,

It's probably related to your board performances. Which one are you using ?

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX
I'm using stm32l4r9ai discovery kit
OLync.1
Associate III

Here's an example of the problem - the white dot to the left of the "50". This occurs intermittently as the gauge needle moves.

Hello,

That's related to performance issues.

If you want to get better graphics with this kind of animations, you could try to use a more powerful MCU.

I ran the Gauge Demo from TouchGFX 4.19.1 on a STM32F769I discovery board, and everything worked fine.

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX
I have been using non-optimised debug builds so will try a release build but I presume the TouchGfx library remains the same and so I shouldn't expect any change in graphics performance?