Merge lp:~joeferner/kicad/filter-by-pin-count into lp:kicad/product

Proposed by Joe Ferner
Status: Merged
Merged at revision: 3465
Proposed branch: lp:~joeferner/kicad/filter-by-pin-count
Merge into: lp:kicad/product
Diff against target: 457 lines (+223/-12)
13 files modified
bitmaps_png/CMakeLists.txt (+1/-0)
bitmaps_png/cpp_26/module_pin_filtered_list.cpp (+97/-0)
bitmaps_png/sources/module_pin_filtered_list.svg (+31/-0)
common/footprint_info.cpp (+3/-0)
cvpcb/class_footprints_listbox.cpp (+30/-0)
cvpcb/cvframe.cpp (+32/-4)
cvpcb/cvpcb_id.h (+1/-0)
cvpcb/cvstruct.h (+2/-0)
cvpcb/tool_cvpcb.cpp (+10/-2)
include/bitmaps.h (+1/-0)
include/footprint_info.h (+2/-0)
pcbnew/netlist_reader.h (+5/-2)
pcbnew/netlist_reader_firstformat.cpp (+8/-4)
To merge this branch: bzr merge lp:~joeferner/kicad/filter-by-pin-count
Reviewer Review Type Date Requested Status
KiCad Lead Developers Pending
Review via email: mp+97720@code.launchpad.net

Description of the change

Added a toolbar button to cvpcb to allow filtering the list of modules by pin/pad count.

This can be used by selecting the "Filter by Pin Count" toolbar item, then selecting a component on the left. The module list on the right will be filtered by the number of pins of the selected component.

This is useful when the component you have selected doesn't have a filter and you know you need a part with X number of pins.

To post a comment you must log in.
Revision history for this message
Dick Hollenbeck (dickelbeck) wrote :

Wow if this works as intended, this is EXCELLENT WORK!

Just a few comments for future reference. I am in favor of committing as is, and would
volunteer to do so if no-one objects in the next day or so.

{ for function opening, at beginning of next line.

> +void FOOTPRINTS_LISTBOX::SetFootprintFilteredByPinCount( COMPONENT_INFO* Component,
> + FOOTPRINT_LIST& list ) {
> + wxString msg;
> + int OldSelection = GetSelection();
> + bool HasItem = false;

We are trying to migrate to C++ comments for single line versions, but we are not there yet:

> + int m_padCount; /* Number of pads */
>
> FOOTPRINT_INFO()
> {
> m_Num = 0;
> + m_padCount = 0;
> }
> };
>

> {
> - ReadOldFmtNetlistModuleDescr( line, BUILDLIST );

The syntax of the cast is fine with no interior spaces, but would prefer one space AFTER
the cast.

> + curComponent = (COMPONENT_INFO*)ReadOldFmtNetlistModuleDescr( line, BUILDLIST );
> continue;
> }
>
> if( state >= 3 ) // First pass: pad descriptions are not read here.
> {

{ bracket on next line, or remove both.

> + if( curComponent ) {
> + curComponent->m_pinCount++;
> + }
> state--;
> }
> }
> @@ -191,7 +195,7 @@
>

Space after cast:

> + m_currModule = (MODULE*)ReadOldFmtNetlistModuleDescr( line, READMODULE );
> continue;
> }

Revision history for this message
Miguel Angel Ajo (mangelajo) wrote :

Wow, good work :)

Just a question -from my ignorance from most kicad internals-

I don't know if that case exists, but, if somebody edits the library is it saved/reloaded from disk or just kept in ram?

May it need to ItemLib->m_padCount++ / ItemLib->m_padCount-- or keep that in sync any other way when any footprint is edited?

greetings,
Mike

Revision history for this message
Joe Ferner (joeferner) wrote :

Thanks for the feedback. I wanted to choose something small to get my feet wet in the kicad code.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bitmaps_png/CMakeLists.txt'
2--- bitmaps_png/CMakeLists.txt 2012-03-09 18:58:58 +0000
3+++ bitmaps_png/CMakeLists.txt 2012-03-15 18:54:19 +0000
4@@ -332,6 +332,7 @@
5 module_filtered_list
6 module_full_list
7 module_options
8+ module_pin_filtered_list
9 module_ratsnest
10 module
11 modview_icon
12
13=== added file 'bitmaps_png/cpp_26/module_pin_filtered_list.cpp'
14--- bitmaps_png/cpp_26/module_pin_filtered_list.cpp 1970-01-01 00:00:00 +0000
15+++ bitmaps_png/cpp_26/module_pin_filtered_list.cpp 2012-03-15 18:54:19 +0000
16@@ -0,0 +1,97 @@
17+
18+/* Do not modify this file, it was automatically generated by the
19+ * PNG2cpp CMake script, using a *.png file as input.
20+ */
21+
22+#include <bitmaps.h>
23+
24+static const unsigned char png[] = {
25+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
26+ 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
27+ 0xce, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64,
28+ 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x07, 0x7f, 0x00, 0x00, 0x07,
29+ 0x7f, 0x01, 0x78, 0x5e, 0xe4, 0x82, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f,
30+ 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63,
31+ 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x04, 0xb2, 0x49,
32+ 0x44, 0x41, 0x54, 0x48, 0x89, 0xcd, 0x94, 0x7f, 0x4c, 0xd4, 0x65, 0x1c, 0xc7, 0x5f, 0xcf, 0xdd,
33+ 0xf7, 0x7b, 0x77, 0xf1, 0x63, 0xa0, 0x70, 0xa8, 0x0c, 0x54, 0x14, 0x0f, 0x06, 0x83, 0xe2, 0xb4,
34+ 0xdc, 0x95, 0x73, 0x3a, 0xb5, 0xb5, 0x65, 0x1b, 0x6b, 0xcb, 0xa9, 0xad, 0x04, 0x4d, 0x8c, 0xc2,
35+ 0x8d, 0xfe, 0xcb, 0x96, 0xeb, 0x8f, 0x36, 0x37, 0xff, 0x68, 0x68, 0xad, 0x52, 0x37, 0x37, 0x56,
36+ 0xce, 0x35, 0xa5, 0x55, 0x5b, 0x5a, 0x6d, 0xb4, 0xc0, 0x10, 0x31, 0xbb, 0x8b, 0x38, 0x9d, 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+ 0xea, 0xea, 0x9a, 0xd4, 0x04, 0x22, 0x8f, 0xea, 0x74, 0xb1, 0x72, 0xe5, 0xca, 0x4a, 0xa5, 0xd4,
104+ 0xcc, 0xfe, 0x6a, 0xf8, 0xa1, 0xbe, 0xbe, 0xbe, 0xd8, 0xf4, 0xe4, 0xba, 0xff, 0x06, 0xff, 0x5b,
105+ 0xa3, 0x73, 0xc0, 0xf0, 0x4c, 0x1a, 0x44, 0xe4, 0x34, 0xcc, 0xf0, 0x8e, 0x00, 0xd6, 0xad, 0x5b,
106+ 0x97, 0x64, 0x18, 0xc6, 0xac, 0xe9, 0xd4, 0x9a, 0xcd, 0xe6, 0x50, 0x6d, 0x6d, 0x6d, 0x00, 0xe0,
107+ 0x5f, 0x6d, 0xdb, 0xe2, 0x7f, 0x13, 0xa4, 0x85, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
108+ 0x44, 0xae, 0x42, 0x60, 0x82,
109+};
110+
111+const BITMAP_OPAQUE module_pin_filtered_list_xpm[1] = {{ png, sizeof( png ), "module_pin_filtered_list_xpm" }};
112+
113+//EOF
114
115=== added file 'bitmaps_png/sources/module_pin_filtered_list.svg'
116--- bitmaps_png/sources/module_pin_filtered_list.svg 1970-01-01 00:00:00 +0000
117+++ bitmaps_png/sources/module_pin_filtered_list.svg 2012-03-15 18:54:19 +0000
118@@ -0,0 +1,31 @@
119+<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48" version="1.1" viewBox="0 0 48 48">
120+ <g transform="matrix(-2.8288,0,0,-2.4916,-6.4559,36.786)">
121+ <g stroke-linejoin="round">
122+ <rect transform="rotate(90)" height="14.619" width="9.7086" stroke="#000" y="3.4905" x="1.904" stroke-width="0.4" fill="#fff"/>
123+ <path d="m693.26 625.06a18.914 18.914 0 0 1 -37.828 0.11702" transform="matrix(0 .071482 -.071482 0 41.168 -41.24)" stroke="#030303" stroke-width="5.5958" fill="none"/>
124+ </g>
125+ <g stroke-linejoin="round" transform="translate(-.0375 -.15)" stroke="#030303">
126+ <rect transform="rotate(90)" height="2.511" width="4.7176" y="13.332" x="-.31959" stroke-width="0.3" fill="#ff7800"/>
127+ <rect transform="rotate(90)" height="2.511" width="4.7176" y="5.3636" x="-.31959" stroke-width="0.3" fill="#ff7800"/>
128+ <path d="m654.65 737.28a9.5805 9.5805 0 1 1 -19.161 0 9.5805 9.5805 0 1 1 19.161 0z" transform="matrix(0 .071482 -.071482 0 46.083 -44.072)" stroke-width="4.1969" fill="#ffede0"/>
129+ <rect transform="rotate(90)" height="2.511" width="4.7176" y="9.3478" x="-.31959" stroke-width="0.3" fill="#ff7800"/>
130+ <path d="m654.65 737.28a9.5805 9.5805 0 1 1 -19.161 0 9.5805 9.5805 0 1 1 19.161 0z" transform="matrix(0 .071482 -.071482 0 42.08 -44.072)" stroke-width="4.1969" fill="#ffede0"/>
131+ <path d="m654.65 737.28a9.5805 9.5805 0 1 1 -19.161 0 9.5805 9.5805 0 1 1 19.161 0z" transform="matrix(0 .071482 -.071482 0 38.077 -44.072)" stroke-width="4.1969" fill="#ffede0"/>
132+ </g>
133+ <g transform="translate(-.0375 9.6261)">
134+ <rect stroke-linejoin="round" transform="rotate(90)" height="2.511" width="4.7176" stroke="#030303" y="13.332" x="-.31959" stroke-width="0.3" fill="#ff7800"/>
135+ <rect stroke-linejoin="round" transform="rotate(90)" height="2.511" width="4.7176" stroke="#030303" y="5.3636" x="-.31959" stroke-width="0.3" fill="#ff7800"/>
136+ <path stroke-linejoin="round" d="m654.65 737.28a9.5805 9.5805 0 1 1 -19.161 0 9.5805 9.5805 0 1 1 19.161 0z" transform="matrix(0 .071482 -.071482 0 46.083 -44.072)" stroke="#030303" stroke-width="4.1969" fill="#ffede0"/>
137+ <rect stroke-linejoin="round" transform="rotate(90)" height="2.511" width="4.7176" stroke="#030303" y="9.3478" x="-.31959" stroke-width="0.3" fill="#ff7800"/>
138+ <path stroke-linejoin="round" d="m654.65 737.28a9.5805 9.5805 0 1 1 -19.161 0 9.5805 9.5805 0 1 1 19.161 0z" transform="matrix(0 .071482 -.071482 0 42.08 -44.072)" stroke="#030303" stroke-width="4.1969" fill="#ffede0"/>
139+ <g stroke-width="0.3">
140+ <path stroke-linejoin="round" d="m654.65 737.28a9.5805 9.5805 0 1 1 -19.161 0 9.5805 9.5805 0 1 1 19.161 0z" transform="matrix(0 .071482 -.071482 0 38.077 -44.072)" stroke="#030303" stroke-width="4.1969" fill="#ffede0"/>
141+ </g>
142+ </g>
143+ </g>
144+ <rect ry="2.1184" height="31.004" width="24.273" y="15.396" x="21.327" fill="#3e3e3e"/>
145+ <path d="m25.2 28h15" stroke="#f2f2f4" stroke-width="1.5" fill="none"/>
146+ <path d="m25.2 33h15" stroke="#f2f2f4" stroke-width="1.5" fill="none"/>
147+ <path d="m30 22.5l-1.5 16" stroke="#f2f2f4" stroke-width="1.5" fill="none"/>
148+ <path d="m36.5 22.5l-1.5 16" stroke="#f2f2f4" stroke-width="1.5" fill="none"/>
149+</svg>
150
151=== modified file 'common/footprint_info.cpp'
152--- common/footprint_info.cpp 2012-03-08 17:47:23 +0000
153+++ common/footprint_info.cpp 2012-03-15 18:54:19 +0000
154@@ -117,6 +117,9 @@
155 if( strnicmp( line, "$EndMODULE", 10 ) == 0 )
156 break;
157
158+ if( strnicmp( line, "$PAD", 4 ) == 0 )
159+ ItemLib->m_padCount++;
160+
161 int id = ((line[0] & 0xFF) << 8) + (line[1] & 0xFF);
162 switch( id )
163 {
164
165=== modified file 'cvpcb/class_footprints_listbox.cpp'
166--- cvpcb/class_footprints_listbox.cpp 2012-02-01 19:49:37 +0000
167+++ cvpcb/class_footprints_listbox.cpp 2012-03-15 18:54:19 +0000
168@@ -173,6 +173,36 @@
169 Refresh();
170 }
171
172+void FOOTPRINTS_LISTBOX::SetFootprintFilteredByPinCount( COMPONENT_INFO* Component,
173+ FOOTPRINT_LIST& list ) {
174+ wxString msg;
175+ int OldSelection = GetSelection();
176+ bool HasItem = false;
177+
178+ m_FilteredFootprintList.Clear();
179+
180+ for( unsigned ii = 0; ii < list.GetCount(); ii++ )
181+ {
182+ FOOTPRINT_INFO& footprint = list.GetItem(ii);
183+
184+ if( Component->m_pinCount == footprint.m_padCount ) {
185+ msg.Printf( wxT( "%3d %s" ), m_FilteredFootprintList.GetCount() + 1,
186+ footprint.m_Module.GetData() );
187+ m_FilteredFootprintList.Add( msg );
188+ HasItem = true;
189+ }
190+ }
191+
192+ if( HasItem )
193+ SetActiveFootprintList( false );
194+ else
195+ SetActiveFootprintList( true );
196+
197+ if( ( GetCount() == 0 ) || ( OldSelection >= GetCount() ) )
198+ SetSelection( 0, true );
199+
200+ Refresh();
201+}
202
203 /** Set the footprint list. We can have 2 footprint list:
204 * The full footprint list
205
206=== modified file 'cvpcb/cvframe.cpp'
207--- cvpcb/cvframe.cpp 2012-03-08 17:47:23 +0000
208+++ cvpcb/cvframe.cpp 2012-03-15 18:54:19 +0000
209@@ -84,6 +84,8 @@
210 EVT_TOOL( ID_PCB_DISPLAY_FOOTPRINT_DOC, CVPCB_MAINFRAME::DisplayDocFile )
211 EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
212 CVPCB_MAINFRAME::OnSelectFilteringFootprint )
213+ EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
214+ CVPCB_MAINFRAME::OnSelectFilteringFootprint )
215 EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
216 CVPCB_MAINFRAME::OnSelectFilteringFootprint )
217
218@@ -189,7 +191,15 @@
219
220 if( config )
221 {
222- int state = m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST );
223+ int state = 0;
224+ if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) )
225+ {
226+ state = 1;
227+ }
228+ else if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST ) )
229+ {
230+ state = 2;
231+ }
232 config->Write( wxT( FILTERFOOTPRINTKEY ), state );
233 }
234
235@@ -506,7 +516,8 @@
236 #define SELECT_FULL_LIST true
237 int selection = -1;
238
239- if( !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) )
240+ if( !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST )
241+ && !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST ))
242 m_FootprintList->SetActiveFootprintList( SELECT_FULL_LIST, REDRAW_LIST );
243
244 else
245@@ -521,8 +532,18 @@
246 if( &m_components[ selection ] == NULL )
247 m_FootprintList->SetActiveFootprintList( SELECT_FULL_LIST, REDRAW_LIST );
248 else
249- m_FootprintList->SetFootprintFilteredList( &m_components[ selection ],
250- m_footprints );
251+ {
252+ if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST ) )
253+ {
254+ m_FootprintList->SetFootprintFilteredByPinCount( &m_components[ selection ],
255+ m_footprints );
256+ }
257+ else
258+ {
259+ m_FootprintList->SetFootprintFilteredList( &m_components[ selection ],
260+ m_footprints );
261+ }
262+ }
263 }
264 }
265
266@@ -572,12 +593,19 @@
267 {
268 switch( event.GetId() )
269 {
270+ case ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST:
271+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
272+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
273+ break;
274+
275 case ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST:
276 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
277+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
278 break;
279
280 case ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST:
281 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
282+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
283 break;
284
285 default:
286
287=== modified file 'cvpcb/cvpcb_id.h'
288--- cvpcb/cvpcb_id.h 2012-01-23 04:33:36 +0000
289+++ cvpcb/cvpcb_id.h 2012-03-15 18:54:19 +0000
290@@ -30,5 +30,6 @@
291 ID_CVPCB_SHOW3D_FRAME,
292 ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
293 ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
294+ ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
295 ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE
296 };
297
298=== modified file 'cvpcb/cvstruct.h'
299--- cvpcb/cvstruct.h 2012-02-01 19:49:37 +0000
300+++ cvpcb/cvstruct.h 2012-03-15 18:54:19 +0000
301@@ -54,6 +54,8 @@
302 void SetFootprintFullList( FOOTPRINT_LIST& list );
303 void SetFootprintFilteredList( COMPONENT_INFO* Component,
304 FOOTPRINT_LIST& list );
305+ void SetFootprintFilteredByPinCount( COMPONENT_INFO* Component,
306+ FOOTPRINT_LIST& list );
307 void SetActiveFootprintList( bool FullList, bool Redraw = false );
308
309 wxString GetSelectedFootprint();
310
311=== modified file 'cvpcb/tool_cvpcb.cpp'
312--- cvpcb/tool_cvpcb.cpp 2012-02-01 19:49:37 +0000
313+++ cvpcb/tool_cvpcb.cpp 2012-03-15 18:54:19 +0000
314@@ -103,6 +103,13 @@
315 _( "Display the filtered footprint list for the current component" ),
316 wxEmptyString );
317
318+ m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
319+ KiBitmap( module_pin_filtered_list_xpm ),
320+ wxNullBitmap,
321+ true, NULL,
322+ _( "Display the filtered footprint list by pin count for the current component" ),
323+ wxEmptyString );
324+
325 m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
326 KiBitmap( module_full_list_xpm ),
327 wxNullBitmap, true, NULL,
328@@ -113,8 +120,9 @@
329 {
330 wxString key = wxT( FILTERFOOTPRINTKEY );
331 int opt = config->Read( key, (long) 1 );
332- m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt );
333- m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, !opt );
334+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, opt == 2 );
335+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt == 1 );
336+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, opt == 0 );
337 }
338
339 // after adding the buttons to the toolbar, must call Realize() to reflect the changes
340
341=== modified file 'include/bitmaps.h'
342--- include/bitmaps.h 2012-03-09 18:58:58 +0000
343+++ include/bitmaps.h 2012-03-15 18:54:19 +0000
344@@ -294,6 +294,7 @@
345 EXTERN_BITMAP( module_check_xpm )
346 EXTERN_BITMAP( module_edit_xpm )
347 EXTERN_BITMAP( module_filtered_list_xpm )
348+EXTERN_BITMAP( module_pin_filtered_list_xpm )
349 EXTERN_BITMAP( module_full_list_xpm )
350 EXTERN_BITMAP( module_options_xpm )
351 EXTERN_BITMAP( module_ratsnest_xpm )
352
353=== modified file 'include/footprint_info.h'
354--- include/footprint_info.h 2012-01-23 04:33:36 +0000
355+++ include/footprint_info.h 2012-03-15 18:54:19 +0000
356@@ -23,10 +23,12 @@
357 int m_Num; /* Order number in the display list. */
358 wxString m_Doc; /* Footprint description. */
359 wxString m_KeyWord; /* Footprint key words. */
360+ int m_padCount; /* Number of pads */
361
362 FOOTPRINT_INFO()
363 {
364 m_Num = 0;
365+ m_padCount = 0;
366 }
367 };
368
369
370=== modified file 'pcbnew/netlist_reader.h'
371--- pcbnew/netlist_reader.h 2012-03-10 07:58:21 +0000
372+++ pcbnew/netlist_reader.h 2012-03-15 18:54:19 +0000
373@@ -81,6 +81,7 @@
374 wxString m_TimeStamp; // the schematic full time stamp found in netlist
375 wxString m_Libpart; // the schematic libpart found in netlist
376 wxArrayString m_FootprintFilter; // a footprint filters list found in old format netlist
377+ int m_pinCount; // the number of pins found in the netlist
378
379 public: COMPONENT_INFO( const wxString& libname,
380 const wxString& cmpname,
381@@ -91,6 +92,7 @@
382 m_Reference = cmpname;
383 m_Value = value;
384 m_TimeStamp = timestamp;
385+ m_pinCount = 0;
386 }
387
388 ~COMPONENT_INFO() { };
389@@ -409,9 +411,10 @@
390 * If true: component file *.cmp is used
391 * If false: the netlist only is used
392 * This flag is reset to false if the .cmp file is not found
393- * @return a reference to the corresponding module on board (NULL if not found)
394+ * @return if aBuildList = true, a reference to the COMPONENT_INFO
395+ * if aBuildList = false, a reference to the corresponding MODULE on board (NULL if not found)
396 */
397- MODULE* ReadOldFmtNetlistModuleDescr( char* aText, bool aBuildList );
398+ void* ReadOldFmtNetlistModuleDescr( char* aText, bool aBuildList );
399
400 /**
401 * Function loadNewModules
402
403=== modified file 'pcbnew/netlist_reader_firstformat.cpp'
404--- pcbnew/netlist_reader_firstformat.cpp 2012-02-01 19:49:37 +0000
405+++ pcbnew/netlist_reader_firstformat.cpp 2012-03-15 18:54:19 +0000
406@@ -83,6 +83,7 @@
407 // netlineReader dtor will close aFile
408 FILE_LINE_READER netlineReader( aFile, m_netlistFullName );
409
410+ COMPONENT_INFO *curComponent = NULL;
411 while( netlineReader.ReadLine() )
412 {
413 char* line = StrPurge( netlineReader.Line() );
414@@ -116,12 +117,15 @@
415
416 if( state == 2 )
417 {
418- ReadOldFmtNetlistModuleDescr( line, BUILDLIST );
419+ curComponent = (COMPONENT_INFO*)ReadOldFmtNetlistModuleDescr( line, BUILDLIST );
420 continue;
421 }
422
423 if( state >= 3 ) // First pass: pad descriptions are not read here.
424 {
425+ if( curComponent ) {
426+ curComponent->m_pinCount++;
427+ }
428 state--;
429 }
430 }
431@@ -191,7 +195,7 @@
432
433 if( state == 2 )
434 {
435- m_currModule = ReadOldFmtNetlistModuleDescr( line, READMODULE );
436+ m_currModule = (MODULE*)ReadOldFmtNetlistModuleDescr( line, READMODULE );
437 continue;
438 }
439
440@@ -216,7 +220,7 @@
441 * (2 MODB_1)
442 * )
443 */
444-MODULE* NETLIST_READER::ReadOldFmtNetlistModuleDescr( char* aText, bool aBuildList )
445+void* NETLIST_READER::ReadOldFmtNetlistModuleDescr( char* aText, bool aBuildList )
446 {
447 char* text;
448 wxString timeStampPath; // the full time stamp read from netlist
449@@ -264,7 +268,7 @@
450 COMPONENT_INFO* cmp_info = new COMPONENT_INFO( footprintName, cmpReference,
451 cmpValue, timeStampPath );
452 AddModuleInfo( cmp_info );
453- return NULL;
454+ return cmp_info;
455 }
456
457 // search the module loaded on board