cancel
Showing results for 
Search instead for 
Did you mean: 

Can I name the screen ADJUST and Box With Border adjust?

AD�?b
Senior

I have a problem with Tutorial 2. I don't want to add the counter after pressing. Does not work after implementation " Using a wildcard text " ?

16 REPLIES 16
Martin KJELDSEN
Chief III

To answer your first question: Yes, you can. Because the screen name will become classes ADJUSTView, ADJUSTPresenter, so there will be no name clashes.

Your second question, please elaborate, it's a bit unclear to me,

/Martin

Thank you with your reply. I had a confused function name.

AD�?b
Senior

How to display a variable on the screen. I created text <value>. How do I associate this with my variable "counter" and update it on a regular basis. The variable is global.

Hi Martin

Studied. A bit different from my need. My variable "counter" is set in the file "main.cpp" and not from buttons. Will it be seen in other files?

Bob Bailey
Senior

Another community member made a youtube video on how to do this. There are TouchGFX documents as well, but the video was enough to get me going

https://www.youtube.com/watch?v=majcfxr3u2E

in main.cpp in whatever task, variable gets put into a queue

in the model.cpp in the gui the data is received from the queue and passed to the presenter, which passes it to the view. (I think I got that right)

i believe you could access the data right from the view, but I think that will cause you problems later on.

Basically there is a structure to TouchGFX and its best to follow it. By using a queue you keep the GUI thread/task and your main task from accessing the variable at the same time, which is a good idea with the RTOS.

There is a similar process for sending gui data back to the main logic.

Be sure to put your code changes in the main.cpp between the user code start and end comments.

Bob

Thanks Bob. I will study it.

Combine the tutorial that i sent you with this: Integrating with hardware - https://community.st.com/s/question/0D50X0000AU4zodSQB/interfacing-with-hardware-in-touchgfx-applications

The link contains projects that you can try for certain boards which are aging a bit now, but the video that @Bob Bailey​ posted actually uses CubeMX to do it, which is really nice!