2025-01-04 04:12:51 +00:00
|
|
|
|
#include "fitcurvedialog.h"
|
|
|
|
|
|
|
|
|
|
#include <QLogValueAxis>
|
|
|
|
|
|
|
|
|
|
#include "../DockTitleBar.h"
|
|
|
|
|
#include "../DockWidget.h"
|
|
|
|
|
|
2025-01-05 11:12:18 +00:00
|
|
|
|
#include "common/SpdLogger.h"
|
|
|
|
|
#include "workspace/WorkSpace.h"
|
|
|
|
|
#include "workspace/Timestep.h"
|
|
|
|
|
#include "workspace/WorkSpaceManager.h"
|
|
|
|
|
|
2025-01-04 04:12:51 +00:00
|
|
|
|
FitCurveDialog::FitCurveDialog(int iType, QWidget* parent) :
|
|
|
|
|
QDialog(parent),
|
|
|
|
|
ui(new Ui::FitCurveDialog)
|
|
|
|
|
{
|
|
|
|
|
m_iType = iType;
|
|
|
|
|
|
|
|
|
|
if (1 == m_iType)
|
|
|
|
|
{
|
|
|
|
|
setWindowTitle("2D Curve");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
setWindowTitle("2D(y(lg)) Curve");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qApp->setOverrideCursor(Qt::ArrowCursor); //<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
initQChartView();
|
2025-01-05 11:12:18 +00:00
|
|
|
|
|
|
|
|
|
connect(&WorkSpaceManager::Get(), &WorkSpaceManager::WorkSpaceChanged, this, &FitCurveDialog::OnWorkSpaceChanged);
|
2025-01-04 04:12:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::initQChartView() {
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
curveChartView = new FitCurveChartView(this);
|
|
|
|
|
curveChartView->setMaximumWidth(1730);
|
|
|
|
|
curveChartView->setMinimumHeight(480);
|
|
|
|
|
|
|
|
|
|
curveChart = new QChart();
|
|
|
|
|
curveChart->setTheme(QChart::ChartThemeBlueIcy);
|
|
|
|
|
//curveChart->setContentsMargins(0, 0, 0, 0); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD>ȫ<EFBFBD><C8AB>Ϊ0, <20><><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//curveChart->setMargins(QMargins(5, -30, 5, 10)); //<2F><><EFBFBD><EFBFBD><EFBFBD>ڱ߽<DAB1>, <20><><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
curveChart->setBackgroundRoundness(0); //<2F><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD>߿<EFBFBD>Բ<EFBFBD>ǰ뾶
|
|
|
|
|
curveChartView->setChart(curveChart);
|
|
|
|
|
|
|
|
|
|
//QObject::connect(fitPointsSeriesS, &QSplineSeries::clicked, [=](const QPointF& point)mutable {
|
|
|
|
|
// QPointF tempPoint;
|
|
|
|
|
// QVector<QPointF> tempList(fitPointsSeriesS->pointsVector()); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD>м<EFBFBD><D0BC><EFBFBD>, <20><>Ϊֱ<CEAA><D6B1>ʹ<EFBFBD>ûᵼ<C3BB>¿<EFBFBD><C2BF><EFBFBD>
|
|
|
|
|
// int tempX = qRound(point.x());
|
|
|
|
|
// int tempY = -999;
|
|
|
|
|
// for (int i = 0; i < tempList.size(); i++) {
|
|
|
|
|
// if (tempList[i].x() == tempX) {
|
|
|
|
|
// tempY = tempList[i].y();
|
|
|
|
|
// tempPoint.setX(tempX);
|
|
|
|
|
// tempPoint.setY(tempY);
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (tempY != -999) {
|
|
|
|
|
// QToolTip::showText(QCursor::pos(), QString("(%1,%2)").arg(tempX).arg(tempY));
|
|
|
|
|
// QVector<QPointF> tipList;
|
|
|
|
|
// tipList.append(tempPoint);
|
|
|
|
|
// tipSeries->replace(tipList);
|
|
|
|
|
// updateXYGuideLine();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
m_pAxisX = new QValueAxis;
|
|
|
|
|
m_pAxisX->setRange(0, 10);
|
|
|
|
|
m_pAxisX->setTickCount(21);
|
|
|
|
|
m_pAxisX->setLabelFormat("%d");
|
|
|
|
|
m_pAxisX->setLabelsAngle(-90); //<2F><><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>Ƕ<EFBFBD>
|
|
|
|
|
curveChart->addAxis(m_pAxisX, Qt::AlignBottom);
|
|
|
|
|
|
|
|
|
|
//xGuideSeries->attachAxis(m_pAxisX);
|
|
|
|
|
//yGuideSeries->attachAxis(m_pAxisX);
|
|
|
|
|
// fitPointsSeriesS->attachAxis(m_pAxisX);
|
|
|
|
|
// tipSeries->attachAxis(m_pAxisX);
|
|
|
|
|
|
|
|
|
|
if (1 == m_iType)
|
|
|
|
|
{
|
|
|
|
|
m_pAxisY = new QValueAxis;
|
|
|
|
|
m_pAxisY->setRange(0, 10);
|
|
|
|
|
m_pAxisY->setTickCount(11);
|
|
|
|
|
m_pAxisY->setLabelFormat("%d");
|
|
|
|
|
curveChart->addAxis(m_pAxisY, Qt::AlignLeft);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_pLgAxisY = new QLogValueAxis();
|
|
|
|
|
m_pLgAxisY->setLabelFormat("%e");
|
|
|
|
|
m_pLgAxisY->setMinorTickCount(9);
|
|
|
|
|
//axisY->setMinorTickLineVisible(true);
|
|
|
|
|
m_pLgAxisY->setLabelsAngle(90);
|
|
|
|
|
m_pLgAxisY->setRange(1, 100);
|
|
|
|
|
|
|
|
|
|
curveChart->addAxis(m_pLgAxisY, Qt::AlignLeft);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// axisX->setGridLineVisible(false); //<2F><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
// axisY->setGridLineVisible(false); //<2F><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y<EFBFBD><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
/*curveChart->legend()->markers()[0]->setVisible(false);
|
|
|
|
|
curveChart->legend()->markers()[1]->setVisible(false);
|
|
|
|
|
curveChart->legend()->markers()[2]->setVisible(false);
|
|
|
|
|
curveChart->legend()->markers()[3]->setVisible(false);*/
|
|
|
|
|
curveChartView->setRenderHint(QPainter::Antialiasing); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
connect(curveChartView, &FitCurveChartView::signalMouseEvent, this, &FitCurveDialog::theSlotMouseEvent);
|
|
|
|
|
connect(curveChartView, &FitCurveChartView::signalWheelEvent, this, &FitCurveDialog::theSlotWheelEvent);
|
|
|
|
|
|
|
|
|
|
//curveChartView->show();
|
|
|
|
|
|
|
|
|
|
QHBoxLayout* pLayout = new QHBoxLayout(this);
|
|
|
|
|
pLayout->addWidget(curveChartView);
|
|
|
|
|
|
|
|
|
|
// ui->chartLayout->addWidget(curveChartView);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::theSlotMouseEvent(int eventId, QMouseEvent* event) {
|
|
|
|
|
if (eventId == 0) { //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
isPressed = true;
|
|
|
|
|
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
|
|
|
|
|
pressedPoint = mouseEvent->pos();
|
|
|
|
|
}
|
|
|
|
|
else if (eventId == 1) { //<2F><><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>
|
|
|
|
|
if (isPressed) {
|
|
|
|
|
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
|
|
|
|
|
curveChart->scroll(-(mouseEvent->pos().x() - pressedPoint.x()) / 10,
|
|
|
|
|
(mouseEvent->pos().y() - pressedPoint.y()) / 10);
|
|
|
|
|
updateXYGuideLine();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (eventId == 2) { //<2F><><EFBFBD><EFBFBD>̧<EFBFBD><CCA7>
|
|
|
|
|
isPressed = false;
|
|
|
|
|
}
|
|
|
|
|
else if (eventId == 3) { //˫<><CBAB>
|
|
|
|
|
resetZoomAndScroll();
|
|
|
|
|
updateXYGuideLine();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::theSlotWheelEvent(QWheelEvent* event) {
|
|
|
|
|
int delta = event->angleDelta().y();
|
|
|
|
|
if (delta > 0) {
|
|
|
|
|
curveChart->zoom(0.95);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
curveChart->zoom(1.05);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateXYGuideLine();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::slotAddSeries(QVariant varSeriesData)
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч
|
|
|
|
|
if (!varSeriesData.isValid())
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString strName = varSeriesData.toMap().value("Name").toString(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
QVariantList varCurDataList = varSeriesData.toMap().value("Data").toList(); // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
int iYType = varSeriesData.toMap().value("yType").toInt(); // y<><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
QColor color = varSeriesData.toMap().value("Color").value<QColor>(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
QString strXName = varSeriesData.toMap().value("xTitle").toString(); // x<><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
QString strYName = varSeriesData.toMap().value("yTitle").toString(); // y<><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
QString strZName = varSeriesData.toMap().value("zTitle").toString(); // z<><7A><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int iCurveType = varSeriesData.toMap().value("curveType").toInt(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int iID = varSeriesData.toMap().value("ID").toInt(); // y<><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
bool bAdd = varSeriesData.toMap().value("Add").toBool(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
if (iCurveType == 3) // <20>Ƕ<EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool bNew = false;
|
|
|
|
|
QSplineSeries* pSeries = NULL;
|
|
|
|
|
if (m_seriesIDMap.contains(iID))
|
|
|
|
|
{
|
|
|
|
|
pSeries = m_seriesIDMap.value(iID);
|
|
|
|
|
pSeries->setName(strName); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
pSeries->setColor(color); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
pSeries->setUseOpenGL(true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!bAdd)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pSeries = new QSplineSeries(this);
|
|
|
|
|
pSeries->setName(strName); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
pSeries->setColor(color); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
pSeries->setUseOpenGL(true);
|
|
|
|
|
|
|
|
|
|
bNew = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pAxisX->setTitleText(strXName); // <20><><EFBFBD><EFBFBD>x<EFBFBD><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
// xy<78><79><EFBFBD>ķ<EFBFBD>Χ
|
|
|
|
|
m_iXMax = m_pAxisX->max(); // <20><>ǰx<C7B0><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
m_iXMin = m_pAxisX->min(); // <20><>ǰx<C7B0><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ
|
|
|
|
|
|
|
|
|
|
if (0 == iYType) // һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
m_iYMax = m_pAxisY->max(); // <20><>ǰy<C7B0><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
m_iYMin = m_pAxisY->min(); // <20><>ǰy<C7B0><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
}
|
|
|
|
|
else // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
m_iYMax = m_pLgAxisY->max(); // <20><>ǰy<C7B0><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
m_iYMin = m_pLgAxisY->min(); // <20><>ǰy<C7B0><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
QVector<QPointF> listKey;
|
|
|
|
|
for (size_t i = 0; i < varCurDataList.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
QPointF ptKey = varCurDataList[i].toPointF();
|
|
|
|
|
listKey.push_back(ptKey);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>x<EFBFBD><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>Сֵ
|
|
|
|
|
if (m_iXMin > ptKey.x())
|
|
|
|
|
{
|
|
|
|
|
m_iXMin = ptKey.x();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_iXMax < ptKey.x())
|
|
|
|
|
{
|
|
|
|
|
m_iXMax = ptKey.x();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_iYMin > ptKey.y())
|
|
|
|
|
{
|
|
|
|
|
m_iYMin = ptKey.y();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_iYMax < ptKey.y())
|
|
|
|
|
{
|
|
|
|
|
m_iYMax = ptKey.y();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>x<EFBFBD>᷶Χ
|
|
|
|
|
m_pAxisX->setRange(m_iXMin, m_iXMax);
|
|
|
|
|
pSeries->replace(listKey);
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
curveChart->addSeries(pSeries);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>y<EFBFBD>᷶Χ
|
|
|
|
|
if (iYType == 0)
|
|
|
|
|
{
|
|
|
|
|
m_pAxisY->setRange(m_iYMin, m_iYMax);
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
pSeries->attachAxis(m_pAxisY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pAxisY->setTitleText(strYName);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_pLgAxisY->setRange(m_iYMin, m_iYMax);
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
pSeries->attachAxis(m_pLgAxisY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pLgAxisY->setTitleText(strYName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
pSeries->attachAxis(m_pAxisX);
|
|
|
|
|
m_seriesIDMap.insert(iID, pSeries);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//QObject::connect(fitPointsSeriesS, &QSplineSeries::clicked, [=](const QPointF& point)mutable {
|
|
|
|
|
// QPointF tempPoint;
|
|
|
|
|
// QVector<QPointF> tempList(fitPointsSeriesS->pointsVector()); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD>м<EFBFBD><D0BC><EFBFBD>, <20><>Ϊֱ<CEAA><D6B1>ʹ<EFBFBD>ûᵼ<C3BB>¿<EFBFBD><C2BF><EFBFBD>
|
|
|
|
|
// int tempX = qRound(point.x());
|
|
|
|
|
// int tempY = -999;
|
|
|
|
|
// for (int i = 0; i < tempList.size(); i++) {
|
|
|
|
|
// if (tempList[i].x() == tempX) {
|
|
|
|
|
// tempY = tempList[i].y();
|
|
|
|
|
// tempPoint.setX(tempX);
|
|
|
|
|
// tempPoint.setY(tempY);
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (tempY != -999) {
|
|
|
|
|
// QToolTip::showText(QCursor::pos(), QString("(%1,%2)").arg(tempX).arg(tempY));
|
|
|
|
|
// QVector<QPointF> tipList;
|
|
|
|
|
// tipList.append(tempPoint);
|
|
|
|
|
// tipSeries->replace(tipList);
|
|
|
|
|
// updateXYGuideLine();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::slotDelCurve(int iID)
|
|
|
|
|
{
|
|
|
|
|
QSplineSeries* pSeries = NULL;
|
|
|
|
|
if (m_seriesIDMap.contains(iID))
|
|
|
|
|
{
|
|
|
|
|
pSeries = m_seriesIDMap.value(iID);
|
|
|
|
|
curveChart->removeSeries(pSeries);
|
|
|
|
|
|
|
|
|
|
m_seriesIDMap.remove(iID);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::slotInserKeyPoint(int iID, float xValue, float yValue)
|
|
|
|
|
{
|
|
|
|
|
QSplineSeries* pSeries = NULL;
|
|
|
|
|
if (m_seriesIDMap.contains(iID))
|
|
|
|
|
{
|
|
|
|
|
pSeries = m_seriesIDMap.value(iID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (pSeries)
|
|
|
|
|
{
|
|
|
|
|
QVector<QPointF> vecKeyPoints = pSeries->pointsVector();
|
|
|
|
|
vecKeyPoints.push_back(QPointF(xValue, yValue));
|
|
|
|
|
|
|
|
|
|
if (m_iXMax < xValue)
|
|
|
|
|
{
|
|
|
|
|
m_iXMax = xValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_iXMin > xValue)
|
|
|
|
|
{
|
|
|
|
|
m_iXMin = xValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_iYMax < yValue)
|
|
|
|
|
{
|
|
|
|
|
m_iYMax = yValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_iYMin > yValue)
|
|
|
|
|
{
|
|
|
|
|
m_iYMin = yValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (1 == m_iType)
|
|
|
|
|
{
|
|
|
|
|
m_pAxisY->setRange(m_iXMin, m_iXMax);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_pLgAxisY->setRange(m_iYMin, m_iYMax);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pSeries->replace(vecKeyPoints);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::slotUpdateTime(double dTime)
|
|
|
|
|
{
|
|
|
|
|
if (m_vecWavePoint.size() > 0)
|
|
|
|
|
{
|
|
|
|
|
if (dTime < 1)
|
|
|
|
|
{
|
|
|
|
|
QMap<int, QSplineSeries*>::iterator pItor = m_seriesIDMap.begin();
|
|
|
|
|
while (pItor != m_seriesIDMap.end())
|
|
|
|
|
{
|
|
|
|
|
pItor.value()->clear();
|
|
|
|
|
pItor++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((dTime - 1) >= m_vecWavePoint.size())
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<std::vector<float>> batch = m_vecWavePoint[dTime - 1];
|
|
|
|
|
|
|
|
|
|
m_pAxisX->setTitleText("x"); // <20><><EFBFBD><EFBFBD>x<EFBFBD><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
// xy<78><79><EFBFBD>ķ<EFBFBD>Χ
|
|
|
|
|
m_iXMax = m_pAxisX->max(); // <20><>ǰx<C7B0><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
m_iXMin = m_pAxisX->min(); // <20><>ǰx<C7B0><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ
|
|
|
|
|
|
|
|
|
|
m_iYMax = m_pAxisY->max(); // <20><>ǰy<C7B0><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
m_iYMin = m_pAxisY->min(); // <20><>ǰy<C7B0><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_iXMin = 0;
|
|
|
|
|
m_iYMin = 0;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < batch.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
bool bNew = false;
|
|
|
|
|
QSplineSeries* pSeries = nullptr;
|
|
|
|
|
if (m_seriesIDMap.contains(i+1))
|
|
|
|
|
{
|
|
|
|
|
pSeries = m_seriesIDMap.value(i + 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pSeries = new QSplineSeries(this);
|
|
|
|
|
m_seriesIDMap.insert(i + 1, pSeries);
|
|
|
|
|
bNew = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString strName = QString::fromLocal8Bit("Ŀ<EFBFBD><EFBFBD>") + QString::number(i+1);
|
|
|
|
|
pSeries->setName(strName); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); // <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
QColor color(QRandomGenerator::global()->bounded(255), QRandomGenerator::global()->bounded(255), QRandomGenerator::global()->bounded(255));
|
|
|
|
|
pSeries->setColor(color); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pSeries->setUseOpenGL(true);
|
|
|
|
|
|
|
|
|
|
std::vector<float> vecData = batch[i];
|
|
|
|
|
if (m_iXMax < vecData.size())
|
|
|
|
|
{
|
|
|
|
|
m_iXMax = vecData.size();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QList<QPointF> listKey;
|
|
|
|
|
for (int j = 0; j < vecData.size(); j++)
|
|
|
|
|
{
|
|
|
|
|
float fY = vecData[j];
|
|
|
|
|
|
|
|
|
|
listKey.push_back(QPointF(j+1, fY));
|
|
|
|
|
|
|
|
|
|
if (m_iYMax < fY)
|
|
|
|
|
{
|
|
|
|
|
m_iYMax = fY;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_iYMin > fY)
|
|
|
|
|
{
|
|
|
|
|
m_iYMin = fY;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pAxisX->setRange(m_iXMin, m_iXMax);
|
|
|
|
|
pSeries->replace(listKey);
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
curveChart->addSeries(pSeries);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pAxisY->setRange(m_iYMin, m_iYMax);
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
pSeries->attachAxis(m_pAxisY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pAxisY->setTitleText(QString::fromLocal8Bit("<EFBFBD><EFBFBD>ֵ"));
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
pSeries->attachAxis(m_pAxisX);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_vecReportPoint.size() > 0)
|
|
|
|
|
{
|
|
|
|
|
if (dTime < 1)
|
|
|
|
|
{
|
|
|
|
|
QMap<int, QSplineSeries*>::iterator pItor = m_seriesIDMap.begin();
|
|
|
|
|
while (pItor != m_seriesIDMap.end())
|
|
|
|
|
{
|
|
|
|
|
pItor.value()->clear();
|
|
|
|
|
pItor++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((dTime - 1) >= m_vecReportPoint.size())
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<std::vector<float>> batch = m_vecReportPoint[dTime - 1];
|
|
|
|
|
|
|
|
|
|
m_pAxisX->setTitleText(QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")); // <20><><EFBFBD><EFBFBD>x<EFBFBD><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// xy<78><79><EFBFBD>ķ<EFBFBD>Χ
|
|
|
|
|
m_iXMax = m_pAxisX->max(); // <20><>ǰx<C7B0><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
m_iXMin = m_pAxisX->min(); // <20><>ǰx<C7B0><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ
|
|
|
|
|
|
|
|
|
|
m_iYMax = m_pAxisY->max(); // <20><>ǰy<C7B0><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
m_iYMin = m_pAxisY->min(); // <20><>ǰy<C7B0><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < batch.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
bool bNew = false;
|
|
|
|
|
QSplineSeries* pSeries = nullptr;
|
|
|
|
|
if (m_seriesIDMap.contains(i + 1))
|
|
|
|
|
{
|
|
|
|
|
pSeries = m_seriesIDMap.value(i + 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pSeries = new QSplineSeries(this);
|
|
|
|
|
m_seriesIDMap.insert(i + 1, pSeries);
|
|
|
|
|
bNew = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString strName = QString::fromLocal8Bit("Ŀ<EFBFBD><EFBFBD>") + QString::number(i + 1);
|
|
|
|
|
pSeries->setName(strName); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); // <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
QColor color(QRandomGenerator::global()->bounded(255), QRandomGenerator::global()->bounded(255), QRandomGenerator::global()->bounded(255));
|
|
|
|
|
pSeries->setColor(color); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pSeries->setUseOpenGL(true);
|
|
|
|
|
|
|
|
|
|
std::vector<float> vecData = batch[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float fX = vecData[0];
|
|
|
|
|
float fY = vecData[1];
|
|
|
|
|
|
|
|
|
|
if (m_iYMax < fY)
|
|
|
|
|
{
|
|
|
|
|
m_iYMax = fY;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_iYMin > fY)
|
|
|
|
|
{
|
|
|
|
|
m_iYMin = fY;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_iXMax < fX)
|
|
|
|
|
{
|
|
|
|
|
m_iXMax = fX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_iXMin > fX)
|
|
|
|
|
{
|
|
|
|
|
m_iXMax = fX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pAxisX->setRange(m_iXMin, m_iXMax);
|
|
|
|
|
pSeries->append(QPointF(fX,fY));
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
curveChart->addSeries(pSeries);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pAxisY->setRange(m_iYMin, m_iYMax);
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
pSeries->attachAxis(m_pAxisY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pAxisY->setTitleText(QString::fromLocal8Bit("<EFBFBD>ٶ<EFBFBD>"));
|
|
|
|
|
|
|
|
|
|
if (bNew)
|
|
|
|
|
{
|
|
|
|
|
pSeries->attachAxis(m_pAxisX);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::updateXYGuideLine() {
|
|
|
|
|
/* if (tipSeries->points().size() > 0) {
|
|
|
|
|
QVector<int> axisRanges = getAxisRanges();
|
|
|
|
|
QVector<QPointF> xGuideList, yGuideList;
|
|
|
|
|
int tempX = tipSeries->points()[0].x();
|
|
|
|
|
int tempY = tipSeries->points()[0].y();
|
|
|
|
|
xGuideList.append(QPointF(tempX, axisRanges[2]));
|
|
|
|
|
xGuideList.append(QPointF(tempX, tempY));
|
|
|
|
|
yGuideList.append(QPointF(axisRanges[0], tempY));
|
|
|
|
|
yGuideList.append(QPointF(tempX, tempY));
|
|
|
|
|
xGuideSeries->replace(xGuideList);
|
|
|
|
|
yGuideSeries->replace(yGuideList);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
xGuideSeries->clear();
|
|
|
|
|
yGuideSeries->clear();
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::resetZoomAndScroll() {
|
|
|
|
|
curveChart->zoomReset();
|
|
|
|
|
QList<QAbstractAxis*> axesX, axesY;
|
|
|
|
|
axesX = curveChart->axes(Qt::Horizontal);
|
|
|
|
|
axesY = curveChart->axes(Qt::Vertical);
|
|
|
|
|
QValueAxis* curAxisX = (QValueAxis*)axesX[0];
|
|
|
|
|
QValueAxis* curAxisY = (QValueAxis*)axesY[0];
|
|
|
|
|
curAxisX->setRange(m_iXMin, m_iXMax);
|
|
|
|
|
curAxisY->setRange(m_iYMin, m_iYMax);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVector<int> FitCurveDialog::getAxisRanges() {
|
|
|
|
|
QList<QAbstractAxis*> axesX, axesY;
|
|
|
|
|
axesX = curveChart->axes(Qt::Horizontal);
|
|
|
|
|
axesY = curveChart->axes(Qt::Vertical);
|
|
|
|
|
QValueAxis* curAxisX = (QValueAxis*)axesX[0];
|
|
|
|
|
QValueAxis* curAxisY = (QValueAxis*)axesY[0];
|
|
|
|
|
QVector<int> ranges = { int(curAxisX->min()), int(curAxisX->max()), int(curAxisY->min()), int(curAxisY->max()) };
|
|
|
|
|
return ranges;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::InitWaveFile(const QString& strFile, int iBatchCount)
|
|
|
|
|
{
|
|
|
|
|
m_vecWavePoint.clear();
|
|
|
|
|
ParseWave(strFile, m_vecWavePoint, iBatchCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::InitReportFile(const QString& strFile, int iBatchCount)
|
|
|
|
|
{
|
|
|
|
|
m_vecReportPoint.clear();
|
|
|
|
|
ParseReport(strFile, m_vecReportPoint, iBatchCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::ParseWave(const QString& strFile, std::vector<std::vector<std::vector<float>>>& vecWavePoint, int iRowCount)
|
|
|
|
|
{
|
|
|
|
|
if (strFile.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
QMessageBox::information(nullptr, QString::fromLocal8Bit("<EFBFBD><EFBFBD>ʾ"), QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Wave<EFBFBD>ļ<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QFile file(strFile);
|
|
|
|
|
if (file.open(QIODevice::ReadOnly))
|
|
|
|
|
{
|
|
|
|
|
std::vector<std::vector<float>> batch;
|
|
|
|
|
|
|
|
|
|
int iRow = 1;
|
|
|
|
|
while (!file.atEnd())
|
|
|
|
|
{
|
|
|
|
|
QString strLine = file.readLine().simplified();
|
|
|
|
|
if (!strLine.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
QStringList listLine = strLine.split(" ");
|
|
|
|
|
std::vector<float> vecLine;
|
|
|
|
|
for (size_t i = 0; i < listLine.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
vecLine.push_back(listLine[i].toFloat());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
batch.push_back(vecLine);
|
|
|
|
|
|
|
|
|
|
if (iRow % iRowCount == 0)
|
|
|
|
|
{
|
|
|
|
|
vecWavePoint.push_back(batch);
|
|
|
|
|
batch.clear();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
iRow++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::ParseReport(const QString& strFile, std::vector<std::vector<std::vector<float>>>& vecReportPoint, int iRowCount)
|
|
|
|
|
{
|
|
|
|
|
if (strFile.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
QMessageBox::information(nullptr, QString::fromLocal8Bit("<EFBFBD><EFBFBD>ʾ"), QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Report<EFBFBD>ļ<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QFile file(strFile);
|
|
|
|
|
if (file.open(QIODevice::ReadOnly))
|
|
|
|
|
{
|
|
|
|
|
std::vector<std::vector<float>> batch;
|
|
|
|
|
|
|
|
|
|
int iRow = 1;
|
|
|
|
|
while (!file.atEnd())
|
|
|
|
|
{
|
|
|
|
|
QString strLine = file.readLine().simplified();
|
|
|
|
|
if (!strLine.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
QStringList listLine = strLine.split(" ");
|
|
|
|
|
std::vector<float> vecLine;
|
|
|
|
|
for (size_t i = 0; i < listLine.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
if (12 == i || i == 13) // <20><><EFBFBD>롢<EFBFBD>ٶ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
vecLine.push_back(listLine[i].toFloat());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
batch.push_back(vecLine);
|
|
|
|
|
|
|
|
|
|
if (iRow % iRowCount == 0)
|
|
|
|
|
{
|
|
|
|
|
vecReportPoint.push_back(batch);
|
|
|
|
|
batch.clear();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
iRow++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slotUpdateTime(1);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-05 11:12:18 +00:00
|
|
|
|
void FitCurveDialog::OnWorkSpaceChanged(WorkSpace* worksapce) {
|
|
|
|
|
if (worksapce == nullptr) {
|
|
|
|
|
LOG_ERROR("worksapce is nullptr");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
connect(worksapce, &WorkSpace::TimestepChanged, this, &FitCurveDialog::OnTimestepChanged);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::OnTimestepChanged(Timestep* timestep) {
|
|
|
|
|
if (timestep == nullptr) {
|
|
|
|
|
LOG_ERROR("timestep is nullptr");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
connect(timestep, SIGNAL(TimeChanged(double)), this, SLOT(slotUpdateTime(double)));
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-04 04:12:51 +00:00
|
|
|
|
FitCurveDialog::~FitCurveDialog()
|
|
|
|
|
{
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FitCurveDialog::AttachDock(DockWidget* dockWidget)
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == dockWidget) {
|
|
|
|
|
qDebug() << __FUNCTION__ << "dockwidget is nullptr";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dockWidget->SetDockWidgetTitleBar(nullptr);
|
|
|
|
|
dockWidget->setWidget(this);
|
|
|
|
|
|
|
|
|
|
DockTitleBar* dockTitleBar = new DockTitleBar;
|
|
|
|
|
|
|
|
|
|
if (1 == m_iType)
|
|
|
|
|
{
|
|
|
|
|
dockTitleBar->SetTitle(tr("2D Curve"));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dockTitleBar->SetTitle(tr("2D(y(lg)) Curve"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dockWidget->SetDockWidgetTitleBar(dockTitleBar);
|
|
|
|
|
}
|