cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX: How to change the screen to a specific one from the Model?

HTD
Senior III

The action should be triggered from a hardware driver and work from any screen.

What I already know:

How to generate "goto" functions from TouchGFX designer and call them from a view.

Now - the hard way to do that is to generate the "goto" functions for each view and bind them from presenters to the ModelListener event. A lot of clicking and writing, the more of it the more screens I have in my application, and I have plenty of them.

My goal is to make it simpler, but I don't know is there a simpler way. The idea is whenever a hardware driver error occurs - I want my application to immediately show a kind of BSOD to ensure when the screens show data - the data is accurate (because otherwise BSOD should appear).

1 REPLY 1
HTD
Senior III

OK, so I got a pretty nice workaround:

I put my BSOD function in my ModelListener.hpp:

// ...
 
#include <gui/common/FrontendApplication.hpp>
 
// ...
 
void BSOD()
{
    static_cast<FrontendApplication*>(touchgfx::Application::getInstance())
    ->gotoErrorScreenNoTransition();
}

And that's it. Probably the quickest way to do it.