2021-12-27 07:00 AM
The recommended way to update the UI from the backend app seems to be using sampling of a message queue in the Model class: Backend Communication | TouchGFX Documentation.
Now, maybe I am missing something out, but is this really a practical methodology if let say, there are dozens of params that are needed to by propagated for updates in the UI (and vice versa)?
Is there any other way? Lets say that a backend task acquire a mutex for the whole Model class and update (or polls) the params in Model directly via getters and setters? Any example of this or any other viable method?
Thanks in advance
2021-12-27 07:15 AM
If your backend engine can provide for example struct with all in memory, then you can use direct memory.
structmyvars beckend;
struct screenvars;
And without any setters and getters and queue
screenX::handleTickEvent ()
{
if( backend.new || backed.param1 != screenvars.param1 )
{
show....
backend.new = false;
screenvars.param1 = backed.param1;
}
}
2021-12-27 07:51 AM
Thank you.
I am sorry, but I am not sure how the handelTickEvent() should be triggered and by what? Also I assume it would need two structs with overlapping data for backend and UI respectively?
I was hoping to use the existing Model class to store ALL data that is used commonly for backend and UI and then update it directly from the backend task.
2021-12-27 08:41 AM
2021-12-27 09:27 PM
Many thanks for clarifying!