← Back to team overview

kicad-developers team mailing list archive

[PATCH] Change default grid size to match KLC in LIBEDIT

 

Hi all,

KLC 4.1.i says that pin origins must lie on 100mil grid nodes in symbols.
This patch changes the default grid size from 50 mil to 100 mil in the schematic library editor so that new library contributors will have one less thing to worry about.

-- 
Regards,
Gaurav Juvekar
From ebff7e4efac99107ae2962580bb708f1b2c4399f Mon Sep 17 00:00:00 2001
From: Gaurav Juvekar <gauravjuvekar@xxxxxxxxx>
Date: Fri, 15 Sep 2017 23:16:52 +0530
Subject: [PATCH] Use KLC recommendation for symbol grid size
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------2.7.4"

This is a multi-part message in MIME format.
--------------2.7.4
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


KLC recommends that library symbol pins should be on a 100 mil grid.

This patch changes the default grid size to 100 mils for libedit so that first
time contributors will get it correct without any additional efforts
---
 eeschema/libeditframe.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


--------------2.7.4
Content-Type: text/x-patch; name="0001-Use-KLC-recommendation-for-symbol-grid-size.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Use-KLC-recommendation-for-symbol-grid-size.patch"

diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp
index 9200ef1..3c0d1eb 100644
--- a/eeschema/libeditframe.cpp
+++ b/eeschema/libeditframe.cpp
@@ -204,8 +204,8 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
     if( m_textSize == -1 )
         m_textSize = GetDefaultTextSize();
 
-    // Initialize grid id to the default value 50 mils:
-    m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
+    // Initialize grid id to the KLC recommendation value 100 mils:
+    m_LastGridSizeId = ID_POPUP_GRID_LEVEL_100 - ID_POPUP_GRID_LEVEL_1000;
 
     wxIcon icon;
     icon.CopyFromBitmap( KiBitmap( icon_libedit_xpm ) );
@@ -220,8 +220,8 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
     SetCrossHairPosition( wxPoint( 0, 0 ) );
 
     // Ensure m_LastGridSizeId is an offset inside the allowed schematic range
-    if( m_LastGridSizeId < ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000 )
-        m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
+    if( m_LastGridSizeId < ID_POPUP_GRID_LEVEL_100 - ID_POPUP_GRID_LEVEL_1000 )
+        m_LastGridSizeId = ID_POPUP_GRID_LEVEL_100 - ID_POPUP_GRID_LEVEL_1000;
 
     if( m_LastGridSizeId > ID_POPUP_GRID_LEVEL_1 - ID_POPUP_GRID_LEVEL_1000 )
         m_LastGridSizeId = ID_POPUP_GRID_LEVEL_1 - ID_POPUP_GRID_LEVEL_1000;

--------------2.7.4--


Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups