From 82e4cba655beabc4c4c0d97634c7bd6235523dea Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 23 Mar 2020 01:06:04 -0300 Subject: [PATCH] Added inner layers check for the pdf_pcb_print type --- kiplot/kiplot.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kiplot/kiplot.py b/kiplot/kiplot.py index f0344a4c..314fe177 100644 --- a/kiplot/kiplot.py +++ b/kiplot/kiplot.py @@ -583,6 +583,16 @@ class Plotter(object): check_script(misc.CMD_PCBNEW_PRINT_LAYERS, misc.URL_PCBNEW_PRINT_LAYERS, '1.1.2') to = output.options.type_options + # Verify the inner layers + layer_cnt = board.GetCopperLayerCount() + for l in output.layers: + layer = l.layer + # for inner layers, we can now check if the layer exists + if layer.is_inner: + if layer.layer < 1 or layer.layer >= layer_cnt - 1: + raise PlotError( + "Inner layer {} is not valid for this board" + .format(layer.layer)) outdir = plot_ctrl.GetPlotOptions().GetOutputDirectory() cmd = [misc.CMD_PCBNEW_PRINT_LAYERS, '--output_name', to.output_name,