cancel
Showing results for 
Search instead for 
Did you mean: 

Calling screen classes directly as opposed to only frontendapplication

JDubi.1
Associate II

Hi all!

So in our application we want to call the screen classes themselves in c. We have setup linking header files etc and we are able to call screen transistion via the frontendapplication with:

 #include <gui_generated/main_screen/MainViewBase.hpp>
 
 void transition(void) {
static_cast<FrontendApplication(Application::getInstance())>gotoSetup_Boot_Branded_2ScreenNoTransition();
 }

But we want to call the screen classes themselves... is there an easy way to do this? I've been trying to, but only get error during compiling. Something like this:

 void transition(void) {
static_cast<MainViewBase(Mainview::getInstance())>Progress_Update();
 }

Any help would be appreciated thanks!

Best

Jacob

5 REPLIES 5
MM..1
Chief III

Try explain because  is there an easy way to do this? NO

JDubi.1
Associate II

What do you mean? Are you saying there is no easy way to do this?

Michael K
Senior III

This sounds a bit like an XY problem.

What larger problem are you trying to solve here?

Embedded UI/UX Consulting: cadenza.design
JDubi.1
Associate II

Hi Michael,

You mean flipping the screen in the X or Y direction? No, my problem is that I want to call the individual screen object classes in order to update things like wildcards from the backend, as of right now I can only access screen transitions from the backend with the frontendapplication, but I want to be able to access individual screens, like MainView or some other arbitrary screen. Does that make sense?

Maybe you need more learn about C++. For TouchGFX you have two choices

  1. Use MVP and RTOS messages read docu Model-View-Presenter Design Pattern | TouchGFX Documentation
  2. Use memory struct shared variables. For example in interrupt or any other proces you change update value, and in model.tick or screen.tick you check if value changed and if yes call inside class func.
in mode ltick ...
 if((Key_Code==ENC_SEL_DN && Enc_Sel.rate>25) || RC5_Inst==IR_INPDN)
 {
 static_cast<FrontendApplication*>(Application::getInstance())->handleKeyEvent(74);
 }
 if((Key_Code==ENC_SEL_UP && Enc_Sel.rate>25) || RC5_Inst==IR_INPUP)
 {
 static_cast<FrontendApplication*>(Application::getInstance())->handleKeyEvent(73);
 }
 
in screen handletick ...
		if(SharedC_Settings.theme != 0)
		{
			SharedC_Settings.theme-=1;
			DisplayGauge(); 
		}
  1.