2021-10-17 08:00 AM
TouchGFX creates Model and ModelListener but I can't figure out how to access the Model "getters" from main.c or any other user code. I can't find where Model or ModelListener is instantiated or where a pointer to the class instance can be found. How to access the "getters"?
2021-10-17 08:30 AM
This class isnt desired to use from main.c. TouchGFX Model is for use with active screen inside GFX task. And over rtos QUEUE messages or shared memory with other tasks...
2021-10-17 02:30 PM
Queuing messages requires the overhead of writing to a queue, waiting on a queue, thread context switch when queue has data, reading from a queue, all to get data that could be instantly satisfied by a class "getter".
The principle of MVC, model-view-controller, is that "getters" provide "safe" access to a class private members.
But not for TouchGFX Model?
2021-10-17 10:19 PM
2021-10-19 12:57 AM
Hello FNato.1,
Please have a look at this article to understand how to communicate with the Model from the View (The ModelListener is not necessary in this case).
You can also read this article to understand how to communicate from main.c to Model which is called Backend communication.
Hope this helps,
/Alexandre