← Back to team overview

kicad-developers team mailing list archive

Re: Inserting new pins based on pin orientation in eeschema

 

Le 22/04/2015 05:05, Simon Richter a écrit :
> Hi,
> 
> On 22.04.2015 04:16, Ed Johns wrote:
> 
>> I just re-implemented the calculations for pin offsets when 
>> inserting pins in the library editor in eeschema.  They are no 
>> longer dependent on global settings.  They are only dependent on 
>> the currently selected grid size and the size of the text.  The 
>> direction of the offset is determined by the orientation of the 
>> pin.
> 
> This is good for packages with pins numbered counterclockwise, but 
> makes things more difficult when pins are added top-to-bottom on 
> the right side.
> 
> From a coding style POV, I'd use std::max(), and something like
> 
> int xOffset = aXGridSize * ( 1 + ( maxTextHeight / aXGridSize ) );
> 
> to avoid using the grid size three times in the same formula, but 
> these are minor issues and the gatekeeper may feel the opposite.
> 
> g_RepeatStep is set from the eeschema config dialog, and used 
> precisely here and in the "repeat" action (which apparently is 
> reachable only through a hotkey). Is anyone actually using this, 
> and/or should it be advertised better in the UI?
> 
> Simon

Guys volunteer to rebuild schematic libraries have already done a good
job and have spent a lot of time (and many mails) on the "best practices
".
See:
https://github.com/KiCad/kicad-library/blob/master/KiCad_Library_Convent
ion.txt

therefore:
offset between pins = 100 mils
grid to place pins is 50 mils (the pin themselves are on a 100 mils
grid, but you sometimes have to use a 50 mils grid to place pins at
positions symmetric to the X or Y axis, like in 2 input gates, or Op Amp
s)

Automatic insertion of pins have to comply with that.

-- 
Jean-Pierre CHARRAS


Follow ups

References