Documentation
¶
Overview ¶
Package mtip reads the HUDS XML an Open-MBEE MTIP export writes: the diagram records carrying each shown element's bounds and each connector's route, so a SysML v1 migration can lay out the views it writes. Model content in the file is ignored entirely; the export is a presentation augment, never a second model input.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector struct {
ID, Type string
Points []float64
// Ends are the element ids at the path's first and second end, "" when the
// record does not say; a symbol stream names them, the export does not.
Ends [2]string
}
Connector is one drawn edge's route, source to target, flattened as (x0, y0, x1, y1, …).
type Diagram ¶
type Diagram struct {
ID, Type, Name string // Name from attributes/attribute[key="name"]/attribute[key="value"], "" if absent
Placements []Placement // in key order
Connectors []Connector // in key order
Unsupported map[string]int // unknown relationship_metadata child tags, by tag
Malformed []string // per-record problems; the record part they name is skipped
}
Diagram is one exported diagram: the elements it shows placed, and its connectors routed.
type Export ¶
type Export struct {
MTIPVersion, CameoVersion, ExportTime string
Diagrams []Diagram // in file order
Records int // every <data> seen, for the mismatch message
}
Export is the diagram layer of one MTIP export.
func Parse ¶
Parse reads one HUDS export: the packet's metadata and every <data> record, keeping only the diagram records — those carrying an element placement list or a diagramConnector list. A document that is not well-formed XML fails with the position; one whose root is not <packet> is not a HUDS export and is refused, as is one with no root element at all.
type Placement ¶
type Placement struct {
ID, Type string
X, Y, Width, Height float64
// OnPath reports a shape the tool draws on a path symbol — an association
// end or connector end at the line's end — rather than as a node of its own.
OnPath bool
// HiddenCompartments names the compartment kinds the symbol suppresses
// (DiagramLayout's show… switches, sorted); only a symbol stream states them.
// UnsupportedCompartments are the suppressed compartments no kind answers to.
HiddenCompartments, UnsupportedCompartments []string
}
Placement is one shown element's box in pixels, y down from the top left.