|
|
|
|
@ -23,7 +23,7 @@ nmReservoirParameterPage::nmReservoirParameterPage(
|
|
|
|
|
m_nCurrentObjectIndex(-1),
|
|
|
|
|
m_bUpdatingObject(false),
|
|
|
|
|
m_bBuildingFields(false),
|
|
|
|
|
m_pTitleLabel(nullptr),
|
|
|
|
|
m_pObjectDisplayGroup(nullptr),
|
|
|
|
|
m_pObjectLabel(nullptr),
|
|
|
|
|
m_pObjectComboBox(nullptr),
|
|
|
|
|
m_pGroupsWidget(nullptr),
|
|
|
|
|
@ -45,35 +45,31 @@ nmReservoirParameterPage::~nmReservoirParameterPage()
|
|
|
|
|
|
|
|
|
|
void nmReservoirParameterPage::createUi()
|
|
|
|
|
{
|
|
|
|
|
// 第一步:创建原型中的单层内容头,储层页自动隐藏对象选择器。
|
|
|
|
|
// 第一步:创建单行对象显示控制区,储层页自动隐藏该分组。
|
|
|
|
|
m_pMainLayout = new QVBoxLayout(this);
|
|
|
|
|
m_pMainLayout->setContentsMargins(8, 6, 8, 8);
|
|
|
|
|
m_pMainLayout->setSpacing(8);
|
|
|
|
|
|
|
|
|
|
QWidget* pHeaderWidget = new QWidget(this);
|
|
|
|
|
QHBoxLayout* pHeaderLayout = new QHBoxLayout(pHeaderWidget);
|
|
|
|
|
pHeaderLayout->setContentsMargins(8, 4, 8, 4);
|
|
|
|
|
pHeaderLayout->setSpacing(9);
|
|
|
|
|
m_pObjectDisplayGroup = new QGroupBox(tr("Object display"), this);
|
|
|
|
|
m_pObjectDisplayGroup->setSizePolicy(
|
|
|
|
|
QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
|
|
|
QHBoxLayout* pObjectLayout = new QHBoxLayout(m_pObjectDisplayGroup);
|
|
|
|
|
pObjectLayout->setContentsMargins(8, 15, 8, 8);
|
|
|
|
|
pObjectLayout->setSpacing(9);
|
|
|
|
|
|
|
|
|
|
m_pTitleLabel = new QLabel(categoryTitle(), pHeaderWidget);
|
|
|
|
|
pHeaderLayout->addWidget(m_pTitleLabel, 1);
|
|
|
|
|
|
|
|
|
|
m_pObjectLabel = new QLabel(objectSelectorLabel(), pHeaderWidget);
|
|
|
|
|
m_pObjectComboBox = new QComboBox(pHeaderWidget);
|
|
|
|
|
m_pObjectLabel = new QLabel(tr("Display:"), m_pObjectDisplayGroup);
|
|
|
|
|
m_pObjectLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
|
m_pObjectComboBox = new QComboBox(m_pObjectDisplayGroup);
|
|
|
|
|
m_pObjectComboBox->setMinimumWidth(260);
|
|
|
|
|
m_pObjectComboBox->setMaximumWidth(420);
|
|
|
|
|
m_pObjectComboBox->setMinimumHeight(27);
|
|
|
|
|
pHeaderLayout->addWidget(m_pObjectLabel);
|
|
|
|
|
pHeaderLayout->addWidget(m_pObjectComboBox);
|
|
|
|
|
// 储层页只有一个固定对象,顶部分类按钮已经说明当前页面,
|
|
|
|
|
// 不再重复显示无操作价值的页标题;其他页面保留对象选择区。
|
|
|
|
|
if (m_eCategory == NM_RESERVOIR_PAGE_RESERVOIR)
|
|
|
|
|
{
|
|
|
|
|
pHeaderWidget->hide();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_pMainLayout->addWidget(pHeaderWidget);
|
|
|
|
|
}
|
|
|
|
|
pObjectLayout->addStretch(1);
|
|
|
|
|
pObjectLayout->addWidget(m_pObjectLabel);
|
|
|
|
|
pObjectLayout->addWidget(m_pObjectComboBox);
|
|
|
|
|
pObjectLayout->addStretch(1);
|
|
|
|
|
m_pMainLayout->addWidget(m_pObjectDisplayGroup);
|
|
|
|
|
m_pObjectDisplayGroup->setVisible(
|
|
|
|
|
m_eCategory != NM_RESERVOIR_PAGE_RESERVOIR);
|
|
|
|
|
|
|
|
|
|
// 第二步:分组载体没有边框,仅用于实现原型中的两列网格。
|
|
|
|
|
m_pGroupsWidget = new QWidget(this);
|
|
|
|
|
@ -90,46 +86,6 @@ void nmReservoirParameterPage::createUi()
|
|
|
|
|
this, SLOT(slotObjectChanged(int)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString nmReservoirParameterPage::categoryTitle() const
|
|
|
|
|
{
|
|
|
|
|
switch (m_eCategory)
|
|
|
|
|
{
|
|
|
|
|
case NM_RESERVOIR_PAGE_RESERVOIR:
|
|
|
|
|
return tr("Reservoir parameters");
|
|
|
|
|
case NM_RESERVOIR_PAGE_WELL:
|
|
|
|
|
return tr("Well parameters");
|
|
|
|
|
case NM_RESERVOIR_PAGE_FAULT:
|
|
|
|
|
return tr("Fault parameters");
|
|
|
|
|
case NM_RESERVOIR_PAGE_FRACTURE:
|
|
|
|
|
return tr("Fracture parameters");
|
|
|
|
|
case NM_RESERVOIR_PAGE_COMPOSITE_REGION:
|
|
|
|
|
return tr("Composite region parameters");
|
|
|
|
|
case NM_RESERVOIR_PAGE_REGION_MARK:
|
|
|
|
|
return tr("Region mark parameters");
|
|
|
|
|
default:
|
|
|
|
|
return QString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString nmReservoirParameterPage::objectSelectorLabel() const
|
|
|
|
|
{
|
|
|
|
|
switch (m_eCategory)
|
|
|
|
|
{
|
|
|
|
|
case NM_RESERVOIR_PAGE_WELL:
|
|
|
|
|
return tr("Select well:");
|
|
|
|
|
case NM_RESERVOIR_PAGE_FAULT:
|
|
|
|
|
return tr("Select fault:");
|
|
|
|
|
case NM_RESERVOIR_PAGE_FRACTURE:
|
|
|
|
|
return tr("Select fracture:");
|
|
|
|
|
case NM_RESERVOIR_PAGE_COMPOSITE_REGION:
|
|
|
|
|
return tr("Select composite region:");
|
|
|
|
|
case NM_RESERVOIR_PAGE_REGION_MARK:
|
|
|
|
|
return tr("Select region mark:");
|
|
|
|
|
default:
|
|
|
|
|
return tr("Select object:");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool nmReservoirParameterPage::reloadObjects(QString& sError)
|
|
|
|
|
{
|
|
|
|
|
// 第一步:重新取得会话对象描述,并把稳定对象code放入UserRole。
|
|
|
|
|
@ -148,8 +104,7 @@ bool nmReservoirParameterPage::reloadObjects(QString& sError)
|
|
|
|
|
m_bUpdatingObject = false;
|
|
|
|
|
|
|
|
|
|
bool bShowSelector = m_eCategory != NM_RESERVOIR_PAGE_RESERVOIR;
|
|
|
|
|
m_pObjectLabel->setVisible(bShowSelector);
|
|
|
|
|
m_pObjectComboBox->setVisible(bShowSelector);
|
|
|
|
|
m_pObjectDisplayGroup->setVisible(bShowSelector);
|
|
|
|
|
|
|
|
|
|
// 第二步:构建首个对象;空分类显示无额外面板的空状态。
|
|
|
|
|
return buildObject(m_listObjectInfos.isEmpty() ? -1 : 0, sError);
|
|
|
|
|
|