|
|
|
@ -11,6 +11,94 @@
|
|
|
|
#define DEBUG_UI(msg) OutputDebugStringA(QString("[UI] %1\n").arg(msg).toLocal8Bit().data())
|
|
|
|
#define DEBUG_UI(msg) OutputDebugStringA(QString("[UI] %1\n").arg(msg).toLocal8Bit().data())
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置某一行参数是否显示。隐藏时同步取消勾选并禁用,避免隐藏参数参与自动拟合。
|
|
|
|
|
|
|
|
void nmWxAutomaticFitting::setParameterRowVisible(QTableWidget* table, int row, bool visible)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!table || row < 0 || row >= table->rowCount()) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
table->setRowHidden(row, !visible);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QCheckBox* checkBox = qobject_cast<QCheckBox*>(table->cellWidget(row, 1));
|
|
|
|
|
|
|
|
if(checkBox) {
|
|
|
|
|
|
|
|
checkBox->setEnabled(visible);
|
|
|
|
|
|
|
|
if(!visible) {
|
|
|
|
|
|
|
|
checkBox->setChecked(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 隐藏参数行后重新整理序号,让界面看起来像删除了不需要的参数。
|
|
|
|
|
|
|
|
void nmWxAutomaticFitting::renumberVisibleParameterRows(QTableWidget* table)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!table) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int visibleIndex = 1;
|
|
|
|
|
|
|
|
for(int row = 0; row < table->rowCount(); ++row) {
|
|
|
|
|
|
|
|
if(table->isRowHidden(row)) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTableWidgetItem* item = table->item(row, 0);
|
|
|
|
|
|
|
|
if(!item) {
|
|
|
|
|
|
|
|
item = new QTableWidgetItem();
|
|
|
|
|
|
|
|
table->setItem(row, 0, item);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
item->setText(QString::number(visibleIndex++));
|
|
|
|
|
|
|
|
item->setTextAlignment(Qt::AlignCenter);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 根据当前模型类型控制参数显示:0-5行为通用参数,6-10行为随PVT模型变化的参数。
|
|
|
|
|
|
|
|
void nmWxAutomaticFitting::updateParameterVisibility(QTableWidget* table, NM_SOLVER_MODEL_TYPE eType)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!table) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int row = 0; row < table->rowCount(); ++row) {
|
|
|
|
|
|
|
|
setParameterRowVisible(table, row, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool showCt = false;
|
|
|
|
|
|
|
|
bool showCf = false;
|
|
|
|
|
|
|
|
bool showSwi = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch(eType) {
|
|
|
|
|
|
|
|
case SMT_Oil_ConstPvt:
|
|
|
|
|
|
|
|
case SMT_Water_ConstPvt:
|
|
|
|
|
|
|
|
// 常量PVT使用综合压缩系数Ct。
|
|
|
|
|
|
|
|
showCt = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SMT_Oil_VariablePvt:
|
|
|
|
|
|
|
|
case SMT_Water_VariablePvt:
|
|
|
|
|
|
|
|
case SMT_Gas_VariablePvt:
|
|
|
|
|
|
|
|
// 变化PVT使用岩石压缩系数Cf。
|
|
|
|
|
|
|
|
showCf = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SMT_Oil_Water_TwoPhase:
|
|
|
|
|
|
|
|
// 油水两相使用Cf,并且只有它需要初始含水饱和度Swi。
|
|
|
|
|
|
|
|
showCf = true;
|
|
|
|
|
|
|
|
showSwi = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
showCf = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setParameterRowVisible(table, 6, showCt); // Ct
|
|
|
|
|
|
|
|
setParameterRowVisible(table, 7, showCf); // Cf
|
|
|
|
|
|
|
|
setParameterRowVisible(table, 8, false); // Soi
|
|
|
|
|
|
|
|
setParameterRowVisible(table, 9, showSwi); // Swi
|
|
|
|
|
|
|
|
setParameterRowVisible(table, 10, false); // Sgi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
renumberVisibleParameterRows(table);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nmWxAutomaticFitting::nmWxAutomaticFitting(QWidget *parent)
|
|
|
|
nmWxAutomaticFitting::nmWxAutomaticFitting(QWidget *parent)
|
|
|
|
: iDlgBase(parent)
|
|
|
|
: iDlgBase(parent)
|
|
|
|
, m_autoFitterPSO(nullptr)
|
|
|
|
, m_autoFitterPSO(nullptr)
|
|
|
|
@ -274,6 +362,11 @@ void nmWxAutomaticFitting::setupParameterTable()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nmDataAnalyzeManager* pManager = nmDataAnalyzeManager::getCurrentInstance();
|
|
|
|
|
|
|
|
if(pManager) {
|
|
|
|
|
|
|
|
updateParameterVisibility(m_parameterTable, pManager->getSolverModelType());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 连接选择改变信号
|
|
|
|
// 连接选择改变信号
|
|
|
|
connect(m_parameterTable, SIGNAL(currentCellChanged(int, int, int, int)),
|
|
|
|
connect(m_parameterTable, SIGNAL(currentCellChanged(int, int, int, int)),
|
|
|
|
this, SLOT(onCellSelectionChanged(int, int, int, int)));
|
|
|
|
this, SLOT(onCellSelectionChanged(int, int, int, int)));
|
|
|
|
@ -430,17 +523,21 @@ void nmWxAutomaticFitting::onCellSelectionChanged(int currentRow, int currentCol
|
|
|
|
void nmWxAutomaticFitting::onReverseSelection()
|
|
|
|
void nmWxAutomaticFitting::onReverseSelection()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// 更新反选逻辑,包含所有参数
|
|
|
|
// 更新反选逻辑,包含所有参数
|
|
|
|
m_kCheckBox->setChecked(!m_kCheckBox->isChecked());
|
|
|
|
if(!m_parameterTable) {
|
|
|
|
m_sCheckBox->setChecked(!m_sCheckBox->isChecked());
|
|
|
|
return;
|
|
|
|
m_cCheckBox->setChecked(!m_cCheckBox->isChecked());
|
|
|
|
}
|
|
|
|
m_phiCheckBox->setChecked(!m_phiCheckBox->isChecked());
|
|
|
|
|
|
|
|
m_piCheckBox->setChecked(!m_piCheckBox->isChecked());
|
|
|
|
if(!m_parameterTable->isRowHidden(0)) m_kCheckBox->setChecked(!m_kCheckBox->isChecked());
|
|
|
|
m_hCheckBox->setChecked(!m_hCheckBox->isChecked());
|
|
|
|
if(!m_parameterTable->isRowHidden(1)) m_sCheckBox->setChecked(!m_sCheckBox->isChecked());
|
|
|
|
m_ctCheckBox->setChecked(!m_ctCheckBox->isChecked());
|
|
|
|
if(!m_parameterTable->isRowHidden(2)) m_cCheckBox->setChecked(!m_cCheckBox->isChecked());
|
|
|
|
m_cfCheckBox->setChecked(!m_cfCheckBox->isChecked());
|
|
|
|
if(!m_parameterTable->isRowHidden(3)) m_phiCheckBox->setChecked(!m_phiCheckBox->isChecked());
|
|
|
|
m_soiCheckBox->setChecked(!m_soiCheckBox->isChecked());
|
|
|
|
if(!m_parameterTable->isRowHidden(4)) m_piCheckBox->setChecked(!m_piCheckBox->isChecked());
|
|
|
|
m_swiCheckBox->setChecked(!m_swiCheckBox->isChecked());
|
|
|
|
if(!m_parameterTable->isRowHidden(5)) m_hCheckBox->setChecked(!m_hCheckBox->isChecked());
|
|
|
|
m_sgiCheckBox->setChecked(!m_sgiCheckBox->isChecked());
|
|
|
|
if(!m_parameterTable->isRowHidden(6)) m_ctCheckBox->setChecked(!m_ctCheckBox->isChecked());
|
|
|
|
|
|
|
|
if(!m_parameterTable->isRowHidden(7)) m_cfCheckBox->setChecked(!m_cfCheckBox->isChecked());
|
|
|
|
|
|
|
|
if(!m_parameterTable->isRowHidden(8)) m_soiCheckBox->setChecked(!m_soiCheckBox->isChecked());
|
|
|
|
|
|
|
|
if(!m_parameterTable->isRowHidden(9)) m_swiCheckBox->setChecked(!m_swiCheckBox->isChecked());
|
|
|
|
|
|
|
|
if(!m_parameterTable->isRowHidden(10)) m_sgiCheckBox->setChecked(!m_sgiCheckBox->isChecked());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void nmWxAutomaticFitting::onAlgorithmChanged(int index)
|
|
|
|
void nmWxAutomaticFitting::onAlgorithmChanged(int index)
|
|
|
|
|