Engineering Paper Component 편집기
계획된 Extension UI
이 페이지는 아직 production Flow surface에 연결되지 않은 Engineering Paper editor의 목표 동선을 설명합니다. 현재 Component target은 exact target/raw settings와 usage-derived 일부 port를 보존한 read-only unsupported Node로 열립니다. settings schema, Open editor와 document projection은 계획 범위입니다. host presentation은 Node presentation과 third-party UI의 contract_only V2입니다. 이 successor V2 release artifact bytes는 아직 없으므로 7-field ComponentRef는 contract-only non-resolvable member shape입니다. concrete digest나 exact ref를 만들어 설치·admit하는 절차는 아직 지원하지 않습니다.
Engineering Paper는 문서 작성 Extension이 제공하는 Component 하나라는 목표 계약입니다. 향후 PXFLOW에서 이 Component를 배치한 뒤 Node를 더블클릭하거나 Open editor를 눌러 편집기를 엽니다. Project의 일반 Report를 작성하고 Flow input/result를 연결하는 작업은 Report Workbench에서 진행합니다.
아래 절차는 contract-only 목표 동선입니다.
- Components → Available → Engineering Paper에서 Add to project를 누릅니다.
- Components → Installed에서 Engineering Paper의 Add를 누릅니다.
- upstream result를 Engineering Paper Node input에 연결합니다.
- Node를 더블클릭하고 Open editor를 누릅니다.
Section, Formula block과 Evidence table은 Engineering Paper Node의 편집기 안에서 추가하고 구성합니다. Canvas에는 이 문서 구성을 담은 Engineering Paper Node가 표시됩니다.
계획된 화면 구성
| UI 위치 | 하는 일 | 저장되는 곳 |
|---|---|---|
| Outline | section 순서와 문서 구조 탐색 | 현재 Node의 문서 초안 |
| 본문 | 문단, 값, 표와 설명 편집 | 현재 Node의 문서 초안 |
| Insert | section, 연결된 값, formula, evidence table 추가 | 현재 문서 위치 |
| Mapped inputs | 현재 Node에 연결된 input과 사용 위치 확인 | Canvas 연결과 문서 위치 |
| Preview document | 현재 문서 구성과 연결된 값 미리 보기 | 편집 중인 미리 보기 |
| Save | 문서 초안 저장 | 현재 Flow |
| Run in PXFLOW | PXFLOW로 돌아가 Validate·Save·Run | Run·Result |
편집기 상단에는 현재 Flow, Node와 template 이름을 함께 표시합니다. 같은 template을 여러 번 사용해도 각 Node의 연결과 문서 초안은 서로 구분됩니다.
계획된 Flow 결과 문서 projection
값을 Component에 보내는 연결은 PXFLOW Studio Canvas에서 만듭니다. 편집기는 현재 Node에 이미 연결된 값을 문서 안에 배치합니다.
- PXFLOW에서 이름 있는 upstream result를 Engineering Paper Node input에 연결합니다. 예:
check.results.check_result→design_report.inputs.design_result. - Node를 더블클릭해 편집기를 엽니다.
- 문서 위치를 선택하고 Insert → Mapped value를 누릅니다.
- 현재 Node input과 필요한 Record field를 고릅니다.
- 값, check, table 또는 evidence 표현을 선택하고 Insert를 누릅니다.
Canvas 연결에서 값이 Node로 들어오는 경로를 정하고, 편집기에서 들어온 값을 문서 어디에 보여 줄지 정합니다.
Extension SDK template 사용
Post-contract candidate
아래 document.input(...), non-empty settings={"template": ...}와 이에 따른 input 연결은 별도 versioned settings + port-projection 계약 뒤의 candidate입니다. 초기 successor V2는 component declaration.inputs에 고정된 port와 absent 또는 {} settings만 허용하며 Node instance에서 port를 추가하지 않습니다.
Extension SDK template은 문서 기본 구조와 input 표시 위치를 코드로 재사용할 때 사용합니다. @px.paper는 문서 작성 Extension이 제공하는 optional SDK extension입니다. 이 decorator는 재사용할 문서 template definition을 등록합니다. Flow module은 flow = px.Flow(...)와 top-level placement·wiring statement로 구성합니다.
# 계획된 dependency command — 현재 공개 CLI가 아님
pxlab dependency add engineering_paper@^1.0다음 Python fence 전체는 contract_only이며 current SDK에서 실행할 수 없는 candidate입니다. core Function 부분만 현재 facade의 일반 parameter annotation과 px.Results annotated field를 사용합니다. @px.paper, document.input(...), non-empty settings={"template": ...}와 그 input 연결이 남아 있으므로 fence 전체를 current 예제로 복사하면 안 됩니다.
이 예제는 contract_only 목표 문법이며, 현재 설치본에서는 실행 상태로 표시된 current 예제를 사용하세요.
from pipelinexlab import px
from engineering_paper import components as paper_components
class BeamCheckResults(px.Results):
utilization: float
passed: bool
@px.function(
key="check_beam",
version="1.0.0",
description="Checks one beam load against the design capacity.",
)
def check_beam(load: float) -> BeamCheckResults:
utilization = load / 500.0
return BeamCheckResults(
utilization=utilization,
passed=utilization <= 1.0,
)
@px.paper(
version="1.0.0",
title="RC beam design report",
description="Presents the beam check results as an engineering document.",
)
def rc_beam_report(document: px.Paper):
utilization = document.input("utilization", float, unit="1")
passed = document.input("passed", bool)
summary = document.section("summary", title="Design summary")
summary.result(
"utilization",
utilization,
description="Demand-to-resistance ratio.",
)
summary.result(
"passed",
passed,
description="Whether the beam check passes.",
)
flow = px.Flow(
"rc_beam_design",
label="RC beam design",
description="Checks a beam load and prepares an engineering document.",
)
load = flow.input("load", float, unit="kN", description="Factored beam load.")
check = flow.node("beam_check", check_beam)
paper = flow.node(
"design_report",
paper_components.engineering_paper,
settings={"template": rc_beam_report},
)
flow.connect(load, check.inputs.load)
flow.connect(check.results.utilization, paper.inputs.utilization)
flow.connect(check.results.passed, paper.inputs.passed)
flow.result(
"utilization",
check.results.utilization,
description="Beam demand-to-capacity utilization.",
)
flow.result(
"paper_document",
paper.results.document,
description="Generated engineering document.",
)| SDK | 화면 |
|---|---|
rc_beam_report | Component의 template 선택 항목 |
@px.function(key="check_beam", ...) | Definitions에서 관리하는 Project Function |
document.input("utilization", ...) · 후보 | 별도 승인 뒤 publish/materialization 시 고정할 declaration input; Node-instance port 아님 |
paper_components.engineering_paper | Components의 Engineering Paper 카드 |
flow.node("beam_check", check_beam) | Function Reference Node 하나 |
flow.node("design_report", ...) | Canvas의 한 Node instance |
flow.connect(..., paper.inputs.utilization) | upstream result → Component input 연결 |
flow.result("paper_document", paper.results.document) | Run이 저장할 Component-owned document artifact Result |
@px.paper template을 Component의 raw template setting에 지정하는 authoring bridge는 계획 범위입니다. 현재 flow.node(...)로 배치한 target은 read-only unsupported Node이며 placement, raw settings와 연결은 Flow가 보존합니다.
초기 successor V2에서는 declaration에 이미 고정된 port만 연결할 수 있습니다. Engineering Paper는 engineering_paper Component 정확히 하나이므로 input contract가 다른 template은 별도 versioned settings + port-projection 계약 전까지 unsupported입니다. 일반 package의 1:N 기능으로 별도 Engineering Paper Component를 만들지 않습니다. Add input과 instance-port materialization도 같은 계약이 승인된 뒤에 엽니다.
계획된 Formula block 문서 계산
Insert → Formula는 현재 문서의 표시·검토에 필요한 짧은 수식을 작성합니다. 입력값, 구조화된 식, 대입값, 결과와 check를 한 block에 보여 줍니다.
| 계산 범위 | 사용할 곳 |
|---|---|
| 현재 문서의 짧은 표시·검토 수식 | Engineering Paper editor의 Formula block |
| Flow에서 실행할 Project 계산 | explicit key를 가진 @px.function → Function Reference Node |
| Function 구현 안에서만 쓰는 보조 계산 | decorator 없는 Python def helper |
| Component 전용 화면과 setting이 있는 계산 | @px.component |
| 실행 순서와 typed 연결 | PXFLOW |
Formula block은 문서 안의 짧은 계산과 단위 확인에 사용합니다. 작성한 내용은 Engineering Paper Node의 문서 구성에 저장되고 해당 Node의 편집기에서 확인합니다.
Project Function source는 Node 안에서 직접 고치지 않습니다. Definitions → Functions → Open Function에서 사용 중인 모든 Node의 영향을 확인한 뒤 함께 갱신합니다. 현재 Node만 다른 계산을 사용해야 하면 Function을 Duplicate / Branch하고 그 Node의 target을 새 Function으로 바꿉니다.
계획된 Result 표시
Mapped result block은 현재 Engineering Paper Node input으로 들어온 계산 결과를 읽기 전용으로 보여 줍니다.
| 상태 | 의미 | 동작 |
|---|---|---|
| Current | 현재 저장 상태와 input으로 만든 Result | 값과 생성 근거 확인 |
| Stale | Flow나 input이 Result 뒤에 바뀜 | Open PXFLOW → Run |
| Missing | 아직 연결되지 않았거나 Result가 없음 | Canvas 연결과 Run 확인 |
| Component dependency required | 필요한 Component package가 필요함 | Add required package |
새 Run은 작성한 문단이나 표를 덮어쓰지 않습니다. mapped block이 가리키는 Result와 상태만 갱신합니다.
계획된 Component draft와 artifact
| 이름 | 생기는 시점 | 의미 |
|---|---|---|
| Document draft | editor에서 Save | 현재 Engineering Paper Node에 저장한 문서 초안 |
| Document artifact | 저장한 Flow를 Run | Engineering Paper Node가 typed Result로 만든 document artifact |
| PDF artifact | Document artifact의 Output에서 저장 | 전달·인쇄용 Extension 출력 |
Flow Run은 공개한 typed Result를 저장합니다. Engineering Paper Component는 일반 Node input 연결로 계산 Result를 받아 document artifact를 만들고, 사용자는 해당 Node의 Result에서 이를 확인합니다. 선택한 artifact의 Output은 PDF 미리 보기·저장·다운로드·인쇄를 제공합니다.
px.Report 또는 Report Workbench에서 만든 .pxreport는 이 Component artifact와 별도로 저장됩니다. Report에서 artifact를 사용할 때는 Report의 artifact 위치에 연결합니다.