SymbolsLibraryFormat
last edited 4 years ago by mmarina
The Library of Symbols is .xml file.
The xml root is a tag '
The list of symbols are placed in tag '
Symbols Library file has following format:
<symbolsLibrary>
<symbols>
<!-- first element -->
<symbolItem icon="icon1.gif" name="SymbolName 1">
<description> The description of a symbol 1</description >
. . . the diagram of fist symbol . . .
</symbolItem>
<!-- second element -->
<symbolItem icon="icon2.gif" name="SymbolName 2">
<description> The description of a symbol 2</description >
. . . the diagram of second symbol . . .
</symbolItem>
. . . . . .
<!-- last element -->
<symbolItem icon="icon N.gif" name="SymbolName N">
<description> The description of a symbol N </description >
. . . the diagram of last symbol . . .
</symbolItem>
</symbols>
</symbolsLibrary>
Symbol format in the library:
<g type="symbol" name="SymbolName">
<g>
. . . Visual part of a symbol . . .
</g>
. . . inpins / outpins. . .
</g>
The symbol wraps by a tag '.
The first tag in structure of a symbol wraps up all tags drawing and a title of a symbol.
The others
For example:
<g type="symbol" name="SymbolName 1">
<g>
<path stroke="#000000" stroke-width="1" fill="#abcdef" d="M0,0 L0,60 L50,30Z" />
<text startOffset="0" y="33" x="5"> Symbol Title </text>
</g>
<g type="inpin" id="2" transform="translate(0 19)">
<path class="emptyPin" d="M-10,3 L-16,3 L-16,-3 L-10,-3 L-10,3 M-10,0 L0,0Z" />
<text class="pinTextStyle" startOffset="0" y="4" x="-28">2</text>
</g>
<g type="inpin" id="1" transform="translate(0 40)">
<path class="emptyPin" d="M-10,3 L-16,3 L-16,-3 L-10,-3 L-10,3 M-10,0 L0,0Z" />
<text class="pinTextStyle" startOffset="0" y="4" x="-28">1</text>
</g>
<g type="outpin" id="3" transform="translate(50 30)">
<path class="emptyPin" d="M0,0 L10,0 M10,-3 L16,-3 L16,3 L10,3 L10,-3Z" />
<text class="pinTextStyle" startOffset="0" y="5" x="-50">3</text>
</g>
</g>
Example:
<symbolsLibrary>
<symbols>
<symbol icon="icon1.gif" name="Element AND">
<description> Logic element AND </description >
<g type="symbol" name="Element AND">
<g>
<path stroke="#000000" stroke-width="1" fill="#abcdef" d="M0,0 L0,60 L50,30Z" />
<text startOffset="0" y="33" x="5"> AND</text>
</g>
<g type="inpin" id="2" transform="translate(0 19)">
<path class="emptyPin" d="M-10,3 L-16,3 L-16,-3 L-10,-3 L-10,3 M-10,0 L0,0Z" />
<text class="pinTextStyle" startOffset="0" y="4" x="-28">2</text>
</g>
<g type="inpin" id="1" transform="translate(0 40)">
<path class="emptyPin" d="M-10,3 L-16,3 L-16,-3 L-10,-3 L-10,3 M-10,0 L0,0Z" />
<text class="pinTextStyle" startOffset="0" y="4" x="-28">1</text>
</g>
<g type="outpin" id="3" transform="translate(50 30)">
<path class="emptyPin" d="M0,0 L10,0 M10,-3 L16,-3 L16,3 L10,3 L10,-3Z" />
<text class="pinTextStyle" startOffset="0" y="5" x="-50">3</text>
</g>
</g>
</symbol>
<symbol icon="icon2.gif" name="Element OR">
<description> Logic element OR </description >
<g type="symbol" name="Element OR">
<g>
<path stroke="#000000" stroke-width="1" fill="#aaccff" d="M0,0 L0,60 L50,30Z" />
<text startOffset="0" y="33" x="5"> OR </text>
</g>
<g type="inpin" id="2" transform="translate(0 19)">
<path class="emptyPin" d="M-10,3 L-16,3 L-16,-3 L-10,-3 L-10,3 M-10,0 L0,0Z" />
<text class="pinTextStyle" startOffset="0" y="4" x="-28">2</text>
</g>
<g type="inpin" id="1" transform="translate(0 40)">
<path class="emptyPin" d="M-10,3 L-16,3 L-16,-3 L-10,-3 L-10,3 M-10,0 L0,0Z" />
<text class="pinTextStyle" startOffset="0" y="4" x="-28">1</text>
</g>
<g type="outpin" id="3" transform="translate(50 30)">
<path class="emptyPin" d="M0,0 L10,0 M10,-3 L16,-3 L16,3 L10,3 L10,-3Z" />
<text class="pinTextStyle" startOffset="0" y="5" x="-50">3</text>
</g>
</g>
</symbol>
. . . . . . . . . . . . . . . . . . . . . . .
<symbol icon="icon6.gif" name="Accumulator">
<description> Arithmetical element accumulator </description >
<g type="symbol" name="Accumulator">
<g>
<path stroke="#000000" stroke-width="1" fill="#ffbbdd" d="M0,0 L0,60 L50,30Z" />
<text startOffset="0" y="33" x="5"> ADD</text>
</g>
<g type="inpin" id="2" transform="translate(0 19)">
<path class="emptyPin" d="M-10,3 L-16,3 L-16,-3 L-10,-3 L-10,3 M-10,0 L0,0Z" />
<text class="pinTextStyle" startOffset="0" y="4" x="-28">2</text>
</g>
<g type="inpin" id="1" transform="translate(0 40)">
<path class="emptyPin" d="M-10,3 L-16,3 L-16,-3 L-10,-3 L-10,3 M-10,0 L0,0Z" />
<text class="pinTextStyle" startOffset="0" y="4" x="-28">1</text>
</g>
<g type="outpin" id="3" transform="translate(50 30)">
<path class="emptyPin" d="M0,0 L10,0 M10,-3 L16,-3 L16,3 L10,3 L10,-3Z" />
<text class="pinTextStyle" startOffset="0" y="5" x="-50">3</text>
</g>
</g>
</symbol>
</symbols>
</symbolsLibrary>