Plugin: End-Circuits
endcircuit.js
) allows to display SVG images for the internal
circuits of components. When cavities with end-circuit information or
wires connected to such cavities are selected, the corresponding
end-circuit images are displayed in the body of the component. The
end-circuit ports corresponding to the selected cavities are
highlighted.
End-Circuit SVG Images
End-circuits need to be available in Scalable Vector Graphics (SVG) format as files in the same directory as the EDB database. We require that the file names of the SVG images do not contain spaces, commas, and semicolons.
Every SVG file can be referenced by an arbitrary number of components, e.g., if multiple ECUs have the same end-circuits, they can share the same SVG files. Each component can refer to several end-circuit files, each showing the relevant part for a cavity or a group of related cavities. Splitting the internals of an ECU component into several parts has the advantage that EEvision can display the relevant end-circuit part of the selected pins only, leading to clearer schematics.
For connecting the end-circuit image to the component's cavities, placeholder strings in the SVG image are used. We support two different kinds of placeholders:
-
Port names are replaced with the name of the connector and cavity
they are connected to. Port names always start with an exclamation mark
and consist otherwise only of capital letters and digits. For instance,
the string
!INPUT
is such a port name. If it is connected in the EDB with cavity1
of connectorA
, then the string!INPUT
is replaced by EEvision withA-1
and a shape denoting the signal direction (if available in the EDB). -
Parameters are replaced by values defined in the EDB database.
For instance, if two end-circuits differ only by the value of resistors
and capacitors, these values can be modeled as parameters that are
replaced with the concrete values. This mechanism allows to use a single
SVG file for both instantiations. Parameters can also be used for
internationalization: If all language-specific strings are replaced by
parameters, the EDB can provide the translation for the selected
language. Parameter strings start with a space plus a question mark and
contain otherwise only capital letters and digits. For instance,
␣?RES1
is a valid parameter string.
Below we present examples of end-circuit SVG files with port names and parameter strings.
Highlighting in End-circuit Images
The plugin supports highlighting of end-circuit parts connected to a
selected pin. For this purpose a simple color coding scheme is used: All
parts of the end-circuit that have the same color as a port string (of the
form !PORT
) are highlighted (with the Nlview selection color)
when a pin connected to that port is selected. The colors of ports that
are not connected to a selected pin are replaced by black. The remaining
colors in the image are not changed.
Specification of End-Circuits in the EDB
For connecting a cavity to an end-circuit, the cavity needs to have an
attribute with the name “␣ecfile
” (with a
leading space, indicating that the attribute is an internal attribute to
EEvision). The value of this attribute is a semicolon-separated list of
connection data.
Each piece of connection data is a list of four entries that are separated with commas; in case of only one connection the attribute looks as follows:
␣ecfile = filename,instID,portname,direction
The four fields have the following meaning:
-
filename
is the name of the SVG file with the end-circuit. The extension.svg
can be omitted. -
instID
Multiple instances of the same SVG file can be used in the same component. For instance, if a component contains four fuses and the corresponding SVG file depicts a single fuse, we can instantiate it four times. Each instance then gets a different instance ID that is unique within the component. The instance ID can be an arbitrary string consisting of digits and letters. See below for examples how to use multiple instances in one component. -
portname
is the name of the port in the SVG image which the cavity is connected. The leading exclamation mark is omitted, i.e., if in the SVG image the port is named!INPUT
, then the port name in the “␣ecfile
” attribute is simplyINPUT
. -
direction
For replacing the port names and drawing the correct port symbols, we need to know position of the port name w.r.t. the corresponding signal line. Possible values are-
left
– the port name is left of the corresponding line; right
– the port name is right of the line;-
top
– the port name is vertically above the line; -
bottom
– the port name is vertically below the line.
-
For parameter substitution, the cavity attributes whose name start with
“␣?
” are used: If the cavity has an attribute
␣?RES1 = 10 Ω
then the parameter ?RES1
in
the SVG image is replaced with the value 10 Ω
in all
end-circuit instances the cavity is connected to. It is sufficient to
specify the attribute once at a single cavity. However, if the attribute
is repeated at multiple cavities connected to the same end-circuit
instance, the values of all repetitions must be consistent.
If a cavity is connected to multiple end-circuit instances, but the parameter should be substituted only in some of them, the attribute name must include the instance ID, followed by a colon.
Assume that the end-circuit image opv.svg
contains a parameter
?RES
, denoting the value of a resistor. Further assume that a
cavity is connected to two instances of this end-circuit image:
␣ecfile = opv,1,IN,left;opv,2,IN,left
If ?RES
should be replaced with 100 Ω
in the first
instance, but 250 Ω
in the second, we can use the following
cavity attributes:
␣?1:RES = 100 Ω ␣?2:RES = 250 Ω
Examples
Example 1
Figure 1 shows a simple end-circuit example, where the ECU only references a single SVG file and each cavity of the ECU is connected to one port of the end-circuit.
Fig. 1(a): An end-circuit SVG file: opv.svg
Cavity | Attribute | Value |
---|---|---|
1 | ␣ecfile | opv,1,IN1,left |
␣?R1 | 10 kΩ | |
␣?R2 | 15 kΩ | |
␣?R3 | 20 kΩ | |
␣?R4 | 15 kΩ | |
␣?C1 | 5 μF | |
␣?C2 | 10 μF | |
2 | ␣ecfile | opv,1,IN2,left |
3 | ␣ecfile | opv,1,OUT1,right |
4 | ␣ecfile | opv,1,OUT2,right |
Fig. 1(b): The cavity attributes at component C1
,
connector A
Fig. 1(c): The resulting schematics when cavity 1
is selected
In Fig. 1(a), the SVG file is shown. The ports are named
!IN1
, !IN2
, !OUT1
, and !OUT2
. Note
that the port names all start with “!
”. The image
additionally contains six parameter strings: ?R1
, ...,
?R4
, ?C1
, and ?C2
. All parameter strings start
with “?
”. Note that all port names and parameter
strings consist – apart from “!
” and
“?
” – of capital letters and digits only.
The table in Fig. 1(b) lists the necessary attributes that connect
the SVG image with the ECU component. Each cavity needs an
“␣ecfile
” attribute; here all refer to the same
SVG file (opv.svg
). The file extension can be omitted. All refer
to the same instance of the end-circuit template. In the example, the
instance identifier is “1
”. The third entry is the
port name (IN1
, etc.) to which the cavity is connected; the
leading exclamation mark “!
” is omitted. Finally, the
“␣ecfile
” attribute specifies on which side of
the corresponding line in the SVG file the port is placed:
IN1
and IN2
are on the left, OUT1
and
OUT2
are on the right.
Additionally, the values of the parameters need to be specified. They can
be attached to an arbitrary cavity that is connected to the end-circuit
instance. Here we specified them at cavity 1
.
The resulting schematics is shown in Fig. 1(c). We obtain this result
when we select cavity 1
or the wire connected to it. We can see
that the port names have been replaced by the corresponding connector name
and cavity name. The shape of the generated port symbol depends on the
flags of the cavity: -in
, -out
, both -in
and
-out
, or no flag. Also all parameter have been replaced by their
value. Since cavity 1
is selected, the corresponding end-circuit
port A-1
is highlighted.
Example 2
A more complicated example is shown in Fig. 2. It uses three
end-circuit instances of two different SVG files trans.svg
and
opv2.svg
. The corresponding pin attributes are listed in the
following table. Note that we do not use parameter substitution here.
The file trans.svg
(see Fig. 2(a)) contains color-coded
ports. For instance, whenever a pin connected to port !IN1
is
selected, then all parts colored in red will be highlighted. All colors
(here: blue and green) of ports without a selected pin are replaced by
black. The remaining colors (here: violet for the transistor labels) are
not changed.
Fig. 2(a): Image file trans.svg
.
Fig. 2(b): Image file opv2.svg
.
Cavity | Attribute | Value |
---|---|---|
1 | ␣ecfile | opv2,3,IN2,left |
2 | ␣ecfile | trans,2,OUT,right |
4 | ␣ecfile | trans,1,IN1,left;trans,2,IN2,left;opv,3,IN1,left |
8 | ␣ecfile | trans,1,OUT,right |
9 | ␣ecfile | trans,1,IN1,left |
10 | ␣ecfile | trans,2,IN1,left |
11 | ␣ecfile | opv2,3,OUT2,right |
12 | ␣ecfile | trans,1,IN1,left;trans,2,IN1,left |
13 | ␣ecfile | opv2,3,OUT1,right |
Fig. 2(c): The ␣ecfile
attributes at the
cavities of component B46
in the EDB.
Fig. 2(d): The resulting schematics after selecting cavity
4
.
We have three end-circuit instances, two of the file
trans.svg
(with instance IDs 1
and 2
) and one
of opv2.svg
(with instance ID 3
). Cavity 4
is connected to three ports, cavity 12
to two ports.
Summary
The EEvision end-circuit plugin provides the following features:
- Several cavities can connect to the same end-circuit port.
- One cavity can connect to several end-circuit ports.
- The scale factor for different end-circuit SVGs is determined automatically from the font size of the port names. The SVG images are scaled such that the font size of the images are the same.
- Parameter substitution can be used for internationalization and adapting device parameters.
- If an SVG image has ports only on one side (left/right), we flip it if necessary such that the ports are on the same side as the majority of the cavities they are connected to.
- The port shape in the displayed image reflects the signal direction of the cavities (in/out/inout).
- We highlight the port connected to selected cavities. Multiple selections are supported.