1.解释结论显示名称,字体,颜色,结论占比,显示位置,层号,层号字体等属性
2.修改解释结论,修改道宽后结论的符号变形的BUG。
This commit is contained in:
parent
c7dec2d5a6
commit
ef3683af4c
|
|
@ -163,12 +163,13 @@ void TransparentDraggableResult::drawResult(double left_Low, double right_Hight,
|
|||
}
|
||||
|
||||
// 设置矩形范围
|
||||
void TransparentDraggableResult::setRange(double left_Low, double right_Hight)
|
||||
void TransparentDraggableResult::setRange(double left_Low, double right_Hight)
|
||||
{
|
||||
if(left_Low >= right_Hight) return;
|
||||
|
||||
double lY1 = mPlot->yAxis->range().lower;//+10
|
||||
double lY2 = (mPlot->yAxis->range().upper-mPlot->yAxis->range().lower)/2;
|
||||
double lY1 = m_nShowPos*g_dPixelPerCm+mPlot->yAxis->range().lower;//+10
|
||||
double lY2 = m_nShowPos*g_dPixelPerCm+(mPlot->yAxis->range().upper-mPlot->yAxis->range().lower)* (m_nConclusionProportion /100.0f);
|
||||
|
||||
mRect->topLeft->setCoords(left_Low, lY1);
|
||||
mRect->bottomRight->setCoords(right_Hight, mPlot->yAxis->range().upper);
|
||||
|
||||
|
|
@ -204,6 +205,17 @@ void TransparentDraggableResult::setRange(double left_Low, double right_Hight)
|
|||
//mPlot->replot();
|
||||
}
|
||||
|
||||
void TransparentDraggableResult::setShowProperty(int nCopr, int nSPos, bool bupdate)
|
||||
{
|
||||
m_nConclusionProportion = nCopr;
|
||||
m_nShowPos = nSPos;
|
||||
|
||||
if (bupdate)
|
||||
{
|
||||
setRange(mRect->topLeft->key(), mRect->bottomRight->key());
|
||||
}
|
||||
}
|
||||
|
||||
void TransparentDraggableResult::setDragRange(double left_Low, double right_Hight)
|
||||
{
|
||||
if (left_Low >= right_Hight) return;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public:
|
|||
void drawResult(double left_Low, double right_Hight, double lY1, double lY2);
|
||||
// 设置矩形范围
|
||||
void setRange(double left_Low, double right_Hight);
|
||||
// 设置结论占比%
|
||||
void setShowProperty(int nCopr, int nSPos, bool bupdate = false);
|
||||
void setDragRange(double left_Low, double right_Hight);
|
||||
// 获取当前范围
|
||||
QCPRange getRange();
|
||||
|
|
@ -95,6 +97,10 @@ private:
|
|||
|
||||
// 添加最小宽度成员变量
|
||||
double mMinWidth;
|
||||
// 结论占比%
|
||||
int m_nConclusionProportion = 50;
|
||||
// 显示位置cm
|
||||
int m_nShowPos = 0;
|
||||
};
|
||||
|
||||
#endif // TRANSPARENTDRAGGABLERESUL_H
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ void TransparentGroupResult::addResultToPlot(double left_Low, double right_Hight
|
|||
|
||||
// 在初始化代码中
|
||||
TransparentDraggableResult *dragRect = new TransparentDraggableResult(mPlot, upDragRect, strUuid);
|
||||
dragRect->setShowProperty(m_nConclusionProportion, m_nShowPos);
|
||||
//图片,提前设值,后面setRange改变
|
||||
dragRect->setResult(myResult);
|
||||
// 设置初始范围
|
||||
|
|
@ -99,6 +100,54 @@ QCPRange TransparentGroupResult::getRange()
|
|||
return QCPRange(mRect->topLeft->coords().x(), mRect->bottomRight->coords().x());
|
||||
}
|
||||
|
||||
void TransparentGroupResult::setGroupConclusionProportion(int nCopr)
|
||||
{
|
||||
if (nCopr > 0)
|
||||
{
|
||||
m_nConclusionProportion = nCopr;
|
||||
}
|
||||
|
||||
QObjectList objList = m_mapDraggable_Result.values();
|
||||
for (int i = 0; i < objList.size(); i++)
|
||||
{
|
||||
TransparentDraggableResult* p = qobject_cast<TransparentDraggableResult*>(objList.at(i));
|
||||
if (p)
|
||||
{
|
||||
p->setShowProperty(m_nConclusionProportion, m_nShowPos, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TransparentGroupResult::setGroupShowPos(int nSPos)
|
||||
{
|
||||
if (nSPos > 0)
|
||||
{
|
||||
m_nShowPos = nSPos;
|
||||
}
|
||||
|
||||
QObjectList objList = m_mapDraggable_Result.values();
|
||||
for (int i = 0; i < objList.size(); i++)
|
||||
{
|
||||
TransparentDraggableResult* p = qobject_cast<TransparentDraggableResult*>(objList.at(i));
|
||||
if (p)
|
||||
{
|
||||
p->setShowProperty(m_nConclusionProportion, m_nShowPos, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TransparentGroupResult::setFloorVisible(bool bs)
|
||||
{
|
||||
mItemTitle->setVisible(bs);
|
||||
mPlot->replot();
|
||||
}
|
||||
|
||||
void TransparentGroupResult::setFloorFont(QFont f)
|
||||
{
|
||||
mItemTitle->setFont(f);
|
||||
mPlot->replot();
|
||||
}
|
||||
|
||||
// 删除框图
|
||||
void TransparentGroupResult::deleteRect()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,7 +35,14 @@ public:
|
|||
void setDragRange(double left_Low, double right_Hight);
|
||||
// 获取当前范围
|
||||
QCPRange getRange();
|
||||
|
||||
|
||||
// 设置结论占比%
|
||||
void setGroupConclusionProportion(int nCopr);
|
||||
// 设置显示位置
|
||||
void setGroupShowPos(int nSPos);
|
||||
void setFloorVisible(bool bs);
|
||||
void setFloorFont(QFont f);
|
||||
|
||||
// 删除框图
|
||||
void deleteRect();
|
||||
|
||||
|
|
@ -88,6 +95,11 @@ private:
|
|||
// 添加最小宽度成员变量
|
||||
double mMinWidth;
|
||||
|
||||
// 设置结论占比%
|
||||
int m_nConclusionProportion = 50;
|
||||
// 显示位置cm
|
||||
int m_nShowPos = 0;
|
||||
|
||||
QVector<QString> m_vecResult;
|
||||
QMap<QString, QObject*> m_mapDraggable_Result;
|
||||
bool m_bArrow = false;
|
||||
|
|
|
|||
|
|
@ -906,6 +906,10 @@ void FormDraw::setColWidth(int iNewWidth)
|
|||
{
|
||||
int dHight = form->geometry().height();
|
||||
form->setGeometry(0, 0, iNewWidth, (int)dHight);//7500-3184
|
||||
if (form->m_strLineName == "RESULT")
|
||||
{
|
||||
form->setConclusionProportion(0);
|
||||
}
|
||||
form->replot();//屏蔽,缩减时间
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW)
|
|||
|
||||
//curv->setMaximumHeight((int)dHight);
|
||||
//curv->setViewport(QRect(0, 0, g_iOneWidth, (int)dHight));//7500-3184
|
||||
this->setGeometry(0, 0, nW-1, (int)dHight);//7500-3184
|
||||
this->setGeometry(0, 0, nW, (int)dHight);//7500-3184
|
||||
}
|
||||
|
||||
void QMyCustomPlot::changePropertyWaveUpdate()
|
||||
|
|
@ -599,6 +599,58 @@ void QMyCustomPlot::groupEndResult()
|
|||
m_strGroupUid = "";
|
||||
}
|
||||
|
||||
void QMyCustomPlot::setShowProperty(QVariant val, int ntag)
|
||||
{
|
||||
QObjectList objList = m_mapDragGroup.values();
|
||||
for (int i = 0; i < objList.size(); i++)
|
||||
{
|
||||
TransparentGroupResult *pGroup = qobject_cast<TransparentGroupResult *>(objList.at(i));
|
||||
if (pGroup == nullptr)
|
||||
continue;
|
||||
if (ntag == 1)
|
||||
{
|
||||
pGroup->setGroupConclusionProportion(val.toInt());
|
||||
}
|
||||
else if (ntag == 2)
|
||||
{
|
||||
pGroup->setGroupShowPos(val.toInt());
|
||||
}
|
||||
else if (ntag == 3)
|
||||
{
|
||||
pGroup->setFloorVisible(val.toBool());
|
||||
}
|
||||
else if (ntag == 4)
|
||||
{
|
||||
QFont f = val.value<QFont>();
|
||||
pGroup->setFloorFont(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QMyCustomPlot::setConclusionProportion(int nCopro)
|
||||
{
|
||||
QObjectList objList = m_mapDragGroup.values();
|
||||
for (int i = 0; i < objList.size(); i++)
|
||||
{
|
||||
TransparentGroupResult *pGroup = qobject_cast<TransparentGroupResult *>(objList.at(i));
|
||||
if (pGroup == nullptr)
|
||||
continue;
|
||||
pGroup->setGroupConclusionProportion(nCopro);
|
||||
}
|
||||
}
|
||||
|
||||
void QMyCustomPlot::setShowPos(int nSPos)
|
||||
{
|
||||
QObjectList objList = m_mapDragGroup.values();
|
||||
for (int i = 0; i < objList.size(); i++)
|
||||
{
|
||||
TransparentGroupResult *pGroup = qobject_cast<TransparentGroupResult *>(objList.at(i));
|
||||
if (pGroup == nullptr)
|
||||
continue;
|
||||
pGroup->setGroupShowPos(nSPos);
|
||||
}
|
||||
}
|
||||
|
||||
//蝌蚪图,重绘网格线
|
||||
void QMyCustomPlot::drawCustomElements()
|
||||
{
|
||||
|
|
@ -1999,7 +2051,19 @@ void QMyCustomPlot::s_changeDrawProperty(QVariantList vlist)
|
|||
}
|
||||
else if ("结论占比%" == strProperty)
|
||||
{
|
||||
|
||||
this->setShowProperty(varVal, 1);
|
||||
}
|
||||
else if ("显示位置(cm)" == strProperty)
|
||||
{
|
||||
this->setShowProperty(varVal, 2);
|
||||
}
|
||||
else if ("显示层号" == strProperty)
|
||||
{
|
||||
this->setShowProperty(varVal, 3);
|
||||
}
|
||||
else if ("层号字体" == strProperty)
|
||||
{
|
||||
this->setShowProperty(varVal, 4);
|
||||
}
|
||||
this->replot();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ public:
|
|||
void groupBeginResult(float fEndDepth, float fStartDepth);
|
||||
void groupEndResult();
|
||||
|
||||
// 设置解释结论属性
|
||||
void setShowProperty(QVariant val, int ntag);
|
||||
void setConclusionProportion(int nCopro);
|
||||
void setShowPos(int nSPos);
|
||||
protected:
|
||||
//virtual void mouseMoveEvent(QMouseEvent *event);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user