refactor(nmSubWxs): 精简编辑井轨迹视图控件

- 增加3D视图入口可见性接口
- 在新版编辑井对话框中隐藏未实现的3D视图
- 完整移除重复的手动刷新按钮及相关信号槽
- 保留参数变化后的轨迹自动刷新机制
- 更新中文翻译资源
feature/refactor-well-editor-20260821
lh 3 weeks ago
parent ed2b90de03
commit 5c14f4e8e7

Binary file not shown.

@ -6294,7 +6294,6 @@ Average pressure in contour: %2 MPa</source>
<message><source>Zoom in</source><translation></translation></message> <message><source>Zoom in</source><translation></translation></message>
<message><source>Coordinates</source><translation></translation></message> <message><source>Coordinates</source><translation></translation></message>
<message><source>Edit wellbore</source><translation></translation></message> <message><source>Edit wellbore</source><translation></translation></message>
<message><source>Refresh</source><translation></translation></message>
<message><source>Edit perforations</source><translation></translation></message> <message><source>Edit perforations</source><translation></translation></message>
<message><source>New perforation</source><translation></translation></message> <message><source>New perforation</source><translation></translation></message>
<message><source>Delete perforation</source><translation></translation></message> <message><source>Delete perforation</source><translation></translation></message>

@ -897,6 +897,9 @@ class NM_SUB_WXS_EXPORT nmWxWellboreTrajectoryDisplay : public QWidget
// 设置当前要显示的井数据 // 设置当前要显示的井数据
void setCurrentWellboreData(nmDataWellBase* pWellData); void setCurrentWellboreData(nmDataWellBase* pWellData);
/** @brief 设置3D视图入口是否可见。 */
void set3DViewVisible(bool bVisible);
// 对当前可见视图设置模式和更新UI // 对当前可见视图设置模式和更新UI
void setEditWellMode(bool enabled); // 用于井筒轨迹编辑模式 void setEditWellMode(bool enabled); // 用于井筒轨迹编辑模式
void setPerforationEditMode(bool enabled); // 射孔编辑模式 void setPerforationEditMode(bool enabled); // 射孔编辑模式
@ -962,7 +965,6 @@ class NM_SUB_WXS_EXPORT nmWxWellboreTrajectoryDisplay : public QWidget
void onZoomInClicked(); // 放大 void onZoomInClicked(); // 放大
void onXYClicked(); // 坐标显示 void onXYClicked(); // 坐标显示
void onEditWellClicked(); // 编辑井筒轨迹(发出请求) void onEditWellClicked(); // 编辑井筒轨迹(发出请求)
void onRefreshClicked(); // 刷新当前轨迹视图
void onEditPerforationsClicked(); // 编辑射孔(发出请求) void onEditPerforationsClicked(); // 编辑射孔(发出请求)
void onNewPerforationClicked(); // 添加射孔段(发出请求) void onNewPerforationClicked(); // 添加射孔段(发出请求)
void onDeletePerforationClicked(); // 删除射孔段(发出请求) void onDeletePerforationClicked(); // 删除射孔段(发出请求)
@ -996,7 +998,6 @@ class NM_SUB_WXS_EXPORT nmWxWellboreTrajectoryDisplay : public QWidget
QAction *m_pZoomInAction; // 放大 QAction *m_pZoomInAction; // 放大
QAction *m_pXYAction; // 坐标显示 QAction *m_pXYAction; // 坐标显示
QAction *m_pEditWellAction; // 编辑井筒轨迹 QAction *m_pEditWellAction; // 编辑井筒轨迹
QAction *m_pRefreshAction; // 刷新当前轨迹视图
QAction *m_pEditPerforationsAction; // 编辑射孔 QAction *m_pEditPerforationsAction; // 编辑射孔
QAction *m_pNewPerforationAction; // 添加射孔段 QAction *m_pNewPerforationAction; // 添加射孔段
QAction *m_pDeletePerforationAction; // 删除射孔段 QAction *m_pDeletePerforationAction; // 删除射孔段

@ -415,6 +415,7 @@ void nmWxWellEditor::createUi()
// 第二步:右侧轨迹视图占据剩余空间,避免参数区拉伸破坏绘图比例。 // 第二步:右侧轨迹视图占据剩余空间,避免参数区拉伸破坏绘图比例。
m_pTrajectoryDisplay = m_pTrajectoryDisplay =
new nmWxWellboreTrajectoryDisplay(m_pMainSplitter); new nmWxWellboreTrajectoryDisplay(m_pMainSplitter);
m_pTrajectoryDisplay->set3DViewVisible(false);
m_pMainSplitter->addWidget(pParameterContainer); m_pMainSplitter->addWidget(pParameterContainer);
m_pMainSplitter->addWidget(m_pTrajectoryDisplay); m_pMainSplitter->addWidget(m_pTrajectoryDisplay);
m_pMainSplitter->setStretchFactor(0, 0); m_pMainSplitter->setStretchFactor(0, 0);

@ -4028,6 +4028,24 @@ void nmWxWellboreTrajectoryDisplay::setCurrentWellboreData(nmDataWellBase* pWell
m_pCrossSectionViewWidget->resetViewTransform(); m_pCrossSectionViewWidget->resetViewTransform();
} }
void nmWxWellboreTrajectoryDisplay::set3DViewVisible(bool bVisible)
{
if (m_p3DViewRadio == nullptr || m_pStackedWidget == nullptr)
{
return;
}
m_p3DViewRadio->setVisible(bVisible);
if (!bVisible && m_pStackedWidget->currentIndex() == 2)
{
// 隐藏当前3D页时返回俯视图保持选中状态、页面和工具栏一致。
m_pTopViewRadio->setChecked(true);
m_pStackedWidget->setCurrentIndex(0);
updateToolBarForCurrentView(0);
emit currentViewChanged(0);
}
}
void nmWxWellboreTrajectoryDisplay::setEditWellMode(bool enabled) void nmWxWellboreTrajectoryDisplay::setEditWellMode(bool enabled)
{ {
// 将状态传递给当前激活的子视图 // 将状态传递给当前激活的子视图
@ -4170,7 +4188,6 @@ void nmWxWellboreTrajectoryDisplay::createToolBar()
m_pXYAction = m_pToolBar->addAction(QIcon(sIconDir + "NmWellbore4.png"), tr("Coordinates")); m_pXYAction = m_pToolBar->addAction(QIcon(sIconDir + "NmWellbore4.png"), tr("Coordinates"));
m_pEditWellAction = m_pToolBar->addAction(QIcon(sIconDir + "NmWellbore5.png"), tr("Edit wellbore")); m_pEditWellAction = m_pToolBar->addAction(QIcon(sIconDir + "NmWellbore5.png"), tr("Edit wellbore"));
m_pRefreshAction = m_pToolBar->addAction(QIcon(sIconDir + "NmWellbore6.png"), tr("Refresh"));
m_pToolBar->addSeparator(); m_pToolBar->addSeparator();
// 第二步:射孔编辑命令按当前井型和视角动态启用。 // 第二步:射孔编辑命令按当前井型和视角动态启用。
@ -4213,8 +4230,6 @@ void nmWxWellboreTrajectoryDisplay::connectSignalsSlots()
connect(m_pZoomInAction, SIGNAL(triggered()), this, SLOT(onZoomInClicked())); connect(m_pZoomInAction, SIGNAL(triggered()), this, SLOT(onZoomInClicked()));
connect(m_pXYAction, SIGNAL(triggered()), this, SLOT(onXYClicked())); // XY 坐标显示仍然在视图内管理 connect(m_pXYAction, SIGNAL(triggered()), this, SLOT(onXYClicked())); // XY 坐标显示仍然在视图内管理
connect(m_pRefreshAction, SIGNAL(triggered()),
this, SLOT(onRefreshClicked()));
// ============== 模式请求信号连接 ============== // ============== 模式请求信号连接 ==============
// 这些槽函数现在将发出请求给控制器 // 这些槽函数现在将发出请求给控制器
@ -4414,12 +4429,6 @@ void nmWxWellboreTrajectoryDisplay::onEditWellClicked()
emit requestedEditWellMode(nCurrentViewIndex); emit requestedEditWellMode(nCurrentViewIndex);
} }
void nmWxWellboreTrajectoryDisplay::onRefreshClicked()
{
// 刷新只重读当前工作副本,不加载文件也不修改业务数据。
onWellboreDataChanged();
}
void nmWxWellboreTrajectoryDisplay::onEditPerforationsClicked() void nmWxWellboreTrajectoryDisplay::onEditPerforationsClicked()
{ {
int nCurrentViewIndex = m_pStackedWidget->currentIndex(); int nCurrentViewIndex = m_pStackedWidget->currentIndex();
@ -4514,7 +4523,6 @@ void nmWxWellboreTrajectoryDisplay::updateToolBarForCurrentView(int viewIndex)
m_pXYAction->setEnabled(true); m_pXYAction->setEnabled(true);
m_pEditWellAction->setEnabled(true); m_pEditWellAction->setEnabled(true);
m_pRefreshAction->setEnabled(true);
m_pEditPerforationsAction->setEnabled(true); m_pEditPerforationsAction->setEnabled(true);
m_pNewPerforationAction->setEnabled(true); m_pNewPerforationAction->setEnabled(true);
m_pDeletePerforationAction->setEnabled(true); m_pDeletePerforationAction->setEnabled(true);

Loading…
Cancel
Save