|
|
|
|
@ -29,7 +29,7 @@
|
|
|
|
|
#include "nmSingalCenter.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "nmDataAnalyzeManager.h"
|
|
|
|
|
#include "nmPlotGraphicBinder.h"
|
|
|
|
|
#include "ZxDataGaugeP.h"
|
|
|
|
|
#include "ZxDataGaugeF.h"
|
|
|
|
|
|
|
|
|
|
@ -49,6 +49,7 @@ nmObjPointWell::nmObjPointWell()
|
|
|
|
|
, m_bSelectWell(false)
|
|
|
|
|
, m_pWellData(nullptr)
|
|
|
|
|
, m_pNmWellData(nullptr)
|
|
|
|
|
, m_pGraphicBinder(nullptr)
|
|
|
|
|
, m_enumWellType(NM_WELL_MODEL::Vertical_Well)
|
|
|
|
|
{
|
|
|
|
|
nmObjPointWell::init("", NULL, NULL);
|
|
|
|
|
@ -62,6 +63,7 @@ nmObjPointWell::nmObjPointWell(const QString& sName, \
|
|
|
|
|
, m_bSelectWell(false)
|
|
|
|
|
, m_pWellData(nullptr)
|
|
|
|
|
, m_pNmWellData(nullptr)
|
|
|
|
|
, m_pGraphicBinder(nullptr)
|
|
|
|
|
, m_enumWellType(NM_WELL_MODEL::Vertical_Well)
|
|
|
|
|
{
|
|
|
|
|
nmObjPointWell::init(sName, pAxisX, pAxisY);
|
|
|
|
|
@ -90,6 +92,7 @@ void nmObjPointWell::init(const QString& sName, \
|
|
|
|
|
loadTempl();
|
|
|
|
|
|
|
|
|
|
m_pNmWellData = nullptr;
|
|
|
|
|
m_pGraphicBinder = nullptr;
|
|
|
|
|
|
|
|
|
|
// 连接图元可见性信号和槽
|
|
|
|
|
connect(this, SIGNAL(sigObjVisibleChanged(bool)),
|
|
|
|
|
@ -107,7 +110,7 @@ bool nmObjPointWell::runMove(const QPointF &pt1, const QPointF &pt2)
|
|
|
|
|
nmObjPoint::runMove(pt1, pt2);
|
|
|
|
|
|
|
|
|
|
// 更新井的位置信息
|
|
|
|
|
if(m_pWellData) {
|
|
|
|
|
if(m_pWellData && m_pNmWellData) {
|
|
|
|
|
QPointF newLocation = this->getValueOf(pt2);
|
|
|
|
|
m_pWellData->setLocationX(newLocation.x());
|
|
|
|
|
m_pWellData->setLocationY(newLocation.y());
|
|
|
|
|
@ -135,7 +138,9 @@ bool nmObjPointWell::runMove(const QPointF &pt1, const QPointF &pt2)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nmDataAnalyzeManager::getCurrentInstance()->notifyDataChanged();
|
|
|
|
|
if (m_pGraphicBinder) {
|
|
|
|
|
m_pGraphicBinder->notifyDataChanged();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -221,6 +226,7 @@ void nmObjPointWell::afterCreated()
|
|
|
|
|
|
|
|
|
|
if(NULL != pPlot) {
|
|
|
|
|
QString sName = m_pWellData->getName();
|
|
|
|
|
this->setName(sName);
|
|
|
|
|
ZxObjBase* p = pPlot->addOneObj(POT_Text, sName, false, \
|
|
|
|
|
m_pAxisX, m_pAxisY);
|
|
|
|
|
appendSubObjs(p);
|
|
|
|
|
@ -331,11 +337,12 @@ void nmObjPointWell::afterCreated()
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化默认参数
|
|
|
|
|
m_pNmWellData = nmDataAnalyzeManager::getCurrentInstance()->createWell(m_enumWellType);
|
|
|
|
|
// 如果已有井数据(文件加载时通过 bindWellToGraphic 绑定),则跳过创建
|
|
|
|
|
if (m_pNmWellData == nullptr) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
m_pNmWellData = m_pGraphicBinder->createWellForGraphic(this, m_enumWellType);
|
|
|
|
|
if (m_pNmWellData == nullptr) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pNmWellData->setWellName(m_pWellData->getName());
|
|
|
|
|
nmDataAttribute tempAttr = m_pNmWellData->getX();
|
|
|
|
|
@ -373,12 +380,13 @@ void nmObjPointWell::afterCreated()
|
|
|
|
|
QVector<QVector<double>> vvecHistoryLogData;
|
|
|
|
|
QVector<QVector<double>> vvecHistorySemiLogData;
|
|
|
|
|
|
|
|
|
|
nmDataAnalyzeManager::getCurrentInstance()->calculationLogData(m_pNmWellData, vvecHistoryPressureData, vvecHistoryLogData, vvecHistorySemiLogData);
|
|
|
|
|
m_pGraphicBinder->calculateWellLogData(m_pNmWellData, vvecHistoryPressureData, vvecHistoryLogData, vvecHistorySemiLogData);
|
|
|
|
|
|
|
|
|
|
// 存储历史数据到井对象
|
|
|
|
|
m_pNmWellData->setHistoryPressure(vvecHistoryPressureData);
|
|
|
|
|
m_pNmWellData->setHistoryLogLog(vvecHistoryLogData);
|
|
|
|
|
m_pNmWellData->setHistorySemiLog(vvecHistorySemiLogData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -449,7 +457,7 @@ void nmObjPointWell::createWell()
|
|
|
|
|
void nmObjPointWell::editWell()
|
|
|
|
|
{
|
|
|
|
|
// 如果没有层数据,提示用户定义分层信息
|
|
|
|
|
if(nmDataAnalyzeManager::getCurrentInstance()->getLayers().isEmpty()) {
|
|
|
|
|
if(m_pGraphicBinder && !m_pGraphicBinder->hasLayers()) {
|
|
|
|
|
QMessageBox::information(nullptr, tr("error"), tr("please setting layers Data!"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -469,6 +477,7 @@ void nmObjPointWell::editWell()
|
|
|
|
|
|
|
|
|
|
// 更新ZxDataWell的数据
|
|
|
|
|
m_pWellData->setName(pReturnWellData->getWellName());
|
|
|
|
|
this->setName(pReturnWellData->getWellName());
|
|
|
|
|
m_pWellData->setLocationX(pReturnWellData->getX().getValue().toDouble());
|
|
|
|
|
m_pWellData->setLocationY(pReturnWellData->getY().getValue().toDouble());
|
|
|
|
|
m_pWellData->setWellRadius(pReturnWellData->getRadius().getValue().toDouble());
|
|
|
|
|
@ -503,25 +512,28 @@ void nmObjPointWell::editWell()
|
|
|
|
|
moveToPos(this->getPosOf(this->getAllPos()));
|
|
|
|
|
|
|
|
|
|
// 判断是不是当前查看的井
|
|
|
|
|
nmDataWellBase* pCurWellData = nmDataAnalyzeManager::getCurrentInstance()->getCurWellData();
|
|
|
|
|
nmDataWellBase* pCurWellData = m_pGraphicBinder->getCurrentWellData();
|
|
|
|
|
if (pCurWellData != nullptr && pCurWellData->getWellName() == m_pNmWellData->getWellName())
|
|
|
|
|
{
|
|
|
|
|
// 设置到当前井
|
|
|
|
|
nmDataAnalyzeManager::getCurrentInstance()->setCurWellData(pReturnWellData);
|
|
|
|
|
m_pGraphicBinder->setCurrentWellData(pReturnWellData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新当前井数据,并添加到数据中心
|
|
|
|
|
nmDataAnalyzeManager::getCurrentInstance()->removeWell(m_pNmWellData);
|
|
|
|
|
m_pGraphicBinder->removeWellData(m_pNmWellData);
|
|
|
|
|
|
|
|
|
|
if (m_pNmWellData != nullptr)
|
|
|
|
|
{
|
|
|
|
|
m_pNmWellData = nullptr;
|
|
|
|
|
}
|
|
|
|
|
m_pNmWellData = pReturnWellData;
|
|
|
|
|
nmDataAnalyzeManager::getCurrentInstance()->appendNmWellData(m_pNmWellData);
|
|
|
|
|
m_pGraphicBinder->appendWellData(m_pNmWellData);
|
|
|
|
|
m_pGraphicBinder->updateWellDataMapping(this, m_pNmWellData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nmDataAnalyzeManager::getCurrentInstance()->notifyDataChanged();
|
|
|
|
|
if (m_pGraphicBinder) {
|
|
|
|
|
m_pGraphicBinder->notifyDataChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this->update();
|
|
|
|
|
}
|
|
|
|
|
@ -551,6 +563,10 @@ const QString& nmObjPointWell::getWellID() const
|
|
|
|
|
|
|
|
|
|
void nmObjPointWell::paintBack(QPainter* painter, const ZxPaintParam& param)
|
|
|
|
|
{
|
|
|
|
|
if (m_pGraphicBinder) {
|
|
|
|
|
m_pGraphicBinder->syncWellData(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_pWellData == nullptr) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -747,7 +763,9 @@ void nmObjPointWell::paintBack(QPainter* painter, const ZxPaintParam& param)
|
|
|
|
|
|
|
|
|
|
void nmObjPointWell::removeData()
|
|
|
|
|
{
|
|
|
|
|
nmDataAnalyzeManager::getCurrentInstance()->removeWell(m_pNmWellData);
|
|
|
|
|
if (m_pGraphicBinder) {
|
|
|
|
|
m_pGraphicBinder->removeWellBinding(this);
|
|
|
|
|
}
|
|
|
|
|
m_pNmWellData = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -755,16 +773,18 @@ void nmObjPointWell::setNmWellData(nmDataWellBase* wellData)
|
|
|
|
|
{
|
|
|
|
|
// 如果是外界设置了当前图元绑定的井数据,则不需要再次在afterCreated()函数中再次设置数据
|
|
|
|
|
m_bSelectWell = false;
|
|
|
|
|
QString wellClass = m_pWellData->getWellClassEn();
|
|
|
|
|
m_pNmWellData = wellData;
|
|
|
|
|
|
|
|
|
|
m_pNmWellData = wellData;
|
|
|
|
|
if (m_pWellData) {
|
|
|
|
|
QString wellClass = m_pWellData->getWellClassEn();
|
|
|
|
|
|
|
|
|
|
if(ZxBaseUtil::isSameStr(wellClass, "VerticalWell")) {
|
|
|
|
|
m_enumWellType = NM_WELL_MODEL::Vertical_Well;
|
|
|
|
|
} else if(ZxBaseUtil::isSameStr(wellClass, "VerticalFracturedWell")) {
|
|
|
|
|
m_enumWellType = NM_WELL_MODEL::Vertical_Fractured_Well;
|
|
|
|
|
} else if(ZxBaseUtil::isSameStr(wellClass, "HorizontalFracturedWell")) {
|
|
|
|
|
m_enumWellType = NM_WELL_MODEL::Horizontal_Fractured_Well;
|
|
|
|
|
if(ZxBaseUtil::isSameStr(wellClass, "VerticalWell")) {
|
|
|
|
|
m_enumWellType = NM_WELL_MODEL::Vertical_Well;
|
|
|
|
|
} else if(ZxBaseUtil::isSameStr(wellClass, "VerticalFracturedWell")) {
|
|
|
|
|
m_enumWellType = NM_WELL_MODEL::Vertical_Fractured_Well;
|
|
|
|
|
} else if(ZxBaseUtil::isSameStr(wellClass, "HorizontalFracturedWell")) {
|
|
|
|
|
m_enumWellType = NM_WELL_MODEL::Horizontal_Fractured_Well;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -775,5 +795,10 @@ nmDataWellBase* nmObjPointWell::getNmWellData()
|
|
|
|
|
|
|
|
|
|
void nmObjPointWell::onObjVisibleChanged(bool bIsVisible)
|
|
|
|
|
{
|
|
|
|
|
m_pNmWellData->setPlotVisible(bIsVisible);
|
|
|
|
|
if (m_pGraphicBinder) {
|
|
|
|
|
nmDataWellBase* pData = m_pGraphicBinder->getWellDataFor(this);
|
|
|
|
|
if (pData) {
|
|
|
|
|
pData->setPlotVisible(bIsVisible);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|