Added gerber.gerber_job_file option to control the gerber job file name.
This commit is contained in:
parent
63999aa009
commit
e2854ef524
|
|
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- filter_msg -> filter
|
||||
- error_number -> number
|
||||
- regexp -> regex
|
||||
- gerber.gerber_job_file option to control the gerber job file name.
|
||||
|
||||
## [0.5.0] - 2020-07-11
|
||||
### Changed
|
||||
|
|
|
|||
|
|
@ -381,6 +381,7 @@ Next time you need this list just use an alias, like this:
|
|||
- `exclude_edge_layer`: [boolean=true] do not include the PCB edge layer.
|
||||
- `exclude_pads_from_silkscreen`: [boolean=false] do not plot the component pads in the silk screen.
|
||||
- `force_plot_invisible_refs_vals`: [boolean=false] include references and values even when they are marked as invisible.
|
||||
- `gerber_job_file`: [string='%f-job.%x'] name for the gerber job file.
|
||||
- `gerber_precision`: [number=4.6] this the gerber coordinate format, can be 4.5 or 4.6.
|
||||
- `line_width`: [number=0.1] [0.02,2] line_width for objects without width [mm].
|
||||
- `plot_footprint_refs`: [boolean=true] include the footprint references.
|
||||
|
|
|
|||
|
|
@ -116,6 +116,8 @@ outputs:
|
|||
exclude_pads_from_silkscreen: false
|
||||
# [boolean=false] include references and values even when they are marked as invisible
|
||||
force_plot_invisible_refs_vals: false
|
||||
# [string='%f-job.%x'] name for the gerber job file
|
||||
gerber_job_file: '%f-job.%x'
|
||||
# [number=4.6] this the gerber coordinate format, can be 4.5 or 4.6
|
||||
gerber_precision: 4.6
|
||||
# [number=0.1] [0.02,2] line_width for objects without width [mm]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import os
|
|||
from pcbnew import (GERBER_JOBFILE_WRITER, PLOT_CONTROLLER, IsCopperLayer)
|
||||
from .out_base import (BaseOutput)
|
||||
from .error import (PlotError, KiPlotConfigurationError)
|
||||
from .gs import (GS)
|
||||
from .optionable import BaseOptions
|
||||
from .layer import Layer
|
||||
from kiplot.macros import macros, document # noqa: F401
|
||||
|
|
@ -87,12 +86,8 @@ class AnyLayerOptions(BaseOptions):
|
|||
jobfile_writer.AddGbrFile(id, os.path.basename(plot_ctrl.GetPlotFileName()))
|
||||
|
||||
if create_job:
|
||||
base_fn = os.path.join(
|
||||
os.path.dirname(plot_ctrl.GetPlotFileName()),
|
||||
os.path.basename(GS.pcb_file))
|
||||
base_fn = os.path.splitext(base_fn)[0]
|
||||
job_fn = base_fn+'-job.gbrjob'
|
||||
jobfile_writer.CreateJobFile(job_fn)
|
||||
job_fn = self.expand_filename(po.gerber_job_file, ext='gbrjob')
|
||||
jobfile_writer.CreateJobFile(os.path.abspath(os.path.join(output_dir, job_fn)))
|
||||
|
||||
def read_vals_from_po(self, po):
|
||||
# excludeedgelayer
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ class GerberOptions(AnyLayerOptions):
|
|||
self.create_gerber_job_file = True
|
||||
""" creates a file with information about all the generated gerbers.
|
||||
You can use it in gerbview to load all gerbers at once """
|
||||
self.gerber_job_file = '%f-job.%x'
|
||||
""" name for the gerber job file """
|
||||
self.use_gerber_x2_attributes = True
|
||||
""" use the extended X2 format """
|
||||
self.use_gerber_net_attributes = True
|
||||
|
|
@ -47,6 +49,7 @@ class GerberOptions(AnyLayerOptions):
|
|||
po.SetIncludeGerberNetlistInfo(self.use_gerber_net_attributes)
|
||||
po.SetUseAuxOrigin(self.use_aux_axis_as_origin)
|
||||
po.SetLineWidth(FromMM(self.line_width))
|
||||
setattr(po, 'gerber_job_file', self.gerber_job_file)
|
||||
|
||||
def read_vals_from_po(self, po):
|
||||
super().read_vals_from_po(po)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ def test_gerber_inner():
|
|||
|
||||
ctx.expect_out_file(ctx.get_gerber_filename('GND_Cu'))
|
||||
ctx.expect_out_file(ctx.get_gerber_filename('Signal1'))
|
||||
ctx.expect_out_file(ctx.get_gerber_job_filename())
|
||||
ctx.expect_out_file(os.path.join(GERBER_DIR, 'test-'+prj+'.gbrjob'))
|
||||
ctx.clean_up()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ outputs:
|
|||
use_protel_extensions: false
|
||||
gerber_precision: 4.6
|
||||
create_gerber_job_file: true
|
||||
gerber_job_file: 'test-%f.%x'
|
||||
use_gerber_x2_attributes: true
|
||||
use_gerber_net_attributes: false
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue