2022-06-02 02:56 AM
I reviewed the Button example in TouchGFX Designer.
As in the captured image above, I figured out the structure of the function that is called when the touch button is pressed using a break in MainViewBasee.cpp
If you break the break in "void MainViewBase::buttonCallbackHandler(const touchgfx::AbstractButton& src)"
and look at each step, you can see that it is normally called with a normally defined function.
However, the problem is that other functions are called in the project you created yourself.
It should be "SC5_1_decreaseValue" or "SC5_1_increaseValue",
but "void Screen5_1View::tearDownScreen()" is called.
If you apply the brake, press "botton_up" and confirm with a single step,
After entering the condition in button_up in the if statement, it is executed as the button_down part in the next step.
and
in the next step
"void Screen5_1View::tearDownScreen()"
will run as
There doesn't seem to be much difference compared to the example source that works normally, but what the hell is the problem?
2022-06-02 05:41 AM
Hello @mSH.1 ,
To be honest, I don't understand your question.
Can you please provide more details on how should your project work, what is happening and what's wrong ?
Could you also edit or reformulate some parts of your post, because it's quite confusing and hard to understand.
Thanks,
/Yoann
2022-06-02 06:05 AM
Sorry for the inaccurate explanation
Let's tidy up
If you look at the captured figure at the bottom, it is a callback function for when the button is pressed, and there is a virtual function to be executed in that function.
-> increaseValue();
-> decreaseValue();
However, the function that is actually executed is teardownscreen().
even if you brake
Teardownscreen() is called even when running in single step.
The difference from the basic example is that the teardownscreen() function seems to have only a difference in definition.
There is no teardownscreen() function in the basic example.
2022-06-03 02:48 AM
I found a warin by myself
The problem was that I did not put anything in the virtual function in view.cpp in the gui folder.
2022-06-03 02:48 AM
Hello,
Like the documentation says, tearDownScreen() is called before a screen stops being displayed, and can be used to clean up some resources before exiting the screen.
If you only want to increase/decrease values on a counter, without ever switching screens, it is not normal that this function is called.
I didn't succeed on reproducing your error, but I created a project, based on the Button example from TouchGFX Designer, and which also allows me to switch to an other screen using buttons. If you put a breakpoint in the method tearDownScreen() from Screen1View.cpp, you will see that this function is triggered only when you press the right-bottom corner button on the second screen, right before the application switches back to the main screen.
I will join my project to this post, so you could compare the differences between your project and mine.
Let me know how it's going,
/Yoann