diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 8a1f6d3..eb58127 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -3,7 +3,7 @@ #include -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; ChannelCharts::ChannelCharts(QWidget *parent) : @@ -21,20 +21,52 @@ void ChannelCharts::initDataChart(int index) { -/* QChart * dataChart = new QChart(); - dataChart->setTheme(QChart::ChartThemeDark); - dataChart->setDropShadowEnabled(true); - dataChart->legend()->setVisible(false); - dataChart->setAnimationOptions(QChart::AllAnimations); + ui->dataPlot->addGraph(); // blue line + ui->dataPlot->graph(0)->setPen(QPen(QColor(40, 110, 255))); +// ui->dataPlot->addGraph(); // red line +// ui->dataPlot->graph(1)->setPen(QPen(QColor(255, 110, 40))); - QLineSeries * series = new QLineSeries(); - for (int i = 0; i < phaseVector[index].size(); i++) - { - series->append(i, phaseVector[index][i] * 1E12); - } + QSharedPointer timeTicker(new QCPAxisTickerTime); + timeTicker->setTimeFormat("%h:%m:%s"); + ui->dataPlot->xAxis->setTicker(timeTicker); + ui->dataPlot->axisRect()->setupFullAxesBox(); + ui->dataPlot->yAxis->setRange(1e-9, 1e-8); - dataChart->addSeries(series); - dataChart->createDefaultAxes(); */ // 基于已添加到图表的 series 来创建默认的坐标轴 + qint64 base = phaseVector[index].at(0).at(0).toLongLong(); + + QColor color(20+200,105, 150, 150); + ui->dataPlot->graph()->setLineStyle(QCPGraph::lsLine); + ui->dataPlot->graph()->setPen(QPen(color.lighter(200))); + ui->dataPlot->graph()->setBrush(QBrush(color)); + // generate random walk data: +// QVector timeData(phaseVector[index].size()); + for (int i=0; idataPlot->graph(0)->addData((phaseVector[index].at(i).at(0).toLongLong() - base) / 1000.0, phaseVector[index].at(i).at(1).toDouble()); + } +// ui->dataPlot->graph()->data()->set(timeData); + + // configure bottom axis to show date instead of number: + // configure left axis text labels: + // set a more compact font size for bottom and left axis tick labels: + ui->dataPlot->xAxis->setTickLabelFont(QFont(QFont().family(), 8)); + ui->dataPlot->yAxis->setTickLabelFont(QFont(QFont().family(), 8)); + // set axis labels: + ui->dataPlot->xAxis->setLabel("Date"); + ui->dataPlot->yAxis->setLabel("Random wobbly lines value"); + // make top and right axes visible but without ticks and labels: + ui->dataPlot->xAxis2->setVisible(true); + ui->dataPlot->yAxis2->setVisible(true); + ui->dataPlot->xAxis2->setTicks(false); + ui->dataPlot->yAxis2->setTicks(false); + ui->dataPlot->xAxis2->setTickLabels(false); + ui->dataPlot->yAxis2->setTickLabels(false); + // set axis ranges to show all data: + ui->dataPlot->xAxis->setRange((phaseVector[index].at(0).at(0).toULongLong() - base) / 1000.0, (phaseVector[index].last().at(0).toULongLong() - base) / 1000.0); + // show legend with slightly transparent background brush: + ui->dataPlot->legend->setVisible(false); + ui->dataPlot->legend->setBrush(QColor(255, 255, 255, 150)); + ui->dataPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); } void ChannelCharts::initAllenChart(int index) @@ -75,10 +107,8 @@ ui->allenPlot->xAxis->setLabelColor(Qt::white); ui->allenPlot->xAxis->setLabel("平均时间(秒)"); - channelAllan[index] << 1.78e-13 << 6.38e-14 << 1.65e-14 << 1.47e-14 << 4.45e-15; - // prepare y axis: - ui->allenPlot->yAxis->setRange(channelAllan[index][4] * 0.5, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); + ui->allenPlot->yAxis->setRange(-1e-15, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); ui->allenPlot->yAxis->setPadding(5); // a bit more space to the left border ui->allenPlot->yAxis->setLabel("阿伦方差"); ui->allenPlot->yAxis->setBasePen(QPen(Qt::white)); diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 8a1f6d3..eb58127 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -3,7 +3,7 @@ #include -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; ChannelCharts::ChannelCharts(QWidget *parent) : @@ -21,20 +21,52 @@ void ChannelCharts::initDataChart(int index) { -/* QChart * dataChart = new QChart(); - dataChart->setTheme(QChart::ChartThemeDark); - dataChart->setDropShadowEnabled(true); - dataChart->legend()->setVisible(false); - dataChart->setAnimationOptions(QChart::AllAnimations); + ui->dataPlot->addGraph(); // blue line + ui->dataPlot->graph(0)->setPen(QPen(QColor(40, 110, 255))); +// ui->dataPlot->addGraph(); // red line +// ui->dataPlot->graph(1)->setPen(QPen(QColor(255, 110, 40))); - QLineSeries * series = new QLineSeries(); - for (int i = 0; i < phaseVector[index].size(); i++) - { - series->append(i, phaseVector[index][i] * 1E12); - } + QSharedPointer timeTicker(new QCPAxisTickerTime); + timeTicker->setTimeFormat("%h:%m:%s"); + ui->dataPlot->xAxis->setTicker(timeTicker); + ui->dataPlot->axisRect()->setupFullAxesBox(); + ui->dataPlot->yAxis->setRange(1e-9, 1e-8); - dataChart->addSeries(series); - dataChart->createDefaultAxes(); */ // 基于已添加到图表的 series 来创建默认的坐标轴 + qint64 base = phaseVector[index].at(0).at(0).toLongLong(); + + QColor color(20+200,105, 150, 150); + ui->dataPlot->graph()->setLineStyle(QCPGraph::lsLine); + ui->dataPlot->graph()->setPen(QPen(color.lighter(200))); + ui->dataPlot->graph()->setBrush(QBrush(color)); + // generate random walk data: +// QVector timeData(phaseVector[index].size()); + for (int i=0; idataPlot->graph(0)->addData((phaseVector[index].at(i).at(0).toLongLong() - base) / 1000.0, phaseVector[index].at(i).at(1).toDouble()); + } +// ui->dataPlot->graph()->data()->set(timeData); + + // configure bottom axis to show date instead of number: + // configure left axis text labels: + // set a more compact font size for bottom and left axis tick labels: + ui->dataPlot->xAxis->setTickLabelFont(QFont(QFont().family(), 8)); + ui->dataPlot->yAxis->setTickLabelFont(QFont(QFont().family(), 8)); + // set axis labels: + ui->dataPlot->xAxis->setLabel("Date"); + ui->dataPlot->yAxis->setLabel("Random wobbly lines value"); + // make top and right axes visible but without ticks and labels: + ui->dataPlot->xAxis2->setVisible(true); + ui->dataPlot->yAxis2->setVisible(true); + ui->dataPlot->xAxis2->setTicks(false); + ui->dataPlot->yAxis2->setTicks(false); + ui->dataPlot->xAxis2->setTickLabels(false); + ui->dataPlot->yAxis2->setTickLabels(false); + // set axis ranges to show all data: + ui->dataPlot->xAxis->setRange((phaseVector[index].at(0).at(0).toULongLong() - base) / 1000.0, (phaseVector[index].last().at(0).toULongLong() - base) / 1000.0); + // show legend with slightly transparent background brush: + ui->dataPlot->legend->setVisible(false); + ui->dataPlot->legend->setBrush(QColor(255, 255, 255, 150)); + ui->dataPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); } void ChannelCharts::initAllenChart(int index) @@ -75,10 +107,8 @@ ui->allenPlot->xAxis->setLabelColor(Qt::white); ui->allenPlot->xAxis->setLabel("平均时间(秒)"); - channelAllan[index] << 1.78e-13 << 6.38e-14 << 1.65e-14 << 1.47e-14 << 4.45e-15; - // prepare y axis: - ui->allenPlot->yAxis->setRange(channelAllan[index][4] * 0.5, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); + ui->allenPlot->yAxis->setRange(-1e-15, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); ui->allenPlot->yAxis->setPadding(5); // a bit more space to the left border ui->allenPlot->yAxis->setLabel("阿伦方差"); ui->allenPlot->yAxis->setBasePen(QPen(Qt::white)); diff --git a/ChannelItem.cpp b/ChannelItem.cpp index cdf793d..a000598 100644 --- a/ChannelItem.cpp +++ b/ChannelItem.cpp @@ -69,7 +69,7 @@ void ChannelItem::on_clearDataButt_clicked() { // 清除测量数据 - QVector pNullVector(0,0); + QVector pNullVector; QMutex mutex; mutex.lock(); @@ -81,6 +81,6 @@ { chartFrame->setWindowTitle(QString("通道 - %1 数据曲线").arg(index + 1)); chartFrame->initAllenChart(index); -// chartFrame->initDataChart(index); + chartFrame->initDataChart(index); chartFrame->show(); } diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 8a1f6d3..eb58127 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -3,7 +3,7 @@ #include -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; ChannelCharts::ChannelCharts(QWidget *parent) : @@ -21,20 +21,52 @@ void ChannelCharts::initDataChart(int index) { -/* QChart * dataChart = new QChart(); - dataChart->setTheme(QChart::ChartThemeDark); - dataChart->setDropShadowEnabled(true); - dataChart->legend()->setVisible(false); - dataChart->setAnimationOptions(QChart::AllAnimations); + ui->dataPlot->addGraph(); // blue line + ui->dataPlot->graph(0)->setPen(QPen(QColor(40, 110, 255))); +// ui->dataPlot->addGraph(); // red line +// ui->dataPlot->graph(1)->setPen(QPen(QColor(255, 110, 40))); - QLineSeries * series = new QLineSeries(); - for (int i = 0; i < phaseVector[index].size(); i++) - { - series->append(i, phaseVector[index][i] * 1E12); - } + QSharedPointer timeTicker(new QCPAxisTickerTime); + timeTicker->setTimeFormat("%h:%m:%s"); + ui->dataPlot->xAxis->setTicker(timeTicker); + ui->dataPlot->axisRect()->setupFullAxesBox(); + ui->dataPlot->yAxis->setRange(1e-9, 1e-8); - dataChart->addSeries(series); - dataChart->createDefaultAxes(); */ // 基于已添加到图表的 series 来创建默认的坐标轴 + qint64 base = phaseVector[index].at(0).at(0).toLongLong(); + + QColor color(20+200,105, 150, 150); + ui->dataPlot->graph()->setLineStyle(QCPGraph::lsLine); + ui->dataPlot->graph()->setPen(QPen(color.lighter(200))); + ui->dataPlot->graph()->setBrush(QBrush(color)); + // generate random walk data: +// QVector timeData(phaseVector[index].size()); + for (int i=0; idataPlot->graph(0)->addData((phaseVector[index].at(i).at(0).toLongLong() - base) / 1000.0, phaseVector[index].at(i).at(1).toDouble()); + } +// ui->dataPlot->graph()->data()->set(timeData); + + // configure bottom axis to show date instead of number: + // configure left axis text labels: + // set a more compact font size for bottom and left axis tick labels: + ui->dataPlot->xAxis->setTickLabelFont(QFont(QFont().family(), 8)); + ui->dataPlot->yAxis->setTickLabelFont(QFont(QFont().family(), 8)); + // set axis labels: + ui->dataPlot->xAxis->setLabel("Date"); + ui->dataPlot->yAxis->setLabel("Random wobbly lines value"); + // make top and right axes visible but without ticks and labels: + ui->dataPlot->xAxis2->setVisible(true); + ui->dataPlot->yAxis2->setVisible(true); + ui->dataPlot->xAxis2->setTicks(false); + ui->dataPlot->yAxis2->setTicks(false); + ui->dataPlot->xAxis2->setTickLabels(false); + ui->dataPlot->yAxis2->setTickLabels(false); + // set axis ranges to show all data: + ui->dataPlot->xAxis->setRange((phaseVector[index].at(0).at(0).toULongLong() - base) / 1000.0, (phaseVector[index].last().at(0).toULongLong() - base) / 1000.0); + // show legend with slightly transparent background brush: + ui->dataPlot->legend->setVisible(false); + ui->dataPlot->legend->setBrush(QColor(255, 255, 255, 150)); + ui->dataPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); } void ChannelCharts::initAllenChart(int index) @@ -75,10 +107,8 @@ ui->allenPlot->xAxis->setLabelColor(Qt::white); ui->allenPlot->xAxis->setLabel("平均时间(秒)"); - channelAllan[index] << 1.78e-13 << 6.38e-14 << 1.65e-14 << 1.47e-14 << 4.45e-15; - // prepare y axis: - ui->allenPlot->yAxis->setRange(channelAllan[index][4] * 0.5, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); + ui->allenPlot->yAxis->setRange(-1e-15, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); ui->allenPlot->yAxis->setPadding(5); // a bit more space to the left border ui->allenPlot->yAxis->setLabel("阿伦方差"); ui->allenPlot->yAxis->setBasePen(QPen(Qt::white)); diff --git a/ChannelItem.cpp b/ChannelItem.cpp index cdf793d..a000598 100644 --- a/ChannelItem.cpp +++ b/ChannelItem.cpp @@ -69,7 +69,7 @@ void ChannelItem::on_clearDataButt_clicked() { // 清除测量数据 - QVector pNullVector(0,0); + QVector pNullVector; QMutex mutex; mutex.lock(); @@ -81,6 +81,6 @@ { chartFrame->setWindowTitle(QString("通道 - %1 数据曲线").arg(index + 1)); chartFrame->initAllenChart(index); -// chartFrame->initDataChart(index); + chartFrame->initDataChart(index); chartFrame->show(); } diff --git a/ChannelItem.h b/ChannelItem.h index 5a18519..6198147 100644 --- a/ChannelItem.h +++ b/ChannelItem.h @@ -6,7 +6,7 @@ #include "common/utils/SettingConfig.h" #include "ChannelCharts.h" -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; namespace Ui { diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 8a1f6d3..eb58127 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -3,7 +3,7 @@ #include -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; ChannelCharts::ChannelCharts(QWidget *parent) : @@ -21,20 +21,52 @@ void ChannelCharts::initDataChart(int index) { -/* QChart * dataChart = new QChart(); - dataChart->setTheme(QChart::ChartThemeDark); - dataChart->setDropShadowEnabled(true); - dataChart->legend()->setVisible(false); - dataChart->setAnimationOptions(QChart::AllAnimations); + ui->dataPlot->addGraph(); // blue line + ui->dataPlot->graph(0)->setPen(QPen(QColor(40, 110, 255))); +// ui->dataPlot->addGraph(); // red line +// ui->dataPlot->graph(1)->setPen(QPen(QColor(255, 110, 40))); - QLineSeries * series = new QLineSeries(); - for (int i = 0; i < phaseVector[index].size(); i++) - { - series->append(i, phaseVector[index][i] * 1E12); - } + QSharedPointer timeTicker(new QCPAxisTickerTime); + timeTicker->setTimeFormat("%h:%m:%s"); + ui->dataPlot->xAxis->setTicker(timeTicker); + ui->dataPlot->axisRect()->setupFullAxesBox(); + ui->dataPlot->yAxis->setRange(1e-9, 1e-8); - dataChart->addSeries(series); - dataChart->createDefaultAxes(); */ // 基于已添加到图表的 series 来创建默认的坐标轴 + qint64 base = phaseVector[index].at(0).at(0).toLongLong(); + + QColor color(20+200,105, 150, 150); + ui->dataPlot->graph()->setLineStyle(QCPGraph::lsLine); + ui->dataPlot->graph()->setPen(QPen(color.lighter(200))); + ui->dataPlot->graph()->setBrush(QBrush(color)); + // generate random walk data: +// QVector timeData(phaseVector[index].size()); + for (int i=0; idataPlot->graph(0)->addData((phaseVector[index].at(i).at(0).toLongLong() - base) / 1000.0, phaseVector[index].at(i).at(1).toDouble()); + } +// ui->dataPlot->graph()->data()->set(timeData); + + // configure bottom axis to show date instead of number: + // configure left axis text labels: + // set a more compact font size for bottom and left axis tick labels: + ui->dataPlot->xAxis->setTickLabelFont(QFont(QFont().family(), 8)); + ui->dataPlot->yAxis->setTickLabelFont(QFont(QFont().family(), 8)); + // set axis labels: + ui->dataPlot->xAxis->setLabel("Date"); + ui->dataPlot->yAxis->setLabel("Random wobbly lines value"); + // make top and right axes visible but without ticks and labels: + ui->dataPlot->xAxis2->setVisible(true); + ui->dataPlot->yAxis2->setVisible(true); + ui->dataPlot->xAxis2->setTicks(false); + ui->dataPlot->yAxis2->setTicks(false); + ui->dataPlot->xAxis2->setTickLabels(false); + ui->dataPlot->yAxis2->setTickLabels(false); + // set axis ranges to show all data: + ui->dataPlot->xAxis->setRange((phaseVector[index].at(0).at(0).toULongLong() - base) / 1000.0, (phaseVector[index].last().at(0).toULongLong() - base) / 1000.0); + // show legend with slightly transparent background brush: + ui->dataPlot->legend->setVisible(false); + ui->dataPlot->legend->setBrush(QColor(255, 255, 255, 150)); + ui->dataPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); } void ChannelCharts::initAllenChart(int index) @@ -75,10 +107,8 @@ ui->allenPlot->xAxis->setLabelColor(Qt::white); ui->allenPlot->xAxis->setLabel("平均时间(秒)"); - channelAllan[index] << 1.78e-13 << 6.38e-14 << 1.65e-14 << 1.47e-14 << 4.45e-15; - // prepare y axis: - ui->allenPlot->yAxis->setRange(channelAllan[index][4] * 0.5, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); + ui->allenPlot->yAxis->setRange(-1e-15, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); ui->allenPlot->yAxis->setPadding(5); // a bit more space to the left border ui->allenPlot->yAxis->setLabel("阿伦方差"); ui->allenPlot->yAxis->setBasePen(QPen(Qt::white)); diff --git a/ChannelItem.cpp b/ChannelItem.cpp index cdf793d..a000598 100644 --- a/ChannelItem.cpp +++ b/ChannelItem.cpp @@ -69,7 +69,7 @@ void ChannelItem::on_clearDataButt_clicked() { // 清除测量数据 - QVector pNullVector(0,0); + QVector pNullVector; QMutex mutex; mutex.lock(); @@ -81,6 +81,6 @@ { chartFrame->setWindowTitle(QString("通道 - %1 数据曲线").arg(index + 1)); chartFrame->initAllenChart(index); -// chartFrame->initDataChart(index); + chartFrame->initDataChart(index); chartFrame->show(); } diff --git a/ChannelItem.h b/ChannelItem.h index 5a18519..6198147 100644 --- a/ChannelItem.h +++ b/ChannelItem.h @@ -6,7 +6,7 @@ #include "common/utils/SettingConfig.h" #include "ChannelCharts.h" -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; namespace Ui { diff --git a/DataProcessAlgorithm.cpp b/DataProcessAlgorithm.cpp index db69c4b..2b16bf7 100644 --- a/DataProcessAlgorithm.cpp +++ b/DataProcessAlgorithm.cpp @@ -1,7 +1,7 @@ #include "DataProcessAlgorithm.h" #include -extern QVector> phaseVector; +extern QVector> phaseVector; DataProcessAlgorithm::DataProcessAlgorithm(QObject *parent) : QObject(parent) { @@ -18,7 +18,10 @@ double tau_2 = pow(d * tau0, 2); //pow是计算x的y次幂 for (; i < aN - 2 * d; i++) { - y[i] = pow(phaseVector[index][i+2*d] - 2 * phaseVector[index][i+d] + phaseVector[index][i], 2); + double vi2 = phaseVector[index][i+2*d].at(1).toDouble(); + double vi1 = phaseVector[index][i+d].at(1).toDouble(); + double vi = phaseVector[index][i].at(1).toDouble(); + y[i] = pow(vi2 - 2 * vi1 + vi, 2); sum=sum+y[i]; } allan[0] = sum/(2*tau_2*(aN-2*d)); //delta的平方 diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 8a1f6d3..eb58127 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -3,7 +3,7 @@ #include -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; ChannelCharts::ChannelCharts(QWidget *parent) : @@ -21,20 +21,52 @@ void ChannelCharts::initDataChart(int index) { -/* QChart * dataChart = new QChart(); - dataChart->setTheme(QChart::ChartThemeDark); - dataChart->setDropShadowEnabled(true); - dataChart->legend()->setVisible(false); - dataChart->setAnimationOptions(QChart::AllAnimations); + ui->dataPlot->addGraph(); // blue line + ui->dataPlot->graph(0)->setPen(QPen(QColor(40, 110, 255))); +// ui->dataPlot->addGraph(); // red line +// ui->dataPlot->graph(1)->setPen(QPen(QColor(255, 110, 40))); - QLineSeries * series = new QLineSeries(); - for (int i = 0; i < phaseVector[index].size(); i++) - { - series->append(i, phaseVector[index][i] * 1E12); - } + QSharedPointer timeTicker(new QCPAxisTickerTime); + timeTicker->setTimeFormat("%h:%m:%s"); + ui->dataPlot->xAxis->setTicker(timeTicker); + ui->dataPlot->axisRect()->setupFullAxesBox(); + ui->dataPlot->yAxis->setRange(1e-9, 1e-8); - dataChart->addSeries(series); - dataChart->createDefaultAxes(); */ // 基于已添加到图表的 series 来创建默认的坐标轴 + qint64 base = phaseVector[index].at(0).at(0).toLongLong(); + + QColor color(20+200,105, 150, 150); + ui->dataPlot->graph()->setLineStyle(QCPGraph::lsLine); + ui->dataPlot->graph()->setPen(QPen(color.lighter(200))); + ui->dataPlot->graph()->setBrush(QBrush(color)); + // generate random walk data: +// QVector timeData(phaseVector[index].size()); + for (int i=0; idataPlot->graph(0)->addData((phaseVector[index].at(i).at(0).toLongLong() - base) / 1000.0, phaseVector[index].at(i).at(1).toDouble()); + } +// ui->dataPlot->graph()->data()->set(timeData); + + // configure bottom axis to show date instead of number: + // configure left axis text labels: + // set a more compact font size for bottom and left axis tick labels: + ui->dataPlot->xAxis->setTickLabelFont(QFont(QFont().family(), 8)); + ui->dataPlot->yAxis->setTickLabelFont(QFont(QFont().family(), 8)); + // set axis labels: + ui->dataPlot->xAxis->setLabel("Date"); + ui->dataPlot->yAxis->setLabel("Random wobbly lines value"); + // make top and right axes visible but without ticks and labels: + ui->dataPlot->xAxis2->setVisible(true); + ui->dataPlot->yAxis2->setVisible(true); + ui->dataPlot->xAxis2->setTicks(false); + ui->dataPlot->yAxis2->setTicks(false); + ui->dataPlot->xAxis2->setTickLabels(false); + ui->dataPlot->yAxis2->setTickLabels(false); + // set axis ranges to show all data: + ui->dataPlot->xAxis->setRange((phaseVector[index].at(0).at(0).toULongLong() - base) / 1000.0, (phaseVector[index].last().at(0).toULongLong() - base) / 1000.0); + // show legend with slightly transparent background brush: + ui->dataPlot->legend->setVisible(false); + ui->dataPlot->legend->setBrush(QColor(255, 255, 255, 150)); + ui->dataPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); } void ChannelCharts::initAllenChart(int index) @@ -75,10 +107,8 @@ ui->allenPlot->xAxis->setLabelColor(Qt::white); ui->allenPlot->xAxis->setLabel("平均时间(秒)"); - channelAllan[index] << 1.78e-13 << 6.38e-14 << 1.65e-14 << 1.47e-14 << 4.45e-15; - // prepare y axis: - ui->allenPlot->yAxis->setRange(channelAllan[index][4] * 0.5, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); + ui->allenPlot->yAxis->setRange(-1e-15, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); ui->allenPlot->yAxis->setPadding(5); // a bit more space to the left border ui->allenPlot->yAxis->setLabel("阿伦方差"); ui->allenPlot->yAxis->setBasePen(QPen(Qt::white)); diff --git a/ChannelItem.cpp b/ChannelItem.cpp index cdf793d..a000598 100644 --- a/ChannelItem.cpp +++ b/ChannelItem.cpp @@ -69,7 +69,7 @@ void ChannelItem::on_clearDataButt_clicked() { // 清除测量数据 - QVector pNullVector(0,0); + QVector pNullVector; QMutex mutex; mutex.lock(); @@ -81,6 +81,6 @@ { chartFrame->setWindowTitle(QString("通道 - %1 数据曲线").arg(index + 1)); chartFrame->initAllenChart(index); -// chartFrame->initDataChart(index); + chartFrame->initDataChart(index); chartFrame->show(); } diff --git a/ChannelItem.h b/ChannelItem.h index 5a18519..6198147 100644 --- a/ChannelItem.h +++ b/ChannelItem.h @@ -6,7 +6,7 @@ #include "common/utils/SettingConfig.h" #include "ChannelCharts.h" -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; namespace Ui { diff --git a/DataProcessAlgorithm.cpp b/DataProcessAlgorithm.cpp index db69c4b..2b16bf7 100644 --- a/DataProcessAlgorithm.cpp +++ b/DataProcessAlgorithm.cpp @@ -1,7 +1,7 @@ #include "DataProcessAlgorithm.h" #include -extern QVector> phaseVector; +extern QVector> phaseVector; DataProcessAlgorithm::DataProcessAlgorithm(QObject *parent) : QObject(parent) { @@ -18,7 +18,10 @@ double tau_2 = pow(d * tau0, 2); //pow是计算x的y次幂 for (; i < aN - 2 * d; i++) { - y[i] = pow(phaseVector[index][i+2*d] - 2 * phaseVector[index][i+d] + phaseVector[index][i], 2); + double vi2 = phaseVector[index][i+2*d].at(1).toDouble(); + double vi1 = phaseVector[index][i+d].at(1).toDouble(); + double vi = phaseVector[index][i].at(1).toDouble(); + y[i] = pow(vi2 - 2 * vi1 + vi, 2); sum=sum+y[i]; } allan[0] = sum/(2*tau_2*(aN-2*d)); //delta的平方 diff --git a/PhaseDevice.cpp b/PhaseDevice.cpp index 934ee69..d39544c 100644 --- a/PhaseDevice.cpp +++ b/PhaseDevice.cpp @@ -4,9 +4,10 @@ #include #include #include +#include // 原始数据 - 补偿之前的值 -QVector> phaseVector(PHASE_MESSURE_CHANNEL, QVector(0,0)); +QVector> phaseVector(PHASE_MESSURE_CHANNEL, QVector()); // allan方差值 - 1s ~ 10000s QVector> channelAllan(PHASE_MESSURE_CHANNEL, QVector(0,0)); @@ -16,6 +17,11 @@ clientUtil = new UDPClientUtil(this); connect(clientUtil, &UDPClientUtil::dataRecieved, this, &PhaseDevice::dataReceivedHandler); + +// QTimer * timer = new QTimer(this); +// connect(timer, &QTimer::timeout, +// this, &PhaseDevice::mockPhaseData); +// timer->start(1000); } PhaseDevice::~PhaseDevice() @@ -107,9 +113,11 @@ QLogUtil::writeChannelDataLogByDate(phaseData->timestamp.mid(0, 10), chFilename, channelDataStr); // 3.3 将补偿前的时差数据存入数据栈, 用于计算allen方差 + QStringList valueList; + valueList << QString::number(phaseData->milisecond) << QString::number(phaseData->channelBeforeDelay.at(i), 'e', 4); QMutex mutex; mutex.lock(); - phaseVector[i].append(phaseData->channelBeforeDelay.at(i)); + phaseVector[i].append(valueList); mutex.unlock(); // 3.4 分别计算不同时间维度的稳定度 @@ -131,3 +139,23 @@ // 4. 在界面上简单显示相差数据结果 emit this->sendDataToDraw(phaseData); } + +void PhaseDevice::mockPhaseData() +{ + QDateTime now = QDateTime::currentDateTime(); + + QString frameId = now.toString("HHmmsszzz"); + + QByteArray buffer; + buffer.append(QByteUtil::hexStringToBytes(frameId.mid(0, 8))); + + for (int i = 1; i <= 16; i++) + { + int value = qrand() % 10000; + buffer.append(QByteUtil::hexStringToBytes("00800000")).append(QByteUtil::ULongToBytes(value, 4)); + } + + buffer.append(QByteUtil::hexStringToBytes("EEEEEEEE")); + + this->dataReceivedHandler(buffer); +} diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 8a1f6d3..eb58127 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -3,7 +3,7 @@ #include -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; ChannelCharts::ChannelCharts(QWidget *parent) : @@ -21,20 +21,52 @@ void ChannelCharts::initDataChart(int index) { -/* QChart * dataChart = new QChart(); - dataChart->setTheme(QChart::ChartThemeDark); - dataChart->setDropShadowEnabled(true); - dataChart->legend()->setVisible(false); - dataChart->setAnimationOptions(QChart::AllAnimations); + ui->dataPlot->addGraph(); // blue line + ui->dataPlot->graph(0)->setPen(QPen(QColor(40, 110, 255))); +// ui->dataPlot->addGraph(); // red line +// ui->dataPlot->graph(1)->setPen(QPen(QColor(255, 110, 40))); - QLineSeries * series = new QLineSeries(); - for (int i = 0; i < phaseVector[index].size(); i++) - { - series->append(i, phaseVector[index][i] * 1E12); - } + QSharedPointer timeTicker(new QCPAxisTickerTime); + timeTicker->setTimeFormat("%h:%m:%s"); + ui->dataPlot->xAxis->setTicker(timeTicker); + ui->dataPlot->axisRect()->setupFullAxesBox(); + ui->dataPlot->yAxis->setRange(1e-9, 1e-8); - dataChart->addSeries(series); - dataChart->createDefaultAxes(); */ // 基于已添加到图表的 series 来创建默认的坐标轴 + qint64 base = phaseVector[index].at(0).at(0).toLongLong(); + + QColor color(20+200,105, 150, 150); + ui->dataPlot->graph()->setLineStyle(QCPGraph::lsLine); + ui->dataPlot->graph()->setPen(QPen(color.lighter(200))); + ui->dataPlot->graph()->setBrush(QBrush(color)); + // generate random walk data: +// QVector timeData(phaseVector[index].size()); + for (int i=0; idataPlot->graph(0)->addData((phaseVector[index].at(i).at(0).toLongLong() - base) / 1000.0, phaseVector[index].at(i).at(1).toDouble()); + } +// ui->dataPlot->graph()->data()->set(timeData); + + // configure bottom axis to show date instead of number: + // configure left axis text labels: + // set a more compact font size for bottom and left axis tick labels: + ui->dataPlot->xAxis->setTickLabelFont(QFont(QFont().family(), 8)); + ui->dataPlot->yAxis->setTickLabelFont(QFont(QFont().family(), 8)); + // set axis labels: + ui->dataPlot->xAxis->setLabel("Date"); + ui->dataPlot->yAxis->setLabel("Random wobbly lines value"); + // make top and right axes visible but without ticks and labels: + ui->dataPlot->xAxis2->setVisible(true); + ui->dataPlot->yAxis2->setVisible(true); + ui->dataPlot->xAxis2->setTicks(false); + ui->dataPlot->yAxis2->setTicks(false); + ui->dataPlot->xAxis2->setTickLabels(false); + ui->dataPlot->yAxis2->setTickLabels(false); + // set axis ranges to show all data: + ui->dataPlot->xAxis->setRange((phaseVector[index].at(0).at(0).toULongLong() - base) / 1000.0, (phaseVector[index].last().at(0).toULongLong() - base) / 1000.0); + // show legend with slightly transparent background brush: + ui->dataPlot->legend->setVisible(false); + ui->dataPlot->legend->setBrush(QColor(255, 255, 255, 150)); + ui->dataPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); } void ChannelCharts::initAllenChart(int index) @@ -75,10 +107,8 @@ ui->allenPlot->xAxis->setLabelColor(Qt::white); ui->allenPlot->xAxis->setLabel("平均时间(秒)"); - channelAllan[index] << 1.78e-13 << 6.38e-14 << 1.65e-14 << 1.47e-14 << 4.45e-15; - // prepare y axis: - ui->allenPlot->yAxis->setRange(channelAllan[index][4] * 0.5, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); + ui->allenPlot->yAxis->setRange(-1e-15, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); ui->allenPlot->yAxis->setPadding(5); // a bit more space to the left border ui->allenPlot->yAxis->setLabel("阿伦方差"); ui->allenPlot->yAxis->setBasePen(QPen(Qt::white)); diff --git a/ChannelItem.cpp b/ChannelItem.cpp index cdf793d..a000598 100644 --- a/ChannelItem.cpp +++ b/ChannelItem.cpp @@ -69,7 +69,7 @@ void ChannelItem::on_clearDataButt_clicked() { // 清除测量数据 - QVector pNullVector(0,0); + QVector pNullVector; QMutex mutex; mutex.lock(); @@ -81,6 +81,6 @@ { chartFrame->setWindowTitle(QString("通道 - %1 数据曲线").arg(index + 1)); chartFrame->initAllenChart(index); -// chartFrame->initDataChart(index); + chartFrame->initDataChart(index); chartFrame->show(); } diff --git a/ChannelItem.h b/ChannelItem.h index 5a18519..6198147 100644 --- a/ChannelItem.h +++ b/ChannelItem.h @@ -6,7 +6,7 @@ #include "common/utils/SettingConfig.h" #include "ChannelCharts.h" -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; namespace Ui { diff --git a/DataProcessAlgorithm.cpp b/DataProcessAlgorithm.cpp index db69c4b..2b16bf7 100644 --- a/DataProcessAlgorithm.cpp +++ b/DataProcessAlgorithm.cpp @@ -1,7 +1,7 @@ #include "DataProcessAlgorithm.h" #include -extern QVector> phaseVector; +extern QVector> phaseVector; DataProcessAlgorithm::DataProcessAlgorithm(QObject *parent) : QObject(parent) { @@ -18,7 +18,10 @@ double tau_2 = pow(d * tau0, 2); //pow是计算x的y次幂 for (; i < aN - 2 * d; i++) { - y[i] = pow(phaseVector[index][i+2*d] - 2 * phaseVector[index][i+d] + phaseVector[index][i], 2); + double vi2 = phaseVector[index][i+2*d].at(1).toDouble(); + double vi1 = phaseVector[index][i+d].at(1).toDouble(); + double vi = phaseVector[index][i].at(1).toDouble(); + y[i] = pow(vi2 - 2 * vi1 + vi, 2); sum=sum+y[i]; } allan[0] = sum/(2*tau_2*(aN-2*d)); //delta的平方 diff --git a/PhaseDevice.cpp b/PhaseDevice.cpp index 934ee69..d39544c 100644 --- a/PhaseDevice.cpp +++ b/PhaseDevice.cpp @@ -4,9 +4,10 @@ #include #include #include +#include // 原始数据 - 补偿之前的值 -QVector> phaseVector(PHASE_MESSURE_CHANNEL, QVector(0,0)); +QVector> phaseVector(PHASE_MESSURE_CHANNEL, QVector()); // allan方差值 - 1s ~ 10000s QVector> channelAllan(PHASE_MESSURE_CHANNEL, QVector(0,0)); @@ -16,6 +17,11 @@ clientUtil = new UDPClientUtil(this); connect(clientUtil, &UDPClientUtil::dataRecieved, this, &PhaseDevice::dataReceivedHandler); + +// QTimer * timer = new QTimer(this); +// connect(timer, &QTimer::timeout, +// this, &PhaseDevice::mockPhaseData); +// timer->start(1000); } PhaseDevice::~PhaseDevice() @@ -107,9 +113,11 @@ QLogUtil::writeChannelDataLogByDate(phaseData->timestamp.mid(0, 10), chFilename, channelDataStr); // 3.3 将补偿前的时差数据存入数据栈, 用于计算allen方差 + QStringList valueList; + valueList << QString::number(phaseData->milisecond) << QString::number(phaseData->channelBeforeDelay.at(i), 'e', 4); QMutex mutex; mutex.lock(); - phaseVector[i].append(phaseData->channelBeforeDelay.at(i)); + phaseVector[i].append(valueList); mutex.unlock(); // 3.4 分别计算不同时间维度的稳定度 @@ -131,3 +139,23 @@ // 4. 在界面上简单显示相差数据结果 emit this->sendDataToDraw(phaseData); } + +void PhaseDevice::mockPhaseData() +{ + QDateTime now = QDateTime::currentDateTime(); + + QString frameId = now.toString("HHmmsszzz"); + + QByteArray buffer; + buffer.append(QByteUtil::hexStringToBytes(frameId.mid(0, 8))); + + for (int i = 1; i <= 16; i++) + { + int value = qrand() % 10000; + buffer.append(QByteUtil::hexStringToBytes("00800000")).append(QByteUtil::ULongToBytes(value, 4)); + } + + buffer.append(QByteUtil::hexStringToBytes("EEEEEEEE")); + + this->dataReceivedHandler(buffer); +} diff --git a/PhaseDevice.h b/PhaseDevice.h index 0950f54..11c88eb 100644 --- a/PhaseDevice.h +++ b/PhaseDevice.h @@ -23,6 +23,8 @@ QByteArray dataBuff; + void mockPhaseData(); + signals: void sendDataToDraw(PhaseDataDto * phaseData); diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 8a1f6d3..eb58127 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -3,7 +3,7 @@ #include -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; ChannelCharts::ChannelCharts(QWidget *parent) : @@ -21,20 +21,52 @@ void ChannelCharts::initDataChart(int index) { -/* QChart * dataChart = new QChart(); - dataChart->setTheme(QChart::ChartThemeDark); - dataChart->setDropShadowEnabled(true); - dataChart->legend()->setVisible(false); - dataChart->setAnimationOptions(QChart::AllAnimations); + ui->dataPlot->addGraph(); // blue line + ui->dataPlot->graph(0)->setPen(QPen(QColor(40, 110, 255))); +// ui->dataPlot->addGraph(); // red line +// ui->dataPlot->graph(1)->setPen(QPen(QColor(255, 110, 40))); - QLineSeries * series = new QLineSeries(); - for (int i = 0; i < phaseVector[index].size(); i++) - { - series->append(i, phaseVector[index][i] * 1E12); - } + QSharedPointer timeTicker(new QCPAxisTickerTime); + timeTicker->setTimeFormat("%h:%m:%s"); + ui->dataPlot->xAxis->setTicker(timeTicker); + ui->dataPlot->axisRect()->setupFullAxesBox(); + ui->dataPlot->yAxis->setRange(1e-9, 1e-8); - dataChart->addSeries(series); - dataChart->createDefaultAxes(); */ // 基于已添加到图表的 series 来创建默认的坐标轴 + qint64 base = phaseVector[index].at(0).at(0).toLongLong(); + + QColor color(20+200,105, 150, 150); + ui->dataPlot->graph()->setLineStyle(QCPGraph::lsLine); + ui->dataPlot->graph()->setPen(QPen(color.lighter(200))); + ui->dataPlot->graph()->setBrush(QBrush(color)); + // generate random walk data: +// QVector timeData(phaseVector[index].size()); + for (int i=0; idataPlot->graph(0)->addData((phaseVector[index].at(i).at(0).toLongLong() - base) / 1000.0, phaseVector[index].at(i).at(1).toDouble()); + } +// ui->dataPlot->graph()->data()->set(timeData); + + // configure bottom axis to show date instead of number: + // configure left axis text labels: + // set a more compact font size for bottom and left axis tick labels: + ui->dataPlot->xAxis->setTickLabelFont(QFont(QFont().family(), 8)); + ui->dataPlot->yAxis->setTickLabelFont(QFont(QFont().family(), 8)); + // set axis labels: + ui->dataPlot->xAxis->setLabel("Date"); + ui->dataPlot->yAxis->setLabel("Random wobbly lines value"); + // make top and right axes visible but without ticks and labels: + ui->dataPlot->xAxis2->setVisible(true); + ui->dataPlot->yAxis2->setVisible(true); + ui->dataPlot->xAxis2->setTicks(false); + ui->dataPlot->yAxis2->setTicks(false); + ui->dataPlot->xAxis2->setTickLabels(false); + ui->dataPlot->yAxis2->setTickLabels(false); + // set axis ranges to show all data: + ui->dataPlot->xAxis->setRange((phaseVector[index].at(0).at(0).toULongLong() - base) / 1000.0, (phaseVector[index].last().at(0).toULongLong() - base) / 1000.0); + // show legend with slightly transparent background brush: + ui->dataPlot->legend->setVisible(false); + ui->dataPlot->legend->setBrush(QColor(255, 255, 255, 150)); + ui->dataPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); } void ChannelCharts::initAllenChart(int index) @@ -75,10 +107,8 @@ ui->allenPlot->xAxis->setLabelColor(Qt::white); ui->allenPlot->xAxis->setLabel("平均时间(秒)"); - channelAllan[index] << 1.78e-13 << 6.38e-14 << 1.65e-14 << 1.47e-14 << 4.45e-15; - // prepare y axis: - ui->allenPlot->yAxis->setRange(channelAllan[index][4] * 0.5, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); + ui->allenPlot->yAxis->setRange(-1e-15, channelAllan[index].isEmpty() ? 0.1 : channelAllan[index][0]); ui->allenPlot->yAxis->setPadding(5); // a bit more space to the left border ui->allenPlot->yAxis->setLabel("阿伦方差"); ui->allenPlot->yAxis->setBasePen(QPen(Qt::white)); diff --git a/ChannelItem.cpp b/ChannelItem.cpp index cdf793d..a000598 100644 --- a/ChannelItem.cpp +++ b/ChannelItem.cpp @@ -69,7 +69,7 @@ void ChannelItem::on_clearDataButt_clicked() { // 清除测量数据 - QVector pNullVector(0,0); + QVector pNullVector; QMutex mutex; mutex.lock(); @@ -81,6 +81,6 @@ { chartFrame->setWindowTitle(QString("通道 - %1 数据曲线").arg(index + 1)); chartFrame->initAllenChart(index); -// chartFrame->initDataChart(index); + chartFrame->initDataChart(index); chartFrame->show(); } diff --git a/ChannelItem.h b/ChannelItem.h index 5a18519..6198147 100644 --- a/ChannelItem.h +++ b/ChannelItem.h @@ -6,7 +6,7 @@ #include "common/utils/SettingConfig.h" #include "ChannelCharts.h" -extern QVector> phaseVector; +extern QVector> phaseVector; extern QVector> channelAllan; namespace Ui { diff --git a/DataProcessAlgorithm.cpp b/DataProcessAlgorithm.cpp index db69c4b..2b16bf7 100644 --- a/DataProcessAlgorithm.cpp +++ b/DataProcessAlgorithm.cpp @@ -1,7 +1,7 @@ #include "DataProcessAlgorithm.h" #include -extern QVector> phaseVector; +extern QVector> phaseVector; DataProcessAlgorithm::DataProcessAlgorithm(QObject *parent) : QObject(parent) { @@ -18,7 +18,10 @@ double tau_2 = pow(d * tau0, 2); //pow是计算x的y次幂 for (; i < aN - 2 * d; i++) { - y[i] = pow(phaseVector[index][i+2*d] - 2 * phaseVector[index][i+d] + phaseVector[index][i], 2); + double vi2 = phaseVector[index][i+2*d].at(1).toDouble(); + double vi1 = phaseVector[index][i+d].at(1).toDouble(); + double vi = phaseVector[index][i].at(1).toDouble(); + y[i] = pow(vi2 - 2 * vi1 + vi, 2); sum=sum+y[i]; } allan[0] = sum/(2*tau_2*(aN-2*d)); //delta的平方 diff --git a/PhaseDevice.cpp b/PhaseDevice.cpp index 934ee69..d39544c 100644 --- a/PhaseDevice.cpp +++ b/PhaseDevice.cpp @@ -4,9 +4,10 @@ #include #include #include +#include // 原始数据 - 补偿之前的值 -QVector> phaseVector(PHASE_MESSURE_CHANNEL, QVector(0,0)); +QVector> phaseVector(PHASE_MESSURE_CHANNEL, QVector()); // allan方差值 - 1s ~ 10000s QVector> channelAllan(PHASE_MESSURE_CHANNEL, QVector(0,0)); @@ -16,6 +17,11 @@ clientUtil = new UDPClientUtil(this); connect(clientUtil, &UDPClientUtil::dataRecieved, this, &PhaseDevice::dataReceivedHandler); + +// QTimer * timer = new QTimer(this); +// connect(timer, &QTimer::timeout, +// this, &PhaseDevice::mockPhaseData); +// timer->start(1000); } PhaseDevice::~PhaseDevice() @@ -107,9 +113,11 @@ QLogUtil::writeChannelDataLogByDate(phaseData->timestamp.mid(0, 10), chFilename, channelDataStr); // 3.3 将补偿前的时差数据存入数据栈, 用于计算allen方差 + QStringList valueList; + valueList << QString::number(phaseData->milisecond) << QString::number(phaseData->channelBeforeDelay.at(i), 'e', 4); QMutex mutex; mutex.lock(); - phaseVector[i].append(phaseData->channelBeforeDelay.at(i)); + phaseVector[i].append(valueList); mutex.unlock(); // 3.4 分别计算不同时间维度的稳定度 @@ -131,3 +139,23 @@ // 4. 在界面上简单显示相差数据结果 emit this->sendDataToDraw(phaseData); } + +void PhaseDevice::mockPhaseData() +{ + QDateTime now = QDateTime::currentDateTime(); + + QString frameId = now.toString("HHmmsszzz"); + + QByteArray buffer; + buffer.append(QByteUtil::hexStringToBytes(frameId.mid(0, 8))); + + for (int i = 1; i <= 16; i++) + { + int value = qrand() % 10000; + buffer.append(QByteUtil::hexStringToBytes("00800000")).append(QByteUtil::ULongToBytes(value, 4)); + } + + buffer.append(QByteUtil::hexStringToBytes("EEEEEEEE")); + + this->dataReceivedHandler(buffer); +} diff --git a/PhaseDevice.h b/PhaseDevice.h index 0950f54..11c88eb 100644 --- a/PhaseDevice.h +++ b/PhaseDevice.h @@ -23,6 +23,8 @@ QByteArray dataBuff; + void mockPhaseData(); + signals: void sendDataToDraw(PhaseDataDto * phaseData); diff --git a/common/utils/UDPClientUtil.cpp b/common/utils/UDPClientUtil.cpp index 41dc090..4fb50ab 100644 --- a/common/utils/UDPClientUtil.cpp +++ b/common/utils/UDPClientUtil.cpp @@ -21,7 +21,7 @@ client->writeDatagram(data, QHostAddress(SettingConfig::getInstance().DEVICE_HOST), SettingConfig::getInstance().DEVICE_PORT); -// std::cout << "[send]" << data.toStdString() << std::endl; + std::cout << "[send]" << data.toStdString() << std::endl; } void UDPClientUtil::readData()