2025-04-22T17:33:03

This commit is contained in:
yuntang 2025-04-22 17:33:03 +08:00
parent ed67bf9287
commit 658c68b3ce
2 changed files with 9 additions and 4 deletions

View File

@ -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:"<<cd.sample_temp<<",dsc:"<<cd.dsc;
// Update curve.
// _currentCurve->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<Global::ExperimentData>* pEdVtr = nullptr; // 声明指针变量

View File

@ -15,6 +15,7 @@ RealTimeDataForm::~RealTimeDataForm()
void RealTimeDataForm::slotRevCommonData(const CommonData &data)
{
return;
#if 0
qDebug()<<"rev-------------------------";
// 格式化输出 double 类型,保留三位小数