QVector<double> xv;
QVector<double> cv1;
QVector<double> cv2;
QVector<double> xv;
QVector<double> cv1;
QVector<double> cv2;
To copy to clipboard, switch view to plain text mode
{
int v = 0;
double f = ui->frequency->value();
xv.append(sizeof_array/f);
char *buf = array.data();
if (ui->ecgPlux->isChecked() == true || ui->channel_1->currentIndex() != 0)
{
cv1.append(buf[1]);
curve1->attach(plot_all[0]);
curve1->setData(xv,cv1);
curve1
->setPen
(QPen(Qt
::blue,
1));
plot_all[0]->replot();
curve2->attach(plot[0]);
curve2->setData(xv,cv1);
curve2
->setPen
(QPen(Qt
::blue,
1));
plot[0]->replot();
}
if (ui->xyzPlux->isChecked() == true || ui->channel_2->currentIndex() != 0)
{
cv2.append(buf[2]);
curve3->attach(plot_all[1]);
curve3->setData(xv,cv2);
curve3
->setPen
(QPen(Qt
::blue,
1));
plot_all[0]->replot();
curve4->attach(plot[1]);
curve4->setData(xv,cv1);
curve4
->setPen
(QPen(Qt
::blue,
1));
plot[1]->replot();
}
//printf ("%d ->", buf[0]);
fprintf (data, "%d,", buf[0]);
for (int i = 1; i < 9; i++)
{
v = buf[i];
//printf ("%d,", v);
fprintf (data, "%d,", v);
}
//printf ("\n");
fprintf (data, "\n");
sizeof_array++;
}
void gui::process_new_info(QByteArray array)
{
int v = 0;
double f = ui->frequency->value();
xv.append(sizeof_array/f);
char *buf = array.data();
if (ui->ecgPlux->isChecked() == true || ui->channel_1->currentIndex() != 0)
{
cv1.append(buf[1]);
QwtPlotCurve *curve1 = new QwtPlotCurve;
curve1->attach(plot_all[0]);
curve1->setData(xv,cv1);
curve1->setPen(QPen(Qt::blue,1));
plot_all[0]->replot();
QwtPlotCurve *curve2 = new QwtPlotCurve;
curve2->attach(plot[0]);
curve2->setData(xv,cv1);
curve2->setPen(QPen(Qt::blue,1));
plot[0]->replot();
}
if (ui->xyzPlux->isChecked() == true || ui->channel_2->currentIndex() != 0)
{
cv2.append(buf[2]);
QwtPlotCurve *curve3 = new QwtPlotCurve;
curve3->attach(plot_all[1]);
curve3->setData(xv,cv2);
curve3->setPen(QPen(Qt::blue,1));
plot_all[0]->replot();
QwtPlotCurve *curve4 = new QwtPlotCurve;
curve4->attach(plot[1]);
curve4->setData(xv,cv1);
curve4->setPen(QPen(Qt::blue,1));
plot[1]->replot();
}
//printf ("%d ->", buf[0]);
fprintf (data, "%d,", buf[0]);
for (int i = 1; i < 9; i++)
{
v = buf[i];
//printf ("%d,", v);
fprintf (data, "%d,", v);
}
//printf ("\n");
fprintf (data, "\n");
sizeof_array++;
}
To copy to clipboard, switch view to plain text mode
Bookmarks