cancel
Showing results for 
Search instead for 
Did you mean: 

How to send messages to Touchgfx simulator app?

KMili
Associate III

I need to simulate some external data while running simulator. For example, our device reads temperatures and I need some way to pass those temperatures (simulate) to simulator. Is there any way that is ready for this? Or I must write WinAPI code for that (sockets, COM, IPC, etc.)?

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Hi @KMili​,

There are a few ways to go about it. If you have a complex simulator application, yes, you can create a standalone simulator and just communicate with the TouchGFX Simulator using sockets (Check for socket data in Model::tick() ). We've done this in the past for customers - It's a very flexible solution.

Or, if you want to embed the simulated data inside the simulator application you can use FrontEndApplication to react to keyboard events to trigger various scenarios.

Edit (Adding text from other post): Override the handleKeyEvent() method in your FrontEndApplication class.

void FrontendApplication::handleKeyEvent(uint8_t c)
{
    //Pass the keyevent on
    touchgfx::MVPApplication::handleKeyEvent(c);
 
    //Handle events
    if (c == '1')
    {
        model.startSimulation();
        return;
    }
...

Let me know what you think

/Martin

View solution in original post

4 REPLIES 4
Martin KJELDSEN
Chief III

Hi @KMili​,

There are a few ways to go about it. If you have a complex simulator application, yes, you can create a standalone simulator and just communicate with the TouchGFX Simulator using sockets (Check for socket data in Model::tick() ). We've done this in the past for customers - It's a very flexible solution.

Or, if you want to embed the simulated data inside the simulator application you can use FrontEndApplication to react to keyboard events to trigger various scenarios.

Edit (Adding text from other post): Override the handleKeyEvent() method in your FrontEndApplication class.

void FrontendApplication::handleKeyEvent(uint8_t c)
{
    //Pass the keyevent on
    touchgfx::MVPApplication::handleKeyEvent(c);
 
    //Handle events
    if (c == '1')
    {
        model.startSimulation();
        return;
    }
...

Let me know what you think

/Martin

"you can use FrontEndApplication to react to keyboard events" - how to do that?

void FrontendApplication::handleKeyEvent(uint8_t c)
{
    //Pass the keyevent on
    touchgfx::MVPApplication::handleKeyEvent(c);
 
    //Handle events
    if (c == '1')
    {
        model.startSimulation();
        return;
    }

Override the handleKeyEvent() method in your FrontEndApplication class.

Hello,
I am learning to design a graphical interface in TouchGFX for STM32F746-DISCO. So far, I've sent everything to the board every time, but it's very tedious. I was looking for a simulator only test option and found this thread.
Can you advise me how to implement this communication?
"There are a few ways to go about it. If you have a complex simulator application, yes, you can create a standalone simulator and just communicate with the TouchGFX Simulator using sockets (Check for socket data in Model::tick() ). We've done this in the past for customers - It's a very flexible solution."

Jirka