Updating GUI with data from multiple threads

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
alfloke
In need of some credit
In need of some credit
Posts: 2
Joined: Mon Jan 04, 2021 9:35 am

Updating GUI with data from multiple threads

Post by alfloke »

Hi,

I am working on an image processing application that takes images from 4 cameras.

Each of the cameras would have a thread acquiring the images, processing the images and generating some data.

The GUI would be updated with the acquired images as well as some annotation on the images itself. Some wxStaticText objects on the GUI would also be updated with the data.

I found a similar application - viewtopic.php?t=39098

This has given me some ideas. But I am still trying to figure out, how can it be scaled up to 4 threads with 4 cameras/images and wxStaticText strings. Would appreciate any ideas on this.

Thank you.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Updating GUI with data from multiple threads

Post by PB »

Where is the problem? You just need to create 4 threads instead of one and the threads will send the images together with other data and camera id and the main thread will have to know what to do with them?

FWIW, here is a similar example code I wrote some time ago (in particular ocvframe.cpp); however, it uses a single thread and I did not try to scale it to multiple threads
https://github.com/PBfordev/wxopencvtest
alfloke
In need of some credit
In need of some credit
Posts: 2
Joined: Mon Jan 04, 2021 9:35 am

Re: Updating GUI with data from multiple threads

Post by alfloke »

Thank you for the explanation and example code.

It is clearer to me now.
Post Reply