Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix KiCAD8 var names #209

Merged
merged 1 commit into from
Apr 28, 2024
Merged

Fix KiCAD8 var names #209

merged 1 commit into from
Apr 28, 2024

Conversation

jakeogh
Copy link
Contributor

@jakeogh jakeogh commented Apr 23, 2024

While trying to run a the README example for kicad8 (#179) I noticed the var names in kicad8/lib.py were wrong. It's still complaining about KICAD8_SYMBOL_DIR env var missing, is that user error?

$ cat test.py
#!/usr/bin/env python3

import os
import sys
from skidl import KICAD8
from skidl import set_default_tool
from skidl import lib_search_paths
from skidl import footprint_search_paths
from skidl import TEMPLATE
from skidl import Part
from skidl import Net
from skidl import generate_netlist
from skidl import generate_pcb

os.environ["KICAD8_SYMBOL_DIR"] = "/usr/share/kicad/symbols/"
set_default_tool(KICAD8)

lib_search_paths[KICAD8].append('/usr/share/kicad/symbols')
footprint_search_paths[KICAD8].append('/usr/share/kicad/footprints')
print(f"{footprint_search_paths=}", file=sys.stderr)

# Create part templates.
q = Part("Device", "Q_PNP_CBE", dest=TEMPLATE)
r = Part("Device", "R", dest=TEMPLATE)

# Create nets.
gnd, vcc = Net("GND"), Net("VCC")
a, b, a_and_b = Net("A"), Net("B"), Net("A_AND_B")

# Instantiate parts.
gndt = Part("power", "GND")             # Ground terminal.
vcct = Part("power", "VCC")             # Power terminal.
q1, q2 = q(2)                           # Two transistors.
r1, r2, r3, r4, r5 = r(5, value="10K")  # Five 10K resistors.

# Make connections between parts.
# ptlint:
a & r1 & q1["B C"] & r4 & q2["B C"] & a_and_b & r5 & gnd
b & r2 & q1["B"]
q1["C"] & r3 & gnd
vcc += q1["E"], q2["E"], vcct
gnd += gndt

generate_netlist()

$ ./test.py
WARNING: KICAD_SYMBOL_DIR environment variable is missing, so the default KiCad symbol libraries won't be searched. @ [/home/cfg/cad/skidl/bug_179/<frozen importlib._bootstrap_external>:940=>/home/cfg/cad/skidl/bug_179/<frozen importlib._bootstrap>:241]
WARNING: KICAD7_SYMBOL_DIR environment variable is missing, so the default KiCad symbol libraries won't be searched. @ [/home/cfg/cad/skidl/bug_179/<frozen importlib._bootstrap_external>:940=>/home/cfg/cad/skidl/bug_179/<frozen importlib._bootstrap>:241]
WARNING: KICAD8_SYMBOL_DIR environment variable is missing, so the default KiCad symbol libraries won't be searched. @ [/home/cfg/cad/skidl/bug_179/<frozen importlib._bootstrap_external>:940=>/home/cfg/cad/skidl/bug_179/<frozen importlib._bootstrap>:241]
WARNING: KICAD6_SYMBOL_DIR environment variable is missing, so the default KiCad symbol libraries won't be searched. @ [/home/cfg/cad/skidl/bug_179/<frozen importlib._bootstrap_external>:940=>/home/cfg/cad/skidl/bug_179/<frozen importlib._bootstrap>:241]
footprint_search_paths={'kicad': ['/home/user/.config/kicad'], 'kicad7': ['/home/user/.config/kicad'], 'kicad8': ['/home/user/.config/kicad', '/usr/share/kicad/footprints'], 'skidl': ['/home/user/.config/kicad'], 'kicad6': ['/home/user/.config/kicad'], 'spice': ['/home/user/.config/kicad']}
WARNING: Could not load KiCad schematic library "Device", falling back to backup library. @ [/home/cfg/cad/skidl/bug_179/example_from_readme_bug_179.py:23]
WARNING: Could not load KiCad schematic library "Device", falling back to backup library. @ [/home/cfg/cad/skidl/bug_179/example_from_readme_bug_179.py:24]
WARNING: Could not load KiCad schematic library "power", falling back to backup library. @ [/home/cfg/cad/skidl/bug_179/example_from_readme_bug_179.py:31]
WARNING: Could not load KiCad schematic library "power", falling back to backup library. @ [/home/cfg/cad/skidl/bug_179/example_from_readme_bug_179.py:32]
INFO: No errors or warnings found while generating netlist.


@jakeogh jakeogh changed the title Fix kicad8 var names Fix KiCad8 var names Apr 23, 2024
@jakeogh jakeogh changed the title Fix KiCad8 var names Fix KiCAD8 var names Apr 23, 2024
@devbisme devbisme merged commit 064c108 into devbisme:development Apr 28, 2024
@devbisme
Copy link
Owner

Thanks! I incorporated your fixes into the development branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants