三图一表,追加滚动条支持
This commit is contained in:
parent
474c5dd007
commit
6a502f755d
|
|
@ -176,7 +176,7 @@ signals:
|
||||||
void sig_changeScale(QString strUuid, int iNewScale);
|
void sig_changeScale(QString strUuid, int iNewScale);
|
||||||
|
|
||||||
//自定义滚动条
|
//自定义滚动条
|
||||||
void sig_vertScrollBarChanged(QString strUuid, int iNewValue);
|
void sig_vertScrollBarChanged(QString strUuid, int iNewValue, int low, int upper);
|
||||||
|
|
||||||
//改变深度
|
//改变深度
|
||||||
void sig_changeDepth(QString strUuid, QString strSlfName, QString strWellName, int iY1, int iY2);
|
void sig_changeDepth(QString strUuid, QString strSlfName, QString strWellName, int iY1, int iY2);
|
||||||
|
|
|
||||||
|
|
@ -578,7 +578,7 @@ double GetPixelPerCm()
|
||||||
if (screen) {
|
if (screen) {
|
||||||
// 获取逻辑DPI
|
// 获取逻辑DPI
|
||||||
logicalDpi = screen->logicalDotsPerInch();
|
logicalDpi = screen->logicalDotsPerInch();
|
||||||
qDebug() << "Logical DPI:" << QString::number(logicalDpi);
|
//qDebug() << "Logical DPI:" << QString::number(logicalDpi);
|
||||||
|
|
||||||
if(logicalDpi==0)
|
if(logicalDpi==0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2399,7 +2399,7 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
||||||
//
|
//
|
||||||
changedMCalsProperty(m_propertyData[pProperty], variant);
|
changedMCalsProperty(m_propertyData[pProperty], variant);
|
||||||
}
|
}
|
||||||
else if (m_strCurrentProperty == DCA_PROPERTY)//井斜方位图
|
else if (m_strCurrentProperty == DCA_PROPERTY)//裂缝
|
||||||
{
|
{
|
||||||
// 先处理通用属性
|
// 先处理通用属性
|
||||||
CommonPropertyChanged(pProperty, variant);
|
CommonPropertyChanged(pProperty, variant);
|
||||||
|
|
|
||||||
|
|
@ -4051,7 +4051,8 @@ FormLine* FormDraw::s_addSantuyibiao(QString strUuid, QString strSlfName, QStrin
|
||||||
dHight = 32767;
|
dHight = 32767;
|
||||||
}
|
}
|
||||||
int ntmpw = (g_iOneWidth * 4) * g_dPixelPerCm;
|
int ntmpw = (g_iOneWidth * 4) * g_dPixelPerCm;
|
||||||
this->setGeometry(0, 0, ntmpw - 2, (int)dHight);
|
//curv->setGeometry(0, 0, ntmpw - 2, (int)dHight);
|
||||||
|
curv->setGeometry(0, 0, ntmpw - 2, (int)32767);//斜井三图一表,固定最大值,方便上下滚动
|
||||||
curv->show();
|
curv->show();
|
||||||
|
|
||||||
//斜井三图一表
|
//斜井三图一表
|
||||||
|
|
|
||||||
|
|
@ -1630,6 +1630,21 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
painter.drawText(rect.width()/2- tRect.width()/2, nbay - 6, m_strUnit);
|
painter.drawText(rect.width()/2- tRect.width()/2, nbay - 6, m_strUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//多臂井径
|
||||||
|
if(m_strType == "MCalsObject")
|
||||||
|
{
|
||||||
|
int nbay = rect.height() - 5;
|
||||||
|
|
||||||
|
// 显示刻度
|
||||||
|
if (m_bShowScale)
|
||||||
|
{
|
||||||
|
drawScale_MCals(painter, rect);
|
||||||
|
}
|
||||||
|
QFontMetrics fm2(m_curveUnitFont);
|
||||||
|
QRect tRect = fm2.boundingRect(m_strUnit);
|
||||||
|
painter.drawText(rect.width()/2- tRect.width()/2, nbay - 6, m_strUnit);
|
||||||
|
}
|
||||||
|
|
||||||
if(m_strLineName == "深度")
|
if(m_strLineName == "深度")
|
||||||
{
|
{
|
||||||
QFont oldFont = painter.font();
|
QFont oldFont = painter.font();
|
||||||
|
|
@ -2028,6 +2043,28 @@ void FormInfo::drawScale_Kedou(QPainter& painter, const QRect& rect)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FormInfo::drawScale_MCals(QPainter& painter, const QRect& rect)
|
||||||
|
{
|
||||||
|
int nbay = rect.height() - 5;
|
||||||
|
QVector<QStringList> vecScale;
|
||||||
|
|
||||||
|
vecScale << QStringList({ QString::number(m_iStartArmPos) , QString::number(m_iEndArmPos) });
|
||||||
|
|
||||||
|
painter.setFont(m_curveScaleFont);
|
||||||
|
QFontMetrics fm1(m_curveScaleFont);
|
||||||
|
QRect textRect = fm1.boundingRect(QString::number(m_iStartArmPos, 'f', 0));
|
||||||
|
int ntxthei = textRect.height() - 4;
|
||||||
|
int nyy = nbay - ntxthei * vecScale.size() - 3;
|
||||||
|
for (int i = 0; i < vecScale.size(); i++)
|
||||||
|
{
|
||||||
|
const QStringList& slist = vecScale.at(i);
|
||||||
|
QRect textRect = fm1.boundingRect(slist.at(1));
|
||||||
|
int y = nyy + (i + 1) * ntxthei;
|
||||||
|
painter.drawText(rect.x() + 3, y, slist.at(0));
|
||||||
|
painter.drawText(rect.width() - textRect.width() - 3, y, slist.at(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FormInfo::paintClassify(QPainter &painter, int compassCenterY)
|
void FormInfo::paintClassify(QPainter &painter, int compassCenterY)
|
||||||
{
|
{
|
||||||
// 绘制分类
|
// 绘制分类
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,10 @@ protected:
|
||||||
|
|
||||||
// 绘制刻度
|
// 绘制刻度
|
||||||
void drawScale(QPainter& painter, const QRect& rect);
|
void drawScale(QPainter& painter, const QRect& rect);
|
||||||
|
//蝌蚪图等
|
||||||
void drawScale_Kedou(QPainter& painter, const QRect& rect);
|
void drawScale_Kedou(QPainter& painter, const QRect& rect);
|
||||||
|
//多臂井径
|
||||||
|
void drawScale_MCals(QPainter& painter, const QRect& rect);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void dragEnterEvent(QDragEnterEvent* event);
|
void dragEnterEvent(QDragEnterEvent* event);
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@ FormLine::FormLine(QWidget *parent, QString strSlfName, QString strWellName, QSt
|
||||||
//斜井三图一表
|
//斜井三图一表
|
||||||
connect(CallManage::getInstance(), SIGNAL(sig_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant)),
|
connect(CallManage::getInstance(), SIGNAL(sig_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant)),
|
||||||
this, SLOT(s_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant)));
|
this, SLOT(s_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant)));
|
||||||
|
//自定义滚动条
|
||||||
|
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged(QString, int, int, int)), this, SLOT(vertScrollBarChanged(QString, int, int, int)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormLine::DrawTvd()
|
void FormLine::DrawTvd()
|
||||||
|
|
@ -319,3 +322,22 @@ void FormLine::s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//自定义滚动条
|
||||||
|
void FormLine::vertScrollBarChanged(QString strUuid, int value, int low, int upper)
|
||||||
|
{
|
||||||
|
if(m_strUuid==strUuid)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//上移或下移
|
||||||
|
QRect geoRect = geometry();
|
||||||
|
//
|
||||||
|
double dDelta = value - upper;
|
||||||
|
double dPercent = dDelta / (low-upper);
|
||||||
|
|
||||||
|
setGeometry(0, -(dPercent*geoRect.height()), geoRect.width(), geoRect.height());
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@ public slots:
|
||||||
//斜井三图一表
|
//斜井三图一表
|
||||||
void s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
|
void s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
|
||||||
QString strGroup, QString strProperty, QVariant variant);
|
QString strGroup, QString strProperty, QVariant variant);
|
||||||
|
|
||||||
|
//滚动条
|
||||||
|
void vertScrollBarChanged(QString strUuid, int value, int low, int upper);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FORMLINE_H
|
#endif // FORMLINE_H
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ void MainWindowCurve::s_mouseWheel(QWheelEvent *event)
|
||||||
void MainWindowCurve::vertScrollBarChanged(int value)
|
void MainWindowCurve::vertScrollBarChanged(int value)
|
||||||
{
|
{
|
||||||
//通知界面缩放
|
//通知界面缩放
|
||||||
emit CallManage::getInstance()->sig_vertScrollBarChanged(m_strUuid, value);
|
emit CallManage::getInstance()->sig_vertScrollBarChanged(m_strUuid, value, -m_iY1, -m_iY2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
|
||||||
connect(CallManage::getInstance(), SIGNAL(sig_ChangeScaleType(QString, QString, QString, QString, QString, QString)), this, SLOT(s_ChangeScaleType(QString, QString, QString, QString, QString, QString)));
|
connect(CallManage::getInstance(), SIGNAL(sig_ChangeScaleType(QString, QString, QString, QString, QString, QString)), this, SLOT(s_ChangeScaleType(QString, QString, QString, QString, QString, QString)));
|
||||||
|
|
||||||
//自定义滚动条
|
//自定义滚动条
|
||||||
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged(QString, int)), this, SLOT(vertScrollBarChanged(QString, int)));
|
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged(QString, int, int, int)), this, SLOT(vertScrollBarChanged(QString, int, int, int)));
|
||||||
|
|
||||||
//曲线选中,置顶
|
//曲线选中,置顶
|
||||||
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int, QString)));
|
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int, QString)));
|
||||||
|
|
@ -11819,7 +11819,7 @@ void QMyCustomPlot::addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, co
|
||||||
}
|
}
|
||||||
|
|
||||||
//自定义滚动条
|
//自定义滚动条
|
||||||
void QMyCustomPlot::vertScrollBarChanged(QString strUuid, int value)
|
void QMyCustomPlot::vertScrollBarChanged(QString strUuid, int value, int low, int upper)
|
||||||
{
|
{
|
||||||
if(m_strUuid==strUuid)
|
if(m_strUuid==strUuid)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -406,7 +406,7 @@ signals:
|
||||||
public slots:
|
public slots:
|
||||||
void slot_time();
|
void slot_time();
|
||||||
//自定义滚动条
|
//自定义滚动条
|
||||||
void vertScrollBarChanged(QString strUuid, int value);
|
void vertScrollBarChanged(QString strUuid, int value, int low, int upper);
|
||||||
//信号槽刷新
|
//信号槽刷新
|
||||||
void slot_replot();
|
void slot_replot();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user