← Back to team overview

kicad-developers team mailing list archive

Re: [RFC] Long pin numbers/pad names support

 

Le 14/08/2017 à 08:42, Maciej Suminski a écrit :
> Hi Jean-Pierre,
> 
> On 08/13/2017 02:01 PM, jp charras wrote:
> [snip]
>>
>> This was made to speed up netlist and connection calculations in the early time of Pcbnew.
>> (There was no support of wxString and std::string, therefore comparing 2 strings was not as easy and
>> not as fast as comparing 2 numbers).
>>
>> I am thinking the long pin number support can be now safely removed without any problem and the code
>> will be clearer.
>>
>> I don't think the file format changes, if the pad name is restricted to 4 ASCII7 chars, like now.
> 
> It is true, but I opt for removing the name length constraint, therefore
> I suggested to increment the file format version. I realize there are
> not many cases when it is useful, but I am converting a library that
> uses e.g. SHIELD, MECH1, MECH2 for pad names. Truncating pad names may
> easily result in a disaster, so for now I am just skipping such parts,
> but ideally we could support them too.
> 
>> The file format changes only if the pad name is free (any UTF8 char, any length).
>> However a full free name/pin number can be not compatible with netlists:
>> see Spice and other formats for instance.

In fact the current plugin just truncates pad/pin names to 4 chars, and do not generate any error
message.

So modifying the version id does not fix the truncation issue, because the truncation is not
detected by current Pcbnew and Eeschema versions.
However, it could be useful to identify files accepting a free pad name.

> 
> I think this should be handled by exporters by displaying a message. We
> do not need to restrict ourselves only due to other software limitations.
> 
>> Moreover any non ASCII7 char will create problems in X2 Gerber files (only ASCII7 chars are allowed
>> in Gerber files).
>>
>> But this is an other problem (and besides, I am not sure a free pad name is very useful: all
>> footprints use only digits and A...Z chars in Pad names).
> 
> Then it sounds like ASCII7 is a reasonable choice. In such case we
> either should use std::string or wxString::{From,To}Ascii()

This is not necessary.
Exactly, in Gerber files, when a non ASCII7 char is stored (it happens in advanced X2 format, which
stores project name, net names, pad names and component references) this char is stored in a 4 digit
hexadecimal sequence, using its UTF16 value.

The file is less easy to read by an user, and using non ASCII7 chars is not a good idea, from this
point of view, but this is possible.

> 
> Regards,
> Orson


-- 
Jean-Pierre CHARRAS


References