PDA

View Full Version : How to read two sensors connected serialy in Qt and Plot iy in two graph ?



suhairkp
27th January 2017, 07:50
I am designing a Patient monitoring system Gui in Qt . i have complete c code for processing two sensor output values and i designed a GUI for plotting two graphs in a window .i tested c code running from qt and worked .

Two sensors are connected serially and trying to read each ports and plotting . I completed reading one sensor at a time and plotted it in my Gui by calling c program from qt using Q Process and it worked . i wrote two widgets for two sensors and trying to plot it as two graphs at same time , but is not reading . My friend suggested to Use QThread for reading two serial port at a time .

i want to read two sensor reading at a time and plot with respect to time ... Anyone please help me ... or give suggestion to use any method's for reading two serial port at a time ...

Lesiok
27th January 2017, 09:25
How to read these sensors. Whether it is in response to the question whether the sensor sends a continuous stream of data?

anda_skoa
27th January 2017, 09:53
If you are running two programs via QProcess you shouldn't need threads.

You are using QProcess asyncrhonously, right?

Cheers,
_

suhairkp
27th January 2017, 10:30
Thanks for quick reply...
@Lesiok and @ anda_skoa ,yes , sensors sending continues data's.. in a specific baud rate ... Qprocess containing serial port reading and processing of two continues data's from two serial port ,only single Qprocess is using and it contai; processing of each datas.. .. but in my window gui , i designed two widgets and promoted each to two sensor output values . output from Qprocess reading in qt and plotting , but reading two serial port at a time is not occurring

Lesiok
27th January 2017, 10:47
You need to show some code. In particular, how to start and operate these processes.