Home > Back-end >  Qt do PC real-time display curve with qt chart
Qt do PC real-time display curve with qt chart

Time:10-31

MCU preach 500 points per second but chart drawing per second may only 20 points but also delay to ask what happened when I was under the point of update

Void MainWidget: : the updateData (float value)///////update the data function
{
int i;
QVector OldData=https://bbs.csdn.net/topics/SplineSeries-> pointsVector ();
QVector OldData3=scatterSeries - & gt; PointsVector ();
QVector The data;///////////new data variable
QVector Data3.///////////new data variable

If (oldData. The size () & lt; 250) {
data=https://bbs.csdn.net/topics/SplineSeries-> pointsVector ();//////////////the quantity of no more than 97 data points before the data is copied to the new data variables in
Data3=scatterSeries - & gt; PointsVector ();
} else {
/* add before the old data to the new vector, don't copy the former data, that is, every time to replace the previous data
* because every time add one data here, so is 1, according to the actual situation when using modified
*/
/*

For (I=1; i Data. Append (QPointF (I - 1, oldData. At (I) y ()));
Data3. Append (QPointF (I - 1, oldData. At (I) y ()));
}
}

Qint64 size=data. The size ();
for(i=0; i <1; + + I)
{
Data. Append (QPointF (I + size, value));///////////I'll here is single chip microcomputer to his
Data3. Append (QPointF (I + size, value));

}
SplineSeries - & gt; The replace (data);///to replace the whole data//////is equivalent to load the coordinate point set
ScatterSeries - & gt; The replace (data3);
count++;


}

CodePudding user response:

CodePudding user response:

Film screening standard is showing 24 frames per second, keep out 24 times per second, the refresh rate is 48 times per second, the frame is the picture here, that is to say the movie screening 24 frames per second, in order to achieve the effect of animation,

Studies have shown that the human eye under limit for 55 frames per second, and studies show that more than 60 frames per second can significantly enhance the audience's viewing experience, five times as many as 120 frames per second is 24 frames per second, adopting this technology can make the picture of more lifelike, let the audience as if place oneself among them, give a person a kind of like the feeling is unreal,

So, the use of images of 24 frames per second frequency in accordance with the law, can make us notice the picture of the interrupt,


So you can not draw the received data, each 1000/24, about 40 milliseconds to paint an otherwise point is busy not to come over, and can the brushwork in 40 ms to do optimization, so that we can improve the efficiency of drawing,
In addition to collect the data and drawing in the two threads,

CodePudding user response:

The waveform looks ecg waveform, so give you advice is as follows:
1) every 40 ms paint, painting 25 per second;
2) if the efficiency is not high enough to to the rightness of collect raw data were analyzed, and without damage the graphics according to the rules to simplify data, reduce the number of line drawing,
3) the receiving data and draw some points in the two threads to complete,

CodePudding user response:

refer to the second floor springsun_xu response:
film screening 24 frames per second, is the standard block 24 times per second, the refresh rate is 48 times per second, the frame is the picture here, that is to say the movie screening 24 frames per second, in order to achieve the effect of animation,

Studies have shown that the human eye under limit for 55 frames per second, and studies show that more than 60 frames per second can significantly enhance the audience's viewing experience, five times as many as 120 frames per second is 24 frames per second, adopting this technology can make the picture of more lifelike, let the audience as if place oneself among them, give a person a kind of like the feeling is unreal,

So, the use of images of 24 frames per second frequency in accordance with the law, can make us notice the picture of the interrupt,


So you can not draw the received data, each 1000/24, about 40 milliseconds to paint an otherwise point is busy not to come over, and can the brushwork in 40 ms to do optimization, so that we can improve the efficiency of drawing,
In addition to collect data and drawing in the two threads,


1000/24 of a point per second picture, it looks not continuous curve, but the emergence of a jump jump, once appear, if you see the pictures

CodePudding user response:

To draw, use the ScrollDC scrolling display area, draw new each time point

CodePudding user response:

This function, you update only one point at a time?? The poor efficiency, incoming array, batch update is good oh,,

CodePudding user response:

How does the displayed on the curve numerical
  • Related