Alternative way of updating the TouchGFX UI from backend?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-27 7: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
- Labels:
-
TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-27 7: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;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-27 7: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-27 8:41 AM
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-27 9:27 PM
Many thanks for clarifying!
