问题
实时波形分析,波形显示刷新周期500ms,刷新宽度为310点;在显示宽度为800时,不时出现程序忙的圆圈状态,界面有些卡。
分析
显示处理最主要部分是往LineSeries中添加逐个添加节点。
//向单个LineSeries中添加节点
void CCurveView::addSeries(int iChan, const QList<QPointF> *pListPoint)
{
assert(iChan < m_iChanCnt);
QLineSeries *pSeries = &m_series[iChan];
double *pMin = &m_pdYMin[iChan];
double *pMax = &m_pdYMax[iChan];
for (QList<QPointF>::const_iterator itr = pListPoint->constBegin(); itr != pListPoint->constEnd(); itr++)
{
QPointF pt(itr->x(), itr->y() + iChan * m_iChanSpan);
if (pt.y() > *pMax) { *pMax = pt.y();}
else if (pt.y() < *pMin) {*pMin = pt.y();}
pSeries->append(pt);
}
int iCnt = pSeries->count();
if (iCnt > m_iPtCapacity)
{
p