Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Use of LED leads to for-pcbdl netlistsvg crash #27

@amstan

Description

@amstan

Thanks Alan for finding this!

For the following test file:

from pcbdl import *

pp3300 = Net("PP3300")

led = LED()
pp3300 << led.P1
Net("LED_K") << led.P2

You might get an error with the current https://github.com/amstan/netlistsvg/tree/for-pcbdl:

TypeError: Cannot read property '1' of undefined
    at Cell.renderAirwire (/home/amstan/Projects/netlistsvg/built/Cell.js:443:22)
    at /home/amstan/Projects/netlistsvg/built/Cell.js:338:23
    at Array.forEach (<anonymous>)
    at Cell.render (/home/amstan/Projects/netlistsvg/built/Cell.js:327:30)
    at /home/amstan/Projects/netlistsvg/built/drawModule.js:25:18
    at Array.map (<anonymous>)
    at Object.drawModule [as default] (/home/amstan/Projects/netlistsvg/built/drawModule.js:23:30)
    at /home/amstan/Projects/netlistsvg/built/index.js:57:61

This is due to this line: https://github.com/amstan/netlistsvg/blob/for-pcbdl/lib/Cell.ts#L464

Problems don't end there:

Looks like netlistsvg.py also outputs the json wrong for LEDs, even though netlistsvg will render it as a generic, we still output it as if it puts a skinned JellyBean (with pins named A and B). My netlistsvg modifications aren't reliable enough and it crashes when it looks a pin name and pin number syntax and doesn't find any because it's a generic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    svgStuff related to the svg output

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions