cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Widgets on TouchgFX controlled through Backend - Not Working, How to Solve the issue?

Ameya M
Associate III

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

6 REPLIES 6
Jesper Ronnholm
Associate III

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?

Martin KJELDSEN
Chief III

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

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

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

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)

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.