KiCad PCB EDA Suite
BOARD_NETLIST_UPDATER Class Reference

Update the BOARD with a new netlist. More...

#include <board_netlist_updater.h>

Public Member Functions

 BOARD_NETLIST_UPDATER (PCB_EDIT_FRAME *aFrame, BOARD *aBoard)
 
 ~BOARD_NETLIST_UPDATER ()
 
bool UpdateNetlist (NETLIST &aNetlist)
 Update the board's components according to the new netlist. More...
 
void SetReporter (REPORTER *aReporter)
 Enable dry run mode (just report, no changes to PCB). More...
 
void SetIsDryRun (bool aEnabled)
 
void SetReplaceFootprints (bool aEnabled)
 
void SetDeleteUnusedFootprints (bool aEnabled)
 
void SetLookupByTimestamp (bool aEnabled)
 
std::vector< FOOTPRINT * > GetAddedFootprints () const
 

Private Member Functions

void cacheNetname (PAD *aPad, const wxString &aNetname)
 
wxString getNetname (PAD *aPad)
 
void cachePinFunction (PAD *aPad, const wxString &aPinFunction)
 
wxString getPinFunction (PAD *aPad)
 
wxPoint estimateFootprintInsertionPosition ()
 
FOOTPRINTaddNewFootprint (COMPONENT *aComponent)
 
FOOTPRINTreplaceFootprint (NETLIST &aNetlist, FOOTPRINT *aFootprint, COMPONENT *aNewComponent)
 
bool updateFootprintParameters (FOOTPRINT *aPcbFootprint, COMPONENT *aNetlistComponent)
 
bool updateComponentPadConnections (FOOTPRINT *aFootprint, COMPONENT *aNewComponent)
 
void cacheCopperZoneConnections ()
 
bool updateCopperZoneNets (NETLIST &aNetlist)
 
bool testConnectivity (NETLIST &aNetlist, std::map< COMPONENT *, FOOTPRINT * > &aFootprintMap)
 

Private Attributes

PCB_EDIT_FRAMEm_frame
 
BOARD_COMMIT m_commit
 
BOARDm_board
 
REPORTERm_reporter
 
std::map< ZONE *, std::vector< PAD * > > m_zoneConnectionsCache
 
std::map< wxString, wxString > m_oldToNewNets
 
std::map< PAD *, wxString > m_padNets
 
std::map< PAD *, wxString > m_padPinFunctions
 
std::vector< FOOTPRINT * > m_addedFootprints
 
std::map< wxString, NETINFO_ITEM * > m_addedNets
 
bool m_deleteUnusedFootprints
 
bool m_isDryRun
 
bool m_replaceFootprints
 
bool m_lookupByTimestamp
 
int m_warningCount
 
int m_errorCount
 
int m_newFootprintsCount
 

Detailed Description

Update the BOARD with a new netlist.

The changes are made to the board are as follows they are not disabled in the status settings in the NETLIST:

  • If a new component is found in the NETLIST and not in the BOARD, it is added to the BOARD.
  • If a the component in the NETLIST is already on the BOARD, then one or more of the following actions can occur:
    • If the footprint name in the NETLIST does not match the footprint name on the BOARD, the footprint on the BOARD is replaced with the footprint specified in the NETLIST and the proper parameters are copied from the existing footprint.
    • If the reference designator in the NETLIST does not match the reference designator on the BOARD, the reference designator is updated from the NETLIST.
    • If the value field in the NETLIST does not match the value field on the BOARD, the value field is updated from the NETLIST.
    • If the time stamp in the NETLIST does not match the time stamp on the BOARD, the time stamp is updated from the NETLIST.
  • After each footprint is added or update as described above, each footprint pad net name is compared and updated to the value defined in the NETLIST.
  • After all of the footprints have been added, updated, and net names and pin function properly set, any extra unlocked footprints are removed from the BOARD.

Definition at line 65 of file board_netlist_updater.h.

Constructor & Destructor Documentation

◆ BOARD_NETLIST_UPDATER()

BOARD_NETLIST_UPDATER::BOARD_NETLIST_UPDATER ( PCB_EDIT_FRAME aFrame,
BOARD aBoard 
)

Definition at line 48 of file board_netlist_updater.cpp.

References NULL_REPORTER::GetInstance(), m_deleteUnusedFootprints, m_errorCount, m_isDryRun, m_lookupByTimestamp, m_newFootprintsCount, m_replaceFootprints, m_reporter, and m_warningCount.

◆ ~BOARD_NETLIST_UPDATER()

BOARD_NETLIST_UPDATER::~BOARD_NETLIST_UPDATER ( )

Definition at line 66 of file board_netlist_updater.cpp.

67{
68}

Member Function Documentation

◆ addNewFootprint()

FOOTPRINT * BOARD_NETLIST_UPDATER::addNewFootprint ( COMPONENT aComponent)
private

Definition at line 132 of file board_netlist_updater.cpp.

133{
134 wxString msg;
135
136 if( aComponent->GetFPID().empty() )
137 {
138 msg.Printf( _( "Cannot add %s (no footprint assigned)." ),
139 aComponent->GetReference(),
140 aComponent->GetFPID().Format().wx_str() );
142 ++m_errorCount;
143 return nullptr;
144 }
145
146 FOOTPRINT* footprint = m_frame->LoadFootprint( aComponent->GetFPID() );
147
148 if( footprint == nullptr )
149 {
150 msg.Printf( _( "Cannot add %s (footprint '%s' not found)." ),
151 aComponent->GetReference(),
152 aComponent->GetFPID().Format().wx_str() );
154 ++m_errorCount;
155 return nullptr;
156 }
157
158 if( m_isDryRun )
159 {
160 msg.Printf( _( "Add %s (footprint '%s')." ),
161 aComponent->GetReference(),
162 aComponent->GetFPID().Format().wx_str() );
163
164 delete footprint;
165 footprint = nullptr;
166 }
167 else
168 {
169 for( PAD* pad : footprint->Pads() )
170 {
171 // Set the pads ratsnest settings to the global settings
172 pad->SetLocalRatsnestVisible( m_frame->GetPcbNewSettings()->m_Display.m_ShowGlobalRatsnest );
173
174 // Pads in the library all have orphaned nets. Replace with Default.
175 pad->SetNetCode( 0 );
176 }
177
178 footprint->SetParent( m_board );
180
181 // This flag is used to prevent connectivity from considering the footprint during its
182 // initial build after the footprint is committed, because we're going to immediately start
183 // a move operation on the footprint and don't want its pads to drive nets onto vias/tracks
184 // it happens to land on at the initial position.
185 footprint->SetAttributes( footprint->GetAttributes() | FP_JUST_ADDED );
186
187 m_addedFootprints.push_back( footprint );
188 m_commit.Add( footprint );
189
190 msg.Printf( _( "Added %s (footprint '%s')." ),
191 aComponent->GetReference(),
192 aComponent->GetFPID().Format().wx_str() );
193 }
194
197 return footprint;
198}
std::vector< FOOTPRINT * > m_addedFootprints
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
Definition: commit.h:78
const wxString & GetReference() const
Definition: pcb_netlist.h:126
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:138
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:115
void SetPosition(const VECTOR2I &aPos) override
Definition: footprint.cpp:1666
void SetAttributes(int aAttributes)
Definition: footprint.h:247
int GetAttributes() const
Definition: footprint.h:246
PADS & Pads()
Definition: footprint.h:175
bool empty() const
Definition: lib_id.h:180
UTF8 Format() const
Definition: lib_id.cpp:116
Definition: pad.h:59
DISPLAY_OPTIONS m_Display
PCBNEW_SETTINGS * GetPcbNewSettings() const
FOOTPRINT * LoadFootprint(const LIB_ID &aFootprintId)
Attempt to load aFootprintId from the footprint library table.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
wxString wx_str() const
Definition: utf8.cpp:46
#define _(s)
@ FP_JUST_ADDED
Definition: footprint.h:73
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_ACTION

References _, COMMIT::Add(), LIB_ID::empty(), estimateFootprintInsertionPosition(), LIB_ID::Format(), FP_JUST_ADDED, FOOTPRINT::GetAttributes(), COMPONENT::GetFPID(), PCB_BASE_FRAME::GetPcbNewSettings(), COMPONENT::GetReference(), PCB_BASE_FRAME::LoadFootprint(), m_addedFootprints, m_board, m_commit, PCBNEW_SETTINGS::m_Display, m_errorCount, m_frame, m_isDryRun, m_newFootprintsCount, m_reporter, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_ShowGlobalRatsnest, pad, FOOTPRINT::Pads(), REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, FOOTPRINT::SetAttributes(), EDA_ITEM::SetParent(), FOOTPRINT::SetPosition(), and UTF8::wx_str().

Referenced by UpdateNetlist().

◆ cacheCopperZoneConnections()

void BOARD_NETLIST_UPDATER::cacheCopperZoneConnections ( )
private

Definition at line 591 of file board_netlist_updater.cpp.

592{
593 for( ZONE* zone : m_board->Zones() )
594 {
595 if( !zone->IsOnCopperLayer() || zone->GetIsRuleArea() )
596 continue;
597
598 m_zoneConnectionsCache[ zone ] = m_board->GetConnectivity()->GetConnectedPads( zone );
599 }
600}
std::map< ZONE *, std::vector< PAD * > > m_zoneConnectionsCache
ZONES & Zones()
Definition: board.h:288
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:399
Handle a list of polygons defining a copper zone.
Definition: zone.h:58

References BOARD::GetConnectivity(), m_board, m_zoneConnectionsCache, and BOARD::Zones().

Referenced by UpdateNetlist().

◆ cacheNetname()

void BOARD_NETLIST_UPDATER::cacheNetname ( PAD aPad,
const wxString &  aNetname 
)
private

Definition at line 74 of file board_netlist_updater.cpp.

75{
76 m_padNets[ aPad ] = aNetname;
77}
std::map< PAD *, wxString > m_padNets

References m_padNets.

Referenced by updateComponentPadConnections().

◆ cachePinFunction()

void BOARD_NETLIST_UPDATER::cachePinFunction ( PAD aPad,
const wxString &  aPinFunction 
)
private

Definition at line 89 of file board_netlist_updater.cpp.

90{
91 m_padPinFunctions[ aPad ] = aPinFunction;
92}
std::map< PAD *, wxString > m_padPinFunctions

References m_padPinFunctions.

Referenced by updateComponentPadConnections().

◆ estimateFootprintInsertionPosition()

wxPoint BOARD_NETLIST_UPDATER::estimateFootprintInsertionPosition ( )
private

Definition at line 104 of file board_netlist_updater.cpp.

105{
106 wxPoint bestPosition;
107
108 if( !m_board->IsEmpty() )
109 {
110 // Position new components below any existing board features.
112
113 if( bbox.GetWidth() || bbox.GetHeight() )
114 {
115 bestPosition.x = bbox.Centre().x;
116 bestPosition.y = bbox.GetBottom() + Millimeter2iu( 10 );
117 }
118 }
119 else
120 {
121 // Position new components in the center of the page when the board is empty.
122 wxSize pageSize = m_board->GetPageSettings().GetSizeIU();
123
124 bestPosition.x = pageSize.GetWidth() / 2;
125 bestPosition.y = pageSize.GetHeight() / 2;
126 }
127
128 return bestPosition;
129}
const PAGE_INFO & GetPageSettings() const
Definition: board.h:593
bool IsEmpty() const
Definition: board.h:330
const EDA_RECT GetBoardEdgesBoundingBox() const
Return the board bounding box calculated using exclusively the board edges (graphics on Edge....
Definition: board.h:795
Handle the component boundary box.
Definition: eda_rect.h:44
int GetWidth() const
Definition: eda_rect.h:123
int GetHeight() const
Definition: eda_rect.h:124
VECTOR2I Centre() const
Definition: eda_rect.h:69
int GetBottom() const
Definition: eda_rect.h:128
static constexpr int Millimeter2iu(double mm)

References EDA_RECT::Centre(), BOARD::GetBoardEdgesBoundingBox(), EDA_RECT::GetBottom(), EDA_RECT::GetHeight(), BOARD::GetPageSettings(), EDA_RECT::GetWidth(), BOARD::IsEmpty(), m_board, Millimeter2iu(), and VECTOR2< T >::x.

Referenced by addNewFootprint().

◆ GetAddedFootprints()

std::vector< FOOTPRINT * > BOARD_NETLIST_UPDATER::GetAddedFootprints ( ) const
inline

Definition at line 92 of file board_netlist_updater.h.

92{ return m_addedFootprints; }

References m_addedFootprints.

Referenced by PCB_EDIT_FRAME::OnNetlistChanged().

◆ getNetname()

wxString BOARD_NETLIST_UPDATER::getNetname ( PAD aPad)
private

Definition at line 80 of file board_netlist_updater.cpp.

81{
82 if( m_isDryRun && m_padNets.count( aPad ) )
83 return m_padNets[ aPad ];
84 else
85 return aPad->GetNetname();
86}

References BOARD_CONNECTED_ITEM::GetNetname(), m_isDryRun, and m_padNets.

Referenced by updateCopperZoneNets().

◆ getPinFunction()

wxString BOARD_NETLIST_UPDATER::getPinFunction ( PAD aPad)
private

Definition at line 95 of file board_netlist_updater.cpp.

96{
97 if( m_isDryRun && m_padPinFunctions.count( aPad ) )
98 return m_padPinFunctions[ aPad ];
99 else
100 return aPad->GetPinFunction();
101}
const wxString & GetPinFunction() const
Definition: pad.h:146

References PAD::GetPinFunction(), m_isDryRun, and m_padPinFunctions.

◆ replaceFootprint()

FOOTPRINT * BOARD_NETLIST_UPDATER::replaceFootprint ( NETLIST aNetlist,
FOOTPRINT aFootprint,
COMPONENT aNewComponent 
)
private

Definition at line 201 of file board_netlist_updater.cpp.

203{
204 wxString msg;
205
206 if( aNewComponent->GetFPID().empty() )
207 {
208 msg.Printf( _( "Cannot update %s (no footprint assigned)." ),
209 aNewComponent->GetReference(),
210 aNewComponent->GetFPID().Format().wx_str() );
212 ++m_errorCount;
213 return nullptr;
214 }
215
216 FOOTPRINT* newFootprint = m_frame->LoadFootprint( aNewComponent->GetFPID() );
217
218 if( newFootprint == nullptr )
219 {
220 msg.Printf( _( "Cannot update %s (footprint '%s' not found)." ),
221 aNewComponent->GetReference(),
222 aNewComponent->GetFPID().Format().wx_str() );
224 ++m_errorCount;
225 return nullptr;
226 }
227
228 if( m_isDryRun )
229 {
230 msg.Printf( _( "Change %s footprint from '%s' to '%s'."),
231 aFootprint->GetReference(),
232 aFootprint->GetFPID().Format().wx_str(),
233 aNewComponent->GetFPID().Format().wx_str() );
234
235 delete newFootprint;
236 newFootprint = nullptr;
237 }
238 else
239 {
240 m_frame->ExchangeFootprint( aFootprint, newFootprint, m_commit );
241
242 msg.Printf( _( "Changed %s footprint from '%s' to '%s'."),
243 aFootprint->GetReference(),
244 aFootprint->GetFPID().Format().wx_str(),
245 aNewComponent->GetFPID().Format().wx_str() );
246 }
247
250 return newFootprint;
251}
const LIB_ID & GetFPID() const
Definition: footprint.h:208
const wxString & GetReference() const
Definition: footprint.h:468
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetFabricationAttrs=true, bool reset3DModels=true, bool *aUpdated=nullptr)
Replace aExisting footprint by aNew footprint using the Existing footprint settings (position,...

References _, LIB_ID::empty(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_ID::Format(), FOOTPRINT::GetFPID(), COMPONENT::GetFPID(), FOOTPRINT::GetReference(), COMPONENT::GetReference(), PCB_BASE_FRAME::LoadFootprint(), m_commit, m_errorCount, m_frame, m_isDryRun, m_newFootprintsCount, m_reporter, REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, and UTF8::wx_str().

Referenced by UpdateNetlist().

◆ SetDeleteUnusedFootprints()

void BOARD_NETLIST_UPDATER::SetDeleteUnusedFootprints ( bool  aEnabled)
inline

◆ SetIsDryRun()

void BOARD_NETLIST_UPDATER::SetIsDryRun ( bool  aEnabled)
inline

Definition at line 84 of file board_netlist_updater.h.

84{ m_isDryRun = aEnabled; }

References m_isDryRun.

Referenced by DIALOG_NETLIST_IMPORT::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().

◆ SetLookupByTimestamp()

void BOARD_NETLIST_UPDATER::SetLookupByTimestamp ( bool  aEnabled)
inline

◆ SetReplaceFootprints()

void BOARD_NETLIST_UPDATER::SetReplaceFootprints ( bool  aEnabled)
inline

◆ SetReporter()

void BOARD_NETLIST_UPDATER::SetReporter ( REPORTER aReporter)
inline

Enable dry run mode (just report, no changes to PCB).

Definition at line 81 of file board_netlist_updater.h.

References m_reporter.

Referenced by DIALOG_NETLIST_IMPORT::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().

◆ testConnectivity()

bool BOARD_NETLIST_UPDATER::testConnectivity ( NETLIST aNetlist,
std::map< COMPONENT *, FOOTPRINT * > &  aFootprintMap 
)
private

Definition at line 782 of file board_netlist_updater.cpp.

784{
785 // Verify that board contains all pads in netlist: if it doesn't then footprints are
786 // wrong or missing.
787
788 wxString msg;
789 wxString padNumber;
790
791 for( int i = 0; i < (int) aNetlist.GetCount(); i++ )
792 {
793 COMPONENT* component = aNetlist.GetComponent( i );
794 FOOTPRINT* footprint = aFootprintMap[component];
795
796 if( !footprint ) // It can be missing in partial designs
797 continue;
798
799 // Explore all pins/pads in component
800 for( unsigned jj = 0; jj < component->GetNetCount(); jj++ )
801 {
802 padNumber = component->GetNet( jj ).GetPinName();
803
804 if( footprint->FindPadByNumber( padNumber ) )
805 continue; // OK, pad found
806
807 // not found: bad footprint, report error
808 msg.Printf( _( "%s pad %s not found in %s." ),
809 component->GetReference(),
810 padNumber,
811 footprint->GetFPID().Format().wx_str() );
813 ++m_errorCount;
814 }
815 }
816
817 return true;
818}
const wxString & GetPinName() const
Definition: pcb_netlist.h:57
Store all of the related footprint information found in a netlist.
Definition: pcb_netlist.h:85
const COMPONENT_NET & GetNet(unsigned aIndex) const
Definition: pcb_netlist.h:111
unsigned GetNetCount() const
Definition: pcb_netlist.h:109
PAD * FindPadByNumber(const wxString &aPadNumber, PAD *aSearchAfterMe=nullptr) const
Return a PAD with a matching number.
Definition: footprint.cpp:1125
unsigned GetCount() const
Definition: pcb_netlist.h:234
COMPONENT * GetComponent(unsigned aIndex)
Return the COMPONENT at aIndex.
Definition: pcb_netlist.h:242

References _, FOOTPRINT::FindPadByNumber(), LIB_ID::Format(), NETLIST::GetComponent(), NETLIST::GetCount(), FOOTPRINT::GetFPID(), COMPONENT::GetNet(), COMPONENT::GetNetCount(), COMPONENT_NET::GetPinName(), COMPONENT::GetReference(), m_errorCount, m_reporter, REPORTER::Report(), RPT_SEVERITY_ERROR, and UTF8::wx_str().

Referenced by UpdateNetlist().

◆ updateComponentPadConnections()

bool BOARD_NETLIST_UPDATER::updateComponentPadConnections ( FOOTPRINT aFootprint,
COMPONENT aNewComponent 
)
private

Definition at line 407 of file board_netlist_updater.cpp.

409{
410 wxString msg;
411
412 // Create a copy only if the footprint has not been added during this update
413 FOOTPRINT* copy = m_commit.GetStatus( aFootprint ) ? nullptr : (FOOTPRINT*) aFootprint->Clone();
414 bool changed = false;
415
416 // At this point, the component footprint is updated. Now update the nets.
417 for( PAD* pad : aFootprint->Pads() )
418 {
419 const COMPONENT_NET& net = aNewComponent->GetNet( pad->GetNumber() );
420
421 wxString pinFunction;
422 wxString pinType;
423
424 if( net.IsValid() ) // i.e. the pad has a name
425 {
426 pinFunction = net.GetPinFunction();
427 pinType = net.GetPinType();
428 }
429
430 if( !m_isDryRun )
431 {
432 if( pad->GetPinFunction() != pinFunction )
433 {
434 changed = true;
435 pad->SetPinFunction( pinFunction );
436 }
437
438 if( pad->GetPinType() != pinType )
439 {
440 changed = true;
441 pad->SetPinType( pinType );
442 }
443 }
444 else
445 {
446 cachePinFunction( pad, pinFunction );
447 }
448
449 // Test if new footprint pad has no net (pads not on copper layers have no net).
450 if( !net.IsValid() || !pad->IsOnCopperLayer() )
451 {
452 if( !pad->GetNetname().IsEmpty() )
453 {
454 if( m_isDryRun )
455 {
456 msg.Printf( _( "Disconnect %s pin %s." ),
457 aFootprint->GetReference(),
458 pad->GetNumber() );
459 }
460 else
461 {
462 msg.Printf( _( "Disconnected %s pin %s." ),
463 aFootprint->GetReference(),
464 pad->GetNumber() );
465 }
466
468 }
469 else if( pad->IsOnCopperLayer() && !pad->GetNumber().IsEmpty() )
470 {
471 // pad is connectable but has no net found in netlist
472 msg.Printf( _( "No net found for symbol %s pin %s." ),
473 aFootprint->GetReference(),
474 pad->GetNumber() );
476 }
477
478 if( !m_isDryRun )
479 {
480 changed = true;
481 pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
482
483 // If the pad has no net from netlist (i.e. not in netlist
484 // it cannot have a pin function
485 if( pad->GetNetname().IsEmpty() )
486 pad->SetPinFunction( wxEmptyString );
487
488 }
489 else
490 {
491 cacheNetname( pad, wxEmptyString );
492 }
493 }
494 else // New footprint pad has a net.
495 {
496 const wxString& netName = net.GetNetName();
497 NETINFO_ITEM* netinfo = m_board->FindNet( netName );
498
499 if( netinfo && !m_isDryRun )
500 netinfo->SetIsCurrent( true );
501
502 if( pad->GetNetname() != netName )
503 {
504
505 if( netinfo == nullptr )
506 {
507 // It might be a new net that has not been added to the board yet
508 if( m_addedNets.count( netName ) )
509 netinfo = m_addedNets[ netName ];
510 }
511
512 if( netinfo == nullptr )
513 {
514 netinfo = new NETINFO_ITEM( m_board, netName );
515
516 // It is a new net, we have to add it
517 if( !m_isDryRun )
518 {
519 changed = true;
520 m_commit.Add( netinfo );
521 }
522
523 m_addedNets[netName] = netinfo;
524 msg.Printf( _( "Add net %s." ), UnescapeString( netName ) );
526 }
527
528 if( !pad->GetNetname().IsEmpty() )
529 {
530 m_oldToNewNets[ pad->GetNetname() ] = netName;
531
532 if( m_isDryRun )
533 {
534 msg.Printf( _( "Reconnect %s pin %s from %s to %s."),
535 aFootprint->GetReference(),
536 pad->GetNumber(),
537 UnescapeString( pad->GetNetname() ),
538 UnescapeString( netName ) );
539 }
540 else
541 {
542 msg.Printf( _( "Reconnected %s pin %s from %s to %s."),
543 aFootprint->GetReference(),
544 pad->GetNumber(),
545 UnescapeString( pad->GetNetname() ),
546 UnescapeString( netName ) );
547 }
548 }
549 else
550 {
551 if( m_isDryRun )
552 {
553 msg.Printf( _( "Connect %s pin %s to %s."),
554 aFootprint->GetReference(),
555 pad->GetNumber(),
556 UnescapeString( netName ) );
557 }
558 else
559 {
560 msg.Printf( _( "Connected %s pin %s to %s."),
561 aFootprint->GetReference(),
562 pad->GetNumber(),
563 UnescapeString( netName ) );
564 }
565 }
566
568
569 if( !m_isDryRun )
570 {
571 changed = true;
572 pad->SetNet( netinfo );
573 }
574 else
575 {
576 cacheNetname( pad, netName );
577 }
578 }
579 }
580 }
581
582 if( changed && copy )
583 m_commit.Modified( aFootprint, copy );
584 else
585 delete copy;
586
587 return true;
588}
void cacheNetname(PAD *aPad, const wxString &aNetname)
std::map< wxString, wxString > m_oldToNewNets
std::map< wxString, NETINFO_ITEM * > m_addedNets
void cachePinFunction(PAD *aPad, const wxString &aPinFunction)
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1437
COMMIT & Modified(EDA_ITEM *aItem, EDA_ITEM *aCopy)
Definition: commit.h:110
int GetStatus(EDA_ITEM *aItem)
Definition: commit.cpp:131
Used to store the component pin name to net name (and pin function) associations stored in a netlist.
Definition: pcb_netlist.h:44
const wxString & GetNetName() const
Definition: pcb_netlist.h:58
bool IsValid() const
Definition: pcb_netlist.h:62
const wxString & GetPinFunction() const
Definition: pcb_netlist.h:59
const wxString & GetPinType() const
Definition: pcb_netlist.h:60
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: footprint.cpp:1355
Handle the data for a net.
Definition: netinfo.h:66
void SetIsCurrent(bool isCurrent)
Definition: netinfo.h:141
static const int UNCONNECTED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
Definition: netinfo.h:364
@ RPT_SEVERITY_WARNING
wxString UnescapeString(const wxString &aSource)

References _, COMMIT::Add(), cacheNetname(), cachePinFunction(), FOOTPRINT::Clone(), copy, BOARD::FindNet(), COMPONENT::GetNet(), COMPONENT_NET::GetNetName(), COMPONENT_NET::GetPinFunction(), COMPONENT_NET::GetPinType(), FOOTPRINT::GetReference(), COMMIT::GetStatus(), COMPONENT_NET::IsValid(), m_addedNets, m_board, m_commit, m_isDryRun, m_oldToNewNets, m_reporter, COMMIT::Modified(), pad, FOOTPRINT::Pads(), REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_WARNING, NETINFO_ITEM::SetIsCurrent(), NETINFO_LIST::UNCONNECTED, and UnescapeString().

Referenced by UpdateNetlist().

◆ updateCopperZoneNets()

bool BOARD_NETLIST_UPDATER::updateCopperZoneNets ( NETLIST aNetlist)
private

Definition at line 603 of file board_netlist_updater.cpp.

604{
605 wxString msg;
606 std::set<wxString> netlistNetnames;
607
608 for( int ii = 0; ii < (int) aNetlist.GetCount(); ii++ )
609 {
610 const COMPONENT* component = aNetlist.GetComponent( ii );
611
612 for( unsigned jj = 0; jj < component->GetNetCount(); jj++ )
613 {
614 const COMPONENT_NET& net = component->GetNet( jj );
615 netlistNetnames.insert( net.GetNetName() );
616 }
617 }
618
619 for( PCB_TRACK* via : m_board->Tracks() )
620 {
621 if( via->Type() != PCB_VIA_T )
622 continue;
623
624 if( netlistNetnames.count( via->GetNetname() ) == 0 )
625 {
626 wxString updatedNetname = wxEmptyString;
627
628 // Take via name from name change map if it didn't match to a new pad
629 // (this is useful for stitching vias that don't connect to tracks)
630 if( m_oldToNewNets.count( via->GetNetname() ) )
631 {
632 updatedNetname = m_oldToNewNets[via->GetNetname()];
633 }
634
635 if( !updatedNetname.IsEmpty() )
636 {
637 if( m_isDryRun )
638 {
639 msg.Printf( _( "Reconnect via from %s to %s." ),
640 UnescapeString( via->GetNetname() ),
641 UnescapeString( updatedNetname ) );
642
644 }
645 else
646 {
647 NETINFO_ITEM* netinfo = m_board->FindNet( updatedNetname );
648
649 if( !netinfo )
650 netinfo = m_addedNets[updatedNetname];
651
652 if( netinfo )
653 {
655 via->SetNet( netinfo );
656
657 msg.Printf( _( "Reconnected via from %s to %s." ),
658 UnescapeString( via->GetNetname() ),
659 UnescapeString( updatedNetname ) );
660
662 }
663 }
664 }
665 else
666 {
667 msg.Printf( _( "Via connected to unknown net (%s)." ),
668 UnescapeString( via->GetNetname() ) );
671 }
672 }
673 }
674
675 // Test copper zones to detect "dead" nets (nets without any pad):
676 for( ZONE* zone : m_board->Zones() )
677 {
678 if( !zone->IsOnCopperLayer() || zone->GetIsRuleArea() )
679 continue;
680
681 if( netlistNetnames.count( zone->GetNetname() ) == 0 )
682 {
683 // Look for a pad in the zone's connected-pad-cache which has been updated to
684 // a new net and use that. While this won't always be the right net, the dead
685 // net is guaranteed to be wrong.
686 wxString updatedNetname = wxEmptyString;
687
688 for( PAD* pad : m_zoneConnectionsCache[ zone ] )
689 {
690 if( getNetname( pad ) != zone->GetNetname() )
691 {
692 updatedNetname = getNetname( pad );
693 break;
694 }
695 }
696
697 // Take zone name from name change map if it didn't match to a new pad
698 // (this is useful for zones on internal layers)
699 if( updatedNetname.IsEmpty() && m_oldToNewNets.count( zone->GetNetname() ) )
700 {
701 updatedNetname = m_oldToNewNets[ zone->GetNetname() ];
702 }
703
704 if( !updatedNetname.IsEmpty() )
705 {
706 if( m_isDryRun )
707 {
708 if( !zone->GetZoneName().IsEmpty() )
709 {
710 msg.Printf( _( "Reconnect copper zone '%s' from %s to %s." ),
711 zone->GetZoneName(),
712 UnescapeString( zone->GetNetname() ),
713 UnescapeString( updatedNetname ) );
714 }
715 else
716 {
717 msg.Printf( _( "Reconnect copper zone from %s to %s." ),
718 UnescapeString( zone->GetNetname() ),
719 UnescapeString( updatedNetname ) );
720 }
721
723 }
724 else
725 {
726 NETINFO_ITEM* netinfo = m_board->FindNet( updatedNetname );
727
728 if( !netinfo )
729 netinfo = m_addedNets[ updatedNetname ];
730
731 if( netinfo )
732 {
733 m_commit.Modify( zone );
734 zone->SetNet( netinfo );
735
736 if( !zone->GetZoneName().IsEmpty() )
737 {
738 msg.Printf( _( "Reconnected copper zone '%s' from %s to %s." ),
739 zone->GetZoneName(),
740 UnescapeString( zone->GetNetname() ),
741 UnescapeString( updatedNetname ) );
742 }
743 else
744 {
745 msg.Printf( _( "Reconnected copper zone from %s to %s." ),
746 UnescapeString( zone->GetNetname() ),
747 UnescapeString( updatedNetname ) );
748 }
749
751 }
752 }
753 }
754 else
755 {
756 if( !zone->GetZoneName().IsEmpty() )
757 {
758 msg.Printf( _( "Copper zone '%s' has no pads connected." ),
759 zone->GetZoneName() );
760 }
761 else
762 {
763 PCB_LAYER_ID layer = zone->GetLayer();
764 VECTOR2I pos = zone->GetPosition();
765
766 msg.Printf( _( "Copper zone on layer %s at (%s, %s) has no pads connected." ),
767 m_board->GetLayerName( layer ),
770 }
771
774 }
775 }
776 }
777
778 return true;
779}
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:103
wxString getNetname(PAD *aPad)
TRACKS & Tracks()
Definition: board.h:279
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:402
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
Definition: commit.h:103
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:104

References _, BOARD::FindNet(), NETLIST::GetComponent(), NETLIST::GetCount(), BOARD::GetLayerName(), COMPONENT::GetNet(), COMPONENT::GetNetCount(), COMPONENT_NET::GetNetName(), getNetname(), EDA_BASE_FRAME::GetUserUnits(), m_addedNets, m_board, m_commit, m_frame, m_isDryRun, m_oldToNewNets, m_reporter, m_warningCount, m_zoneConnectionsCache, MessageTextFromValue(), COMMIT::Modify(), pad, PCB_VIA_T, REPORTER::Report(), RPT_SEVERITY_ACTION, RPT_SEVERITY_WARNING, BOARD::Tracks(), UnescapeString(), via, VECTOR2< T >::x, VECTOR2< T >::y, and BOARD::Zones().

Referenced by UpdateNetlist().

◆ updateFootprintParameters()

bool BOARD_NETLIST_UPDATER::updateFootprintParameters ( FOOTPRINT aPcbFootprint,
COMPONENT aNetlistComponent 
)
private

Definition at line 254 of file board_netlist_updater.cpp.

256{
257 wxString msg;
258
259 // Create a copy only if the footprint has not been added during this update
260 FOOTPRINT* copy = m_commit.GetStatus( aPcbFootprint ) ? nullptr
261 : (FOOTPRINT*) aPcbFootprint->Clone();
262 bool changed = false;
263
264 // Test for reference designator field change.
265 if( aPcbFootprint->GetReference() != aNetlistComponent->GetReference() )
266 {
267 if( m_isDryRun )
268 {
269 msg.Printf( _( "Change %s reference designator to %s." ),
270 aPcbFootprint->GetReference(),
271 aNetlistComponent->GetReference() );
272 }
273 else
274 {
275 msg.Printf( _( "Changed %s reference designator to %s." ),
276 aPcbFootprint->GetReference(),
277 aNetlistComponent->GetReference() );
278
279 changed = true;
280 aPcbFootprint->SetReference( aNetlistComponent->GetReference() );
281 }
282
284 }
285
286 // Test for value field change.
287 if( aPcbFootprint->GetValue() != aNetlistComponent->GetValue() )
288 {
289 if( m_isDryRun )
290 {
291 msg.Printf( _( "Change %s value from %s to %s." ),
292 aPcbFootprint->GetReference(),
293 aPcbFootprint->GetValue(),
294 aNetlistComponent->GetValue() );
295 }
296 else
297 {
298 msg.Printf( _( "Changed %s value from %s to %s." ),
299 aPcbFootprint->GetReference(),
300 aPcbFootprint->GetValue(),
301 aNetlistComponent->GetValue() );
302
303 changed = true;
304 aPcbFootprint->SetValue( aNetlistComponent->GetValue() );
305 }
306
308 }
309
310 // Test for time stamp change.
311 KIID_PATH new_path = aNetlistComponent->GetPath();
312
313 if( !aNetlistComponent->GetKIIDs().empty() )
314 new_path.push_back( aNetlistComponent->GetKIIDs().front() );
315
316 if( aPcbFootprint->GetPath() != new_path )
317 {
318 if( m_isDryRun )
319 {
320 msg.Printf( _( "Update %s symbol association from %s to %s." ),
321 aPcbFootprint->GetReference(),
322 aPcbFootprint->GetPath().AsString(),
323 new_path.AsString() );
324 }
325 else
326 {
327 msg.Printf( _( "Updated %s symbol association from %s to %s." ),
328 aPcbFootprint->GetReference(),
329 aPcbFootprint->GetPath().AsString(),
330 new_path.AsString() );
331
332 changed = true;
333 aPcbFootprint->SetPath( new_path );
334 }
335
337 }
338
339 if( aPcbFootprint->GetProperties() != aNetlistComponent->GetProperties() )
340 {
341 if( m_isDryRun )
342 {
343 msg.Printf( _( "Update %s properties." ),
344 aPcbFootprint->GetReference() );
345 }
346 else
347 {
348 msg.Printf( _( "Updated %s properties." ),
349 aPcbFootprint->GetReference() );
350
351 changed = true;
352 aPcbFootprint->SetProperties( aNetlistComponent->GetProperties() );
353 }
354
356 }
357
358 if( ( aNetlistComponent->GetProperties().count( wxT( "exclude_from_bom" ) ) > 0 )
359 != ( ( aPcbFootprint->GetAttributes() & FP_EXCLUDE_FROM_BOM ) > 0 ) )
360 {
361 if( m_isDryRun )
362 {
363 if( aNetlistComponent->GetProperties().count( wxT( "exclude_from_bom" ) ) )
364 {
365 msg.Printf( _( "Add %s 'exclude from BOM' fabrication attribute." ),
366 aPcbFootprint->GetReference() );
367 }
368 else
369 {
370 msg.Printf( _( "Remove %s 'exclude from BOM' fabrication attribute." ),
371 aPcbFootprint->GetReference() );
372 }
373 }
374 else
375 {
376 int attributes = aPcbFootprint->GetAttributes();
377
378 if( aNetlistComponent->GetProperties().count( wxT( "exclude_from_bom" ) ) )
379 {
380 attributes |= FP_EXCLUDE_FROM_BOM;
381 msg.Printf( _( "Added %s 'exclude from BOM' fabrication attribute." ),
382 aPcbFootprint->GetReference() );
383 }
384 else
385 {
386 attributes &= ~FP_EXCLUDE_FROM_BOM;
387 msg.Printf( _( "Removed %s 'exclude from BOM' fabrication attribute." ),
388 aPcbFootprint->GetReference() );
389 }
390
391 changed = true;
392 aPcbFootprint->SetAttributes( attributes );
393 }
394
396 }
397
398 if( changed && copy )
399 m_commit.Modified( aPcbFootprint, copy );
400 else
401 delete copy;
402
403 return true;
404}
const KIID_PATH & GetPath() const
Definition: pcb_netlist.h:143
const wxString & GetValue() const
Definition: pcb_netlist.h:129
const std::map< wxString, wxString > & GetProperties() const
Definition: pcb_netlist.h:135
const std::vector< KIID > & GetKIIDs() const
Definition: pcb_netlist.h:145
void SetPath(const KIID_PATH &aPath)
Definition: footprint.h:221
void SetReference(const wxString &aReference)
Definition: footprint.h:477
void SetValue(const wxString &aValue)
Definition: footprint.h:498
const wxString & GetValue() const
Definition: footprint.h:490
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: footprint.h:512
const KIID_PATH & GetPath() const
Definition: footprint.h:220
const std::map< wxString, wxString > & GetProperties() const
Definition: footprint.h:511
wxString AsString() const
Definition: kiid.cpp:330
@ FP_EXCLUDE_FROM_BOM
Definition: footprint.h:71

References _, KIID_PATH::AsString(), FOOTPRINT::Clone(), copy, FP_EXCLUDE_FROM_BOM, FOOTPRINT::GetAttributes(), COMPONENT::GetKIIDs(), FOOTPRINT::GetPath(), COMPONENT::GetPath(), FOOTPRINT::GetProperties(), COMPONENT::GetProperties(), FOOTPRINT::GetReference(), COMPONENT::GetReference(), COMMIT::GetStatus(), FOOTPRINT::GetValue(), COMPONENT::GetValue(), m_commit, m_isDryRun, m_reporter, COMMIT::Modified(), REPORTER::Report(), RPT_SEVERITY_ACTION, FOOTPRINT::SetAttributes(), FOOTPRINT::SetPath(), FOOTPRINT::SetProperties(), FOOTPRINT::SetReference(), and FOOTPRINT::SetValue().

Referenced by UpdateNetlist().

◆ UpdateNetlist()

bool BOARD_NETLIST_UPDATER::UpdateNetlist ( NETLIST aNetlist)

Update the board's components according to the new netlist.

See BOARD_NETLIST_UPDATER class description for the details of the process.

Parameters
aNetlistthe new netlist
Returns
true if process was completed successfully

Definition at line 821 of file board_netlist_updater.cpp.

822{
823 FOOTPRINT* lastPreexistingFootprint = nullptr;
824 COMPONENT* component = nullptr;
825 wxString msg;
826
827 m_errorCount = 0;
828 m_warningCount = 0;
830
831 std::map<COMPONENT*, FOOTPRINT*> footprintMap;
832
833 if( !m_board->Footprints().empty() )
834 lastPreexistingFootprint = m_board->Footprints().back();
835
837
838 // First mark all nets (except <no net>) as stale; we'll update those which are current
839 // in the following two loops.
840 //
841 if( !m_isDryRun )
842 {
843 m_board->SetStatus( 0 );
844
845 for( NETINFO_ITEM* net : m_board->GetNetInfo() )
846 net->SetIsCurrent( net->GetNetCode() == 0 );
847 }
848
849 // Next go through the netlist updating all board footprints which have matching component
850 // entries and adding new footprints for those that don't.
851 //
852 for( unsigned i = 0; i < aNetlist.GetCount(); i++ )
853 {
854 component = aNetlist.GetComponent( i );
855
856 if( component->GetProperties().count( wxT( "exclude_from_board" ) ) )
857 continue;
858
859 msg.Printf( _( "Processing symbol '%s:%s'." ),
860 component->GetReference(),
861 component->GetFPID().Format().wx_str() );
863
864 int matchCount = 0;
865
866 for( FOOTPRINT* footprint : m_board->Footprints() )
867 {
868 bool match = false;
869
871 {
872 for( const KIID& uuid : component->GetKIIDs() )
873 {
874 KIID_PATH base = component->GetPath();
875 base.push_back( uuid );
876
877 if( footprint->GetPath() == base )
878 {
879 match = true;
880 break;
881 }
882 }
883 }
884 else
885 {
886 match = footprint->GetReference().CmpNoCase( component->GetReference() ) == 0;
887 }
888
889 if( match )
890 {
891 FOOTPRINT* tmp = footprint;
892
893 if( m_replaceFootprints && component->GetFPID() != footprint->GetFPID() )
894 tmp = replaceFootprint( aNetlist, footprint, component );
895
896 if( tmp )
897 {
898 footprintMap[ component ] = tmp;
899
900 updateFootprintParameters( tmp, component );
901 updateComponentPadConnections( tmp, component );
902 }
903
904 matchCount++;
905 }
906
907 if( footprint == lastPreexistingFootprint )
908 {
909 // No sense going through the newly-created footprints: end of loop
910 break;
911 }
912 }
913
914 if( matchCount == 0 )
915 {
916 FOOTPRINT* footprint = addNewFootprint( component );
917
918 if( footprint )
919 {
920 footprintMap[ component ] = footprint;
921
922 updateFootprintParameters( footprint, component );
923 updateComponentPadConnections( footprint, component );
924 }
925 }
926 else if( matchCount > 1 )
927 {
928 msg.Printf( _( "Multiple footprints found for '%s'." ), component->GetReference() );
930 }
931 }
932
933 updateCopperZoneNets( aNetlist );
934
935 // Finally go through the board footprints and update all those that *don't* have matching
936 // component entries.
937 //
938 for( FOOTPRINT* footprint : m_board->Footprints() )
939 {
940 bool matched = false;
941 bool doDelete = m_deleteUnusedFootprints;
942
943 if( ( footprint->GetAttributes() & FP_BOARD_ONLY ) > 0 )
944 doDelete = false;
945
947 component = aNetlist.GetComponentByPath( footprint->GetPath() );
948 else
949 component = aNetlist.GetComponentByReference( footprint->GetReference() );
950
951 if( component && component->GetProperties().count( wxT( "exclude_from_board" ) ) == 0 )
952 matched = true;
953
954 if( doDelete && !matched && footprint->IsLocked() )
955 {
956 if( m_isDryRun )
957 {
958 msg.Printf( _( "Cannot remove unused footprint %s (locked)." ),
959 footprint->GetReference() );
960 }
961 else
962 {
963 msg.Printf( _( "Could not remove unused footprint %s (locked)." ),
964 footprint->GetReference() );
965 }
966
968 doDelete = false;
969 }
970
971 if( doDelete && !matched )
972 {
973 if( m_isDryRun )
974 {
975 msg.Printf( _( "Remove unused footprint %s." ), footprint->GetReference() );
976 }
977 else
978 {
979 m_commit.Remove( footprint );
980 msg.Printf( _( "Removed unused footprint %s." ), footprint->GetReference() );
981 }
982
984 }
985 else if( !m_isDryRun )
986 {
987 if( !matched )
988 footprint->SetPath( KIID_PATH() );
989
990 for( PAD* pad : footprint->Pads() )
991 {
992 if( pad->GetNet() )
993 pad->GetNet()->SetIsCurrent( true );
994 }
995 }
996 }
997
998 if( !m_isDryRun )
999 {
1000 m_board->GetConnectivity()->Build( m_board );
1001 testConnectivity( aNetlist, footprintMap );
1002
1003 for( NETINFO_ITEM* net : m_board->GetNetInfo() )
1004 {
1005 if( !net->IsCurrent() )
1006 {
1007 msg.Printf( _( "Removed unused net %s." ), net->GetNetname() );
1009 m_commit.Removed( net );
1010 }
1011 }
1012
1015 m_commit.Push( _( "Update netlist" ) );
1016
1019 }
1020
1021 if( m_isDryRun )
1022 {
1023 for( const std::pair<const wxString, NETINFO_ITEM*>& addedNet : m_addedNets )
1024 delete addedNet.second;
1025
1026 m_addedNets.clear();
1027 }
1028
1029 // Update the ratsnest
1032
1033 msg.Printf( _( "Total warnings: %d, errors: %d." ), m_warningCount, m_errorCount );
1035
1036 return true;
1037}
void SetResolveNetConflicts(bool aResolve=true)
Sets a flag that will cause Push() to resolve net conflicts on track/via clusters instead of the defa...
Definition: board_commit.h:73
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
bool updateFootprintParameters(FOOTPRINT *aPcbFootprint, COMPONENT *aNetlistComponent)
bool testConnectivity(NETLIST &aNetlist, std::map< COMPONENT *, FOOTPRINT * > &aFootprintMap)
bool updateCopperZoneNets(NETLIST &aNetlist)
bool updateComponentPadConnections(FOOTPRINT *aFootprint, COMPONENT *aNewComponent)
FOOTPRINT * replaceFootprint(NETLIST &aNetlist, FOOTPRINT *aFootprint, COMPONENT *aNewComponent)
FOOTPRINT * addNewFootprint(COMPONENT *aComponent)
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:737
void SynchronizeNetsAndNetClasses()
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:1503
FOOTPRINTS & Footprints()
Definition: board.h:282
COMMIT & Removed(EDA_ITEM *aItem)
Modify a given item in the model.
Definition: commit.h:96
COMMIT & Remove(EDA_ITEM *aItem)
Notify observers that aItem has been removed.
Definition: commit.h:90
void SetStatus(EDA_ITEM_FLAGS aStatus)
Definition: eda_item.h:150
bool IsLocked() const override
Definition: footprint.h:304
Definition: kiid.h:47
void RemoveUnusedNets()
COMPONENT * GetComponentByPath(const KIID_PATH &aPath)
Return a COMPONENT by aPath.
COMPONENT * GetComponentByReference(const wxString &aReference)
Return a COMPONENT by aReference.
void SaveProjectSettings() override
Save changes to the project settings to the project (.pro) file.
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Definition: reporter.h:99
@ FP_BOARD_ONLY
Definition: footprint.h:72
@ RPT_SEVERITY_INFO

References _, addNewFootprint(), cacheCopperZoneConnections(), BOARD::Footprints(), LIB_ID::Format(), FP_BOARD_ONLY, NETLIST::GetComponent(), NETLIST::GetComponentByPath(), NETLIST::GetComponentByReference(), BOARD::GetConnectivity(), NETLIST::GetCount(), COMPONENT::GetFPID(), COMPONENT::GetKIIDs(), BOARD::GetNetInfo(), COMPONENT::GetPath(), COMPONENT::GetProperties(), COMPONENT::GetReference(), m_addedNets, m_board, m_commit, m_deleteUnusedFootprints, m_errorCount, m_frame, m_isDryRun, m_lookupByTimestamp, m_newFootprintsCount, m_replaceFootprints, m_reporter, m_warningCount, pad, BOARD_COMMIT::Push(), COMMIT::Remove(), COMMIT::Removed(), NETINFO_LIST::RemoveUnusedNets(), replaceFootprint(), REPORTER::Report(), REPORTER::ReportTail(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, PCB_EDIT_FRAME::SaveProjectSettings(), BOARD_COMMIT::SetResolveNetConflicts(), EDA_ITEM::SetStatus(), BOARD::SynchronizeNetsAndNetClasses(), testConnectivity(), updateComponentPadConnections(), updateCopperZoneNets(), updateFootprintParameters(), and UTF8::wx_str().

Referenced by PCB_EDIT_FRAME::KiwayMailIn(), DIALOG_NETLIST_IMPORT::loadNetlist(), and DIALOG_UPDATE_PCB::PerformUpdate().

Member Data Documentation

◆ m_addedFootprints

std::vector<FOOTPRINT*> BOARD_NETLIST_UPDATER::m_addedFootprints
private

Definition at line 127 of file board_netlist_updater.h.

Referenced by addNewFootprint(), and GetAddedFootprints().

◆ m_addedNets

std::map<wxString, NETINFO_ITEM*> BOARD_NETLIST_UPDATER::m_addedNets
private

◆ m_board

◆ m_commit

◆ m_deleteUnusedFootprints

bool BOARD_NETLIST_UPDATER::m_deleteUnusedFootprints
private

◆ m_errorCount

int BOARD_NETLIST_UPDATER::m_errorCount
private

◆ m_frame

PCB_EDIT_FRAME* BOARD_NETLIST_UPDATER::m_frame
private

◆ m_isDryRun

◆ m_lookupByTimestamp

bool BOARD_NETLIST_UPDATER::m_lookupByTimestamp
private

◆ m_newFootprintsCount

int BOARD_NETLIST_UPDATER::m_newFootprintsCount
private

◆ m_oldToNewNets

std::map<wxString, wxString> BOARD_NETLIST_UPDATER::m_oldToNewNets
private

Definition at line 124 of file board_netlist_updater.h.

Referenced by updateComponentPadConnections(), and updateCopperZoneNets().

◆ m_padNets

std::map<PAD*, wxString> BOARD_NETLIST_UPDATER::m_padNets
private

Definition at line 125 of file board_netlist_updater.h.

Referenced by cacheNetname(), and getNetname().

◆ m_padPinFunctions

std::map<PAD*, wxString> BOARD_NETLIST_UPDATER::m_padPinFunctions
private

Definition at line 126 of file board_netlist_updater.h.

Referenced by cachePinFunction(), and getPinFunction().

◆ m_replaceFootprints

bool BOARD_NETLIST_UPDATER::m_replaceFootprints
private

◆ m_reporter

◆ m_warningCount

int BOARD_NETLIST_UPDATER::m_warningCount
private

◆ m_zoneConnectionsCache

std::map<ZONE*, std::vector<PAD*> > BOARD_NETLIST_UPDATER::m_zoneConnectionsCache
private

Definition at line 123 of file board_netlist_updater.h.

Referenced by cacheCopperZoneConnections(), and updateCopperZoneNets().


The documentation for this class was generated from the following files: