[KiCad 7] Added SetExcludeEdgeLayer and SetSvgPrecision to GS
- To solve API differences
This commit is contained in:
parent
f0f889ec43
commit
86573a9e64
19
kibot/gs.py
19
kibot/gs.py
|
|
@ -575,3 +575,22 @@ class GS(object):
|
|||
cmd.insert(1, str(GS.global_kiauto_wait_start))
|
||||
cmd.insert(1, '--wait_start')
|
||||
return cmd, video_remove
|
||||
|
||||
@staticmethod
|
||||
def SetExcludeEdgeLayer(po, exclude_edge_layer):
|
||||
if not GS.ki7:
|
||||
po.SetExcludeEdgeLayer(exclude_edge_layer)
|
||||
elif not exclude_edge_layer:
|
||||
# Include the edge on all layers
|
||||
# Doesn't work in 7.0.0. Bug: https://gitlab.com/kicad/code/kicad/-/issues/13841
|
||||
include = pcbnew.LSET()
|
||||
include.addLayer(GS.board.GetLayerID('Edge.Cuts'))
|
||||
po.SetPlotOnAllLayersSelection(include)
|
||||
|
||||
@staticmethod
|
||||
def SetSvgPrecision(po, svg_precision):
|
||||
if GS.ki7:
|
||||
po.SetSvgPrecision(svg_precision)
|
||||
elif GS.ki6:
|
||||
po.SetSvgPrecision(svg_precision, False)
|
||||
# No ki5 equivalent
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
import os
|
||||
import re
|
||||
from pcbnew import (GERBER_JOBFILE_WRITER, PLOT_CONTROLLER, IsCopperLayer, F_Cu, B_Cu, Edge_Cuts, PLOT_FORMAT_HPGL,
|
||||
PLOT_FORMAT_GERBER, PLOT_FORMAT_POST, PLOT_FORMAT_DXF, PLOT_FORMAT_PDF, PLOT_FORMAT_SVG, LSET)
|
||||
PLOT_FORMAT_GERBER, PLOT_FORMAT_POST, PLOT_FORMAT_DXF, PLOT_FORMAT_PDF, PLOT_FORMAT_SVG)
|
||||
from .optionable import Optionable
|
||||
from .out_base import BaseOutput, VariantOptions
|
||||
from .error import PlotError, KiPlotConfigurationError
|
||||
|
|
@ -96,14 +96,7 @@ class AnyLayerOptions(VariantOptions):
|
|||
po.SetPlotValue(self.plot_footprint_values)
|
||||
po.SetPlotInvisibleText(self.force_plot_invisible_refs_vals)
|
||||
# Edge layer included or not
|
||||
if not GS.ki7:
|
||||
po.SetExcludeEdgeLayer(self.exclude_edge_layer)
|
||||
elif not self.exclude_edge_layer:
|
||||
# Include the edge on all layers
|
||||
# Doesn't work. A bug? https://gitlab.com/kicad/code/kicad/-/issues/13841
|
||||
include = LSET()
|
||||
include.addLayer(GS.board.GetLayerID('Edge.Cuts'))
|
||||
po.SetPlotOnAllLayersSelection(include)
|
||||
GS.SetExcludeEdgeLayer(po, self.exclude_edge_layer)
|
||||
if GS.ki5:
|
||||
po.SetPlotPadsOnSilkLayer(not self.exclude_pads_from_silkscreen)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -1087,11 +1087,10 @@ class PCB_PrintOptions(VariantOptions):
|
|||
pc = PLOT_CONTROLLER(GS.board)
|
||||
po = pc.GetPlotOptions()
|
||||
# Set General Options:
|
||||
po.SetExcludeEdgeLayer(True) # We plot it separately
|
||||
GS.SetExcludeEdgeLayer(po, True) # We plot it separately
|
||||
po.SetUseAuxOrigin(False)
|
||||
po.SetAutoScale(False)
|
||||
if GS.ki6:
|
||||
po.SetSvgPrecision(self.svg_precision, False)
|
||||
GS.SetSvgPrecision(po, self.svg_precision)
|
||||
# Helpers for force_edge_cuts
|
||||
if self.force_edge_cuts:
|
||||
edge_layer = LayerOptions.create_layer('Edge.Cuts')
|
||||
|
|
|
|||
|
|
@ -54,8 +54,7 @@ class SVGOptions(DrillMarks):
|
|||
if GS.ki5:
|
||||
po.SetLineWidth(FromMM(self.line_width))
|
||||
po.SetNegative(self.negative_plot)
|
||||
if GS.ki6:
|
||||
po.SetSvgPrecision(self.svg_precision, False)
|
||||
GS.SetSvgPrecision(po, self.svg_precision)
|
||||
|
||||
def read_vals_from_po(self, po):
|
||||
super().read_vals_from_po(po)
|
||||
|
|
|
|||
Loading…
Reference in New Issue