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 <ratsnest_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_frame( aFrame ),
55  m_board( aBoard )
56 {
58 
59  m_deleteSinglePadNets = true;
61  m_isDryRun = false;
62  m_replaceFootprints = true;
63  m_lookupByTimestamp = false;
64 
65  m_warningCount = 0;
66  m_errorCount = 0;
67 }
68 
69 
71 {
72 }
73 
74 
76 {
77  wxPoint bestPosition;
78 
79  if( !m_board->IsEmpty() )
80  {
81  // Position new components below any existing board features.
83 
84  if( bbox.GetWidth() || bbox.GetHeight() )
85  {
86  bestPosition.x = bbox.Centre().x;
87  bestPosition.y = bbox.GetBottom() + Millimeter2iu( 10 );
88  }
89  }
90  else
91  {
92  // Position new components in the center of the page when the board is empty.
93  wxSize pageSize = m_board->GetPageSettings().GetSizeIU();
94 
95  bestPosition.x = pageSize.GetWidth() / 2;
96  bestPosition.y = pageSize.GetHeight() / 2;
97  }
98 
99  return bestPosition;
100 }
101 
102 
104 {
105  wxString msg;
106 
107  if( aComponent->GetModule() != NULL )
108  {
109  msg.Printf( _( "Adding new component \"%s:%s\" footprint \"%s\".\n" ),
110  GetChars( aComponent->GetReference() ),
111  GetChars( aComponent->GetTimeStamp() ),
112  GetChars( FROM_UTF8( aComponent->GetFPID().Format() ) ) );
114 
115  msg.Printf( _( "Add component %s, footprint: %s.\n" ),
116  GetChars( aComponent->GetReference() ),
117  GetChars( FROM_UTF8( aComponent->GetFPID().Format() ) ) );
119 
120 
121  if( !m_isDryRun )
122  {
123  // Owned by NETLIST, can only copy it.
124  MODULE* footprint = new MODULE( *aComponent->GetModule() );
125  footprint->SetParent( m_board );
127  footprint->SetTimeStamp( GetNewTimeStamp() );
128 
129  m_addedComponents.push_back( footprint );
130  m_commit.Add( footprint );
131 
132  return footprint;
133  }
134  }
135  else
136  {
137  msg.Printf( _( "Cannot add component %s due to missing footprint %s.\n" ),
138  GetChars( aComponent->GetReference() ),
139  GetChars( FROM_UTF8( aComponent->GetFPID().Format() ) ) );
140 
142 
143  msg.Printf( _( "Cannot add new component \"%s:%s\" due to missing "
144  "footprint \"%s\".\n" ),
145  GetChars( aComponent->GetReference() ),
146  GetChars( aComponent->GetTimeStamp() ),
147  GetChars( FROM_UTF8( aComponent->GetFPID().Format() ) ) );
148 
150  ++m_errorCount;
151  }
152 
153  return NULL;
154 }
155 
156 
157 MODULE* BOARD_NETLIST_UPDATER::replaceComponent( NETLIST& aNetlist, MODULE* aPcbComponent, COMPONENT* aNewComponent )
158 {
159  wxString msg;
160 
161  if( !m_replaceFootprints )
162  return NULL;
163 
164  // Test if the footprint has not changed
165  if( aNewComponent->GetFPID().empty() || aPcbComponent->GetFPID() == aNewComponent->GetFPID() )
166  return NULL;
167 
168  if( aNewComponent->GetModule() != NULL )
169  {
170  msg.Printf( _( "Change component %s footprint from %s to %s.\n"),
171  GetChars( aPcbComponent->GetReference() ),
172  GetChars( FROM_UTF8( aPcbComponent->GetFPID().Format() ) ),
173  GetChars( FROM_UTF8( aNewComponent->GetFPID().Format() ) ) );
174 
176 
177  msg.Printf( _( "Replacing component \"%s:%s\" footprint \"%s\" with "
178  "\"%s\".\n" ),
179  GetChars( aPcbComponent->GetReference() ),
180  GetChars( aPcbComponent->GetPath() ),
181  GetChars( FROM_UTF8( aPcbComponent->GetFPID().Format() ) ),
182  GetChars( FROM_UTF8( aNewComponent->GetFPID().Format() ) ) );
183 
185 
186  if( !m_isDryRun )
187  {
188  wxASSERT( aPcbComponent != NULL );
189 
190  MODULE* newFootprint = new MODULE( *aNewComponent->GetModule() );
191  newFootprint->SetParent( m_board );
192 
193  if( aNetlist.IsFindByTimeStamp() )
194  newFootprint->SetReference( aPcbComponent->GetReference() );
195  else
196  newFootprint->SetPath( aPcbComponent->GetPath() );
197 
198  aPcbComponent->CopyNetlistSettings( newFootprint, false );
199  m_commit.Remove( aPcbComponent );
200  m_commit.Add( newFootprint );
201 
202  return newFootprint;
203  }
204  }
205  else
206  {
207  msg.Printf( _( "Cannot change component %s footprint due to missing "
208  "footprint %s.\n" ),
209  GetChars( aPcbComponent->GetReference() ),
210  GetChars( FROM_UTF8( aNewComponent->GetFPID().Format() ) ) );
211 
213 
214  msg.Printf( _( "Cannot replace component \"%s:%s\" due to missing "
215  "footprint \"%s\".\n" ),
216  GetChars( aPcbComponent->GetReference() ),
217  GetChars( aPcbComponent->GetPath() ),
218  GetChars( FROM_UTF8( aNewComponent->GetFPID().Format() ) ) );
219 
221 
222  ++m_errorCount;
223  }
224 
225  return NULL;
226 }
227 
228 
230 {
231  wxString msg;
232 
233  if( !aPcbComponent )
234  return false;
235 
236  bool changed = false;
237  MODULE* copy = (MODULE*) aPcbComponent->Clone();
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 )
305  m_commit.Modified( aPcbComponent, copy );
306  else
307  delete copy;
308 
309  return true;
310 }
311 
312 
314 {
315  wxString msg;
316 
317  bool changed = false;
318  MODULE* copy = (MODULE*) aPcbComponent->Clone();
319 
320  // At this point, the component footprint is updated. Now update the nets.
321  for( D_PAD* pad = aPcbComponent->Pads(); pad; pad = pad->Next() )
322  {
323  COMPONENT_NET net = aNewComponent->GetNet( pad->GetPadName() );
324 
325  if( !net.IsValid() ) // New footprint pad has no net.
326  {
327  if( !pad->GetNetname().IsEmpty() )
328  {
329  msg.Printf( _( "Disconnect component %s pin %s.\n" ),
330  GetChars( aPcbComponent->GetReference() ),
331  GetChars( pad->GetPadName() ) );
333 
334  msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ),
335  GetChars( aPcbComponent->GetReference() ),
336  GetChars( aPcbComponent->GetPath() ),
337  GetChars( pad->GetPadName() ) );
339  }
340 
341  if( !m_isDryRun )
342  {
343  changed = true;
344  pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
345  }
346  }
347  else // New footprint pad has a net.
348  {
349  if( net.GetNetName() != pad->GetNetname() )
350  {
351  const wxString& netName = net.GetNetName();
352  NETINFO_ITEM* netinfo = m_board->FindNet( netName );
353 
354  if( netinfo == nullptr )
355  {
356  // It might be a new net that has not been added to the board yet
357  auto netIt = m_addedNets.find( netName );
358 
359  if( netIt != m_addedNets.end() )
360  netinfo = netIt->second;
361  }
362 
363  if( netinfo == nullptr )
364  {
365  // It is a new net, we have to add it
366  if( !m_isDryRun )
367  {
368  changed = true;
369  netinfo = new NETINFO_ITEM( m_board, netName );
370  m_commit.Add( netinfo );
371  m_addedNets[netName] = netinfo;
372  }
373 
374  msg.Printf( _( "Add net %s.\n" ), GetChars( netName ) );
376  }
377 
378  if( !pad->GetNetname().IsEmpty() )
379  {
380  msg.Printf( _( "Reconnect component %s pin %s from net %s to net %s.\n"),
381  GetChars( aPcbComponent->GetReference() ),
382  GetChars( pad->GetPadName() ),
383  GetChars( pad->GetNetname() ),
384  GetChars( netName ) );
385 
386  } else {
387  msg.Printf( _( "Connect component %s pin %s to net %s.\n"),
388  GetChars( aPcbComponent->GetReference() ),
389  GetChars( pad->GetPadName() ),
390  GetChars( netName ) );
391  }
392 
394 
395  msg.Printf( _( "Changing component \"%s:%s\" pin \"%s\" net name from "
396  "\"%s\" to \"%s\".\n" ),
397  GetChars( aPcbComponent->GetReference() ),
398  GetChars( aPcbComponent->GetPath() ),
399  GetChars( pad->GetPadName() ),
400  GetChars( pad->GetNetname() ),
401  GetChars( netName ) );
403 
404  if( !m_isDryRun )
405  {
406  changed = true;
407  pad->SetNet( netinfo );
408  }
409  }
410  }
411  }
412 
413  if( changed )
414  m_commit.Modified( aPcbComponent, copy );
415  else
416  delete copy;
417 
418  return true;
419 }
420 
421 
423 {
424  wxString msg;
425  MODULE* nextModule;
426  const COMPONENT* component;
427 
428  for( MODULE* module = m_board->m_Modules; module != NULL; module = nextModule )
429  {
430  nextModule = module->Next();
431 
432  if( m_lookupByTimestamp )
433  component = aNetlist.GetComponentByTimeStamp( module->GetPath() );
434  else
435  component = aNetlist.GetComponentByReference( module->GetReference() );
436 
437  if( component == NULL )
438  {
439  if( module->IsLocked() )
440  {
441  msg.Printf( _( "Component %s is locked, skipping removal.\n" ),
442  GetChars( module->GetReference() ) );
444  continue;
445  }
446 
447  msg.Printf( _( "Remove component %s." ),
448  GetChars( module->GetReference() ) );
450 
451  msg.Printf( _( "Removing unused component \"%s:%s\".\n" ),
452  GetChars( module->GetReference() ),
453  GetChars( module->GetPath() ) );
455 
456  if( !m_isDryRun )
457  m_commit.Remove( module );
458  }
459  }
460 
461  return true;
462 }
463 
464 
466 {
467  int count = 0;
468  wxString netname;
469  wxString msg;
470  D_PAD* pad = NULL;
471  D_PAD* previouspad = NULL;
472 
473  // We need the pad list, for next tests.
474  // padlist is the list of pads, sorted by netname.
475 
477 
478  if( m_isDryRun )
479  return false;
480 
481  std::vector<D_PAD*> padlist = m_board->GetPads();
482 
483  for( unsigned kk = 0; kk < padlist.size(); kk++ )
484  {
485  pad = padlist[kk];
486 
487  if( pad->GetNetname().IsEmpty() )
488  continue;
489 
490  if( netname != pad->GetNetname() ) // End of net
491  {
492  if( previouspad && count == 1 )
493  {
494  // First, see if we have a copper zone attached to this pad.
495  // If so, this is not really a single pad net
496 
497  for( int ii = 0; ii < m_board->GetAreaCount(); ii++ )
498  {
499  ZONE_CONTAINER* zone = m_board->GetArea( ii );
500 
501  if( !zone->IsOnCopperLayer() )
502  continue;
503 
504  if( zone->GetIsKeepout() )
505  continue;
506 
507  if( zone->GetNet() == previouspad->GetNet() )
508  {
509  count++;
510  break;
511  }
512  }
513 
514  if( count == 1 ) // Really one pad, and nothing else
515  {
516  msg.Printf( _( "Remove single pad net %s." ),
517  GetChars( previouspad->GetNetname() ) );
519 
520  msg.Printf( _( "Remove single pad net \"%s\" on \"%s\" pad '%s'\n" ),
521  GetChars( previouspad->GetNetname() ),
522  GetChars( previouspad->GetParent()->GetReference() ),
523  GetChars( previouspad->GetPadName() ) );
525 
526  previouspad->SetNetCode( NETINFO_LIST::UNCONNECTED );
527  }
528  }
529 
530  netname = pad->GetNetname();
531  count = 1;
532  }
533  else
534  {
535  count++;
536  }
537 
538  previouspad = pad;
539  }
540 
541  // Examine last pad
542  if( pad && count == 1 )
544 
545  return true;
546 }
547 
548 
550 {
551  // Last step: Some tests:
552  // verify all pads found in netlist:
553  // They should exist in footprints, otherwise the footprint is wrong
554  // note also references or time stamps are updated, so we use only
555  // the reference to find a footprint
556  //
557  // Also verify if zones have acceptable nets, i.e. nets with pads.
558  // Zone with no pad belongs to a "dead" net which happens after changes in schematic
559  // when no more pad use this net name.
560 
561  wxString msg;
562  wxString padname;
563 
564  for( int i = 0; i < (int) aNetlist.GetCount(); i++ )
565  {
566  const COMPONENT* component = aNetlist.GetComponent( i );
567  MODULE* footprint = m_board->FindModuleByReference( component->GetReference() );
568 
569  if( footprint == NULL ) // It can be missing in partial designs
570  continue;
571 
572  // Explore all pins/pads in component
573  for( unsigned jj = 0; jj < component->GetNetCount(); jj++ )
574  {
575  COMPONENT_NET net = component->GetNet( jj );
576  padname = net.GetPinName();
577 
578  if( footprint->FindPadByName( padname ) )
579  continue; // OK, pad found
580 
581  // not found: bad footprint, report error
582  msg.Printf( _( "Component %s pad %s not found in footprint %s\n" ),
583  GetChars( component->GetReference() ),
584  GetChars( padname ),
585  GetChars( FROM_UTF8( footprint->GetFPID().Format() ) ) );
587  ++m_errorCount;
588  }
589  }
590 
591  // Test copper zones to detect "dead" nets (nets without any pad):
592  for( int i = 0; i < m_board->GetAreaCount(); i++ )
593  {
594  ZONE_CONTAINER* zone = m_board->GetArea( i );
595 
596  if( !zone->IsOnCopperLayer() || zone->GetIsKeepout() )
597  continue;
598 
599  int nc = zone->GetNet()->GetNodesCount();
600 
601  if( nc == 0 )
602  {
603  msg.Printf( _( "Copper zone (net name %s): net has no pads connected." ),
604  GetChars( zone->GetNet()->GetNetname() ) );
606  ++m_warningCount;
607  }
608  }
609 
610  return true;
611 }
612 
613 
615 {
616  wxString msg;
617  m_errorCount = 0;
618  m_warningCount = 0;
619 
620  if( !m_isDryRun )
621  {
622  m_board->SetStatus( 0 );
623  }
624 
625  for( int i = 0; i < (int) aNetlist.GetCount(); i++ )
626  {
627  COMPONENT* component = aNetlist.GetComponent( i );
628  MODULE* footprint = NULL;
629 
630  msg.Printf( _( "Processing component \"%s:%s:%s\".\n" ),
631  GetChars( component->GetReference() ),
632  GetChars( component->GetTimeStamp() ),
633  GetChars( FROM_UTF8( component->GetFPID().Format() ) ) );
635 
636  if( aNetlist.IsFindByTimeStamp() )
637  footprint = m_board->FindModule( component->GetTimeStamp(), true );
638  else
639  footprint = m_board->FindModule( component->GetReference() );
640 
641  if( footprint ) // An existing footprint.
642  {
643  MODULE* newFootprint = replaceComponent( aNetlist, footprint, component );
644 
645  if( newFootprint )
646  footprint = newFootprint;
647  }
648  else
649  {
650  footprint = addNewComponent( component );
651  }
652 
653  if( footprint )
654  {
655  updateComponentParameters( footprint, component );
656  updateComponentPadConnections( footprint, component );
657  }
658  }
659 
660  //aNetlist.GetDeleteExtraFootprints()
661 
663  deleteUnusedComponents( aNetlist );
664 
667 
668  if( !m_isDryRun )
669  {
670  m_commit.Push( _( "Update netlist" ) );
671  m_frame->Compile_Ratsnest( NULL, false );
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:764
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:199
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:164
int GetNodesCount() const
Function GetNodesCount.
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
const D_PADS & GetPads()
Function GetPads returns a reference to a list of all the pads.
Definition: class_board.h:762
COMMIT & Modified(EDA_ITEM *aItem, EDA_ITEM *aCopy)
Creates an undo entry for an item that has been already modified.
Definition: commit.cpp:83
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.
Class that computes missing connections on a PCB.
D_PAD * FindPadByName(const wxString &aPadName) const
Function FindPadByName returns a D_PAD* with a matching name.
MODULE * Next() const
Definition: class_module.h:99
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:439
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:839
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:151
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:263
void ProcessBoard()
Function ProcessBoard() Prepares data for computing (computes a list of current nodes and connections...
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:421
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:1051
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:545
RN_DATA * GetRatsnest() const
Function GetRatsnest() returns list of missing connections between components/tracks.
Definition: class_board.h:287
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
void Compile_Ratsnest(wxDC *aDC, bool aDisplayStatus)
Function Compile_Ratsnest Create the entire board ratsnest.
Definition: ratsnest.cpp:165
COMPONENT * GetComponent(unsigned aIndex)
Function GetComponent returns the COMPONENT at aIndex.
Definition: pcb_netlist.h:256
Class NETINFO_ITEM handles the data for a net.
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:1022
bool updateComponentParameters(MODULE *aPcbComponent, COMPONENT *aNewComponent)
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:411
DLIST< MODULE > m_Modules
Definition: class_board.h:243
Class EDA_RECT handles the component boundary box.
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:448
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:382
void CopyNetlistSettings(MODULE *aModule, bool aCopyLocalSettings)
Function CopyNetlistSettings copies the netlist settings to aModule.
DLIST< D_PAD > & Pads()
Definition: class_module.h:133
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:160
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
void SetPath(const wxString &aPath)
Definition: class_module.h:161
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)