← Back to team overview

kicad-developers team mailing list archive

Re: Proposal for batch plotting

 

On Sat, Aug 04, 2012 at 07:40:15PM +0200, jean-pierre charras wrote:
> With all the code made by Dick, S expression is even easier to use than scanf (with a (very) short leaning curve).

The nested paren were a joke about sexp, I'd assume:D

> And the code will be 100% (or 99%) good for any way chosen to store these settings.

I've no issue with that, really. I've done a test bed for the idea. Well, actually it's already almost working (simply it has no GUI and spits stuff on stdout).

The idea is pretty simple and IMHO it goes beautifully with the scripting layer: I bound a simple keyword/value parser to the PCB_PLOT_PARAMS class to set options and added two operations:
1) open a plotfile (with the current options)
2) plot a layer (with the current options)

Each run can do many plotfiles and each plotfile can contain many layers. To made it useful I added a color options for layers. Also I enabled the PDF driver.

Once finished the current plot routines could be altered to simply call it (to avoid bloat and duplication, the plot open routine are exactly the same!)

I'm testing it on an old board I made, the plot control file is heavily commented so it should be clear what I'm trying to get done. It seems to work, the prognosis is good.

Code size is about 400 lines for the main routines (one small class, about 180 lines are for the huge option dispatch if bank) and some light modifications to the rest of the plot stuff: mainly for decoupling from the global plotOption object, also I've fully accessorized the PCB_PLOT_PARAMS and factored out in a routine the 'gerber extension' switch case (it was asking me to do it:D).

-- 
Lorenzo Marcantonio
Logos Srl

Attachment: batchplot-demo.zip
Description: Zip compressed data


Follow ups

References