Skip to main content
Southbranch
Senior
December 27, 2021
Question

Alternative way of updating the TouchGFX UI from backend?

  • December 27, 2021
  • 1 reply
  • 1234 views

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

This topic has been closed for replies.

1 reply

MM..1
Chief III
December 27, 2021

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;
 }
 
}

Southbranch
Senior
December 27, 2021

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.

MM..1
Chief III
December 27, 2021
  •  handelTickEvent() is triggered in basic on every frame (based on clock LCD for example 60Hz)
  • two struct or an marker you need for determine what is new and what showed
  • model class is C++ and in normal compiler yuo can access it only over setters getters usw.
  • struct is normal extern C more simpler and better accessible