fix(nmSubWxs): 按初始井型设置井筒轨迹默认视图

- 直井和压裂直井默认显示截面视图
- 多段压裂水平井默认显示顶层视图
- 仅在打开编辑井时应用默认视图
- 切换井型时保留用户当前选择的视图
feature/refactor-well-editor-20260821
lh 2 weeks ago
parent 1852111c07
commit 6076eb79eb

@ -897,6 +897,9 @@ class NM_SUB_WXS_EXPORT nmWxWellboreTrajectoryDisplay : public QWidget
// 设置当前要显示的井数据
void setCurrentWellboreData(nmDataWellBase* pWellData);
/** @brief 按当前井型选择编辑井场景的默认视图。 */
void selectDefaultViewForCurrentWell();
/** @brief 设置3D视图入口是否可见。 */
void set3DViewVisible(bool bVisible);

@ -119,6 +119,7 @@ bool nmWxWellEditor::initialize(QString& sError)
}
m_pTrajectoryDisplay->setCurrentWellboreData(pWell);
createController();
m_pTrajectoryDisplay->selectDefaultViewForCurrentWell();
m_bInitialized = true;
m_pPressureFlowPage->setWell(pWell);

@ -4028,6 +4028,28 @@ void nmWxWellboreTrajectoryDisplay::setCurrentWellboreData(nmDataWellBase* pWell
m_pCrossSectionViewWidget->resetViewTransform();
}
void nmWxWellboreTrajectoryDisplay::selectDefaultViewForCurrentWell()
{
if (m_pDataWell == nullptr || m_pViewButtonGroup == nullptr ||
m_pStackedWidget == nullptr)
{
return;
}
// 多段压裂水平井优先展示平面分段,其余井型优先展示井深截面。
int nViewId = m_pDataWell->getWellType() ==
NM_WELL_MODEL::Horizontal_Fractured_Well ? 0 : 1;
QAbstractButton* pViewButton = m_pViewButtonGroup->button(nViewId);
if (pViewButton == nullptr)
{
return;
}
// 程序设置选中状态不会触发buttonClicked复用统一入口同步页面和工具栏。
pViewButton->setChecked(true);
onViewRadioButtonToggled(nViewId);
}
void nmWxWellboreTrajectoryDisplay::set3DViewVisible(bool bVisible)
{
if (m_p3DViewRadio == nullptr || m_pStackedWidget == nullptr)

Loading…
Cancel
Save