feat: 阀门插入时把管线断开(短管),对应老代码里的 SplitWPipe #160

Merged
gjm merged 1 commits from company-desktop/company-desktop-computer/feat-aec-valve-break-pipe AGit into main 2026-10-31 13:01:16 +08:00
Collaborator

老代码是 TDbPipeLine::SplitWPipe + Add2Flange(都在 PipelineCmd 模块,我们链不到),
但它收尾时用的是 AecDbEwPipe::SetStartPoint/SetEndPoint 挪管端,按这个思路自己实现:

  • 取阀门两端接口 AecMInterfaces::GetInterface(0/1) 的 ptPos
  • 离管起点近的那端 -> 原管 end 缩到这里
  • 另一端 -> 克隆出来的新管 start 从这里开始(end 沿用原终点),新管入库
    add_aec_valve 新增 break_pipe(缺省 true),返回值带 pipe_split / split_error。
    注意 pipe 现在以 kForWrite 打开(要改端点),不能再以 kForRead 二次打开同一对象
    (第一版就是重复打开失败,导致 pipe_split 一直是 false)。

实测(R230 Debug,空图,DN100 管线 0->10000 在 x=5000 插闸阀):
pipe_split = true,query_aec_entities(type=pipe) 从 1 根变成 2 根(290 原管 + 320 新段)。

还没做:断口处的法兰对接(老代码 Add2Flange 按 DN/压力查 Plumbing.db 的
QueryFlangData/QueryGasketData 取法兰与垫片尺寸),下一步做,法兰可复用 add_aec_fitting。

老代码是 TDbPipeLine::SplitWPipe + Add2Flange(都在 PipelineCmd 模块,我们链不到), 但它收尾时用的是 AecDbEwPipe::SetStartPoint/SetEndPoint 挪管端,按这个思路自己实现: - 取阀门两端接口 AecMInterfaces::GetInterface(0/1) 的 ptPos - 离管起点近的那端 -> 原管 end 缩到这里 - 另一端 -> 克隆出来的新管 start 从这里开始(end 沿用原终点),新管入库 add_aec_valve 新增 break_pipe(缺省 true),返回值带 pipe_split / split_error。 注意 pipe 现在以 kForWrite 打开(要改端点),不能再以 kForRead 二次打开同一对象 (第一版就是重复打开失败,导致 pipe_split 一直是 false)。 实测(R230 Debug,空图,DN100 管线 0->10000 在 x=5000 插闸阀): pipe_split = true,query_aec_entities(type=pipe) 从 1 根变成 2 根(290 原管 + 320 新段)。 还没做:断口处的法兰对接(老代码 Add2Flange 按 DN/压力查 Plumbing.db 的 QueryFlangData/QueryGasketData 取法兰与垫片尺寸),下一步做,法兰可复用 add_aec_fitting。
company-desktop added 1 commit 2026-10-31 13:00:27 +08:00
老代码是 TDbPipeLine::SplitWPipe + Add2Flange(都在 PipelineCmd 模块,我们链不到),
但它收尾时用的是 AecDbEwPipe::SetStartPoint/SetEndPoint 挪管端,按这个思路自己实现:
- 取阀门两端接口 AecMInterfaces::GetInterface(0/1) 的 ptPos
- 离管起点近的那端 -> 原管 end 缩到这里
- 另一端 -> 克隆出来的新管 start 从这里开始(end 沿用原终点),新管入库
add_aec_valve 新增 break_pipe(缺省 true),返回值带 pipe_split / split_error。
注意 pipe 现在以 kForWrite 打开(要改端点),不能再以 kForRead 二次打开同一对象
(第一版就是重复打开失败,导致 pipe_split 一直是 false)。

实测(R230 Debug,空图,DN100 管线 0->10000 在 x=5000 插闸阀):
pipe_split = true,query_aec_entities(type=pipe) 从 1 根变成 2 根(290 原管 + 320 新段)。

还没做:断口处的法兰对接(老代码 Add2Flange 按 DN/压力查 Plumbing.db 的
QueryFlangData/QueryGasketData 取法兰与垫片尺寸),下一步做,法兰可复用 add_aec_fitting。
gjm approved these changes 2026-10-31 13:01:11 +08:00
gjm merged commit 6712187507 into main 2026-10-31 13:01:16 +08:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gjm/envi-code#160