Enhance interconnection views with distinct connectors and port labels#22
Merged
Merged
Conversation
…n views Bump DemaConsulting.Rendering.* packages from 0.1.0-beta.4 to 0.1.0-beta.5 and adopt the new port and parallel-edge APIs: - InterconnectionViewLayoutStrategy now sets CoreOptions.MergeParallelEdges to false, so multiple distinct connect usages between the same two parts each render as their own routed, individually labeled connector instead of collapsing into a single aggregated line. - Connector endpoints now carry real SysML port names (e.g. J40, encoder) as LayoutPort ExternalLabel text instead of always being null. - ResolveEndpoint now resolves the full dotted endpoint path instead of only the head segment, so nested/cross-boundary references resolve to the correct port label at any depth. Note: the connector line itself still terminates at the containing box's boundary rather than routing into the nested part; this remaining limitation is documented honestly in the design doc and ROADMAP.md. - LayeredPlacement.Place gained an additive, default-true mergeParallelEdges parameter; existing callers (ActionFlowViewLayoutStrategy, StateTransitionViewLayoutStrategy) are unaffected. - GeneralViewLayoutStrategy now explicitly sets MergeParallelEdges = false to preserve its prior parallel-edge behavior after the beta.5 bump changed the underlying algorithm's default. Updated design docs, verification docs, reqstream requirements, the user guide, and tests (including new coverage for parallel connections, port labeling, and cross-boundary label resolution). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Beta.6 fixes the root-container leaf-box title-centering regression (title now correctly stays pinned at the top instead of centering mid-canvas and overlapping connector lines). Verified via re-render of the 3-axis gantry interconnection view. Port-label/title collisions on individual part boxes remain, as expected - InterconnectionViewLayoutStrategy still constructs raw LayoutPort records instead of using Rendering's LayoutGraphPort object model, so the new ContentInset collision-avoidance does not yet apply to those labels. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Two integration fixes for InterconnectionViewLayoutStrategy that were never adapted to newer DemaConsulting.Rendering.Layout (beta.5+) capabilities: 1. Root container box now nests its content as Children (matching the existing MakePartBox pattern for nested containers) instead of appending interior.Content as flat sibling nodes. This resolves the underlying inconsistency that caused beta.6's leaf-title-centering heuristic to require a workaround for the root box specifically. 2. LayeredPlacement gains an additive PlaceWithPorts method that uses Rendering's first-class LayoutGraphPort object model (LayoutGraphNode .Ports.AddPort + ExternalLabel, LayoutGraph.AddEdge accepting node or port) instead of manually computing port positions and part box heights from the stale MinPortSlot/ConnectorClearance constants (removed). The engine now auto-sizes boxes and auto-positions ports, eliminating port-label/title collisions (e.g. "encoder"/"OptoSensor" overlapping "StepperMotorX : StepperMotor", J67/J40 hidden under "LBO3AxisGantry" title) and cramped port spacing on high-degree boxes (9-port LBO3AxisGantry). Port placement requires setting HasLabel/ HasKeyword on graph nodes so the engine's title-vs-port reservation activates (keyed on Label/Keyword nullness, not a TitleHeight property). Port-to-connector correlation uses LayoutPort.SourcePort reference identity, correctly handling parallel edges between the same two boxes. LayeredPlacement.Place(...) remains byte-for-byte unchanged; Action FlowViewLayoutStrategy, StateTransitionViewLayoutStrategy, and GeneralViewLayoutStrategy are unaffected. Verified via build.ps1 (0 warnings/errors, all tests green across net8.0/9.0/10.0), lint.ps1, fix.ps1, and rendering C:\temp\3AxisGantry_test.sysml to SVG/PNG with direct coordinate inspection confirming no port-label/title overlaps, adequate port spacing, correct root title pinning, and distinct parallel connectors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Showcases the newly-fixed interconnection-view capability: three independent, named-port connections between the same two parts, each routed as its own distinct connector rather than collapsing onto a shared route, with labels on both ends and boxes auto-sized to keep port labels clear of their own titles. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
'multiport' (no hyphen) in the filename tripped the spell-checker; rename to the hyphenated 09-motor-controller-multi-port.sysml consistent with the gallery README's already-hyphenated prose, and update the README's cross-reference link. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to the interconnection view layout strategy, focusing on more accurate cross-boundary connector labeling, improved port handling, and the preservation of parallel connections. It also updates the underlying layout engine interface to better support port-aware routing and labeling. Documentation has been updated to reflect these changes, clarifying both new behaviors and remaining limitations.
Interconnection View: Cross-boundary Labeling and Port Handling
InterconnectionViewLayoutStrategynow resolves the full dotted reference for connection endpoints (e.g.,board.cpu) and uses the nested segment as a port label, so connectors display the true target name at the port, even for cross-boundary references. The connector itself still terminates at the container boundary (not the inner part), and the limitation is documented. [1] [2] [3]LayeredPlacement.EdgePortRefandLayoutGraphPort.ExternalLabel), and endpoints without a nested segment remain unlabeled, preserving prior behavior.Layout Engine Interface and Data Model
LayeredPlacementhelper now exposes port-aware placement viaPlaceWithPorts, returning both placed rectangles and port locations, and disables parallel-edge merging by default for interconnection views. The data model and documentation are updated to describe new types (PlacedPortLayout,EdgePortRef,PortEdge). [1] [2]Documentation and Minor Updates
.cspell.yamlis updated to include "opto"/"Opto".