[Any layer] Added support for sub-PCBs

This commit is contained in:
Salvador E. Tropea 2022-12-22 13:22:36 -03:00
parent d5570a1b07
commit c9aab5d4cc
3 changed files with 31 additions and 2 deletions

View File

@ -116,6 +116,8 @@ class AnyLayerOptions(VariantOptions):
def run(self, output_dir, layers):
super().run(output_dir)
# Apply the variants and filters
exclude = self.filter_pcb_components(GS.board)
# fresh plot controller
plot_ctrl = PLOT_CONTROLLER(GS.board)
# set up plot options for the whole output
@ -127,8 +129,6 @@ class AnyLayerOptions(VariantOptions):
if create_job:
jobfile_writer = GERBER_JOBFILE_WRITER(GS.board)
plot_ctrl.SetColorMode(True)
# Apply the variants and filters
exclude = self.filter_pcb_components(GS.board)
# Plot every layer in the output
generated = {}
layers = Layer.solve(layers)

View File

@ -8,6 +8,7 @@ pytest-3 --log-cli-level debug
"""
import os
import pytest
from . import context
from kibot.misc import PLOT_ERROR
from kibot.layer import Layer
@ -188,3 +189,16 @@ def test_gerber_protel_2(test_dir):
ctx.search_in_file_d('Report.txt', ['Top layer: good-project_F_Cu.GTL', 'Basename: good-project'])
ctx.test_compress_d(prj+'-result.tar.gz', files)
ctx.clean_up()
@pytest.mark.skipif(context.ki5(), reason="KiKit currently supports KiCad 6 only")
def test_gerber_sub_pcb_bp(test_dir):
""" Test a multiboard example """
prj = 'batteryPack'
ctx = context.TestContext(test_dir, prj, 'gerber_sub_pcb', GERBER_DIR)
ctx.run()
# Check all outputs are there
fname = prj+'-F_Cu_connector.gbr'
ctx.search_in_file_d(fname, [r'%ADD10C,4.000000\*%'])
ctx.search_not_in_file_d(fname, [r'%ADD10R,1.300000X0.450000\*%'])
ctx.clean_up(keep_project=True)

View File

@ -0,0 +1,15 @@
# Drills and Gerber drills
kibot:
version: 1
import:
- file: battery_pack_sub_pcbs.kibot.yaml
outputs:
- name: 'gerbers'
comment: "Gerbers for the Gerber god"
type: gerber
dir: gerberdir
options:
variant: default[connector]
layers: copper