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-2015 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_data.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( aComponent->GetFPID().Format() ) );
113 
114  msg.Printf( _( "Add component %s, footprint: %s.\n" ),
115  GetChars( aComponent->GetReference() ),
116  GetChars( 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( 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( 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( aPcbComponent->GetFPID().Format() ),
172  GetChars( 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( aPcbComponent->GetFPID().Format() ),
181  GetChars( 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( 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( 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  // Create a copy only if the module has not been added during this update
236  MODULE* copy = m_commit.GetStatus( aPcbComponent ) ? nullptr : (MODULE*) aPcbComponent->Clone();
237  bool changed = false;
238 
239  // Test for reference designator field change.
240  if( aPcbComponent->GetReference() != aNewComponent->GetReference() )
241  {
242  msg.Printf( _( "Change component %s reference to %s.\n" ),
243  GetChars( aPcbComponent->GetReference() ),
244  GetChars( aNewComponent->GetReference() ) );
245 
247 
248  msg.Printf( _( "Changing component \"%s:%s\" reference to \"%s\".\n" ),
249  GetChars( aPcbComponent->GetReference() ),
250  GetChars( aPcbComponent->GetPath() ),
251  GetChars( aNewComponent->GetReference() ) );
252 
254 
255  if ( !m_isDryRun )
256  {
257  changed = true;
258  aPcbComponent->SetReference( aNewComponent->GetReference() );
259  }
260  }
261 
262  // Test for value field change.
263  if( aPcbComponent->GetValue() != aNewComponent->GetValue() )
264  {
265  msg.Printf( _( "Change component %s value from %s to %s.\n" ),
266  GetChars( aPcbComponent->GetReference() ),
267  GetChars( aPcbComponent->GetValue() ),
268  GetChars( aNewComponent->GetValue() ) );
269 
271 
272  msg.Printf( _( "Changing component \"%s:%s\" value from \"%s\" to \"%s\".\n" ),
273  GetChars( aPcbComponent->GetReference() ),
274  GetChars( aPcbComponent->GetPath() ),
275  GetChars( aPcbComponent->GetValue() ),
276  GetChars( aNewComponent->GetValue() ) );
277 
279 
280  if( !m_isDryRun )
281  {
282  changed = true;
283  aPcbComponent->SetValue( aNewComponent->GetValue() );
284  }
285  }
286 
287  // Test for time stamp change.
288  if( aPcbComponent->GetPath() != aNewComponent->GetTimeStamp() )
289  {
290  msg.Printf( _( "Changing component path \"%s:%s\" to \"%s\".\n" ),
291  GetChars( aPcbComponent->GetReference() ),
292  GetChars( aPcbComponent->GetPath() ),
293  GetChars( aNewComponent->GetTimeStamp() ) );
294 
296 
297  if( !m_isDryRun )
298  {
299  changed = true;
300  aPcbComponent->SetPath( aNewComponent->GetTimeStamp() );
301  }
302  }
303 
304  if( changed && copy )
305  m_commit.Modified( aPcbComponent, copy );
306  else
307  delete copy;
308 
309  return true;
310 }
311 
312 
314 {
315  wxString msg;
316 
317  // Create a copy only if the module has not been added during this update
318  MODULE* copy = m_commit.GetStatus( aPcbComponent ) ? nullptr : (MODULE*) aPcbComponent->Clone();
319  bool changed = false;
320 
321  // At this point, the component footprint is updated. Now update the nets.
322  for( D_PAD* pad = aPcbComponent->PadsList(); pad; pad = pad->Next() )
323  {
324  COMPONENT_NET net = aNewComponent->GetNet( pad->GetName() );
325 
326  if( !net.IsValid() ) // New footprint pad has no net.
327  {
328  if( !pad->GetNetname().IsEmpty() )
329  {
330  msg.Printf( _( "Disconnect component %s pin %s.\n" ),
331  GetChars( aPcbComponent->GetReference() ),
332  GetChars( pad->GetName() ) );
334 
335  msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ),
336  GetChars( aPcbComponent->GetReference() ),
337  GetChars( aPcbComponent->GetPath() ),
338  GetChars( pad->GetName() ) );
340  }
341 
342  if( !m_isDryRun )
343  {
344  changed = true;
345  pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
346  }
347  }
348  else // New footprint pad has a net.
349  {
350  if( net.GetNetName() != pad->GetNetname() )
351  {
352  const wxString& netName = net.GetNetName();
353  NETINFO_ITEM* netinfo = m_board->FindNet( netName );
354 
355  if( netinfo == nullptr )
356  {
357  // It might be a new net that has not been added to the board yet
358  auto netIt = m_addedNets.find( netName );
359 
360  if( netIt != m_addedNets.end() )
361  netinfo = netIt->second;
362  }
363 
364  if( netinfo == nullptr )
365  {
366  // It is a new net, we have to add it
367  if( !m_isDryRun )
368  {
369  changed = true;
370  netinfo = new NETINFO_ITEM( m_board, netName );
371  m_commit.Add( netinfo );
372  m_addedNets[netName] = netinfo;
373  }
374 
375  msg.Printf( _( "Add net %s.\n" ), GetChars( netName ) );
377  }
378 
379  if( !pad->GetNetname().IsEmpty() )
380  {
381  msg.Printf( _( "Reconnect component %s pin %s from net %s to net %s.\n"),
382  GetChars( aPcbComponent->GetReference() ),
383  GetChars( pad->GetName() ),
384  GetChars( pad->GetNetname() ),
385  GetChars( netName ) );
386 
387  } else {
388  msg.Printf( _( "Connect component %s pin %s to net %s.\n"),
389  GetChars( aPcbComponent->GetReference() ),
390  GetChars( pad->GetName() ),
391  GetChars( netName ) );
392  }
393 
395 
396  msg.Printf( _( "Changing component \"%s:%s\" pin \"%s\" net name from "
397  "\"%s\" to \"%s\".\n" ),
398  GetChars( aPcbComponent->GetReference() ),
399  GetChars( aPcbComponent->GetPath() ),
400  GetChars( pad->GetName() ),
401  GetChars( pad->GetNetname() ),
402  GetChars( netName ) );
404 
405  if( !m_isDryRun )
406  {
407  changed = true;
408  pad->SetNet( netinfo );
409  }
410  }
411  }
412  }
413 
414  if( changed && copy )
415  m_commit.Modified( aPcbComponent, copy );
416  else
417  delete copy;
418 
419  return true;
420 }
421 
422 
424 {
425  wxString msg;
426  MODULE* nextModule;
427  const COMPONENT* component;
428 
429  for( MODULE* module = m_board->m_Modules; module != NULL; module = nextModule )
430  {
431  nextModule = module->Next();
432 
433  if( m_lookupByTimestamp )
434  component = aNetlist.GetComponentByTimeStamp( module->GetPath() );
435  else
436  component = aNetlist.GetComponentByReference( module->GetReference() );
437 
438  if( component == NULL )
439  {
440  if( module->IsLocked() )
441  {
442  msg.Printf( _( "Component %s is locked, skipping removal.\n" ),
443  GetChars( module->GetReference() ) );
445  continue;
446  }
447 
448  msg.Printf( _( "Remove component %s." ),
449  GetChars( module->GetReference() ) );
451 
452  msg.Printf( _( "Removing unused component \"%s:%s\".\n" ),
453  GetChars( module->GetReference() ),
454  GetChars( module->GetPath() ) );
456 
457  if( !m_isDryRun )
458  m_commit.Remove( module );
459  }
460  }
461 
462  return true;
463 }
464 
465 
467 {
468  int count = 0;
469  wxString netname;
470  wxString msg;
471  D_PAD* pad = NULL;
472  D_PAD* previouspad = NULL;
473 
474  // We need the pad list, for next tests.
475  // padlist is the list of pads, sorted by netname.
476 
478 
479  if( m_isDryRun )
480  return false;
481 
482  std::vector<D_PAD*> padlist = m_board->GetPads();
483 
484  for( unsigned kk = 0; kk < padlist.size(); kk++ )
485  {
486  pad = padlist[kk];
487 
488  if( pad->GetNetname().IsEmpty() )
489  continue;
490 
491  if( netname != pad->GetNetname() ) // End of net
492  {
493  if( previouspad && count == 1 )
494  {
495  // First, see if we have a copper zone attached to this pad.
496  // If so, this is not really a single pad net
497 
498  for( int ii = 0; ii < m_board->GetAreaCount(); ii++ )
499  {
500  ZONE_CONTAINER* zone = m_board->GetArea( ii );
501 
502  if( !zone->IsOnCopperLayer() )
503  continue;
504 
505  if( zone->GetIsKeepout() )
506  continue;
507 
508  if( zone->GetNet() == previouspad->GetNet() )
509  {
510  count++;
511  break;
512  }
513  }
514 
515  if( count == 1 ) // Really one pad, and nothing else
516  {
517  msg.Printf( _( "Remove single pad net %s." ),
518  GetChars( previouspad->GetNetname() ) );
520 
521  msg.Printf( _( "Remove single pad net \"%s\" on \"%s\" pad '%s'\n" ),
522  GetChars( previouspad->GetNetname() ),
523  GetChars( previouspad->GetParent()->GetReference() ),
524  GetChars( previouspad->GetName() ) );
526 
527  previouspad->SetNetCode( NETINFO_LIST::UNCONNECTED );
528  }
529  }
530 
531  netname = pad->GetNetname();
532  count = 1;
533  }
534  else
535  {
536  count++;
537  }
538 
539  previouspad = pad;
540  }
541 
542  // Examine last pad
543  if( pad && count == 1 )
545 
546  return true;
547 }
548 
549 
551 {
552  // Last step: Some tests:
553  // verify all pads found in netlist:
554  // They should exist in footprints, otherwise the footprint is wrong
555  // note also references or time stamps are updated, so we use only
556  // the reference to find a footprint
557  //
558  // Also verify if zones have acceptable nets, i.e. nets with pads.
559  // Zone with no pad belongs to a "dead" net which happens after changes in schematic
560  // when no more pad use this net name.
561 
562  wxString msg;
563  wxString padname;
564 
565  for( int i = 0; i < (int) aNetlist.GetCount(); i++ )
566  {
567  const COMPONENT* component = aNetlist.GetComponent( i );
568  MODULE* footprint = m_board->FindModuleByReference( component->GetReference() );
569 
570  if( footprint == NULL ) // It can be missing in partial designs
571  continue;
572 
573  // Explore all pins/pads in component
574  for( unsigned jj = 0; jj < component->GetNetCount(); jj++ )
575  {
576  COMPONENT_NET net = component->GetNet( jj );
577  padname = net.GetPinName();
578 
579  if( footprint->FindPadByName( padname ) )
580  continue; // OK, pad found
581 
582  // not found: bad footprint, report error
583  msg.Printf( _( "Component %s pad %s not found in footprint %s\n" ),
584  GetChars( component->GetReference() ),
585  GetChars( padname ),
586  GetChars( footprint->GetFPID().Format() ) );
588  ++m_errorCount;
589  }
590  }
591 
592  // Test copper zones to detect "dead" nets (nets without any pad):
593  for( int i = 0; i < m_board->GetAreaCount(); i++ )
594  {
595  ZONE_CONTAINER* zone = m_board->GetArea( i );
596 
597  if( !zone->IsOnCopperLayer() || zone->GetIsKeepout() )
598  continue;
599 
600  int nc = m_board->GetConnectivity()->GetPadCount( zone->GetNetCode() );
601 
602  if( nc == 0 )
603  {
604  msg.Printf( _( "Copper zone (net name %s): net has no pads connected." ),
605  GetChars( zone->GetNet()->GetNetname() ) );
607  ++m_warningCount;
608  }
609  }
610 
611  return true;
612 }
613 
614 
616 {
617  wxString msg;
618  m_errorCount = 0;
619  m_warningCount = 0;
620 
621  if( !m_isDryRun )
622  {
623  m_board->SetStatus( 0 );
624  }
625 
626  for( int i = 0; i < (int) aNetlist.GetCount(); i++ )
627  {
628  COMPONENT* component = aNetlist.GetComponent( i );
629  MODULE* footprint = NULL;
630 
631  msg.Printf( _( "Processing component \"%s:%s:%s\".\n" ),
632  GetChars( component->GetReference() ),
633  GetChars( component->GetTimeStamp() ),
634  GetChars( component->GetFPID().Format() ) );
636 
637  if( aNetlist.IsFindByTimeStamp() )
638  footprint = m_board->FindModule( component->GetTimeStamp(), true );
639  else
640  footprint = m_board->FindModule( component->GetReference() );
641 
642  if( footprint ) // An existing footprint.
643  {
644  MODULE* newFootprint = replaceComponent( aNetlist, footprint, component );
645 
646  if( newFootprint )
647  footprint = newFootprint;
648  }
649  else
650  {
651  footprint = addNewComponent( component );
652  }
653 
654  if( footprint )
655  {
656  updateComponentParameters( footprint, component );
657  updateComponentPadConnections( footprint, component );
658  }
659  }
660 
661  //aNetlist.GetDeleteExtraFootprints()
662 
664  deleteUnusedComponents( aNetlist );
665 
668 
669  if( !m_isDryRun )
670  {
671  m_commit.Push( _( "Update netlist" ) );
672  m_board->GetConnectivity()->Build( m_board );
673  testConnectivity( aNetlist );
674  }
675 
676  // Update the ratsnest
677  m_reporter->Report( wxT( "" ), REPORTER::RPT_ACTION );
678  m_reporter->Report( wxT( "" ), REPORTER::RPT_ACTION );
679 
680  msg.Printf( _( "Total warnings: %d, errors: %d." ), m_warningCount, m_errorCount );
682 
683  if( m_errorCount )
684  {
685  m_reporter->Report( _( "Errors occured during the netlist update. Unless you "
686  "fix them, your board will not be consistent with the schematics." ),
688 
689  return false;
690  }
691  else
692  {
693  m_reporter->Report( _( "Netlist update successful!" ), REPORTER::RPT_ACTION );
694  }
695 
696  return true;
697 }
698 
699 
700 bool BOARD_NETLIST_UPDATER::UpdateNetlist( const wxString& aNetlistFileName,
701  const wxString& aCmpFileName )
702 {
703  return false;
704 }
const wxString & GetPinName() const
Definition: pcb_netlist.h:61
void BuildListOfNets()
Definition: class_board.h:722
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
MODULE * replaceComponent(NETLIST &aNetlist, MODULE *aPcbComponent, COMPONENT *aNewComponent)
bool empty() const
Definition: lib_id.h:170
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:164
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:120
MODULE * GetParent() const
Definition: class_pad.h:162
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:467
int GetStatus(EDA_ITEM *aItem)
Returns status of an item.
Definition: commit.cpp:120
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.
const EDA_RECT GetBoardEdgesBoundingBox() const
Function GetBoardEdgesBoundingBox Returns the board bounding box calculated using exclusively the boa...
Definition: class_board.h:797
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:602
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:184
const wxString & GetValue() const
Definition: pcb_netlist.h:151
timestamp_t GetNewTimeStamp()
Definition: common.cpp:166
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:240
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:160
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode sets net using a net code.
const wxString & GetName() const
Definition: class_pad.h:190
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:449
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:1011
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:547
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
COMMIT & Modified(EDA_ITEM *aItem, EDA_ITEM *aCopy)
Creates an undo entry for an item that has been already modified.
Definition: commit.h:110
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.cpp:184
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:982
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:439
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:476
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:278
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
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
void CopyNetlistSettings(MODULE *aModule, bool aCopyLocalSettings)
Function CopyNetlistSettings copies the netlist settings to aModule.
DLIST< D_PAD > & PadsList()
Definition: class_module.h:154
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:193
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:194
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.
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:230
MODULE * addNewComponent(COMPONENT *aComponent)