mtip

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
}

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

func Parse(data []byte) (*Export, error)

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
}

Placement is one shown element's box in pixels, y down from the top left.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL