diff --git a/kibot/out_any_layer.py b/kibot/out_any_layer.py index 17452133..658aff16 100644 --- a/kibot/out_any_layer.py +++ b/kibot/out_any_layer.py @@ -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) diff --git a/tests/test_plot/test_gerber.py b/tests/test_plot/test_gerber.py index 981ff162..ac27ed86 100644 --- a/tests/test_plot/test_gerber.py +++ b/tests/test_plot/test_gerber.py @@ -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) diff --git a/tests/yaml_samples/gerber_sub_pcb.kibot.yaml b/tests/yaml_samples/gerber_sub_pcb.kibot.yaml new file mode 100644 index 00000000..18fc9da1 --- /dev/null +++ b/tests/yaml_samples/gerber_sub_pcb.kibot.yaml @@ -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