← Back to team overview

kicad-developers team mailing list archive

[Proposed Feature] GerbView - Mapping Gerbers w Altium extensions to KiCad PCB layers

 

I wanted to add a feature to GerbView that relates to exporting a KiCad PCB file from loaded Gerbers.  I often use "Export to PCBNew..." to recreate boards from Gerbers, and many of them involve Gerbers generated by Protel, the progenitor to Altium.  Since Altium (and Protel) use specific file extensions for specfic layers, it's tedious to manually have to set each Gerber layer to the equivalent KiCad PCB layer.  Every time I use "Export to PCBNew..." I keep thinking how handy it would be if GerbView could recognize the file extensions and offer to map them to the appropriate KiCad PCB layers.  

So, I've created a proof of concept that compiles into my local copy of GerbView, and I have a couple of questions:
1 - I made my changes directly in the file select_layers_to_pcb.cpp by adding a new member function to it.  The new function is called from and used within "initDialog()". Is it preferable to create a whole new source file/object for containing the new function (or functions if more are needed), or is it okay to add it directly into this existing file?  Or is this the sort of question best answered when someone is reviewing a submission?

2 - In the KiCad source code, I see a lot of text using the macro "_" to provide string translations, but there are also cases where the "wxT" macro (which I don't believe handles translations) is used instead.  Is there a rule of thumb for when to use "_", or is best to just always use it?

3 - The source files I've looked at seem to use "ii" as the default integer index in loops, versus the more traditional "i".  Is this a KiCad thing, or something specific to whatever developer(s) worked in the code I've looked at?
4 - The source files I've looked at only use the generic "int" as opposed to using more specific types such as "int32_t" or "int8_t".  Is the use of "stdint.h" not allowed/not encouraged?

Follow ups