kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #05156
post processing the generic netlist
I have added function to netform.cpp:
/**
* Function MakeCommandLine
* builds up a string that describes a command line for
* executing a child process. The input and output file names
* along with any options to the executable are all possibly
* in the returned string.
*
* @param aFormatString holds:
* <ul>
* <li>the name of the external program
* <li>any options needed by that program
* <li>formatting sequences, see below.
* </ul>
*
* @param aTempfile is the name of an input file to the
* external program.
* @param aFinalFile is the name of an output file that
* the user expects.
*
* <p> Supported formatting sequences and their meaning:
* <ul>
* <li> %B => base filename and path of selected output file, minus
* path and extension.
* <li> %I => complete filename and path of the temporary
* input file.
* <li> %O => complete filename and path of the user chosen
* output file.
* </ul>
*/
With it we are now able to generate the PADS netlist format using the
XSLT plugin along with xsltproc in a fairly simple manor that can be a
model for a number of other purposes including BOM generation. Once
setup, the plugin UI will prompt you for a single output filename then
create the generic XML export with a filename like what you selected but
with a 'tmp' extension. Then an external program is run, and can be
passed the two filenames on a command line along with any options or
hard coded data.
To setup for any particular plugin one time, the process is similar to
what I list below. In this case the post processor was xsltproc, but a
python or shell script would also be handled similarly:
1) install xsltproc and put it into your path.
2) eeschema -> click netlist generation icon -> add plugin tab.
3) for the command line on linux add:
xsltproc -o %O /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl %I
for windows the path to the *.xsl script will be different.
4) For the title say "PADS"
To fire the generic export and invoke the post processor command line,
simply click on "Netlist" from the new PADS tab. The PADS netlist is
then output to where you select in the file dialog. If you want your
output to have a different extension than *.NET, say *.CSV, then simply use
I have also relaxed the file dialog to be able to specify any file
extension for the generic export situation.
Dick