Naming conventions.
This commit is contained in:
parent
9554aaee7f
commit
ab8428bd68
|
@ -546,7 +546,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
||||||
|
|
||||||
BOARD_NETLIST_UPDATER updater( this, GetBoard() );
|
BOARD_NETLIST_UPDATER updater( this, GetBoard() );
|
||||||
updater.SetLookupByTimestamp( false );
|
updater.SetLookupByTimestamp( false );
|
||||||
updater.SetDeleteUnusedComponents ( false );
|
updater.SetDeleteUnusedFootprints( false );
|
||||||
updater.SetReplaceFootprints( false );
|
updater.SetReplaceFootprints( false );
|
||||||
updater.SetDeleteSinglePadNets( false );
|
updater.SetDeleteSinglePadNets( false );
|
||||||
updater.SetWarnPadNoNetInNetlist( false );
|
updater.SetWarnPadNoNetInNetlist( false );
|
||||||
|
|
|
@ -247,7 +247,7 @@ void DIALOG_NETLIST::loadNetlist( bool aDryRun )
|
||||||
updater.SetReporter ( &reporter );
|
updater.SetReporter ( &reporter );
|
||||||
updater.SetIsDryRun( aDryRun );
|
updater.SetIsDryRun( aDryRun );
|
||||||
updater.SetLookupByTimestamp( m_matchByUUID );
|
updater.SetLookupByTimestamp( m_matchByUUID );
|
||||||
updater.SetDeleteUnusedComponents ( m_cbDeleteExtraFootprints->GetValue() );
|
updater.SetDeleteUnusedFootprints( m_cbDeleteExtraFootprints->GetValue());
|
||||||
updater.SetReplaceFootprints( m_cbUpdateFootprints->GetValue() );
|
updater.SetReplaceFootprints( m_cbUpdateFootprints->GetValue() );
|
||||||
updater.SetDeleteSinglePadNets( m_cbDeleteSinglePadNets->GetValue() );
|
updater.SetDeleteSinglePadNets( m_cbDeleteSinglePadNets->GetValue() );
|
||||||
m_warnForNoNetPads = m_cbWarnNoNetPad->GetValue();
|
m_warnForNoNetPads = m_cbWarnNoNetPad->GetValue();
|
||||||
|
|
|
@ -110,7 +110,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun )
|
||||||
updater.SetReporter ( &reporter );
|
updater.SetReporter ( &reporter );
|
||||||
updater.SetIsDryRun( aDryRun );
|
updater.SetIsDryRun( aDryRun );
|
||||||
updater.SetLookupByTimestamp( !m_cbRelinkFootprints->GetValue() );
|
updater.SetLookupByTimestamp( !m_cbRelinkFootprints->GetValue() );
|
||||||
updater.SetDeleteUnusedComponents ( m_cbDeleteExtraFootprints->GetValue() );
|
updater.SetDeleteUnusedFootprints( m_cbDeleteExtraFootprints->GetValue());
|
||||||
updater.SetReplaceFootprints( m_cbUpdateFootprints->GetValue() );
|
updater.SetReplaceFootprints( m_cbUpdateFootprints->GetValue() );
|
||||||
updater.SetDeleteSinglePadNets( m_cbDeleteSinglePadNets->GetValue() );
|
updater.SetDeleteSinglePadNets( m_cbDeleteSinglePadNets->GetValue() );
|
||||||
updater.SetWarnPadNoNetInNetlist( m_warnForNoNetPads );
|
updater.SetWarnPadNoNetInNetlist( m_warnForNoNetPads );
|
||||||
|
|
|
@ -53,7 +53,7 @@ BOARD_NETLIST_UPDATER::BOARD_NETLIST_UPDATER( PCB_EDIT_FRAME* aFrame, BOARD* aBo
|
||||||
m_reporter = &NULL_REPORTER::GetInstance();
|
m_reporter = &NULL_REPORTER::GetInstance();
|
||||||
|
|
||||||
m_deleteSinglePadNets = true;
|
m_deleteSinglePadNets = true;
|
||||||
m_deleteUnusedComponents = false;
|
m_deleteUnusedFootprints = false;
|
||||||
m_isDryRun = false;
|
m_isDryRun = false;
|
||||||
m_replaceFootprints = true;
|
m_replaceFootprints = true;
|
||||||
m_lookupByTimestamp = false;
|
m_lookupByTimestamp = false;
|
||||||
|
@ -103,7 +103,7 @@ wxString BOARD_NETLIST_UPDATER::getPinFunction( PAD* aPad )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxPoint BOARD_NETLIST_UPDATER::estimateComponentInsertionPosition()
|
wxPoint BOARD_NETLIST_UPDATER::estimateFootprintInsertionPosition()
|
||||||
{
|
{
|
||||||
wxPoint bestPosition;
|
wxPoint bestPosition;
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ wxPoint BOARD_NETLIST_UPDATER::estimateComponentInsertionPosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FOOTPRINT* BOARD_NETLIST_UPDATER::addNewComponent( COMPONENT* aComponent )
|
FOOTPRINT* BOARD_NETLIST_UPDATER::addNewFootprint( COMPONENT* aComponent )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
|
@ -178,9 +178,9 @@ FOOTPRINT* BOARD_NETLIST_UPDATER::addNewComponent( COMPONENT* aComponent )
|
||||||
}
|
}
|
||||||
|
|
||||||
footprint->SetParent( m_board );
|
footprint->SetParent( m_board );
|
||||||
footprint->SetPosition( estimateComponentInsertionPosition( ) );
|
footprint->SetPosition( estimateFootprintInsertionPosition() );
|
||||||
|
|
||||||
m_addedComponents.push_back( footprint );
|
m_addedFootprints.push_back( footprint );
|
||||||
m_commit.Add( footprint );
|
m_commit.Add( footprint );
|
||||||
|
|
||||||
msg.Printf( _( "Added %s (footprint \"%s\")." ),
|
msg.Printf( _( "Added %s (footprint \"%s\")." ),
|
||||||
|
@ -194,7 +194,7 @@ FOOTPRINT* BOARD_NETLIST_UPDATER::addNewComponent( COMPONENT* aComponent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FOOTPRINT* BOARD_NETLIST_UPDATER::replaceComponent( NETLIST& aNetlist, FOOTPRINT* aPcbComponent,
|
FOOTPRINT* BOARD_NETLIST_UPDATER::replaceFootprint( NETLIST& aNetlist, FOOTPRINT* aFootprint,
|
||||||
COMPONENT* aNewComponent )
|
COMPONENT* aNewComponent )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -224,8 +224,8 @@ FOOTPRINT* BOARD_NETLIST_UPDATER::replaceComponent( NETLIST& aNetlist, FOOTPRINT
|
||||||
if( m_isDryRun )
|
if( m_isDryRun )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Change %s footprint from '%s' to '%s'."),
|
msg.Printf( _( "Change %s footprint from '%s' to '%s'."),
|
||||||
aPcbComponent->GetReference(),
|
aFootprint->GetReference(),
|
||||||
aPcbComponent->GetFPID().Format().wx_str(),
|
aFootprint->GetFPID().Format().wx_str(),
|
||||||
aNewComponent->GetFPID().Format().wx_str() );
|
aNewComponent->GetFPID().Format().wx_str() );
|
||||||
|
|
||||||
delete newFootprint;
|
delete newFootprint;
|
||||||
|
@ -233,11 +233,11 @@ FOOTPRINT* BOARD_NETLIST_UPDATER::replaceComponent( NETLIST& aNetlist, FOOTPRINT
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_frame->ExchangeFootprint( aPcbComponent, newFootprint, m_commit );
|
m_frame->ExchangeFootprint( aFootprint, newFootprint, m_commit );
|
||||||
|
|
||||||
msg.Printf( _( "Changed %s footprint from '%s' to '%s'."),
|
msg.Printf( _( "Changed %s footprint from '%s' to '%s'."),
|
||||||
aPcbComponent->GetReference(),
|
aFootprint->GetReference(),
|
||||||
aPcbComponent->GetFPID().Format().wx_str(),
|
aFootprint->GetFPID().Format().wx_str(),
|
||||||
aNewComponent->GetFPID().Format().wx_str() );
|
aNewComponent->GetFPID().Format().wx_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -972,7 +972,7 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
|
||||||
FOOTPRINT* tmp = footprint;
|
FOOTPRINT* tmp = footprint;
|
||||||
|
|
||||||
if( m_replaceFootprints && component->GetFPID() != footprint->GetFPID() )
|
if( m_replaceFootprints && component->GetFPID() != footprint->GetFPID() )
|
||||||
tmp = replaceComponent( aNetlist, footprint, component );
|
tmp = replaceFootprint( aNetlist, footprint, component );
|
||||||
|
|
||||||
if( tmp )
|
if( tmp )
|
||||||
{
|
{
|
||||||
|
@ -994,7 +994,7 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
|
||||||
|
|
||||||
if( matchCount == 0 )
|
if( matchCount == 0 )
|
||||||
{
|
{
|
||||||
FOOTPRINT* footprint = addNewComponent( component );
|
FOOTPRINT* footprint = addNewFootprint( component );
|
||||||
|
|
||||||
if( footprint )
|
if( footprint )
|
||||||
{
|
{
|
||||||
|
@ -1019,7 +1019,7 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
|
||||||
//
|
//
|
||||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||||
{
|
{
|
||||||
bool doDelete = m_deleteUnusedComponents;
|
bool doDelete = m_deleteUnusedFootprints;
|
||||||
|
|
||||||
if( ( footprint->GetAttributes() & FP_BOARD_ONLY ) > 0 )
|
if( ( footprint->GetAttributes() & FP_BOARD_ONLY ) > 0 )
|
||||||
doDelete = false;
|
doDelete = false;
|
||||||
|
|
|
@ -84,53 +84,24 @@ public:
|
||||||
*/
|
*/
|
||||||
bool UpdateNetlist( NETLIST& aNetlist );
|
bool UpdateNetlist( NETLIST& aNetlist );
|
||||||
|
|
||||||
///< Set the reporter object.
|
void SetReporter( REPORTER* aReporter ) { m_reporter = aReporter; }
|
||||||
void SetReporter( REPORTER* aReporter )
|
|
||||||
{
|
|
||||||
m_reporter = aReporter;
|
|
||||||
}
|
|
||||||
|
|
||||||
///< Enable "delete single pad nets" option.
|
///< Enable dry run mode (just report, no changes to PCB).
|
||||||
void SetDeleteSinglePadNets( bool aEnabled )
|
void SetIsDryRun( bool aEnabled ) { m_isDryRun = aEnabled; }
|
||||||
{
|
|
||||||
m_deleteSinglePadNets = aEnabled;
|
void SetDeleteSinglePadNets( bool aEnabled ) { m_deleteSinglePadNets = aEnabled; }
|
||||||
}
|
|
||||||
|
|
||||||
///< Enable warning option if a connectable pad is not found in netlist
|
///< Enable warning option if a connectable pad is not found in netlist
|
||||||
///< connectable = pad with a name and on a copper layer.
|
///< connectable = pad with a name and on a copper layer.
|
||||||
void SetWarnPadNoNetInNetlist( bool aEnabled )
|
void SetWarnPadNoNetInNetlist( bool aEnabled ) { m_warnForNoNetPads = aEnabled; }
|
||||||
{
|
|
||||||
m_warnForNoNetPads = aEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
///< Enable dry run mode (just report, no changes to PCB).
|
void SetReplaceFootprints( bool aEnabled ) { m_replaceFootprints = aEnabled; }
|
||||||
void SetIsDryRun( bool aEnabled )
|
|
||||||
{
|
|
||||||
m_isDryRun = aEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
///< Enable replacing footprints with new ones.
|
void SetDeleteUnusedFootprints( bool aEnabled ) { m_deleteUnusedFootprints = aEnabled; }
|
||||||
void SetReplaceFootprints( bool aEnabled )
|
|
||||||
{
|
|
||||||
m_replaceFootprints = aEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
///< Enable removing unused components.
|
void SetLookupByTimestamp( bool aEnabled ) { m_lookupByTimestamp = aEnabled; }
|
||||||
void SetDeleteUnusedComponents( bool aEnabled )
|
|
||||||
{
|
|
||||||
m_deleteUnusedComponents = aEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
///< Enable component lookup by timestamp instead of reference.
|
std::vector<FOOTPRINT*> GetAddedFootprints() const { return m_addedFootprints; }
|
||||||
void SetLookupByTimestamp( bool aEnabled )
|
|
||||||
{
|
|
||||||
m_lookupByTimestamp = aEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<FOOTPRINT*> GetAddedComponents() const
|
|
||||||
{
|
|
||||||
return m_addedComponents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void cacheNetname( PAD* aPad, const wxString& aNetname );
|
void cacheNetname( PAD* aPad, const wxString& aNetname );
|
||||||
|
@ -139,11 +110,11 @@ private:
|
||||||
void cachePinFunction( PAD* aPad, const wxString& aPinFunction );
|
void cachePinFunction( PAD* aPad, const wxString& aPinFunction );
|
||||||
wxString getPinFunction( PAD* aPad );
|
wxString getPinFunction( PAD* aPad );
|
||||||
|
|
||||||
wxPoint estimateComponentInsertionPosition();
|
wxPoint estimateFootprintInsertionPosition();
|
||||||
|
|
||||||
FOOTPRINT* addNewComponent( COMPONENT* aComponent );
|
FOOTPRINT* addNewFootprint( COMPONENT* aComponent );
|
||||||
|
|
||||||
FOOTPRINT* replaceComponent( NETLIST& aNetlist, FOOTPRINT* aPcbComponent,
|
FOOTPRINT* replaceFootprint( NETLIST& aNetlist, FOOTPRINT* aFootprint,
|
||||||
COMPONENT* aNewComponent );
|
COMPONENT* aNewComponent );
|
||||||
|
|
||||||
bool updateFootprintParameters( FOOTPRINT* aPcbFootprint, COMPONENT* aNetlistComponent );
|
bool updateFootprintParameters( FOOTPRINT* aPcbFootprint, COMPONENT* aNetlistComponent );
|
||||||
|
@ -154,8 +125,6 @@ private:
|
||||||
|
|
||||||
bool updateCopperZoneNets( NETLIST& aNetlist );
|
bool updateCopperZoneNets( NETLIST& aNetlist );
|
||||||
|
|
||||||
bool deleteUnusedComponents( NETLIST& aNetlist );
|
|
||||||
|
|
||||||
bool deleteSinglePadNets();
|
bool deleteSinglePadNets();
|
||||||
|
|
||||||
bool testConnectivity( NETLIST& aNetlist, std::map<COMPONENT*, FOOTPRINT*>& aFootprintMap );
|
bool testConnectivity( NETLIST& aNetlist, std::map<COMPONENT*, FOOTPRINT*>& aFootprintMap );
|
||||||
|
@ -169,11 +138,11 @@ private:
|
||||||
std::map<wxString, wxString> m_oldToNewNets;
|
std::map<wxString, wxString> m_oldToNewNets;
|
||||||
std::map<PAD*, wxString> m_padNets;
|
std::map<PAD*, wxString> m_padNets;
|
||||||
std::map<PAD*, wxString> m_padPinFunctions;
|
std::map<PAD*, wxString> m_padPinFunctions;
|
||||||
std::vector<FOOTPRINT*> m_addedComponents;
|
std::vector<FOOTPRINT*> m_addedFootprints;
|
||||||
std::map<wxString, NETINFO_ITEM*> m_addedNets;
|
std::map<wxString, NETINFO_ITEM*> m_addedNets;
|
||||||
|
|
||||||
bool m_deleteSinglePadNets;
|
bool m_deleteSinglePadNets;
|
||||||
bool m_deleteUnusedComponents;
|
bool m_deleteUnusedFootprints;
|
||||||
bool m_isDryRun;
|
bool m_isDryRun;
|
||||||
bool m_replaceFootprints;
|
bool m_replaceFootprints;
|
||||||
bool m_lookupByTimestamp;
|
bool m_lookupByTimestamp;
|
||||||
|
|
|
@ -99,7 +99,7 @@ void PCB_EDIT_FRAME::OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater, bool* aR
|
||||||
for( auto track : board->Tracks() )
|
for( auto track : board->Tracks() )
|
||||||
GetCanvas()->GetView()->Update( track );
|
GetCanvas()->GetView()->Update( track );
|
||||||
|
|
||||||
std::vector<FOOTPRINT*> newFootprints = aUpdater.GetAddedComponents();
|
std::vector<FOOTPRINT*> newFootprints = aUpdater.GetAddedFootprints();
|
||||||
|
|
||||||
// Spread new footprints.
|
// Spread new footprints.
|
||||||
wxPoint areaPosition = (wxPoint) GetCanvas()->GetViewControls()->GetCursorPosition();
|
wxPoint areaPosition = (wxPoint) GetCanvas()->GetViewControls()->GetCursorPosition();
|
||||||
|
|
Loading…
Reference in New Issue