Skip to content
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

Open
amstan opened this issue Sep 4, 2020 · 0 comments
Open

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

amstan opened this issue Sep 4, 2020 · 0 comments
Labels
svg Stuff related to the svg output

Comments

@amstan
Copy link
Contributor

amstan commented Sep 4, 2020

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.

@amstan amstan added the svg Stuff related to the svg output label Sep 4, 2020
amstan added a commit that referenced this issue Sep 4, 2020
LEDs, Diodes and Inductors get better representation now.

Mitigates a little Issue #27
TEST=Try snippet from Issue #27; don't see netlistsvg crash anymore, but see a nice LED
TEST=servo_micro now has an inductor in the svg
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
svg Stuff related to the svg output
Projects
None yet
Development

No branches or pull requests

1 participant