2019-03-26 09:43 AM
Am I correct in thinking that if I can only make changes to screen widgets from within the model::tick() function?
I had passed the model pointer out to the remainder of my hardware app so it could push new updated data as it happened, but even though I saw the view code run to update the widgets, after their invalidate the screen image did not change.
I did see a brief flash of the updated widget as the screen was switching to another one so it looks as if the change was happening but the refresh was not.
If Instead of getting the model to update the presenter/view immediately when told from the outside world I set an internal flag and then from within the model:;tick I checked the flag and called the presenter the updates worked.
So it looks as if the invalidate was not taking effect unless part of the model::tick call, is this correct?
Solved! Go to Solution.
2019-03-28 02:55 PM
Hi @brianshankland9,
Am I correct in thinking that if I can only make changes to screen widgets from within the model::tick() function?
Not exactly. The entire application is getting ticked, not just the model. This means Screens, Widgets that support animation. So, you could override the ::tick() method in your concrete View and even send that tick to custom widgets if you wanted.
You're right, though, that the model::tick() method is the place where you'd interface with other peripheral tasks and you'd then use the modelListener interface to update the currently active Screen. So, you don't have to pass model pointers around if you're using multiple OS tasks.
And ultimately, yes, the application must be ticked for the screens to render to the framebuffer. It does not matter how much you invalidate() - It's all driven by the tick.
Hope that helps
Best regards,
Martin
2019-03-28 02:55 PM
Hi @brianshankland9,
Am I correct in thinking that if I can only make changes to screen widgets from within the model::tick() function?
Not exactly. The entire application is getting ticked, not just the model. This means Screens, Widgets that support animation. So, you could override the ::tick() method in your concrete View and even send that tick to custom widgets if you wanted.
You're right, though, that the model::tick() method is the place where you'd interface with other peripheral tasks and you'd then use the modelListener interface to update the currently active Screen. So, you don't have to pass model pointers around if you're using multiple OS tasks.
And ultimately, yes, the application must be ticked for the screens to render to the framebuffer. It does not matter how much you invalidate() - It's all driven by the tick.
Hope that helps
Best regards,
Martin
2019-03-29 09:18 AM