|
|
|
|
@ -9,6 +9,7 @@
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
|
#include <QGridLayout>
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
@ -45,6 +46,9 @@ nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent)
|
|
|
|
|
{
|
|
|
|
|
// 设置当前实例为静态指针
|
|
|
|
|
s_pCurrentInstance = this;
|
|
|
|
|
m_pResultWellGroup = nullptr;
|
|
|
|
|
m_pResultWellCombo = nullptr;
|
|
|
|
|
m_bFillingResultWellCombo = false;
|
|
|
|
|
|
|
|
|
|
// 初始化图标路径
|
|
|
|
|
m_sIconDir = QCoreApplication::applicationDirPath();
|
|
|
|
|
@ -65,6 +69,7 @@ nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent)
|
|
|
|
|
|
|
|
|
|
// 初始化所有UI组件
|
|
|
|
|
initMainOptionsGroup(); // 初始化主选项组
|
|
|
|
|
initResultWellGroup();
|
|
|
|
|
initOutputGroup(); // 初始化输出组 (新)
|
|
|
|
|
initAdvancedGroup(); // 初始化高级组 (新)
|
|
|
|
|
initTimeSteppingGroup(); // 初始化时间步进组
|
|
|
|
|
@ -73,6 +78,7 @@ nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent)
|
|
|
|
|
|
|
|
|
|
// 将各个组添加到滚动区域的布局中
|
|
|
|
|
pScrollLayout->addWidget(m_pMainOptionsGroup);
|
|
|
|
|
pScrollLayout->addWidget(m_pResultWellGroup);
|
|
|
|
|
pScrollLayout->addWidget(m_pOutputGroup);
|
|
|
|
|
pScrollLayout->addWidget(m_pAdvancedGroup);
|
|
|
|
|
pScrollLayout->addWidget(m_pTimeSteppingGroup);
|
|
|
|
|
@ -118,6 +124,85 @@ nmWxNumericalDesign::~nmWxNumericalDesign()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 外部刷新当前查看井下拉框
|
|
|
|
|
void nmWxNumericalDesign::notifyResultWellSelectorChanged(const QString& wellName)
|
|
|
|
|
{
|
|
|
|
|
if(s_pCurrentInstance == nullptr) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s_pCurrentInstance->fillResultWellCombo(wellName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化查看井结果切换控件
|
|
|
|
|
void nmWxNumericalDesign::initResultWellGroup()
|
|
|
|
|
{
|
|
|
|
|
m_pResultWellGroup = new QGroupBox(tr("View well result"), this);
|
|
|
|
|
QGridLayout* pGridLayout = new QGridLayout(m_pResultWellGroup);
|
|
|
|
|
|
|
|
|
|
QLabel* pCurrentWellLabel = new QLabel(tr("Current well:"), this);
|
|
|
|
|
m_pResultWellCombo = new QComboBox(this);
|
|
|
|
|
fillResultWellCombo();
|
|
|
|
|
|
|
|
|
|
pGridLayout->addWidget(pCurrentWellLabel, 0, 0, Qt::AlignLeft);
|
|
|
|
|
pGridLayout->addWidget(m_pResultWellCombo, 0, 1);
|
|
|
|
|
pGridLayout->setColumnStretch(0, 0);
|
|
|
|
|
pGridLayout->setColumnStretch(1, 1);
|
|
|
|
|
|
|
|
|
|
m_pResultWellGroup->setLayout(pGridLayout);
|
|
|
|
|
m_pResultWellGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 按参与计算井刷新下拉框
|
|
|
|
|
void nmWxNumericalDesign::fillResultWellCombo(const QString& selectedWellName)
|
|
|
|
|
{
|
|
|
|
|
if(m_pResultWellCombo == nullptr) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nmDataAnalyzeManager* pManager = nmDataAnalyzeManager::getCurrentInstance();
|
|
|
|
|
m_bFillingResultWellCombo = true;
|
|
|
|
|
m_pResultWellCombo->clear();
|
|
|
|
|
|
|
|
|
|
if(pManager == nullptr) {
|
|
|
|
|
m_pResultWellCombo->setEnabled(false);
|
|
|
|
|
m_bFillingResultWellCombo = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 使用本次参与计算的井
|
|
|
|
|
QVector<QPair<NM_WELL_MODEL, QString>> vecWellsOrder = pManager->getCalculationWells();
|
|
|
|
|
for(int i = 0; i < vecWellsOrder.size(); ++i) {
|
|
|
|
|
if(vecWellsOrder[i].first == NM_WELL_MODEL::Unknow_Well) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(m_pResultWellCombo->findText(vecWellsOrder[i].second) < 0) {
|
|
|
|
|
m_pResultWellCombo->addItem(vecWellsOrder[i].second);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString sCurrentWellName = selectedWellName;
|
|
|
|
|
if(sCurrentWellName.isEmpty()) {
|
|
|
|
|
nmDataWellBase* pCurrentWell = pManager->getCurWellData();
|
|
|
|
|
if(pCurrentWell != nullptr) {
|
|
|
|
|
sCurrentWellName = pCurrentWell->getWellName();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int nIndex = m_pResultWellCombo->findText(sCurrentWellName);
|
|
|
|
|
if(nIndex < 0 && m_pResultWellCombo->count() > 0) {
|
|
|
|
|
nIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(nIndex >= 0) {
|
|
|
|
|
m_pResultWellCombo->setCurrentIndex(nIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pResultWellCombo->setEnabled(m_pResultWellCombo->count() > 1);
|
|
|
|
|
m_bFillingResultWellCombo = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxNumericalDesign::initMainOptionsGroup()
|
|
|
|
|
{
|
|
|
|
|
m_pMainOptionsGroup = new QGroupBox(tr("Main options"), this);
|
|
|
|
|
@ -517,6 +602,7 @@ void nmWxNumericalDesign::setupConnections()
|
|
|
|
|
{
|
|
|
|
|
// 连接生成按钮的点击信号到槽函数
|
|
|
|
|
connect(m_pGenerateButton, SIGNAL(clicked()), this, SLOT(onGenerateClicked()));
|
|
|
|
|
connect(m_pResultWellCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onResultWellChanged(int)));
|
|
|
|
|
|
|
|
|
|
// 主选项组连接
|
|
|
|
|
// 连接齿轮图标按钮的槽函数
|
|
|
|
|
@ -596,6 +682,30 @@ void nmWxNumericalDesign::onTimeDependentCheck(bool checked)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 切换查看井后同步当前井,并刷新结果曲线
|
|
|
|
|
void nmWxNumericalDesign::onResultWellChanged(int index)
|
|
|
|
|
{
|
|
|
|
|
if(m_bFillingResultWellCombo || index < 0 || m_pResultWellCombo == nullptr) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString sWellName = m_pResultWellCombo->itemText(index);
|
|
|
|
|
if(sWellName.isEmpty()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nmDataAnalyzeManager* pManager = nmDataAnalyzeManager::getCurrentInstance();
|
|
|
|
|
if(pManager != nullptr) {
|
|
|
|
|
nmDataWellBase* pWellData = pManager->findWellByName(sWellName);
|
|
|
|
|
if(pWellData != nullptr) {
|
|
|
|
|
pManager->setCurWellData(pWellData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 复用主窗口已有的井结果刷新逻辑
|
|
|
|
|
emit sigResultWellChanged(sWellName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxNumericalDesign::onGenerateClicked()
|
|
|
|
|
{
|
|
|
|
|
updateDataFromUi();
|
|
|
|
|
@ -768,6 +878,7 @@ void nmWxNumericalDesign::onOptionsIconClicked()
|
|
|
|
|
// 刷新下侧参数栏
|
|
|
|
|
//emit sigIncludeWells();
|
|
|
|
|
nmWxParameterProperty::notifyUpdateTable();
|
|
|
|
|
fillResultWellCombo(sCurrentWell);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|