cancel
Showing results for 
Search instead for 
Did you mean: 

How to start using the graph widget from touchgfx-open-repository in Touchgfx designer?

Shake777
Associate

I want to make a graph (let's just use a y = sin(x) function as an example) on my STM32 discovery board. I can make a basic gui from the standard widgets you get when you first run Touchgfx designer and I can add code to make them do stuff as well. I saw no way to add a graph so I googled it and found out you need the graph widget from the repository found here: https://github.com/touchgfx/touchgfx-open-repository

I have downloaded the repository and my question now is how to get the graph widget into TouchGFX designer so I can start coding it to display y = sin(x)? I have a bunch of folders from the repository and the TemplateView.cpp/.hpp files tell you what the individual functions do but not how to get the widget itself into the designer. Apologies if I am missing something obvious here but I could find no clear answers anywhere else.

1 ACCEPTED SOLUTION
18 REPLIES 18
Martin KJELDSEN
Chief III

Hi @Shake777​,

The graph widget is not a part of the designer (yet), so i'm affraid every effort involving that widget is manual. We're always working on adding more widgets to the designer - To start with we're adding support for the widgets that are already a part of the framework in code but are not yet in the designer.

How far did you get? I'm going to post a small example that shows how to use the graph at earliest convenience.

Best regards,

Martin

Thanks Martin. So far I just have the entire repository downloaded and sitting on my desktop. There is a graph folder in the repository with lots of source code (and a few folders) and header files that I don't know where to put. Do they go in the touchgfx install directory or in my project directory? Where exactly? What do I then need to do to get the custom widget to run? I think I just need to know how to make a downloaded custom widget work in general.

The thing is: The widgets and examples on the open repository are made for a particular version of TouchGFX (4.3.0 in this case) and aren't maintained as new versions come out. I can tell from the structure of widgets/graph that we pushed a sort of incomplete application, i guess for inspiration, since the application structure would be subject to change a bit.

What you would do is create a blank application and then import the files in widgets/graph and use it like it's used in TemplateView.cpp/.hpp.

We do have a sample application somewhere for an older version. I'll try to get it up to speed for the latest version of TouchGFX.

ASch
Associate II

Hi @Martin KJELDSEN​ ,

Dou you have the small example that you talked about?

ASch
Associate II

Thanks @Martin KJELDSEN​ !

You're welcome! :)

guillaume.1
Associate

Hi @Martin KJELDSEN​ ,

I am trying to use this Graph Widget on my application. This Widget works for a 16 bit Color Depth Display, however mine is in 24 bit Color Depth. My Board is "ETEM043005XDH6"

I changed the "PainterRGB565" into "PainterRGB888" in Graph folder, but I think it's not enough.

Now I can start the simulator, so I move to the corresponding screen but nothing is drawn. If I press "F2" during the simulation I can see area getting invalidate but there is no line inside.

Do you have an idea of what is missing or bad configurated?

Is there something else I need to change to run this widget on a 24 bit Color Depth Display ?

Best Regards,

Guillaume

Is the rest of your application also running in 24bpp ?

/Martin