Representation of a component (ECU, splice, eyelet, inliner, ...). Please see the EDB documentation for more information about the EDB object model; here every component contains a set of connectors, which in turn contain a set of cavities. This also holds for inline connectors (which in physical reality do not have a component) and splices/eyelets (which actually neither have connectors nor cavities).

Hierarchy (View Summary)

Accessors

  • get hierParent(): undefined | EdbComponent
  • If the component is an inner component of a component hierarchy, get the surrounding parent component.

    Returns undefined | EdbComponent

  • get id(): ObjectID
  • The unique EDB ID of the object.

    Returns ObjectID

  • get name(): undefined | string
  • The name of the object.

    Returns undefined | string

  • get otype(): ObjectType
  • The object type of the object.

    Returns ObjectType

  • get type(): EdbComponentType
  • The subtype of the component. For instance, for components the type can be either undefined, "ecu", "inliner", "splice", "eyelet", "svg", "hier", or "hbox".

    Returns EdbComponentType

Methods

  • Iterate over the attributes of an object.

    Returns Generator<[string, string | readonly string[]], void, any>

    for (const [name, value] of obj.attributes()) {
    if (typeof value === "string") {
    console.log(`${name} = ${value}`);
    } else {
    console.log(`${name} = [${value.join(", ")}]`);
    }
    }
  • Iterate over all connectors of a component.

    Returns Generator<EdbConnector, void, any>

    console.log(`Component ${comp.name} has connectors`);
    for (const conn of comp.connectors()) {
    console.log(` - ${conn.name}`);
    }
  • Get the value of an attribute.

    Parameters

    • name: string

      the name of the attribute.

    Returns undefined | string | string[]

    the value(s) of the attribute if it exists, or undefined if the object does not have an attribute with the given name. In case the object has multiple attributes with the same name, an array with the values is returned instead of a single string.