Skip to main content
KMili
Associate III
May 29, 2019
Solved

How to send messages to Touchgfx simulator app?

  • May 29, 2019
  • 1 reply
  • 1539 views

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.)?

This topic has been closed for replies.
Best answer by Martin KJELDSEN

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

1 reply

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
May 29, 2019

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

KMili
KMiliAuthor
Associate III
May 29, 2019

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