From 658c68b3ce0c5371b0a3c0cfa848f04db28013b3 Mon Sep 17 00:00:00 2001 From: yuntang <123@qq.com> Date: Tue, 22 Apr 2025 17:33:03 +0800 Subject: [PATCH] 2025-04-22T17:33:03 --- src/ui/centralwidget.cpp | 12 ++++++++---- src/ui/realtimedataform.cpp | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ui/centralwidget.cpp b/src/ui/centralwidget.cpp index fc4629a..fc56882 100644 --- a/src/ui/centralwidget.cpp +++ b/src/ui/centralwidget.cpp @@ -15,6 +15,7 @@ CentralWidget::CentralWidget(QWidget *parent) : QWidget(parent) ,_customPlot(new QCustomPlot(this)) ,_analysisMode(AnalysisMode::None) + ,_currentCurve(nullptr) { setMouseTracking(true); @@ -81,7 +82,7 @@ CentralWidget::CentralWidget(QWidget *parent) _customPlot->yAxis->setLabel("DSC/mW"); // 设置坐标轴范围,以便我们可以看到全部数据 _customPlot->xAxis->setRange(0, 400); - _customPlot->yAxis->setRange(-50, 50); + _customPlot->yAxis->setRange(-100,200); } CentralWidget::~CentralWidget() @@ -143,18 +144,21 @@ void CentralWidget::slotRecvCommonData(const CommonData &cd) if(!_currentCurve){ _currentCurve = new QCPCurve(_customPlot->xAxis, _customPlot->yAxis); } + + logde<<"temp:"<addData(cd.sample_temp, cd.dsc); - _currentCurve->addData(index++,cd.sample_temp, cd.dsc); // _currentCurve->data()->add(QCPCurveData(index++, cd.sample_temp, cd.dsc)); +// _currentCurve->addData(index++,cd.sample_temp, cd.dsc); // 设置曲线数据 // _currentCurve->setData(data); - _customPlot->rescaleAxes(); - _customPlot->replot(); +// _customPlot->rescaleAxes(); +// _customPlot->replot(); // Record data. QVector* pEdVtr = nullptr; // 声明指针变量 diff --git a/src/ui/realtimedataform.cpp b/src/ui/realtimedataform.cpp index 00008ac..ee4af14 100644 --- a/src/ui/realtimedataform.cpp +++ b/src/ui/realtimedataform.cpp @@ -15,6 +15,7 @@ RealTimeDataForm::~RealTimeDataForm() void RealTimeDataForm::slotRevCommonData(const CommonData &data) { + return; #if 0 qDebug()<<"rev-------------------------"; // 格式化输出 double 类型,保留三位小数