左填充、右填充,插值计算算法优化
This commit is contained in:
parent
c9f5d66c2b
commit
f6a1c49c5d
|
|
@ -89,7 +89,7 @@ void FormDraw::s_addLine(QString strUuid, QString strSlfName, QString strWellNam
|
|||
{
|
||||
return;
|
||||
}
|
||||
AppendConsole(PAI_INFO, "FormDraw s_addLine");
|
||||
//AppendConsole(PAI_INFO, "FormDraw s_addLine");
|
||||
|
||||
if(m_listLineName.contains(strLineName))
|
||||
{
|
||||
|
|
@ -145,8 +145,8 @@ void FormDraw::s_AddLine_Property(QString strUuid, QString strSlfName, QString s
|
|||
return;
|
||||
}
|
||||
|
||||
qDebug() << "FormDraw s_AddLine_Property";
|
||||
AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property");
|
||||
//qDebug() << "FormDraw s_AddLine_Property";
|
||||
AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property");
|
||||
|
||||
if(m_listLineName.contains(strLineName))
|
||||
{
|
||||
|
|
@ -182,9 +182,9 @@ void FormDraw::s_AddLine_Property(QString strUuid, QString strSlfName, QString s
|
|||
// QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
// curv->setSizePolicy(policy);
|
||||
|
||||
AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property 1");
|
||||
//AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property 1");
|
||||
curv->show();
|
||||
AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property 2");
|
||||
//AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property 2");
|
||||
|
||||
initForm(curv, strSlfName, strLineName,
|
||||
newLeftScale, newRightScale, lineColor, width, lineStyle);
|
||||
|
|
@ -454,7 +454,7 @@ void FormDraw::s_selectionRectAccepted(const QRect &rect, QMouseEvent *event)
|
|||
void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName,
|
||||
double newLeftScale, double newRightScale, QColor lineColor, double width, Qt::PenStyle lineStyle)
|
||||
{
|
||||
AppendConsole(PAI_INFO, "FormDraw initForm");
|
||||
//AppendConsole(PAI_INFO, "FormDraw initForm");
|
||||
|
||||
CLogIO *logio=new CLogIO();
|
||||
logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead);
|
||||
|
|
@ -510,7 +510,7 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi
|
|||
//赋值
|
||||
m_vmax = vmax;
|
||||
m_vmin = vmin;
|
||||
AppendConsole(PAI_INFO, "FormDraw initForm ReadCurve end");
|
||||
//AppendConsole(PAI_INFO, "FormDraw initForm ReadCurve end");
|
||||
|
||||
widget->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables);
|
||||
|
||||
|
|
@ -578,17 +578,17 @@ AppendConsole(PAI_INFO, "FormDraw initForm ReadCurve end");
|
|||
|
||||
//支持框选
|
||||
//setupSelectionDemo(widget);
|
||||
AppendConsole(PAI_INFO, "FormDraw setupSelectionDemo end");
|
||||
//AppendConsole(PAI_INFO, "FormDraw setupSelectionDemo end");
|
||||
|
||||
//widget->rescaleAxes();
|
||||
//widget->replot();//屏蔽,缩减时间
|
||||
AppendConsole(PAI_INFO, "FormDraw initForm end");
|
||||
//AppendConsole(PAI_INFO, "FormDraw initForm end");
|
||||
}
|
||||
|
||||
void FormDraw::addRandomGraph(QMyCustomPlot *widget, QVector<double> x, QVector<double> y, QString strSlfName, QString strLineName,
|
||||
double newLeftScale, double newRightScale, QColor newlineColor, double width, Qt::PenStyle lineStyle)
|
||||
{
|
||||
AppendConsole(PAI_INFO, "FormDraw addRandomGraph");
|
||||
//AppendConsole(PAI_INFO, "FormDraw addRandomGraph");
|
||||
|
||||
widget->addGraph();
|
||||
if(strLineName=="")
|
||||
|
|
@ -637,7 +637,7 @@ void FormDraw::addRandomGraph(QMyCustomPlot *widget, QVector<double> x, QVector<
|
|||
}
|
||||
//道-对象
|
||||
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, newlineColor, width, m_vmax, m_vmin);
|
||||
AppendConsole(PAI_INFO, "FormDraw addRandomGraph end");
|
||||
//AppendConsole(PAI_INFO, "FormDraw addRandomGraph end");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
|
|||
y.append(y0_old);
|
||||
|
||||
//插值
|
||||
float xNew=x0-rlev*(y0-BaseY0)/(BaseY1-y1);
|
||||
float xNew=x0-rlev*(y0-BaseY0)/((BaseY1-y1)+(y0-BaseY0));//(BaseY1-y1);
|
||||
float yNew=(y0-y1)/(x0-x1)*(xNew-x1) + y1;
|
||||
float yNew_Old=(yNew-m_iX1)/(m_iX2-m_iX1)*(vMax-vMin) + vMin;
|
||||
//
|
||||
|
|
@ -522,7 +522,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
|
|||
y.append(y0_old);
|
||||
|
||||
//插值
|
||||
float xNew=x0-rlev*(y0-BaseY0)/(BaseY1-y1);
|
||||
float xNew=x0-rlev*(y0-BaseY0)/((BaseY1-y1)+(y0-BaseY0));//(BaseY1-y1);
|
||||
float yNew=(BaseY0-BaseY1)/(x0-x1)*(xNew-x1) + BaseY1;
|
||||
float yNew_Old=(yNew-m_iX1)/(m_iX2-m_iX1)*(vMax-vMin) + vMin;
|
||||
//
|
||||
|
|
@ -637,7 +637,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
|
|||
y.append(y0_old);
|
||||
|
||||
//插值
|
||||
float xNew=x0-rlev*(y0-BaseY0)/(BaseY1-y1);
|
||||
float xNew=x0-rlev*(y0-BaseY0)/((BaseY1-y1)+(y0-BaseY0));//(BaseY1-y1);
|
||||
float yNew=(y0-y1)/(x0-x1)*(xNew-x1) + y1;
|
||||
float yNew_Old=(yNew-m_iX1)/(m_iX2-m_iX1)*(vMax-vMin) + vMin;
|
||||
//
|
||||
|
|
@ -654,7 +654,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
|
|||
y.append(y0_old);
|
||||
|
||||
//插值
|
||||
float xNew=x0-rlev*(y0-BaseY0)/(BaseY1-y1);
|
||||
float xNew=x0-rlev*(y0-BaseY0)/((BaseY1-y1)+(y0-BaseY0));//(BaseY1-y1);
|
||||
float yNew=(BaseY0-BaseY1)/(x0-x1)*(xNew-x1) + BaseY1;
|
||||
float yNew_Old=(yNew-m_iX1)/(m_iX2-m_iX1)*(vMax-vMin) + vMin;
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user