diff --git a/CounterRealTime/ChannelChartForm.cpp b/CounterRealTime/ChannelChartForm.cpp index 9a68053..6a86ed6 100644 --- a/CounterRealTime/ChannelChartForm.cpp +++ b/CounterRealTime/ChannelChartForm.cpp @@ -200,56 +200,54 @@ void ChannelChartForm::mouseMoveEvent(QMouseEvent *event) { - QCPGraph *mGraph = ui->dataPlot->graph(0); //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); //获得鼠标位置处对应的横坐标数据x qulonglong x = ui->dataPlot->xAxis->pixelToCoord(event->pos().x()); + this->drawPlotTracer(x); +} + +void ChannelChartForm::showTracerResidual(QMouseEvent *event) +{ + //获得鼠标位置处对应的横坐标数据x + qulonglong x = ui->analysisPlot->xAxis->pixelToCoord(event->pos().x()); + this->drawPlotTracer(x); +} + +void ChannelChartForm::drawPlotTracer(qulonglong x) +{ + QCPGraph *mGraph = ui->dataPlot->graph(0); + QCPGraph *mGraphResi = ui->analysisPlot->graph(0); + QString time = QDateTime::fromSecsSinceEpoch(x).toString("yyyy-MM-dd HH:mm:ss"); + //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); + //显示锚点 tracer->setVisible(true); - tracer->setGraph(mGraph);//将锚点设置到被选中的曲线上 tracer->setGraphKey(x); //将游标横坐标设置成刚获得的横坐标数据x tracer->setInterpolating(false); //游标的纵坐标可以通过曲线数据线性插值自动获得 tracer->updatePosition(); //使得刚设置游标的横纵坐标位置生效 - double yValue = tracer->position->value(); - - //显示tip框 - QToolTip::showText(event->globalPos(), QString( - "

%1

" - "

时间:%2

" - "

钟差:%3

").arg(mGraph->name()).arg(time).arg(QString::number(yValue, 'f', 3)), this, this->rect()); - //重绘 - ui->dataPlot->replot(); -} - -void ChannelChartForm::showTracerResidual(QMouseEvent *event) -{ - QCPGraph *mGraph = ui->analysisPlot->graph(0); - //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); - - //获得鼠标位置处对应的横坐标数据x - qulonglong x = ui->analysisPlot->xAxis->pixelToCoord(event->pos().x()); - QString time = QDateTime::fromSecsSinceEpoch(x).toString("yyyy-MM-dd HH:mm:ss"); - //显示锚点 tracerResi->setVisible(true); - - tracerResi->setGraph(mGraph);//将锚点设置到被选中的曲线上 + tracerResi->setGraph(mGraphResi);//将锚点设置到被选中的曲线上 tracerResi->setGraphKey(x); //将游标横坐标设置成刚获得的横坐标数据x tracerResi->setInterpolating(false); //游标的纵坐标可以通过曲线数据线性插值自动获得 tracerResi->updatePosition(); //使得刚设置游标的横纵坐标位置生效 - double yValue = tracerResi->position->value(); + double yValue = tracer->position->value(); + double yValueResi = tracerResi->position->value(); + + QPoint pos((SettingConfig::getInstance().WINDOW_WIDTH - 500) / 2, -15); + + QString toolLabel = "时间:%1\r\n钟差(ns):%2\t残差(ns):%3"; //显示tip框 - QToolTip::showText(event->globalPos(), QString( - "

%1

" - "

时间:%2

" - "

钟差残差:%3

").arg(mGraph->name()).arg(time).arg(QString::number(yValue, 'f', 6)), this, this->rect()); + QToolTip::showText(pos, toolLabel.arg(time).arg(QString::number(yValue, 'f', 3)).arg(QString::number(yValueResi, 'f', 6)), this, this->rect(), 5*1000); + //重绘 + ui->dataPlot->replot(); ui->analysisPlot->replot(); } diff --git a/CounterRealTime/ChannelChartForm.cpp b/CounterRealTime/ChannelChartForm.cpp index 9a68053..6a86ed6 100644 --- a/CounterRealTime/ChannelChartForm.cpp +++ b/CounterRealTime/ChannelChartForm.cpp @@ -200,56 +200,54 @@ void ChannelChartForm::mouseMoveEvent(QMouseEvent *event) { - QCPGraph *mGraph = ui->dataPlot->graph(0); //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); //获得鼠标位置处对应的横坐标数据x qulonglong x = ui->dataPlot->xAxis->pixelToCoord(event->pos().x()); + this->drawPlotTracer(x); +} + +void ChannelChartForm::showTracerResidual(QMouseEvent *event) +{ + //获得鼠标位置处对应的横坐标数据x + qulonglong x = ui->analysisPlot->xAxis->pixelToCoord(event->pos().x()); + this->drawPlotTracer(x); +} + +void ChannelChartForm::drawPlotTracer(qulonglong x) +{ + QCPGraph *mGraph = ui->dataPlot->graph(0); + QCPGraph *mGraphResi = ui->analysisPlot->graph(0); + QString time = QDateTime::fromSecsSinceEpoch(x).toString("yyyy-MM-dd HH:mm:ss"); + //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); + //显示锚点 tracer->setVisible(true); - tracer->setGraph(mGraph);//将锚点设置到被选中的曲线上 tracer->setGraphKey(x); //将游标横坐标设置成刚获得的横坐标数据x tracer->setInterpolating(false); //游标的纵坐标可以通过曲线数据线性插值自动获得 tracer->updatePosition(); //使得刚设置游标的横纵坐标位置生效 - double yValue = tracer->position->value(); - - //显示tip框 - QToolTip::showText(event->globalPos(), QString( - "

%1

" - "

时间:%2

" - "

钟差:%3

").arg(mGraph->name()).arg(time).arg(QString::number(yValue, 'f', 3)), this, this->rect()); - //重绘 - ui->dataPlot->replot(); -} - -void ChannelChartForm::showTracerResidual(QMouseEvent *event) -{ - QCPGraph *mGraph = ui->analysisPlot->graph(0); - //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); - - //获得鼠标位置处对应的横坐标数据x - qulonglong x = ui->analysisPlot->xAxis->pixelToCoord(event->pos().x()); - QString time = QDateTime::fromSecsSinceEpoch(x).toString("yyyy-MM-dd HH:mm:ss"); - //显示锚点 tracerResi->setVisible(true); - - tracerResi->setGraph(mGraph);//将锚点设置到被选中的曲线上 + tracerResi->setGraph(mGraphResi);//将锚点设置到被选中的曲线上 tracerResi->setGraphKey(x); //将游标横坐标设置成刚获得的横坐标数据x tracerResi->setInterpolating(false); //游标的纵坐标可以通过曲线数据线性插值自动获得 tracerResi->updatePosition(); //使得刚设置游标的横纵坐标位置生效 - double yValue = tracerResi->position->value(); + double yValue = tracer->position->value(); + double yValueResi = tracerResi->position->value(); + + QPoint pos((SettingConfig::getInstance().WINDOW_WIDTH - 500) / 2, -15); + + QString toolLabel = "时间:%1\r\n钟差(ns):%2\t残差(ns):%3"; //显示tip框 - QToolTip::showText(event->globalPos(), QString( - "

%1

" - "

时间:%2

" - "

钟差残差:%3

").arg(mGraph->name()).arg(time).arg(QString::number(yValue, 'f', 6)), this, this->rect()); + QToolTip::showText(pos, toolLabel.arg(time).arg(QString::number(yValue, 'f', 3)).arg(QString::number(yValueResi, 'f', 6)), this, this->rect(), 5*1000); + //重绘 + ui->dataPlot->replot(); ui->analysisPlot->replot(); } diff --git a/CounterRealTime/ChannelChartForm.h b/CounterRealTime/ChannelChartForm.h index 0346afe..debf240 100644 --- a/CounterRealTime/ChannelChartForm.h +++ b/CounterRealTime/ChannelChartForm.h @@ -35,6 +35,8 @@ QCPItemTracer *tracerResi; QCPItemText *tracerResiLabel; + + void drawPlotTracer(qulonglong x); }; #endif // CHANNELCHARTFORM_H diff --git a/CounterRealTime/ChannelChartForm.cpp b/CounterRealTime/ChannelChartForm.cpp index 9a68053..6a86ed6 100644 --- a/CounterRealTime/ChannelChartForm.cpp +++ b/CounterRealTime/ChannelChartForm.cpp @@ -200,56 +200,54 @@ void ChannelChartForm::mouseMoveEvent(QMouseEvent *event) { - QCPGraph *mGraph = ui->dataPlot->graph(0); //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); //获得鼠标位置处对应的横坐标数据x qulonglong x = ui->dataPlot->xAxis->pixelToCoord(event->pos().x()); + this->drawPlotTracer(x); +} + +void ChannelChartForm::showTracerResidual(QMouseEvent *event) +{ + //获得鼠标位置处对应的横坐标数据x + qulonglong x = ui->analysisPlot->xAxis->pixelToCoord(event->pos().x()); + this->drawPlotTracer(x); +} + +void ChannelChartForm::drawPlotTracer(qulonglong x) +{ + QCPGraph *mGraph = ui->dataPlot->graph(0); + QCPGraph *mGraphResi = ui->analysisPlot->graph(0); + QString time = QDateTime::fromSecsSinceEpoch(x).toString("yyyy-MM-dd HH:mm:ss"); + //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); + //显示锚点 tracer->setVisible(true); - tracer->setGraph(mGraph);//将锚点设置到被选中的曲线上 tracer->setGraphKey(x); //将游标横坐标设置成刚获得的横坐标数据x tracer->setInterpolating(false); //游标的纵坐标可以通过曲线数据线性插值自动获得 tracer->updatePosition(); //使得刚设置游标的横纵坐标位置生效 - double yValue = tracer->position->value(); - - //显示tip框 - QToolTip::showText(event->globalPos(), QString( - "

%1

" - "

时间:%2

" - "

钟差:%3

").arg(mGraph->name()).arg(time).arg(QString::number(yValue, 'f', 3)), this, this->rect()); - //重绘 - ui->dataPlot->replot(); -} - -void ChannelChartForm::showTracerResidual(QMouseEvent *event) -{ - QCPGraph *mGraph = ui->analysisPlot->graph(0); - //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); - - //获得鼠标位置处对应的横坐标数据x - qulonglong x = ui->analysisPlot->xAxis->pixelToCoord(event->pos().x()); - QString time = QDateTime::fromSecsSinceEpoch(x).toString("yyyy-MM-dd HH:mm:ss"); - //显示锚点 tracerResi->setVisible(true); - - tracerResi->setGraph(mGraph);//将锚点设置到被选中的曲线上 + tracerResi->setGraph(mGraphResi);//将锚点设置到被选中的曲线上 tracerResi->setGraphKey(x); //将游标横坐标设置成刚获得的横坐标数据x tracerResi->setInterpolating(false); //游标的纵坐标可以通过曲线数据线性插值自动获得 tracerResi->updatePosition(); //使得刚设置游标的横纵坐标位置生效 - double yValue = tracerResi->position->value(); + double yValue = tracer->position->value(); + double yValueResi = tracerResi->position->value(); + + QPoint pos((SettingConfig::getInstance().WINDOW_WIDTH - 500) / 2, -15); + + QString toolLabel = "时间:%1\r\n钟差(ns):%2\t残差(ns):%3"; //显示tip框 - QToolTip::showText(event->globalPos(), QString( - "

%1

" - "

时间:%2

" - "

钟差残差:%3

").arg(mGraph->name()).arg(time).arg(QString::number(yValue, 'f', 6)), this, this->rect()); + QToolTip::showText(pos, toolLabel.arg(time).arg(QString::number(yValue, 'f', 3)).arg(QString::number(yValueResi, 'f', 6)), this, this->rect(), 5*1000); + //重绘 + ui->dataPlot->replot(); ui->analysisPlot->replot(); } diff --git a/CounterRealTime/ChannelChartForm.h b/CounterRealTime/ChannelChartForm.h index 0346afe..debf240 100644 --- a/CounterRealTime/ChannelChartForm.h +++ b/CounterRealTime/ChannelChartForm.h @@ -35,6 +35,8 @@ QCPItemTracer *tracerResi; QCPItemText *tracerResiLabel; + + void drawPlotTracer(qulonglong x); }; #endif // CHANNELCHARTFORM_H diff --git a/CounterRealTime/qss/mainClock.css b/CounterRealTime/qss/mainClock.css index a8ce530..8d5c146 100644 --- a/CounterRealTime/qss/mainClock.css +++ b/CounterRealTime/qss/mainClock.css @@ -165,6 +165,17 @@ margin-left: 30px; font-size: 20px; } + +QToolTip { + font-family: "Microsoft Yahei"; + font-size: 16px; + color: #FFFFFF; + background-color: #0B1425; + min-width: 500px; + padding: 0px 5px; + border: 2px solid #0BB2E9; + border-radius: 12px; +} /* ChannelChartForm */ /* CounterSettingForm */ diff --git a/CounterRealTime/ChannelChartForm.cpp b/CounterRealTime/ChannelChartForm.cpp index 9a68053..6a86ed6 100644 --- a/CounterRealTime/ChannelChartForm.cpp +++ b/CounterRealTime/ChannelChartForm.cpp @@ -200,56 +200,54 @@ void ChannelChartForm::mouseMoveEvent(QMouseEvent *event) { - QCPGraph *mGraph = ui->dataPlot->graph(0); //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); //获得鼠标位置处对应的横坐标数据x qulonglong x = ui->dataPlot->xAxis->pixelToCoord(event->pos().x()); + this->drawPlotTracer(x); +} + +void ChannelChartForm::showTracerResidual(QMouseEvent *event) +{ + //获得鼠标位置处对应的横坐标数据x + qulonglong x = ui->analysisPlot->xAxis->pixelToCoord(event->pos().x()); + this->drawPlotTracer(x); +} + +void ChannelChartForm::drawPlotTracer(qulonglong x) +{ + QCPGraph *mGraph = ui->dataPlot->graph(0); + QCPGraph *mGraphResi = ui->analysisPlot->graph(0); + QString time = QDateTime::fromSecsSinceEpoch(x).toString("yyyy-MM-dd HH:mm:ss"); + //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); + //显示锚点 tracer->setVisible(true); - tracer->setGraph(mGraph);//将锚点设置到被选中的曲线上 tracer->setGraphKey(x); //将游标横坐标设置成刚获得的横坐标数据x tracer->setInterpolating(false); //游标的纵坐标可以通过曲线数据线性插值自动获得 tracer->updatePosition(); //使得刚设置游标的横纵坐标位置生效 - double yValue = tracer->position->value(); - - //显示tip框 - QToolTip::showText(event->globalPos(), QString( - "

%1

" - "

时间:%2

" - "

钟差:%3

").arg(mGraph->name()).arg(time).arg(QString::number(yValue, 'f', 3)), this, this->rect()); - //重绘 - ui->dataPlot->replot(); -} - -void ChannelChartForm::showTracerResidual(QMouseEvent *event) -{ - QCPGraph *mGraph = ui->analysisPlot->graph(0); - //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); - - //获得鼠标位置处对应的横坐标数据x - qulonglong x = ui->analysisPlot->xAxis->pixelToCoord(event->pos().x()); - QString time = QDateTime::fromSecsSinceEpoch(x).toString("yyyy-MM-dd HH:mm:ss"); - //显示锚点 tracerResi->setVisible(true); - - tracerResi->setGraph(mGraph);//将锚点设置到被选中的曲线上 + tracerResi->setGraph(mGraphResi);//将锚点设置到被选中的曲线上 tracerResi->setGraphKey(x); //将游标横坐标设置成刚获得的横坐标数据x tracerResi->setInterpolating(false); //游标的纵坐标可以通过曲线数据线性插值自动获得 tracerResi->updatePosition(); //使得刚设置游标的横纵坐标位置生效 - double yValue = tracerResi->position->value(); + double yValue = tracer->position->value(); + double yValueResi = tracerResi->position->value(); + + QPoint pos((SettingConfig::getInstance().WINDOW_WIDTH - 500) / 2, -15); + + QString toolLabel = "时间:%1\r\n钟差(ns):%2\t残差(ns):%3"; //显示tip框 - QToolTip::showText(event->globalPos(), QString( - "

%1

" - "

时间:%2

" - "

钟差残差:%3

").arg(mGraph->name()).arg(time).arg(QString::number(yValue, 'f', 6)), this, this->rect()); + QToolTip::showText(pos, toolLabel.arg(time).arg(QString::number(yValue, 'f', 3)).arg(QString::number(yValueResi, 'f', 6)), this, this->rect(), 5*1000); + //重绘 + ui->dataPlot->replot(); ui->analysisPlot->replot(); } diff --git a/CounterRealTime/ChannelChartForm.h b/CounterRealTime/ChannelChartForm.h index 0346afe..debf240 100644 --- a/CounterRealTime/ChannelChartForm.h +++ b/CounterRealTime/ChannelChartForm.h @@ -35,6 +35,8 @@ QCPItemTracer *tracerResi; QCPItemText *tracerResiLabel; + + void drawPlotTracer(qulonglong x); }; #endif // CHANNELCHARTFORM_H diff --git a/CounterRealTime/qss/mainClock.css b/CounterRealTime/qss/mainClock.css index a8ce530..8d5c146 100644 --- a/CounterRealTime/qss/mainClock.css +++ b/CounterRealTime/qss/mainClock.css @@ -165,6 +165,17 @@ margin-left: 30px; font-size: 20px; } + +QToolTip { + font-family: "Microsoft Yahei"; + font-size: 16px; + color: #FFFFFF; + background-color: #0B1425; + min-width: 500px; + padding: 0px 5px; + border: 2px solid #0BB2E9; + border-radius: 12px; +} /* ChannelChartForm */ /* CounterSettingForm */ diff --git a/PhaseCompAcq/protocol/PhaseProtocolBM.cpp b/PhaseCompAcq/protocol/PhaseProtocolBM.cpp index 79b70ce..fd6229c 100644 --- a/PhaseCompAcq/protocol/PhaseProtocolBM.cpp +++ b/PhaseCompAcq/protocol/PhaseProtocolBM.cpp @@ -49,7 +49,7 @@ dataObj->channelRawDataStr.append(QString::number((channelRawData - CALCULATE_OFFSET))); } else { - double phase = (CALCULATE_OFFSET - channelRawData) * CALCULATE_FACTOR; + double phase = -(CALCULATE_OFFSET - channelRawData) * CALCULATE_FACTOR; // rawData是无符号long 相位有正有负 小于CALCULATE_OFFSET时是负值 dataObj->channelActive.append("1"); dataObj->channelData.append(phase); dataObj->channelDataStr.append(QString::number(phase, 'f', 15)); diff --git a/CounterRealTime/ChannelChartForm.cpp b/CounterRealTime/ChannelChartForm.cpp index 9a68053..6a86ed6 100644 --- a/CounterRealTime/ChannelChartForm.cpp +++ b/CounterRealTime/ChannelChartForm.cpp @@ -200,56 +200,54 @@ void ChannelChartForm::mouseMoveEvent(QMouseEvent *event) { - QCPGraph *mGraph = ui->dataPlot->graph(0); //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); //获得鼠标位置处对应的横坐标数据x qulonglong x = ui->dataPlot->xAxis->pixelToCoord(event->pos().x()); + this->drawPlotTracer(x); +} + +void ChannelChartForm::showTracerResidual(QMouseEvent *event) +{ + //获得鼠标位置处对应的横坐标数据x + qulonglong x = ui->analysisPlot->xAxis->pixelToCoord(event->pos().x()); + this->drawPlotTracer(x); +} + +void ChannelChartForm::drawPlotTracer(qulonglong x) +{ + QCPGraph *mGraph = ui->dataPlot->graph(0); + QCPGraph *mGraphResi = ui->analysisPlot->graph(0); + QString time = QDateTime::fromSecsSinceEpoch(x).toString("yyyy-MM-dd HH:mm:ss"); + //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); + //显示锚点 tracer->setVisible(true); - tracer->setGraph(mGraph);//将锚点设置到被选中的曲线上 tracer->setGraphKey(x); //将游标横坐标设置成刚获得的横坐标数据x tracer->setInterpolating(false); //游标的纵坐标可以通过曲线数据线性插值自动获得 tracer->updatePosition(); //使得刚设置游标的横纵坐标位置生效 - double yValue = tracer->position->value(); - - //显示tip框 - QToolTip::showText(event->globalPos(), QString( - "

%1

" - "

时间:%2

" - "

钟差:%3

").arg(mGraph->name()).arg(time).arg(QString::number(yValue, 'f', 3)), this, this->rect()); - //重绘 - ui->dataPlot->replot(); -} - -void ChannelChartForm::showTracerResidual(QMouseEvent *event) -{ - QCPGraph *mGraph = ui->analysisPlot->graph(0); - //将像素点转换成qcustomplot中的坐标值,并通过setGraphKey将锚点值设为真实数据值。tracer->setGraphKey(xAxis->pixelToCoord(event->pos().x())); - - //获得鼠标位置处对应的横坐标数据x - qulonglong x = ui->analysisPlot->xAxis->pixelToCoord(event->pos().x()); - QString time = QDateTime::fromSecsSinceEpoch(x).toString("yyyy-MM-dd HH:mm:ss"); - //显示锚点 tracerResi->setVisible(true); - - tracerResi->setGraph(mGraph);//将锚点设置到被选中的曲线上 + tracerResi->setGraph(mGraphResi);//将锚点设置到被选中的曲线上 tracerResi->setGraphKey(x); //将游标横坐标设置成刚获得的横坐标数据x tracerResi->setInterpolating(false); //游标的纵坐标可以通过曲线数据线性插值自动获得 tracerResi->updatePosition(); //使得刚设置游标的横纵坐标位置生效 - double yValue = tracerResi->position->value(); + double yValue = tracer->position->value(); + double yValueResi = tracerResi->position->value(); + + QPoint pos((SettingConfig::getInstance().WINDOW_WIDTH - 500) / 2, -15); + + QString toolLabel = "时间:%1\r\n钟差(ns):%2\t残差(ns):%3"; //显示tip框 - QToolTip::showText(event->globalPos(), QString( - "

%1

" - "

时间:%2

" - "

钟差残差:%3

").arg(mGraph->name()).arg(time).arg(QString::number(yValue, 'f', 6)), this, this->rect()); + QToolTip::showText(pos, toolLabel.arg(time).arg(QString::number(yValue, 'f', 3)).arg(QString::number(yValueResi, 'f', 6)), this, this->rect(), 5*1000); + //重绘 + ui->dataPlot->replot(); ui->analysisPlot->replot(); } diff --git a/CounterRealTime/ChannelChartForm.h b/CounterRealTime/ChannelChartForm.h index 0346afe..debf240 100644 --- a/CounterRealTime/ChannelChartForm.h +++ b/CounterRealTime/ChannelChartForm.h @@ -35,6 +35,8 @@ QCPItemTracer *tracerResi; QCPItemText *tracerResiLabel; + + void drawPlotTracer(qulonglong x); }; #endif // CHANNELCHARTFORM_H diff --git a/CounterRealTime/qss/mainClock.css b/CounterRealTime/qss/mainClock.css index a8ce530..8d5c146 100644 --- a/CounterRealTime/qss/mainClock.css +++ b/CounterRealTime/qss/mainClock.css @@ -165,6 +165,17 @@ margin-left: 30px; font-size: 20px; } + +QToolTip { + font-family: "Microsoft Yahei"; + font-size: 16px; + color: #FFFFFF; + background-color: #0B1425; + min-width: 500px; + padding: 0px 5px; + border: 2px solid #0BB2E9; + border-radius: 12px; +} /* ChannelChartForm */ /* CounterSettingForm */ diff --git a/PhaseCompAcq/protocol/PhaseProtocolBM.cpp b/PhaseCompAcq/protocol/PhaseProtocolBM.cpp index 79b70ce..fd6229c 100644 --- a/PhaseCompAcq/protocol/PhaseProtocolBM.cpp +++ b/PhaseCompAcq/protocol/PhaseProtocolBM.cpp @@ -49,7 +49,7 @@ dataObj->channelRawDataStr.append(QString::number((channelRawData - CALCULATE_OFFSET))); } else { - double phase = (CALCULATE_OFFSET - channelRawData) * CALCULATE_FACTOR; + double phase = -(CALCULATE_OFFSET - channelRawData) * CALCULATE_FACTOR; // rawData是无符号long 相位有正有负 小于CALCULATE_OFFSET时是负值 dataObj->channelActive.append("1"); dataObj->channelData.append(phase); dataObj->channelDataStr.append(QString::number(phase, 'f', 15)); diff --git a/ZXSSCJ.pro b/ZXSSCJ.pro index fec1141..310c433 100644 --- a/ZXSSCJ.pro +++ b/ZXSSCJ.pro @@ -3,7 +3,7 @@ #定义了ordered表示子项目按照添加的顺序来编译 #CONFIG += ordered -SUBDIRS += CounterAcq #计数器数据采集 +#SUBDIRS += CounterAcq #计数器数据采集 #SUBDIRS += CounterAcqBM #6906计数器数据采集 SUBDIRS += CounterRealTime SUBDIRS += PhaseCompAcq #比相仪数据采集