cancel
Showing results for 
Search instead for 
Did you mean: 

Alternative way of updating the TouchGFX UI from backend?

Southbranch
Senior II

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

4 REPLIES 4
MM..1
Chief III

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

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.

  •  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

Many thanks for clarifying!