KiCad PCB EDA Suite
board_netlist_updater.cpp
Go to the documentation of this file.
1 
6 /*
7  * This program source code file is part of KiCad, a free EDA CAD application.
8  *
9  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
10  * Copyright (C) 2015 CERN
11  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
12  * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
13  *
14  * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
15  *
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, you may find one here:
28  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
29  * or you may search the http://www.gnu.org website for the version 2 license,
30  * or you may write to the Free Software Foundation, Inc.,
31  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
32  */
33 
34 
35 #include <common.h> // for PAGE_INFO
36 
37 #include <class_board.h>
38 #include <class_netinfo.h>
39 #include <class_module.h>
40 #include <class_pad.h>
41 #include <class_zone.h>
42 
43 #include <pcb_netlist.h>
44 #include <connectivity.h>
45 #include <reporter.h>
46 
47 #include <board_netlist_updater.h>
48 
49 #include <wxPcbStruct.h>
50 
51 
53  m_commit( aFrame ),
54  m_board( aBoard )
55 {
57 
58  m_deleteSinglePadNets = true;
60  m_isDryRun = false;
61  m_replaceFootprints = true;
62  m_lookupByTimestamp = false;
63 
64  m_warningCount = 0;
65  m_errorCount = 0;
66 }
67 
68 
70 {
71 }
72 
73 
75 {
76  wxPoint bestPosition;
77 
78  if( !m_board->IsEmpty() )
79  {
80  // Position new components below any existing board features.
82 
83  if( bbox.GetWidth() || bbox.GetHeight() )
84  {
85  bestPosition.x = bbox.Centre().x;
86  bestPosition.y = bbox.GetBottom() + Millimeter2iu( 10 );
87  }
88  }
89  else
90  {
91  // Position new components in the center of the page when the board is empty.
92  wxSize pageSize = m_board->GetPageSettings().GetSizeIU();
93 
94  bestPosition.x = pageSize.GetWidth() / 2;
95  bestPosition.y = pageSize.GetHeight() / 2;
96  }
97 
98  return bestPosition;
99 }
100 
101 
103 {
104  wxString msg;
105 
106  if( aComponent->GetModule() != NULL )
107  {
108  msg.Printf( _( "Adding new component \"%s:%s\" footprint \"%s\".\n" ),
109  GetChars( aComponent->GetReference() ),
110  GetChars( aComponent->GetTimeStamp() ),
111  GetChars( FROM_UTF8( aComponent->GetFPID().Format() ) ) );
113 
114  msg.Printf( _( "Add component %s, footprint: %s.\n" ),
115  GetChars( aComponent->GetReference() ),
116  GetChars( FROM_UTF8( aComponent->GetFPID().Format() ) ) );
118 
119 
120  if( !m_isDryRun )
121  {
122  // Owned by NETLIST, can only copy it.
123  MODULE* footprint = new MODULE( *aComponent->GetModule() );
124  footprint->SetParent( m_board );
126  footprint->SetTimeStamp( GetNewTimeStamp() );
127 
128  m_addedComponents.push_back( footprint );
129  m_commit.Add( footprint );
130 
131  return footprint;
132  }
133  }
134  else
135  {
136  msg.Printf( _( "Cannot add component %s due to missing footprint %s.\n" ),
137  GetChars( aComponent->GetReference() ),
138  GetChars( FROM_UTF8( aComponent->GetFPID().Format() ) ) );
139 
141 
142  msg.Printf( _( "Cannot add new component \"%s:%s\" due to missing "
143  "footprint \"%s\".\n" ),
144  GetChars( aComponent->GetReference() ),
145  GetChars( aComponent->GetTimeStamp() ),
146  GetChars( FROM_UTF8( aComponent->GetFPID().Format() ) ) );
147 
149  ++m_errorCount;
150  }
151 
152  return NULL;
153 }
154 
155 
156 MODULE* BOARD_NETLIST_UPDATER::replaceComponent( NETLIST& aNetlist, MODULE* aPcbComponent, COMPONENT* aNewComponent )
157 {
158  wxString msg;
159 
160  if( !m_replaceFootprints )
161  return NULL;
162 
163  // Test if the footprint has not changed
164  if( aNewComponent->GetFPID().empty() || aPcbComponent->GetFPID() == aNewComponent->GetFPID() )
165  return NULL;
166 
167  if( aNewComponent->GetModule() != NULL )
168  {
169  msg.Printf( _( "Change component %s footprint from %s to %s.\n"),
170  GetChars( aPcbComponent->GetReference() ),
171  GetChars( FROM_UTF8( aPcbComponent->GetFPID().Format() ) ),
172  GetChars( FROM_UTF8( aNewComponent->GetFPID().Format() ) ) );
173 
175 
176  msg.Printf( _( "Replacing component \"%s:%s\" footprint \"%s\" with "
177  "\"%s\".\n" ),
178  GetChars( aPcbComponent->GetReference() ),
179  GetChars( aPcbComponent->GetPath() ),
180  GetChars( FROM_UTF8( aPcbComponent->GetFPID().Format() ) ),
181  GetChars( FROM_UTF8( aNewComponent->GetFPID().Format() ) ) );
182 
184 
185  if( !m_isDryRun )
186  {
187  wxASSERT( aPcbComponent != NULL );
188 
189  MODULE* newFootprint = new MODULE( *aNewComponent->GetModule() );
190  newFootprint->SetParent( m_board );
191 
192  if( aNetlist.IsFindByTimeStamp() )
193  newFootprint->SetReference( aPcbComponent->GetReference() );
194  else
195  newFootprint->SetPath( aPcbComponent->GetPath() );
196 
197  aPcbComponent->CopyNetlistSettings( newFootprint, false );
198  m_commit.Remove( aPcbComponent );
199  m_commit.Add( newFootprint );
200 
201  return newFootprint;
202  }
203  }
204  else
205  {
206  msg.Printf( _( "Cannot change component %s footprint due to missing "
207  "footprint %s.\n" ),
208  GetChars( aPcbComponent->GetReference() ),
209  GetChars( FROM_UTF8( aNewComponent->GetFPID().Format() ) ) );
210 
212 
213  msg.Printf( _( "Cannot replace component \"%s:%s\" due to missing "
214  "footprint \"%s\".\n" ),
215  GetChars( aPcbComponent->GetReference() ),
216  GetChars( aPcbComponent->GetPath() ),
217  GetChars( FROM_UTF8( aNewComponent->GetFPID().Format() ) ) );
218 
220 
221  ++m_errorCount;
222  }
223 
224  return NULL;
225 }
226 
227 
229 {
230  wxString msg;
231 
232  if( !aPcbComponent )
233  return false;
234 
235  bool changed = false;
236  MODULE* copy = (MODULE*) aPcbComponent->Clone();
237 
238  // Test for reference designator field change.
239  if( aPcbComponent->GetReference() != aNewComponent->GetReference() )
240  {
241  msg.Printf( _( "Change component %s reference to %s.\n" ),
242  GetChars( aPcbComponent->GetReference() ),
243  GetChars( aNewComponent->GetReference() ) );
244 
246 
247  msg.Printf( _( "Changing component \"%s:%s\" reference to \"%s\".\n" ),
248  GetChars( aPcbComponent->GetReference() ),
249  GetChars( aPcbComponent->GetPath() ),
250  GetChars( aNewComponent->GetReference() ) );
251 
253 
254  if ( !m_isDryRun )
255  {
256  changed = true;
257  aPcbComponent->SetReference( aNewComponent->GetReference() );
258  }
259  }
260 
261  // Test for value field change.
262  if( aPcbComponent->GetValue() != aNewComponent->GetValue() )
263  {
264  msg.Printf( _( "Change component %s value from %s to %s.\n" ),
265  GetChars( aPcbComponent->GetReference() ),
266  GetChars( aPcbComponent->GetValue() ),
267  GetChars( aNewComponent->GetValue() ) );
268 
270 
271  msg.Printf( _( "Changing component \"%s:%s\" value from \"%s\" to \"%s\".\n" ),
272  GetChars( aPcbComponent->GetReference() ),
273  GetChars( aPcbComponent->GetPath() ),
274  GetChars( aPcbComponent->GetValue() ),
275  GetChars( aNewComponent->GetValue() ) );
276 
278 
279  if( !m_isDryRun )
280  {
281  changed = true;
282  aPcbComponent->SetValue( aNewComponent->GetValue() );
283  }
284  }
285 
286  // Test for time stamp change.
287  if( aPcbComponent->GetPath() != aNewComponent->GetTimeStamp() )
288  {
289  msg.Printf( _( "Changing component path \"%s:%s\" to \"%s\".\n" ),
290  GetChars( aPcbComponent->GetReference() ),
291  GetChars( aPcbComponent->GetPath() ),
292  GetChars( aNewComponent->GetTimeStamp() ) );
293 
295 
296  if( !m_isDryRun )
297  {
298  changed = true;
299  aPcbComponent->SetPath( aNewComponent->GetTimeStamp() );
300  }
301  }
302 
303  if( changed )
304  m_commit.Modified( aPcbComponent, copy );
305  else
306  delete copy;
307 
308  return true;
309 }
310 
311 
313 {
314  wxString msg;
315 
316  bool changed = false;
317  MODULE* copy = (MODULE*) aPcbComponent->Clone();
318 
319  // At this point, the component footprint is updated. Now update the nets.
320  for( D_PAD* pad = aPcbComponent->PadsList(); pad; pad = pad->Next() )
321  {
322  COMPONENT_NET net = aNewComponent->GetNet( pad->GetPadName() );
323 
324  if( !net.IsValid() ) // New footprint pad has no net.
325  {
326  if( !pad->GetNetname().IsEmpty() )
327  {
328  msg.Printf( _( "Disconnect component %s pin %s.\n" ),
329  GetChars( aPcbComponent->GetReference() ),
330  GetChars( pad->GetPadName() ) );
332 
333  msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ),
334  GetChars( aPcbComponent->GetReference() ),
335  GetChars( aPcbComponent->GetPath() ),
336  GetChars( pad->GetPadName() ) );
338  }
339 
340  if( !m_isDryRun )
341  {
342  changed = true;
343  pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
344  }
345  }
346  else // New footprint pad has a net.
347  {
348  if( net.GetNetName() != pad->GetNetname() )
349  {
350  const wxString& netName = net.GetNetName();
351  NETINFO_ITEM* netinfo = m_board->FindNet( netName );
352 
353  if( netinfo == nullptr )
354  {
355  // It might be a new net that has not been added to the board yet
356  auto netIt = m_addedNets.find( netName );
357 
358  if( netIt != m_addedNets.end() )
359  netinfo = netIt->second;
360  }
361 
362  if( netinfo == nullptr )
363  {
364  // It is a new net, we have to add it
365  if( !m_isDryRun )
366  {
367  changed = true;
368  netinfo = new NETINFO_ITEM( m_board, netName );
369  m_commit.Add( netinfo );
370  m_addedNets[netName] = netinfo;
371  }
372 
373  msg.Printf( _( "Add net %s.\n" ), GetChars( netName ) );
375  }
376 
377  if( !pad->GetNetname().IsEmpty() )
378  {
379  msg.Printf( _( "Reconnect component %s pin %s from net %s to net %s.\n"),
380  GetChars( aPcbComponent->GetReference() ),
381  GetChars( pad->GetPadName() ),
382  GetChars( pad->GetNetname() ),
383  GetChars( netName ) );
384 
385  } else {
386  msg.Printf( _( "Connect component %s pin %s to net %s.\n"),
387  GetChars( aPcbComponent->GetReference() ),
388  GetChars( pad->GetPadName() ),
389  GetChars( netName ) );
390  }
391 
393 
394  msg.Printf( _( "Changing component \"%s:%s\" pin \"%s\" net name from "
395  "\"%s\" to \"%s\".\n" ),
396  GetChars( aPcbComponent->GetReference() ),
397  GetChars( aPcbComponent->GetPath() ),
398  GetChars( pad->GetPadName() ),
399  GetChars( pad->GetNetname() ),
400  GetChars( netName ) );
402 
403  if( !m_isDryRun )
404  {
405  changed = true;
406  pad->SetNet( netinfo );
407  }
408  }
409  }
410  }
411 
412  if( changed )
413  m_commit.Modified( aPcbComponent, copy );
414  else
415  delete copy;
416 
417  return true;
418 }
419 
420 
422 {
423  wxString msg;
424  MODULE* nextModule;
425  const COMPONENT* component;
426 
427  for( MODULE* module = m_board->m_Modules; module != NULL; module = nextModule )
428  {
429  nextModule = module->Next();
430 
431  if( m_lookupByTimestamp )
432  component = aNetlist.GetComponentByTimeStamp( module->GetPath() );
433  else
434  component = aNetlist.GetComponentByReference( module->GetReference() );
435 
436  if( component == NULL )
437  {
438  if( module->IsLocked() )
439  {
440  msg.Printf( _( "Component %s is locked, skipping removal.\n" ),
441  GetChars( module->GetReference() ) );
443  continue;
444  }
445 
446  msg.Printf( _( "Remove component %s." ),
447  GetChars( module->GetReference() ) );
449 
450  msg.Printf( _( "Removing unused component \"%s:%s\".\n" ),
451  GetChars( module->GetReference() ),
452  GetChars( module->GetPath() ) );
454 
455  if( !m_isDryRun )
456  m_commit.Remove( module );
457  }
458  }
459 
460  return true;
461 }
462 
463 
465 {
466  int count = 0;
467  wxString netname;
468  wxString msg;
469  D_PAD* pad = NULL;
470  D_PAD* previouspad = NULL;
471 
472  // We need the pad list, for next tests.
473  // padlist is the list of pads, sorted by netname.
474 
476 
477  if( m_isDryRun )
478  return false;
479 
480  std::vector<D_PAD*> padlist = m_board->GetPads();
481 
482  for( unsigned kk = 0; kk < padlist.size(); kk++ )
483  {
484  pad = padlist[kk];
485 
486  if( pad->GetNetname().IsEmpty() )
487  continue;
488 
489  if( netname != pad->GetNetname() ) // End of net
490  {
491  if( previouspad && count == 1 )
492  {
493  // First, see if we have a copper zone attached to this pad.
494  // If so, this is not really a single pad net
495 
496  for( int ii = 0; ii < m_board->GetAreaCount(); ii++ )
497  {
498  ZONE_CONTAINER* zone = m_board->GetArea( ii );
499 
500  if( !zone->IsOnCopperLayer() )
501  continue;
502 
503  if( zone->GetIsKeepout() )
504  continue;
505 
506  if( zone->GetNet() == previouspad->GetNet() )
507  {
508  count++;
509  break;
510  }
511  }
512 
513  if( count == 1 ) // Really one pad, and nothing else
514  {
515  msg.Printf( _( "Remove single pad net %s." ),
516  GetChars( previouspad->GetNetname() ) );
518 
519  msg.Printf( _( "Remove single pad net \"%s\" on \"%s\" pad '%s'\n" ),
520  GetChars( previouspad->GetNetname() ),
521  GetChars( previouspad->GetParent()->GetReference() ),
522  GetChars( previouspad->GetPadName() ) );
524 
525  previouspad->SetNetCode( NETINFO_LIST::UNCONNECTED );
526  }
527  }
528 
529  netname = pad->GetNetname();
530  count = 1;
531  }
532  else
533  {
534  count++;
535  }
536 
537  previouspad = pad;
538  }
539 
540  // Examine last pad
541  if( pad && count == 1 )
543 
544  return true;
545 }
546 
547 
549 {
550  // Last step: Some tests:
551  // verify all pads found in netlist:
552  // They should exist in footprints, otherwise the footprint is wrong
553  // note also references or time stamps are updated, so we use only
554  // the reference to find a footprint
555  //
556  // Also verify if zones have acceptable nets, i.e. nets with pads.
557  // Zone with no pad belongs to a "dead" net which happens after changes in schematic
558  // when no more pad use this net name.
559 
560  wxString msg;
561  wxString padname;
562 
563  for( int i = 0; i < (int) aNetlist.GetCount(); i++ )
564  {
565  const COMPONENT* component = aNetlist.GetComponent( i );
566  MODULE* footprint = m_board->FindModuleByReference( component->GetReference() );
567 
568  if( footprint == NULL ) // It can be missing in partial designs
569  continue;
570 
571  // Explore all pins/pads in component
572  for( unsigned jj = 0; jj < component->GetNetCount(); jj++ )
573  {
574  COMPONENT_NET net = component->GetNet( jj );
575  padname = net.GetPinName();
576 
577  if( footprint->FindPadByName( padname ) )
578  continue; // OK, pad found
579 
580  // not found: bad footprint, report error
581  msg.Printf( _( "Component %s pad %s not found in footprint %s\n" ),
582  GetChars( component->GetReference() ),
583  GetChars( padname ),
584  GetChars( FROM_UTF8( footprint->GetFPID().Format() ) ) );
586  ++m_errorCount;
587  }
588  }
589 
590  // Test copper zones to detect "dead" nets (nets without any pad):
591  for( int i = 0; i < m_board->GetAreaCount(); i++ )
592  {
593  ZONE_CONTAINER* zone = m_board->GetArea( i );
594 
595  if( !zone->IsOnCopperLayer() || zone->GetIsKeepout() )
596  continue;
597 
598  int nc = m_board->GetConnectivity()->GetPadCount( zone->GetNetCode() );
599 
600  if( nc == 0 )
601  {
602  msg.Printf( _( "Copper zone (net name %s): net has no pads connected." ),
603  GetChars( zone->GetNet()->GetNetname() ) );
605  ++m_warningCount;
606  }
607  }
608 
609  return true;
610 }
611 
612 
614 {
615  wxString msg;
616  m_errorCount = 0;
617  m_warningCount = 0;
618 
619  if( !m_isDryRun )
620  {
621  m_board->SetStatus( 0 );
622  }
623 
624  for( int i = 0; i < (int) aNetlist.GetCount(); i++ )
625  {
626  COMPONENT* component = aNetlist.GetComponent( i );
627  MODULE* footprint = NULL;
628 
629  msg.Printf( _( "Processing component \"%s:%s:%s\".\n" ),
630  GetChars( component->GetReference() ),
631  GetChars( component->GetTimeStamp() ),
632  GetChars( FROM_UTF8( component->GetFPID().Format() ) ) );
634 
635  if( aNetlist.IsFindByTimeStamp() )
636  footprint = m_board->FindModule( component->GetTimeStamp(), true );
637  else
638  footprint = m_board->FindModule( component->GetReference() );
639 
640  if( footprint ) // An existing footprint.
641  {
642  MODULE* newFootprint = replaceComponent( aNetlist, footprint, component );
643 
644  if( newFootprint )
645  footprint = newFootprint;
646  }
647  else
648  {
649  footprint = addNewComponent( component );
650  }
651 
652  if( footprint )
653  {
654  updateComponentParameters( footprint, component );
655  updateComponentPadConnections( footprint, component );
656  }
657  }
658 
659  //aNetlist.GetDeleteExtraFootprints()
660 
662  deleteUnusedComponents( aNetlist );
663 
666 
667  if( !m_isDryRun )
668  {
669  m_commit.Push( _( "Update netlist" ) );
670  m_board->GetConnectivity()->Build( m_board );
671  testConnectivity( aNetlist );
672  }
673 
674  // Update the ratsnest
675  m_reporter->Report( wxT( "" ), REPORTER::RPT_ACTION );
676  m_reporter->Report( wxT( "" ), REPORTER::RPT_ACTION );
677 
678  msg.Printf( _( "Total warnings: %d, errors: %d." ), m_warningCount, m_errorCount );
680 
681  if( m_errorCount )
682  {
683  m_reporter->Report( _( "Errors occured during the netlist update. Unless you "
684  "fix them, your board will not be consistent with the schematics." ),
686 
687  return false;
688  }
689  else
690  {
691  m_reporter->Report( _( "Netlist update successful!" ), REPORTER::RPT_ACTION );
692  }
693 
694  return true;
695 }
696 
697 
698 bool BOARD_NETLIST_UPDATER::UpdateNetlist( const wxString& aNetlistFileName,
699  const wxString& aCmpFileName )
700 {
701  return false;
702 }
const wxString & GetPinName() const
Definition: pcb_netlist.h:61
void BuildListOfNets()
Definition: class_board.h:736
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:78
MODULE * replaceComponent(NETLIST &aNetlist, MODULE *aPcbComponent, COMPONENT *aNewComponent)
bool empty() const
Function empty.
Definition: lib_id.h:198
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:164
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes...
Definition: macros.h:53
COMMIT & Modified(EDA_ITEM *aItem, EDA_ITEM *aCopy)
Creates an undo entry for an item that has been already modified.
Definition: commit.cpp:82
COMMIT & Add(EDA_ITEM *aItem)
Adds a new item to the model
Definition: commit.h:78
MODULE * GetModule(bool aRelease=false)
Definition: pcb_netlist.h:177
Class BOARD to handle a board.
D_PAD * FindPadByName(const wxString &aPadName) const
Function FindPadByName returns a D_PAD* with a matching name.
MODULE * Next() const
Definition: class_module.h:100
MODULE * GetParent() const
Definition: class_pad.h:108
time_t GetNewTimeStamp()
Definition: common.cpp:166
int GetHeight() const
MODULE * FindModuleByReference(const wxString &aReference) const
Function FindModuleByReference searches for a MODULE within this board with the given reference desig...
Classes to handle copper zones.
BOARD_NETLIST_UPDATER class definition.
const wxString & GetValue() const
Function GetValue.
Definition: class_module.h:447
bool updateComponentPadConnections(MODULE *aPcbComponent, COMPONENT *aNewComponent)
bool IsValid() const
Definition: pcb_netlist.h:65
MODULE * FindModule(const wxString &aRefOrTimeStamp, bool aSearchByTimeStamp=false) const
Function FindModule searches for a module matching aRefOrTimeStamp depending on the state of aSearchB...
bool testConnectivity(NETLIST &aNetlist)
bool UpdateNetlist(NETLIST &aNetlist)
Function UpdateNetlist()
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true) override
Executes the changes.
void SetTimeStamp(time_t aNewTimeStamp)
Definition: base_struct.h:203
const EDA_RECT GetBoardEdgesBoundingBox() const
Function GetBoardEdgesBoundingBox Returns the board bounding box calculated using exclusively the boa...
Definition: class_board.h:811
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:654
std::map< wxString, NETINFO_ITEM * > m_addedNets
const wxString & GetReference() const
Definition: pcb_netlist.h:149
Class COMPONENT_NET is used to store the component pin name to net name associations stored in a netl...
Definition: pcb_netlist.h:48
const LIB_ID & GetFPID() const
Definition: class_module.h:164
const wxString & GetValue() const
Definition: pcb_netlist.h:151
Class NETLIST stores all of information read from a netlist along with the flags used to update the N...
Definition: pcb_netlist.h:205
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:213
bool IsEmpty() const
Definition: class_board.h:268
const wxString & GetNetName() const
Definition: pcb_netlist.h:63
bool IsFindByTimeStamp() const
Definition: pcb_netlist.h:304
D_PAD * Next() const
Definition: class_pad.h:106
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode sets net using a net code.
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:429
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
COMMIT & Remove(EDA_ITEM *aItem)
Removes a new item from the model
Definition: commit.h:90
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1025
const wxString & GetTimeStamp() const
Definition: pcb_netlist.h:168
int GetBottom() const
wxPoint Centre() const
void SetPosition(const wxPoint &aPos) override
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:548
Pad object description.
Class COMPONENT is used to store components and all of their related information found in a netlist...
Definition: pcb_netlist.h:83
int GetNetCode() const
Function GetNetCode.
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:256
const std::vector< D_PAD * > GetPads()
Function GetPads returns a reference to a list of all the pads.
Class NETINFO_ITEM handles the data for a net.
Definition: class_netinfo.h:69
bool IsOnCopperLayer() const
Function IsOnCopperLayer.
Definition: class_zone.h:179
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
const wxString & GetNetname() const
Function GetNetname.
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:996
bool updateComponentParameters(MODULE *aPcbComponent, COMPONENT *aNewComponent)
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:419
DLIST< MODULE > m_Modules
Definition: class_board.h:245
Class EDA_RECT handles the component boundary box.
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:456
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
The common library.
int GetWidth() const
void SetStatus(STATUS_FLAGS aStatus)
Definition: base_struct.h:251
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
UTF8 Format() const
Function Format.
Definition: lib_id.cpp:263
COMPONENT * GetComponentByReference(const wxString &aReference)
Function GetComponentByReference returns a COMPONENT by aReference.
const COMPONENT_NET & GetNet(unsigned aIndex) const
Definition: pcb_netlist.h:137
wxString GetPadName() const
Definition: class_pad.cpp:433
void CopyNetlistSettings(MODULE *aModule, bool aCopyLocalSettings)
Function CopyNetlistSettings copies the netlist settings to aModule.
DLIST< D_PAD > & PadsList()
Definition: class_module.h:134
std::vector< MODULE * > m_addedComponents
Module description (excepted pads)
const wxString & GetNetname() const
Function GetNetname.
static REPORTER & GetInstance()
Definition: reporter.cpp:71
const wxString & GetPath() const
Definition: class_module.h:173
BOARD_NETLIST_UPDATER(PCB_EDIT_FRAME *aFrame, BOARD *aBoard)
unsigned GetCount() const
Function GetCount.
Definition: pcb_netlist.h:247
bool deleteUnusedComponents(NETLIST &aNetlist)
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
unsigned GetNetCount() const
Definition: pcb_netlist.h:135
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:290
void SetPath(const wxString &aPath)
Definition: class_module.h:174
NETINFO_ITEM * GetNet() const
Function GetNet Returns NET_INFO object for a given item.
COMPONENT * GetComponentByTimeStamp(const wxString &aTimeStamp)
Function GetComponentByTimeStamp returns a COMPONENT by aTimeStamp.
MODULE * addNewComponent(COMPONENT *aComponent)