2019-02-13 11:40 PM
Hello,
I am doing a project on TouchGFX on STM32F746G -DISCO board using Keil.
I want to display/not display a widget, either a button/text based on the state of button received from Backend.
When I control only a single widget, the system works as needed, that is widget is displayed when button is pressed, and not when button is released.
But when I add two widgets having similar functionality, changing as per the input received from 2 different buttons, the display does either hang up, or it displays the widget correctly as per the button state for the first time and later the widget is unresponsive to the change in button state.
What could be the issue?
Thanks,
Ameya
2019-02-14 02:54 AM
Sounds like maybe either a callback issue, or attempting to address a destroyed widget.
I've had a similar problem before.
Are you injecting a "hardware button is clicked" as stimuli?
2019-02-14 05:11 AM
Hi @Ameya M,
Have you tried simulating the hardware buttons in the simulator and seeing if you're having issues there?
Can you share your project?
Best regards,
Martin
2019-02-14 05:18 AM
Hello Jesper,
I am not injecting a "hardware button is clicked" as stimuli
I am using widget.setVisible(true/false) in the view window after taking values from backend through RTOS queue, that is either 0 or 1
Also, used widget.invalidate() after displaying the widget as long as getting 1 from the backend.
Thanks,
Ameya
2019-02-14 05:20 AM
Hello Martin,
Thanks for replying, I am not aware of checking the external hardware buttons on simulator.
Could you please elaborate on that?
Thanks,
Ameya
2019-02-14 06:07 AM
What i meant was that you simulate a button press to the model using keyboard buttons (same place you check your OS Queue) to verify if this is an issue with the application or something to do with your target.
How are you propagating this value to the active view? (The correct way would be through the ModelListener interface which all active Presenters inherit from)
2019-02-14 06:11 AM
To elaborate further:
#ifdef SIMULATOR
// Override this virtual function
void FrontendApplication::handleKeyEvent(uint8_t c)
{
touchgfx::MVPApplication::handleKeyEvent(c);
if (c == 'a')
{
model.buttonAPressed();
return;
}
if (c == 'b')
{
model.buttonBPressed();
return;
}
}
#endif
The method inside the model will then call the ModelListener interface to propagate the value to the presenter who will then set the value in the view to update the framebuffer/display.