玫瑰图的实现 ,曲线型数据, 没有表格型数据
This commit is contained in:
parent
1b03eacaa0
commit
6a03ec99f3
|
|
@ -29430,6 +29430,11 @@ QCPItemLine::~QCPItemLine()
|
|||
{
|
||||
}
|
||||
|
||||
void QCPItemLine::setPoints(const QVector<QPointF> &vecPoint)
|
||||
{
|
||||
m_vecPt = vecPoint;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the pen that will be used to draw the line
|
||||
|
||||
|
|
@ -29492,19 +29497,34 @@ void QCPItemLine::draw(QCPPainter *painter)
|
|||
{
|
||||
QCPVector2D startVec(start->pixelPosition());
|
||||
QCPVector2D endVec(end->pixelPosition());
|
||||
//jyl
|
||||
if(m_bCustom)
|
||||
|
||||
if(m_vecPt.size() > 0)
|
||||
{
|
||||
float x1 = startVec.x() + m_nRadius*sin(m_dr);
|
||||
float y1 = startVec.y() - m_nRadius*cos(m_dr);
|
||||
float x1 = startVec.x() + m_vecPt.at(0).x();
|
||||
float y1 = startVec.y() - m_vecPt.at(0).y();
|
||||
startVec.setX(x1);
|
||||
startVec.setY(y1);
|
||||
//
|
||||
float x2 = startVec.x() + m_nTailLen*sin(m_dr);
|
||||
float y2 = startVec.y() - m_nTailLen*cos(m_dr);
|
||||
float x2 = endVec.x() + m_vecPt.at(1).x();
|
||||
float y2 = endVec.y() - m_vecPt.at(1).y();
|
||||
endVec.setX(x2);
|
||||
endVec.setY(y2);
|
||||
}
|
||||
else
|
||||
{
|
||||
//jyl
|
||||
if(m_bCustom)
|
||||
{
|
||||
float x1 = startVec.x() + m_nRadius*sin(m_dr);
|
||||
float y1 = startVec.y() - m_nRadius*cos(m_dr);
|
||||
startVec.setX(x1);
|
||||
startVec.setY(y1);
|
||||
//
|
||||
float x2 = startVec.x() + m_nTailLen*sin(m_dr);
|
||||
float y2 = startVec.y() - m_nTailLen*cos(m_dr);
|
||||
endVec.setX(x2);
|
||||
endVec.setY(y2);
|
||||
}
|
||||
}
|
||||
|
||||
if (qFuzzyIsNull((startVec - endVec).lengthSquared())) {
|
||||
return;
|
||||
|
|
@ -30197,6 +30217,15 @@ double QCPItemText::selectTest(const QPointF &pos, bool onlySelectable, QVariant
|
|||
void QCPItemText::draw(QCPPainter *painter)
|
||||
{
|
||||
QPointF pos(position->pixelPosition());
|
||||
|
||||
if(m_bCustom)
|
||||
{
|
||||
float fx = pos.x();
|
||||
float fy = pos.y();
|
||||
pos.setX(fx + m_fx);
|
||||
pos.setY(fy - m_fy);
|
||||
}
|
||||
|
||||
QTransform transform = painter->transform();
|
||||
transform.translate(pos.x(), pos.y());
|
||||
if (!qFuzzyIsNull(mRotation)) {
|
||||
|
|
@ -31424,13 +31453,14 @@ QCPItemPolygon::QCPItemPolygon(QCustomPlot *parentPlot) :
|
|||
bottomLeft->setCoords(0, 0);
|
||||
bottomRight->setCoords(1, 0);
|
||||
|
||||
m_brushClr = Qt::black;
|
||||
// 此处填写真实的坐标!
|
||||
// vertices << QPointF(-71.8, 5.2) << QPointF(-68.2, -5.2) << QPointF(6.7, 4.9) << QPointF(3.1, 15.3);
|
||||
}
|
||||
|
||||
void QCPItemPolygon::draw(QCPPainter *painter)
|
||||
{
|
||||
if (ni < 0)
|
||||
if (vertices.size() <= 0)
|
||||
return;
|
||||
|
||||
QPointF center(topLeft->pixelPosition());
|
||||
|
|
@ -31438,21 +31468,14 @@ void QCPItemPolygon::draw(QCPPainter *painter)
|
|||
float x = center.x();
|
||||
float y = center.y();
|
||||
|
||||
float dr=ni*flVal;
|
||||
float x1 = x + ifdir*sin(dr);
|
||||
float y1 = y - ifdir*cos(dr);
|
||||
dr=(ni+1)*flVal;
|
||||
float x2 = x + ifdir*sin(dr);
|
||||
float y2 = y - ifdir*cos(dr);
|
||||
|
||||
QPolygonF myPolygon;
|
||||
myPolygon << QPointF(x, y);
|
||||
myPolygon << QPointF(x1, y1);
|
||||
myPolygon << QPointF(x2, y2);
|
||||
myPolygon << QPointF(x, y);
|
||||
for(int i = 0; i < vertices.size(); i++)
|
||||
{
|
||||
myPolygon << QPointF(x + vertices.at(i).x(), y - vertices.at(i).y());
|
||||
}
|
||||
|
||||
painter->setPen(Qt::black); // Set the pen color as needed
|
||||
painter->setBrush(QBrush(Qt::black)); // Set the brush if needed
|
||||
painter->setBrush(QBrush(m_brushClr)); // Set the brush if needed
|
||||
painter->drawPolygon(myPolygon);
|
||||
}
|
||||
|
||||
|
|
@ -31468,6 +31491,11 @@ void QCPItemPolygon::setPoints(const QVector<QPointF> &vecPoint)
|
|||
vertices = vecPoint;
|
||||
}
|
||||
|
||||
void QCPItemPolygon::setBrushColor(const QColor &clr)
|
||||
{
|
||||
m_brushClr = clr;
|
||||
}
|
||||
|
||||
void QCPItemPolygon::setPloyVal(int i, float fv, float dir)
|
||||
{
|
||||
ni = i;
|
||||
|
|
|
|||
|
|
@ -7222,6 +7222,8 @@ public:
|
|||
return mTail;
|
||||
}
|
||||
|
||||
void setPoints(const QVector<QPointF>& vecPoint);
|
||||
|
||||
// setters;
|
||||
void setPen(const QPen &pen);
|
||||
void setSelectedPen(const QPen &pen);
|
||||
|
|
@ -7245,6 +7247,8 @@ public:
|
|||
float m_dr; // 方位
|
||||
float m_nRadius; // 半径
|
||||
|
||||
QVector<QPointF> m_vecPt;
|
||||
|
||||
// reimplemented virtual methods:
|
||||
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
|
||||
|
||||
|
|
@ -7478,6 +7482,10 @@ public:
|
|||
QCPItemAnchor *const bottomLeft;
|
||||
QCPItemAnchor *const left;
|
||||
|
||||
bool m_bCustom;
|
||||
float m_fx;
|
||||
float m_fy;
|
||||
|
||||
protected:
|
||||
enum AnchorIndex {aiTopLeft, aiTop, aiTopRight, aiRight, aiBottomRight, aiBottom, aiBottomLeft, aiLeft};
|
||||
|
||||
|
|
@ -7848,7 +7856,7 @@ public:
|
|||
|
||||
// 设置真实的点信息
|
||||
void setPoints(const QVector<QPointF>& vecPoint);
|
||||
|
||||
void setBrushColor(const QColor& clr);
|
||||
void setPloyVal(int i, float fv, float dir);
|
||||
|
||||
// Define position types
|
||||
|
|
@ -7859,7 +7867,7 @@ public:
|
|||
|
||||
// Define the polygon vertices
|
||||
QVector<QPointF> vertices;
|
||||
|
||||
QColor m_brushClr;
|
||||
int ni = -1;
|
||||
float flVal;
|
||||
float ifdir;
|
||||
|
|
|
|||
|
|
@ -125,6 +125,10 @@ void FormDraw::setDrawData(QStringList listdt)
|
|||
{
|
||||
initFgrq(curv);
|
||||
}
|
||||
else if("roseObject" == strType)
|
||||
{
|
||||
initRose(curv);
|
||||
}
|
||||
curv->replot();
|
||||
|
||||
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
|
||||
|
|
@ -3400,7 +3404,7 @@ void FormDraw::initFgrq(QMyCustomPlot *widget)
|
|||
|
||||
// if(m_Value == NULL)
|
||||
{
|
||||
m_bTableData = true; // 表格 曲线
|
||||
m_bTableData = false; // 表格 曲线
|
||||
m_csCurveDDIR = "DDIR"; // 方位 曲线名
|
||||
m_csCurveDANG = "DANG";//倾角
|
||||
m_csCurveGrad = "GRAD";
|
||||
|
|
@ -3602,9 +3606,22 @@ void FormDraw::initFgrq(QMyCustomPlot *widget)
|
|||
QCPItemPolygon* pol = new QCPItemPolygon(widget);
|
||||
pol->topLeft->setCoords(x, y);
|
||||
pol->bottomRight->setCoords(x, y);
|
||||
pol->setPloyVal(i,flVal, ifdir[i]);
|
||||
// pol->setPoints(myPolygon);
|
||||
// pol->setPoints(myPolygon);
|
||||
|
||||
// pol->setPloyVal(i,flVal, ifdir[i]);
|
||||
|
||||
float dr=i*flVal;
|
||||
float x1 = ifdir[i]*sin(dr);
|
||||
float y1 = ifdir[i]*cos(dr);
|
||||
dr=(i+1)*flVal;
|
||||
float x2 = ifdir[i]*sin(dr);
|
||||
float y2 = ifdir[i]*cos(dr);
|
||||
|
||||
QPolygonF myPolygon;
|
||||
myPolygon << QPointF(0, 0);
|
||||
myPolygon << QPointF(x1, y1);
|
||||
myPolygon << QPointF(x2, y2);
|
||||
myPolygon << QPointF(0, 0);
|
||||
pol->setPoints(myPolygon);
|
||||
|
||||
// QCPItemRect* prt = new QCPItemRect(widget);
|
||||
// prt->topLeft->setCoords(x, y);
|
||||
|
|
@ -3628,6 +3645,369 @@ void FormDraw::initFgrq(QMyCustomPlot *widget)
|
|||
|
||||
}
|
||||
|
||||
void FormDraw::initRose(QMyCustomPlot *widget)
|
||||
{
|
||||
widget->m_iX1 = 0;
|
||||
widget->m_iX2 = 1024;
|
||||
widget->m_iY1 = g_iY1;
|
||||
widget->m_iY2 = g_iY2;
|
||||
//
|
||||
widget->xAxis->setRange(widget->m_iX1, widget->m_iX2);
|
||||
widget->yAxis->setRange(g_iY1, g_iY2);
|
||||
|
||||
//对调XY轴,在最前面设置
|
||||
QCPAxis *yAxis = widget->yAxis;
|
||||
QCPAxis *xAxis = widget->xAxis;
|
||||
widget->xAxis = yAxis;
|
||||
widget->yAxis = xAxis;
|
||||
|
||||
|
||||
// if(m_Value == NULL)
|
||||
{
|
||||
m_bTableData = false; // 表格 曲线
|
||||
m_csCurveDDIR = "STRDIR"; // 方位 曲线名
|
||||
m_csCurveDANG = "CALM";//倾角
|
||||
m_csCurveGrad = "GRAD";
|
||||
|
||||
m_qsTable="FRAC_HOLE.TABLE";
|
||||
m_qsDIR=("DDIR"); // 方位 曲线名
|
||||
m_qsDIP=("DANG");//倾角
|
||||
m_qsDepth="DEPT";
|
||||
m_qsID = "ID";
|
||||
|
||||
Refurbish();
|
||||
}
|
||||
|
||||
double nR = 40;
|
||||
|
||||
QPen wPen(Qt::black, 2);
|
||||
double centerX = widget->m_iX2/2;
|
||||
|
||||
float flVal = 0.0f;
|
||||
float x,y,x1,y1,x2,y2;
|
||||
float ifdir[360];
|
||||
int m_nArc = 36;
|
||||
float m_LeftVal3 = 0;
|
||||
float m_RightVal3 = 100.0;
|
||||
m_LeftVal = 0.0f;
|
||||
m_RightVal = 90.0f;
|
||||
float mind=min(m_RightVal , m_LeftVal);
|
||||
float maxd=max(m_RightVal , m_LeftVal);
|
||||
float dirmax,dipmax,dr;
|
||||
|
||||
float deps;
|
||||
|
||||
float ftmpSdep = 2890;//m_SDep;
|
||||
float ftmpEdep = m_EDep;
|
||||
if (m_bTableData)
|
||||
{
|
||||
ReadFracDef();
|
||||
for (int i = 0 ; i < iFracType ; i++)
|
||||
{
|
||||
m_bTypeDraw[i] = true;
|
||||
}
|
||||
|
||||
ftmpSdep = -g_iY2;
|
||||
ftmpEdep = -g_iY1;
|
||||
}
|
||||
|
||||
int nPointNum = m_FracTabList.count();
|
||||
int n = m_FracDefList.count();
|
||||
int nstep = 5;
|
||||
int tmp = ftmpSdep / nstep;
|
||||
float flDep = tmp * nstep;
|
||||
|
||||
double pi = 3.1415926535;
|
||||
// 射线
|
||||
bool m_bGrid = true;
|
||||
// 井眼垮塌
|
||||
bool m_bJykt = true;
|
||||
// 标注
|
||||
bool m_bHint = true;
|
||||
int m_nAzimStep = 3;
|
||||
|
||||
m_Curve.DepLevel = 0.5;
|
||||
while ( 1)
|
||||
{
|
||||
if((flDep>=ftmpEdep+nstep)||flDep>=ftmpEdep)break;
|
||||
|
||||
double tempf = flDep+(float)(nstep)/2.;
|
||||
double centerY = tempf * -1.0;
|
||||
|
||||
wPen.setWidth(2);
|
||||
wPen.setColor(Qt::black);
|
||||
QCPItemEllipse* pEse = new QCPItemEllipse(widget);
|
||||
pEse->setPen(wPen);
|
||||
pEse->m_bCustom = true;
|
||||
pEse->m_nRadius = nR;
|
||||
pEse->topLeft->setCoords(centerY, centerX);
|
||||
pEse->bottomRight->setCoords(centerY, centerX);
|
||||
|
||||
for(int k = 0; k < 4; k++)
|
||||
{
|
||||
QCPItemLine* pLine1 = new QCPItemLine(widget);
|
||||
pLine1->m_bCustom = true;
|
||||
pLine1->m_dr = qDegreesToRadians(k*90.0);
|
||||
pLine1->m_nRadius = 0;
|
||||
pLine1->m_nTailLen=nR;
|
||||
pLine1->setPen(wPen);
|
||||
pLine1->start->setCoords(centerY,centerX);
|
||||
pLine1->end->setCoords(centerY,centerX);
|
||||
}
|
||||
|
||||
// 写标注
|
||||
if ( m_bHint )
|
||||
{
|
||||
int psize = 10;
|
||||
flVal = m_nAzimStep*360./m_nArc;
|
||||
for (int i=0 ;i<360; i+=(int)(flVal))
|
||||
{
|
||||
QCPItemText* mItemTitle = new QCPItemText(widget);
|
||||
mItemTitle->position->setCoords(centerY,centerX);
|
||||
mItemTitle->setText(QString::number(i));
|
||||
//mItemTitle->setBrush(QBrush(Qt::red));
|
||||
mItemTitle->setFont(QFont("Arial", 10));
|
||||
mItemTitle->setColor(Qt::black);
|
||||
|
||||
dr = i*2* 3.1415926535/ 360.;
|
||||
mItemTitle->m_fx = (nR+psize*0.85)*sin(dr);
|
||||
mItemTitle->m_fy = (nR+psize*0.85)*cos(dr);
|
||||
mItemTitle->m_bCustom = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(m_bGrid)
|
||||
{
|
||||
wPen.setWidth(1);
|
||||
|
||||
double st = 360/m_nArc;
|
||||
for(int i = 0; i < m_nArc; i++)
|
||||
{
|
||||
int ntmp = i % 9;
|
||||
if(ntmp != 0)
|
||||
{
|
||||
QCPItemLine* pLine = new QCPItemLine(widget);
|
||||
pLine->m_bCustom = true;
|
||||
pLine->m_dr = qDegreesToRadians(i * st);
|
||||
pLine->m_nRadius = 0;
|
||||
pLine->m_nTailLen=nR;
|
||||
pLine->setPen(wPen);
|
||||
pLine->start->setCoords(centerY,centerX);
|
||||
pLine->end->setCoords(centerY,centerX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0;i<=m_nArc;i++) ifdir[i]=0.;
|
||||
x1 = 360./m_nArc;
|
||||
|
||||
int i = 0;
|
||||
while ( 1 )
|
||||
{
|
||||
deps = flDep + i * m_Curve.DepLevel;
|
||||
|
||||
tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5;
|
||||
if (deps >= ftmpEdep||
|
||||
deps > m_Curve.EndDepth||
|
||||
deps >=( flDep + nstep))
|
||||
break;
|
||||
if(tempf<0)
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_Value3 !=NULL )// for 控制曲线
|
||||
{
|
||||
float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5;
|
||||
if(tempf3<0)
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]);
|
||||
if(grad<m_LeftVal3||grad>m_RightVal3){i++;continue;}
|
||||
}
|
||||
if (m_Value2 !=NULL ) // 倾角控制
|
||||
{
|
||||
tempf = (deps-m_Curve2.StartDepth)/m_Curve2.DepLevel+0.5;
|
||||
flVal = GetData(m_Curve2.RepCode,(char *)&m_Value2[(int)(tempf)*m_Curve2.CodeLen]);
|
||||
//按倾角范围统计
|
||||
if(flVal > maxd || flVal < mind)
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5;
|
||||
flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]);
|
||||
if(flVal<0)
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
flVal=fmod(flVal,360.f);
|
||||
int j = flVal/x1;
|
||||
if ( j >= 0 && j< m_nArc+1 )
|
||||
ifdir[j] ++;
|
||||
i ++;
|
||||
}
|
||||
|
||||
dirmax=0;
|
||||
int iIndex = -1;
|
||||
for(i=0;i<=m_nArc;i++)
|
||||
{
|
||||
if (dirmax<ifdir[i])
|
||||
{
|
||||
iIndex = i;
|
||||
dirmax=ifdir[i];
|
||||
}
|
||||
}
|
||||
ifdir[m_nArc+1]=ifdir[1];
|
||||
|
||||
//没有统计点,不绘制
|
||||
if (dirmax == 0 ) dirmax=1;
|
||||
|
||||
flVal = pi *2./ m_nArc ;
|
||||
|
||||
QPolygonF myPolygon;
|
||||
float oldx, oldy;
|
||||
for (i=0 ;i<=m_nArc; i++)
|
||||
{
|
||||
dr=i*flVal;
|
||||
float x1 = ifdir[i]*nR*sin(dr)/dirmax;
|
||||
float y1 = ifdir[i]*nR*cos(dr)/dirmax;
|
||||
if(oldx != x1 || oldy != y1)
|
||||
{
|
||||
myPolygon << QPointF(x1, y1);
|
||||
oldx = x1;
|
||||
oldy = y1;
|
||||
}
|
||||
|
||||
if ( i >=m_nArc )
|
||||
dr=0.;
|
||||
else
|
||||
dr=(i+1)*flVal;
|
||||
|
||||
dr=(i+1)*flVal;
|
||||
float x2 = ifdir[i]*nR*sin(dr)/dirmax;
|
||||
float y2 = ifdir[i]*nR*cos(dr)/dirmax;
|
||||
|
||||
if(oldx != x2 || oldy != y2)
|
||||
{
|
||||
myPolygon << QPointF(x2, y2);
|
||||
oldx = x2;
|
||||
oldy = y2;
|
||||
}
|
||||
}
|
||||
// pt[2*m_nArc+2] = pt[0];
|
||||
|
||||
if (iIndex >=0/*&&m_bFill*/ )
|
||||
{
|
||||
x = centerY;
|
||||
y = centerX;
|
||||
QCPItemPolygon* pol = new QCPItemPolygon(widget);
|
||||
pol->topLeft->setCoords(x, y);
|
||||
pol->bottomRight->setCoords(x, y);
|
||||
pol->setPoints(myPolygon);
|
||||
pol->setBrushColor(QColor(255,170,0));
|
||||
}
|
||||
|
||||
myPolygon.clear();
|
||||
tempf = m_nArc/2.;
|
||||
for (i=0 ;i<=m_nArc; i++)
|
||||
{
|
||||
dr=i*flVal;
|
||||
dr = dr-tempf*flVal;
|
||||
float x1 = ifdir[i]*nR*sin(dr)/dirmax;
|
||||
float y1 = ifdir[i]*nR*cos(dr)/dirmax;
|
||||
|
||||
if(oldx != x1 || oldy != y1)
|
||||
{
|
||||
myPolygon << QPointF(x1, y1);
|
||||
oldx = x1;
|
||||
oldy = y1;
|
||||
}
|
||||
|
||||
if ( i >=m_nArc )
|
||||
dr=0.;
|
||||
else
|
||||
dr=(i+1)*flVal;
|
||||
dr = dr-tempf*flVal;
|
||||
float x2 = ifdir[i]*nR*sin(dr)/dirmax;
|
||||
float y2 = ifdir[i]*nR*cos(dr)/dirmax;
|
||||
if(oldx != x2 || oldy != y2)
|
||||
{
|
||||
myPolygon << QPointF(x2, y2);
|
||||
oldx = x2;
|
||||
oldy = y2;
|
||||
}
|
||||
}
|
||||
if (iIndex >=0/*&&m_bFill*/ )
|
||||
{
|
||||
x = centerY;
|
||||
y = centerX;
|
||||
QCPItemPolygon* pol = new QCPItemPolygon(widget);
|
||||
pol->topLeft->setCoords(x, y);
|
||||
pol->bottomRight->setCoords(x, y);
|
||||
pol->setPoints(myPolygon);
|
||||
pol->setBrushColor(QColor(255,170,0));
|
||||
}
|
||||
|
||||
|
||||
if ( m_bJykt && iIndex >=0 )
|
||||
{
|
||||
// 绘制垮塌方向
|
||||
dr=iIndex*flVal;
|
||||
dr = dr-pi/2;//9*flVal;
|
||||
x1 = ifdir[iIndex]*nR*sin(dr)/dirmax;
|
||||
y1 = ifdir[iIndex]*nR*cos(dr)/dirmax;
|
||||
|
||||
dr=iIndex*flVal;
|
||||
dr = dr+pi/2;
|
||||
x2 = ifdir[iIndex]*nR*sin(dr)/dirmax;
|
||||
y2 = ifdir[iIndex]*nR*cos(dr)/dirmax;
|
||||
|
||||
wPen.setWidth(2);
|
||||
wPen.setColor(QColor(0,85,255));
|
||||
this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), wPen);
|
||||
|
||||
dr=iIndex*flVal;
|
||||
float x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
|
||||
float y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
|
||||
this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
|
||||
this->addQCPItemLine(widget, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
|
||||
|
||||
dr=iIndex*flVal;
|
||||
dr = dr-pi;//18*flVal;//m1_nArc*flVal/2;
|
||||
x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
|
||||
y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
|
||||
|
||||
this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
|
||||
this->addQCPItemLine(widget, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
|
||||
|
||||
}
|
||||
|
||||
flDep += nstep;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FormDraw::addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen)
|
||||
{
|
||||
QPolygonF myPolygon;
|
||||
myPolygon << p1;
|
||||
myPolygon << p2;
|
||||
|
||||
QCPItemLine* pLine = new QCPItemLine(widget);
|
||||
pLine->setPen(wPen);
|
||||
pLine->start->setCoords(cx,cy);
|
||||
pLine->end->setCoords(cx,cy);
|
||||
pLine->setPoints(myPolygon);
|
||||
}
|
||||
|
||||
//岩心实验数据
|
||||
void FormDraw::initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -185,7 +185,9 @@ public:
|
|||
void initDepth(QMyCustomPlot *widget);
|
||||
//频率统计图
|
||||
void initFgrq(QMyCustomPlot *widget);
|
||||
|
||||
//玫瑰图
|
||||
void initRose(QMyCustomPlot *widget);
|
||||
void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen);
|
||||
signals:
|
||||
//void sig_AddLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||||
|
||||
|
|
|
|||
|
|
@ -167,6 +167,10 @@ void FormTrack::setDrawDt(QStringList listdt, float vmax, float vmin)
|
|||
{
|
||||
strAliasName = "频率统计图";
|
||||
}
|
||||
else if("roseObject" == strType)
|
||||
{
|
||||
strAliasName = "玫瑰图";
|
||||
}
|
||||
QString strUnit = "";
|
||||
QColor lineColor=QColor(0,0,0);
|
||||
double width=2;
|
||||
|
|
|
|||
|
|
@ -311,6 +311,8 @@ void FormWell::s_NewCol(QStringList listdt)
|
|||
QString strTrackName = "道" + QString::number(columnCount+1);
|
||||
if(strType == "depthObject")
|
||||
strTrackName = "深度";
|
||||
if(strType == "roseObject")
|
||||
strTrackName = "玫瑰图";
|
||||
|
||||
FormTrack *formTrack = NULL;
|
||||
//总行数
|
||||
|
|
|
|||
|
|
@ -145,44 +145,44 @@ RESOURCES += \
|
|||
RC_FILE = $$PWD/qrc/logplus.rc
|
||||
|
||||
CONFIG(debug, debug|release){
|
||||
DESTDIR = ../Bin
|
||||
DESTDIR = ../../Bin
|
||||
TARGET = $$join(TARGET,,,d) #为debug版本生成的文件增加d的后缀
|
||||
} else {
|
||||
DESTDIR = ../Bin
|
||||
DESTDIR = ../../Bin
|
||||
TARGET = $$join(TARGET,,,)
|
||||
}
|
||||
|
||||
INCLUDEPATH += ../Slfio/include
|
||||
INCLUDEPATH += ../common
|
||||
INCLUDEPATH += ../WellLogUI/include
|
||||
INCLUDEPATH += ../qtpropertybrowser
|
||||
INCLUDEPATH += ../BaseFun/include
|
||||
INCLUDEPATH += ../ConvertorManager/include
|
||||
INCLUDEPATH += ../OSGDataModel/include
|
||||
INCLUDEPATH += ../OSGFramework/include
|
||||
INCLUDEPATH += ../DataOutput/include
|
||||
INCLUDEPATH += ../DataMgr/include
|
||||
INCLUDEPATH += ../../Slfio/include
|
||||
INCLUDEPATH += ../../common
|
||||
INCLUDEPATH += ../../WellLogUI/include
|
||||
INCLUDEPATH += ../../qtpropertybrowser
|
||||
INCLUDEPATH += ../../BaseFun/include
|
||||
INCLUDEPATH += ../../ConvertorManager/include
|
||||
INCLUDEPATH += ../../OSGDataModel/include
|
||||
INCLUDEPATH += ../../OSGFramework/include
|
||||
INCLUDEPATH += ../../DataOutput/include
|
||||
INCLUDEPATH += ../../DataMgr/include
|
||||
|
||||
CONFIG(debug, debug|release){
|
||||
LIBS += -L../Bin -lBaseFund
|
||||
LIBS += -L../Bin -lslfiod
|
||||
LIBS += -L../Bin -lWellLogUId
|
||||
LIBS += -L../Bin -lqtpropertybrowserd
|
||||
LIBS += -L../Bin -lConvertorManagerd
|
||||
LIBS += -L../Bin -lOSGDataModeld
|
||||
LIBS += -L../Bin -lDataOutputd
|
||||
LIBS += -L../Bin/ -lCallPlugind -lHPluginManaged
|
||||
LIBS += -L../Bin/ -lDataMgrd
|
||||
LIBS += -L../../Bin -lBaseFund
|
||||
LIBS += -L../../Bin -lslfiod
|
||||
LIBS += -L../../Bin -lWellLogUId
|
||||
LIBS += -L../../Bin -lqtpropertybrowserd
|
||||
LIBS += -L../../Bin -lConvertorManagerd
|
||||
LIBS += -L../../Bin -lOSGDataModeld
|
||||
LIBS += -L../../Bin -lDataOutputd
|
||||
LIBS += -L../../Bin/ -lCallPlugind -lHPluginManaged
|
||||
LIBS += -L../../Bin/ -lDataMgrd
|
||||
#-lCallManaged
|
||||
} else {
|
||||
LIBS += -L../Bin -lBaseFun
|
||||
LIBS += -L../Bin -lslfio
|
||||
LIBS += -L../Bin -lWellLogUI
|
||||
LIBS += -L../Bin -lqtpropertybrowser
|
||||
LIBS += -L../Bin -lConvertorManager
|
||||
LIBS += -L../Bin -lOSGDataModel
|
||||
LIBS += -L../Bin -lDataOutput
|
||||
LIBS += -L../Bin/ -lCallPlugin -lHPluginManage
|
||||
LIBS += -L../Bin/ -lDataMgr
|
||||
LIBS += -L../../Bin -lBaseFun
|
||||
LIBS += -L../../Bin -lslfio
|
||||
LIBS += -L../../Bin -lWellLogUI
|
||||
LIBS += -L../../Bin -lqtpropertybrowser
|
||||
LIBS += -L../../Bin -lConvertorManager
|
||||
LIBS += -L../../Bin -lOSGDataModel
|
||||
LIBS += -L../../Bin -lDataOutput
|
||||
LIBS += -L../../Bin/ -lCallPlugin -lHPluginManage
|
||||
LIBS += -L../../Bin/ -lDataMgr
|
||||
#-lCallManage
|
||||
}
|
||||
|
|
|
|||
|
|
@ -368,6 +368,7 @@ void MainWindowCurve::initToolBar()
|
|||
//connect(m_newAc2, &QAction::triggered, this, &MainWindowCurve::s_NewWell);
|
||||
connect(m_depthAc, &QAction::triggered, this, &MainWindowCurve::s_NewDepth);
|
||||
connect(m_pinlvAc, &QAction::triggered, this, &MainWindowCurve::s_pinLvAc);
|
||||
connect(m_roseAc, &QAction::triggered, this, &MainWindowCurve::s_roseAc);
|
||||
// connect(m_compileAc, &QAction::triggered, this, &MainWindow::s_AddOne);
|
||||
// connect(m_runAc, &QAction::triggered, this, &MainWindow::s_SaveImage);
|
||||
// connect(m_debugAc, &QAction::triggered, this, &MainWindow::s_DrawImg);
|
||||
|
|
@ -378,6 +379,71 @@ void MainWindowCurve::initToolBar()
|
|||
connect(m_electric_imagingAc, &QAction::triggered, this, &MainWindowCurve::s_DrawImage);
|
||||
}
|
||||
|
||||
QStringList MainWindowCurve::insertCol(int nW)
|
||||
{
|
||||
QStringList sret;
|
||||
int column = -1;
|
||||
QString strSlfName = "";
|
||||
QString strLeft = m_leftWidgets->getLeftTreeString();
|
||||
if(strLeft.length() > 0)
|
||||
{
|
||||
QStringList list = strLeft.split("#@@#");//QString字符串分割函数
|
||||
if (list.size() > 3)
|
||||
{
|
||||
strSlfName = list[0];
|
||||
QString strWellName = list[1];
|
||||
// QString strLineName = list[2];
|
||||
// QString strType = list[3];
|
||||
|
||||
if(!m_listWell.contains(strWellName))
|
||||
{
|
||||
//井没创建,创建井+道+曲线
|
||||
//新建井
|
||||
s_NewWell(strWellName);
|
||||
m_listWell.push_back(strWellName);
|
||||
|
||||
column= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ui->tableWidget_2->columnCount()==0)
|
||||
{
|
||||
return sret;
|
||||
}
|
||||
|
||||
int iWidth = 0;
|
||||
if(column < 0)
|
||||
{
|
||||
column = ui->tableWidget_2->currentColumn();//列编号从0开始
|
||||
iWidth = ui->tableWidget_2->columnWidth(column);
|
||||
}
|
||||
|
||||
if(column<0)
|
||||
{
|
||||
//当前没有选中井
|
||||
return sret;
|
||||
}
|
||||
|
||||
if(column%2==0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
//空白列
|
||||
return sret;
|
||||
}
|
||||
|
||||
QString strWellName = ui->tableWidget_2->item(0, column)->text();
|
||||
|
||||
//设置列宽
|
||||
ui->tableWidget_2->setColumnWidth(column, iWidth+nW+8);
|
||||
|
||||
sret << strWellName << strSlfName;
|
||||
|
||||
return sret;
|
||||
}
|
||||
|
||||
void MainWindowCurve::loadStyle(const QString &qssFile)
|
||||
{
|
||||
//加载样式表
|
||||
|
|
@ -733,68 +799,15 @@ void MainWindowCurve::s_NewDepth()
|
|||
|
||||
void MainWindowCurve::s_pinLvAc()
|
||||
{
|
||||
int column = -1;
|
||||
int nW = 160;
|
||||
QString strSlfName = "";
|
||||
QString strLeft = m_leftWidgets->getLeftTreeString();
|
||||
if(strLeft.length() > 0)
|
||||
{
|
||||
QStringList list = strLeft.split("#@@#");//QString字符串分割函数
|
||||
if (list.size() > 3)
|
||||
{
|
||||
strSlfName = list[0];
|
||||
QString strWellName = list[1];
|
||||
// QString strLineName = list[2];
|
||||
// QString strType = list[3];
|
||||
|
||||
if(!m_listWell.contains(strWellName))
|
||||
{
|
||||
//井没创建,创建井+道+曲线
|
||||
//新建井
|
||||
s_NewWell(strWellName);
|
||||
m_listWell.push_back(strWellName);
|
||||
|
||||
column= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ui->tableWidget_2->columnCount()==0)
|
||||
{
|
||||
QStringList sret = this->insertCol(nW);
|
||||
if(sret.length() <= 0)
|
||||
return;
|
||||
}
|
||||
|
||||
int iWidth = 0;
|
||||
if(column < 0)
|
||||
{
|
||||
column = ui->tableWidget_2->currentColumn();//列编号从0开始
|
||||
iWidth = ui->tableWidget_2->columnWidth(column);
|
||||
}
|
||||
|
||||
if(column<0)
|
||||
{
|
||||
//当前没有选中井
|
||||
return;
|
||||
}
|
||||
|
||||
if(column%2==0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
//空白列
|
||||
return;
|
||||
}
|
||||
|
||||
QString strWellName = ui->tableWidget_2->item(0, column)->text();
|
||||
|
||||
//设置列宽
|
||||
ui->tableWidget_2->setColumnWidth(column, iWidth+nW+8);
|
||||
|
||||
QStringList dt;
|
||||
dt << m_strUuid;
|
||||
dt << strWellName;
|
||||
dt << strSlfName;
|
||||
dt << sret.at(0);
|
||||
dt << sret.at(1);
|
||||
dt << "";
|
||||
dt << "plObject";
|
||||
dt << QString::number(nW);
|
||||
|
|
@ -847,6 +860,24 @@ void MainWindowCurve::s_NewGanZhuangTu()
|
|||
emit CallManage::getInstance()->sig_NewTrack(m_strUuid, strWellName, strSlfName, "杆状图", "ganzhuangtuObject", nW);
|
||||
}
|
||||
|
||||
void MainWindowCurve::s_roseAc()
|
||||
{
|
||||
int nW = 160;
|
||||
QStringList sret = this->insertCol(nW);
|
||||
if(sret.length() <= 0)
|
||||
return;
|
||||
|
||||
QStringList dt;
|
||||
dt << m_strUuid;
|
||||
dt << sret.at(0);
|
||||
dt << sret.at(1);
|
||||
dt << "";
|
||||
dt << "roseObject";
|
||||
dt << QString::number(nW);
|
||||
//新建道
|
||||
emit CallManage::getInstance()->sig_NewCol(dt);
|
||||
}
|
||||
|
||||
//井眼垮塌矢量图
|
||||
void MainWindowCurve::s_Jykt()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -85,6 +85,9 @@ public:
|
|||
void initMainToolBar();
|
||||
void initToolBar();
|
||||
|
||||
// 返回 strWellName << strSlfName
|
||||
QStringList insertCol(int nW);
|
||||
|
||||
//停靠
|
||||
void dockLayout();
|
||||
|
||||
|
|
@ -110,6 +113,7 @@ public slots:
|
|||
|
||||
void s_pinLvAc(); // 频率统计
|
||||
void s_NewGanZhuangTu(); // 杆状图
|
||||
void s_roseAc(); // 玫瑰图
|
||||
void s_Jykt(); // 井眼垮塌矢量图
|
||||
void s_Denv(); // 井斜方位图
|
||||
void s_DrawImage(); // 图像 成图
|
||||
|
|
|
|||
|
|
@ -24,7 +24,10 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
|
|||
|
||||
setObjectName("QMyCustomPlot");
|
||||
//this->setOpenGl(true);//不开启,电脑不支持会卡
|
||||
this->setNotAntialiasedElements(QCP::aeAll); // 关闭所有抗锯齿
|
||||
// this->setNotAntialiasedElements(QCP::aeAll); // 关闭所有抗锯齿
|
||||
|
||||
// 开启抗锯齿
|
||||
this->setAntialiasedElement(QCP::aeAll);
|
||||
|
||||
//jyl
|
||||
if(g_iShow==1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user