kicad-developers team mailing list archive
Mailing list archive
Re: [Proposed Feature] GerbView - Mapping Gerbers w Altium extensions to KiCad PCB layers
Some answers below:
> On 20 Jun 2020, at 06:39, <pjmonty@xxxxxxx> <pjmonty@xxxxxxx> wrote:
> 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?
Add it directly.
> 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?
The translation framework can only handle 7-bit ASCII. So any characters above that must be broken out and used with the “wxT” macro (as well as anything you don’t want translated, such as file tokens or the like).
> 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?
It’s pretty random over a larger sample of code. Use either.
> 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?
I’ll let someone else field this.
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp