← Back to team overview

kicad-developers team mailing list archive

Re: sorting pins in .lib files

 


>> I propose to start with getting rid of that mess, and see later whether
>> we want to introduce more flexible scheme, maybe that would give
>> priority to pin name, or location in the drawing.
> It is on my personal to do list at some point in the future.  As an
> interim step, you could use GetNumberString() and sort using the string
> instead of the long integer value of the m_number member variable.

We can and should also think about getting "rid of messes" by *hiding* them behind a
elegant public interfaces.

Client code is where you replicate the calling into the public interfaces, and only that
*replication* would determine if a mess is being made or not.

If awkward implementation details are kept in a single place, hidden behind a public
interface, the awkwardness is not important.

See what I did to the same design of PADs in PCBNEW.  There is a "long" used there to hold
the 4 character pad number.  But nobody knows this, it is hidden.  So changing strategies
is trivial, since you did not replicate the strategy.

Dick




Follow ups

References