← Back to team overview

kicad-developers team mailing list archive

Re: Python LAYER_PAIR parameter for EXCELLON_WRITER().BuildHolesList()

 

Le 15/01/2017 à 13:37, Martin Schreiber a écrit :
> On Sunday 15 January 2017 12:10:20 jp charras wrote:
>>
>> My question was more why do you want to use an helper internal method
>> (which needs the initialization of many parameters, made by a top level
>> method), rather than the method which generates the drill files as used in
>> the demo gen_gerber_and_drill_files_board.py.
>>
> I learned that to use lowlevel access it is more work maybe but it often 
> allows to made better products. :-)
> For the documentation stack generator MSEkicadBOM allows to set filename, 
> scale, orientation, mirroring... of the individual items. There I use 
> PLOT_CONTROLLER and rename/move/delete the produced files.
> For the drill files I saw CreateDrillFile() and thought that it is a handy 
> function to generate individual files directly.
> Maybe it should be documented which pcbnew.py functions are "official" and can 
> be used?
> 
>> They are also subject to change: for instance LAYER_PAIR does not exist 
>> now, due to a collision between 2 structs having the same name defined in
>> Kicad code.
> 
> True, I can live with that if there is a possibility to savely distinguish 
> different API's by version query.
> 
>> And this layer pair parameter for EXCELLON_WRITER().BuildHolesList() is not
>> so easy to calculate for boards with blind/buried vias.
>>
> Agreed.
> 
>> pcbnew.py is automatically generated by Swig from C++ kicad sources.
>> It means many methods in pcbnew.py are not necessary easy to use or not
>> necessary useful.
>>
>> Besides, if you want to work on a tool which needs mainly a list of
>> schematic components and their fields, I encourage you to use the netlist
>> (.net or .xml files) as entry point, not the schematic files.
>>
>> Parsing the schematic files is usually tricky, and is justified only to
>> access info not in netlist. Especially for complex hierarchies.
> 
> The file format of Eeschema is easy to parse, I like it. Using it directly has 
> the advantage that users are not responsible to first create an intermediate 
> file before using MSEkicadBOM.

Using the intermediate xml netlist does not require first create it.
MSEkicadBOM can be run directly from Eeschema (like any BOM script generator)

Eeschema files: easy to parse: yes (the current format was designed when computers were very slow,
to be very easy to parse).
But complex hierarchies use many time the same file. They are *always* tricky to manage.
Parsing a file is not enough.
Be careful.

> 
>> And of course, the code will be outdated when the schematic file format is
>> changed.
>>
> Again, I can live with that if the different formats can be savely 
> distinguished.
> 
> Martin


-- 
Jean-Pierre CHARRAS


References