Renamed D_PAD::{Set,Get}PadName() to D_PAD::{Set,Get}Name()

This commit is contained in:
Maciej Suminski 2017-08-11 11:22:13 +02:00
parent d6f3961804
commit cca63801bf
38 changed files with 77 additions and 77 deletions

View File

@ -104,7 +104,7 @@ void ARRAY_CREATOR::Invoke()
if( new_item->Type() == PCB_PAD_T ) if( new_item->Type() == PCB_PAD_T )
{ {
const wxString padName = array_opts->GetItemNumber( ptN ); const wxString padName = array_opts->GetItemNumber( ptN );
static_cast<D_PAD*>( new_item )->SetPadName( padName ); static_cast<D_PAD*>( new_item )->SetName( padName );
} }
} }
} }

View File

@ -321,7 +321,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
// At this point, the component footprint is updated. Now update the nets. // At this point, the component footprint is updated. Now update the nets.
for( D_PAD* pad = aPcbComponent->PadsList(); pad; pad = pad->Next() ) for( D_PAD* pad = aPcbComponent->PadsList(); pad; pad = pad->Next() )
{ {
COMPONENT_NET net = aNewComponent->GetNet( pad->GetPadName() ); COMPONENT_NET net = aNewComponent->GetNet( pad->GetName() );
if( !net.IsValid() ) // New footprint pad has no net. if( !net.IsValid() ) // New footprint pad has no net.
{ {
@ -329,13 +329,13 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
{ {
msg.Printf( _( "Disconnect component %s pin %s.\n" ), msg.Printf( _( "Disconnect component %s pin %s.\n" ),
GetChars( aPcbComponent->GetReference() ), GetChars( aPcbComponent->GetReference() ),
GetChars( pad->GetPadName() ) ); GetChars( pad->GetName() ) );
m_reporter->Report( msg, REPORTER::RPT_ACTION ); m_reporter->Report( msg, REPORTER::RPT_ACTION );
msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ), msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ),
GetChars( aPcbComponent->GetReference() ), GetChars( aPcbComponent->GetReference() ),
GetChars( aPcbComponent->GetPath() ), GetChars( aPcbComponent->GetPath() ),
GetChars( pad->GetPadName() ) ); GetChars( pad->GetName() ) );
m_reporter->Report( msg, REPORTER::RPT_INFO ); m_reporter->Report( msg, REPORTER::RPT_INFO );
} }
@ -380,14 +380,14 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
{ {
msg.Printf( _( "Reconnect component %s pin %s from net %s to net %s.\n"), msg.Printf( _( "Reconnect component %s pin %s from net %s to net %s.\n"),
GetChars( aPcbComponent->GetReference() ), GetChars( aPcbComponent->GetReference() ),
GetChars( pad->GetPadName() ), GetChars( pad->GetName() ),
GetChars( pad->GetNetname() ), GetChars( pad->GetNetname() ),
GetChars( netName ) ); GetChars( netName ) );
} else { } else {
msg.Printf( _( "Connect component %s pin %s to net %s.\n"), msg.Printf( _( "Connect component %s pin %s to net %s.\n"),
GetChars( aPcbComponent->GetReference() ), GetChars( aPcbComponent->GetReference() ),
GetChars( pad->GetPadName() ), GetChars( pad->GetName() ),
GetChars( netName ) ); GetChars( netName ) );
} }
@ -397,7 +397,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
"\"%s\" to \"%s\".\n" ), "\"%s\" to \"%s\".\n" ),
GetChars( aPcbComponent->GetReference() ), GetChars( aPcbComponent->GetReference() ),
GetChars( aPcbComponent->GetPath() ), GetChars( aPcbComponent->GetPath() ),
GetChars( pad->GetPadName() ), GetChars( pad->GetName() ),
GetChars( pad->GetNetname() ), GetChars( pad->GetNetname() ),
GetChars( netName ) ); GetChars( netName ) );
m_reporter->Report( msg, REPORTER::RPT_INFO ); m_reporter->Report( msg, REPORTER::RPT_INFO );
@ -521,7 +521,7 @@ bool BOARD_NETLIST_UPDATER::deleteSinglePadNets()
msg.Printf( _( "Remove single pad net \"%s\" on \"%s\" pad '%s'\n" ), msg.Printf( _( "Remove single pad net \"%s\" on \"%s\" pad '%s'\n" ),
GetChars( previouspad->GetNetname() ), GetChars( previouspad->GetNetname() ),
GetChars( previouspad->GetParent()->GetReference() ), GetChars( previouspad->GetParent()->GetReference() ),
GetChars( previouspad->GetPadName() ) ); GetChars( previouspad->GetName() ) );
m_reporter->Report( msg, REPORTER::RPT_ACTION ); m_reporter->Report( msg, REPORTER::RPT_ACTION );
previouspad->SetNetCode( NETINFO_LIST::UNCONNECTED ); previouspad->SetNetCode( NETINFO_LIST::UNCONNECTED );

View File

@ -2593,7 +2593,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
// At this point, the component footprint is updated. Now update the nets. // At this point, the component footprint is updated. Now update the nets.
for( auto pad : footprint->Pads() ) for( auto pad : footprint->Pads() )
{ {
COMPONENT_NET net = component->GetNet( pad->GetPadName() ); COMPONENT_NET net = component->GetNet( pad->GetName() );
if( !net.IsValid() ) // Footprint pad had no net. if( !net.IsValid() ) // Footprint pad had no net.
{ {
@ -2602,7 +2602,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ), msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ),
GetChars( footprint->GetReference() ), GetChars( footprint->GetReference() ),
GetChars( footprint->GetPath() ), GetChars( footprint->GetPath() ),
GetChars( pad->GetPadName() ) ); GetChars( pad->GetName() ) );
aReporter->Report( msg, REPORTER::RPT_ACTION ); aReporter->Report( msg, REPORTER::RPT_ACTION );
} }
@ -2622,7 +2622,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
"\"%s\" to \"%s\".\n" ), "\"%s\" to \"%s\".\n" ),
GetChars( footprint->GetReference() ), GetChars( footprint->GetReference() ),
GetChars( footprint->GetPath() ), GetChars( footprint->GetPath() ),
GetChars( pad->GetPadName() ), GetChars( pad->GetName() ),
GetChars( pad->GetNetname() ), GetChars( pad->GetNetname() ),
GetChars( net.GetNetName() ) ); GetChars( net.GetNetName() ) );
aReporter->Report( msg, REPORTER::RPT_ACTION ); aReporter->Report( msg, REPORTER::RPT_ACTION );
@ -2736,7 +2736,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
msg.Printf( _( "Remove single pad net \"%s\" on \"%s\" pad '%s'\n" ), msg.Printf( _( "Remove single pad net \"%s\" on \"%s\" pad '%s'\n" ),
GetChars( pad->GetNetname() ), GetChars( pad->GetNetname() ),
GetChars( pad->GetParent()->GetReference() ), GetChars( pad->GetParent()->GetReference() ),
GetChars( pad->GetPadName() ) ); GetChars( pad->GetName() ) );
aReporter->Report( msg, REPORTER::RPT_ACTION ); aReporter->Report( msg, REPORTER::RPT_ACTION );
} }

View File

@ -373,7 +373,7 @@ void MODULE::CopyNetlistSettings( MODULE* aModule, bool aCopyLocalSettings )
// because we copy settings from the first pad found. // because we copy settings from the first pad found.
// When old and new footprints have very few differences, a better // When old and new footprints have very few differences, a better
// algo can be used. // algo can be used.
D_PAD* oldPad = FindPadByName( pad->GetPadName() ); D_PAD* oldPad = FindPadByName( pad->GetName() );
if( oldPad ) if( oldPad )
oldPad->CopyNetlistSettings( pad, aCopyLocalSettings ); oldPad->CopyNetlistSettings( pad, aCopyLocalSettings );
@ -644,7 +644,7 @@ D_PAD* MODULE::FindPadByName( const wxString& aPadName ) const
{ {
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() ) for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
{ {
if( pad->GetPadName().CmpNoCase( aPadName ) == 0 ) // why case insensitive? if( pad->GetName().CmpNoCase( aPadName ) == 0 ) // why case insensitive?
return pad; return pad;
} }
@ -721,7 +721,7 @@ unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
// Skip pads with no name, because they are usually "mechanical" // Skip pads with no name, because they are usually "mechanical"
// pads, not "electrical" pads // pads, not "electrical" pads
if( pad->GetPadName().IsEmpty() ) if( pad->GetName().IsEmpty() )
continue; continue;
if( !aIncludeNPTH ) if( !aIncludeNPTH )
@ -733,7 +733,7 @@ unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
} }
} }
usedNames.insert( pad->GetPadName() ); usedNames.insert( pad->GetName() );
} }
return usedNames.size(); return usedNames.size();
@ -1208,7 +1208,7 @@ wxString MODULE::GetNextPadName( bool aFillSequenceGaps ) const
// Create a set of used pad numbers // Create a set of used pad numbers
for( D_PAD* pad = PadsList(); pad; pad = pad->Next() ) for( D_PAD* pad = PadsList(); pad; pad = pad->Next() )
{ {
int padNumber = getTrailingInt( pad->GetPadName() ); int padNumber = getTrailingInt( pad->GetName() );
usedNumbers.insert( padNumber ); usedNumbers.insert( padNumber );
} }

View File

@ -517,7 +517,7 @@ bool D_PAD::IncrementPadName( bool aSkipUnconnectable, bool aFillSequenceGaps )
bool skip = aSkipUnconnectable && ( GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED ); bool skip = aSkipUnconnectable && ( GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED );
if( !skip ) if( !skip )
SetPadName( GetParent()->GetNextPadName( aFillSequenceGaps ) ); SetName( GetParent()->GetNextPadName( aFillSequenceGaps ) );
return !skip; return !skip;
} }
@ -1180,7 +1180,7 @@ wxString D_PAD::GetSelectMenuText() const
{ {
wxString text; wxString text;
wxString padlayers( LayerMaskDescribe( GetBoard(), m_layerMask ) ); wxString padlayers( LayerMaskDescribe( GetBoard(), m_layerMask ) );
wxString padname( GetPadName() ); wxString padname( GetName() );
if( padname.IsEmpty() ) if( padname.IsEmpty() )
{ {
@ -1191,7 +1191,7 @@ wxString D_PAD::GetSelectMenuText() const
else else
{ {
text.Printf( _( "Pad %s on %s of %s" ), text.Printf( _( "Pad %s on %s of %s" ),
GetChars(GetPadName() ), GetChars( padlayers ), GetChars(GetName() ), GetChars( padlayers ),
GetChars(GetParent()->GetReference() ) ); GetChars(GetParent()->GetReference() ) );
} }
@ -1253,7 +1253,7 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
wxString msg; wxString msg;
msg.Printf( wxT( "footprint %s, pad %s: could not find valid layer for pad" ), msg.Printf( wxT( "footprint %s, pad %s: could not find valid layer for pad" ),
GetParent() ? GetParent()->GetReference() : "<null>", GetParent() ? GetParent()->GetReference() : "<null>",
GetPadName().IsEmpty() ? "(unnamed)" : GetPadName() ); GetName().IsEmpty() ? "(unnamed)" : GetName() );
wxLogWarning( msg ); wxLogWarning( msg );
} }
#endif #endif

View File

@ -164,7 +164,7 @@ public:
* Set the pad name (sometimes called pad number, although * Set the pad name (sometimes called pad number, although
* it can be an array reference like AA12). * it can be an array reference like AA12).
*/ */
void SetPadName( const wxString& aName ) void SetName( const wxString& aName )
{ {
m_name = aName; m_name = aName;
} }
@ -172,7 +172,7 @@ public:
/** /**
* @return the pad name * @return the pad name
*/ */
const wxString& GetPadName() const const wxString& GetName() const
{ {
return m_name; return m_name;
} }

View File

@ -174,7 +174,7 @@ std::string FormatProbeItem( BOARD_ITEM* aItem )
case PCB_PAD_T: case PCB_PAD_T:
{ {
module = (MODULE*) aItem->GetParent(); module = (MODULE*) aItem->GetParent();
wxString pad = ((D_PAD*)aItem)->GetPadName(); wxString pad = ((D_PAD*)aItem)->GetName();
return StrPrintf( "$PART: \"%s\" $PAD: \"%s\"", return StrPrintf( "$PART: \"%s\" $PAD: \"%s\"",
TO_UTF8( module->GetReference() ), TO_UTF8( module->GetReference() ),

View File

@ -464,7 +464,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
m_staticTextWarningPadFlipped->Show(m_isFlipped); m_staticTextWarningPadFlipped->Show(m_isFlipped);
m_PadNumCtrl->SetValue( m_dummyPad->GetPadName() ); m_PadNumCtrl->SetValue( m_dummyPad->GetName() );
m_PadNetNameCtrl->SetValue( m_dummyPad->GetNetname() ); m_PadNetNameCtrl->SetValue( m_dummyPad->GetNetname() );
// Set the unit name in dialog: // Set the unit name in dialog:
@ -1306,7 +1306,7 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow()
m_currentPad->SetLayerSet( FlipLayerMask( m_currentPad->GetLayerSet() ) ); m_currentPad->SetLayerSet( FlipLayerMask( m_currentPad->GetLayerSet() ) );
} }
m_currentPad->SetPadName( m_padMaster->GetPadName() ); m_currentPad->SetName( m_padMaster->GetName() );
wxString padNetname; wxString padNetname;
@ -1513,7 +1513,7 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( D_PAD* aPad )
aPad->SetOffset( wxPoint( x, y ) ); aPad->SetOffset( wxPoint( x, y ) );
aPad->SetOrientation( m_OrientValue * 10.0 ); aPad->SetOrientation( m_OrientValue * 10.0 );
aPad->SetPadName( m_PadNumCtrl->GetValue() ); aPad->SetName( m_PadNumCtrl->GetValue() );
// Check if user has set an existing net name // Check if user has set an existing net name
const NETINFO_ITEM* netinfo = m_board->FindNet( m_PadNetNameCtrl->GetValue() ); const NETINFO_ITEM* netinfo = m_board->FindNet( m_PadNetNameCtrl->GetValue() );
@ -1593,7 +1593,7 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( D_PAD* aPad )
// Mechanical purpose only: // Mechanical purpose only:
// no offset, no net name, no pad name allowed // no offset, no net name, no pad name allowed
aPad->SetOffset( wxPoint( 0, 0 ) ); aPad->SetOffset( wxPoint( 0, 0 ) );
aPad->SetPadName( wxEmptyString ); aPad->SetName( wxEmptyString );
aPad->SetNetCode( NETINFO_LIST::UNCONNECTED ); aPad->SetNetCode( NETINFO_LIST::UNCONNECTED );
break; break;

View File

@ -858,7 +858,7 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
// update the nets within the pads of the clone // update the nets within the pads of the clone
for( D_PAD* pad = m->PadsList(); pad; pad = pad->Next() ) for( D_PAD* pad = m->PadsList(); pad; pad = pad->Next() )
{ {
string pn_key = makeKey( e.name, TO_UTF8( pad->GetPadName() ) ); string pn_key = makeKey( e.name, TO_UTF8( pad->GetName() ) );
NET_MAP_CITER ni = m_pads_to_nets.find( pn_key ); NET_MAP_CITER ni = m_pads_to_nets.find( pn_key );
if( ni != m_pads_to_nets.end() ) if( ni != m_pads_to_nets.end() )
@ -1255,7 +1255,7 @@ void EAGLE_PLUGIN::packagePad( MODULE* aModule, wxXmlNode* aTree ) const
D_PAD* pad = new D_PAD( aModule ); D_PAD* pad = new D_PAD( aModule );
aModule->PadsList().PushBack( pad ); aModule->PadsList().PushBack( pad );
pad->SetPadName( FROM_UTF8( e.name.c_str() ) ); pad->SetName( FROM_UTF8( e.name.c_str() ) );
// pad's "Position" is not relative to the module's, // pad's "Position" is not relative to the module's,
// whereas Pos0 is relative to the module's but is the unrotated coordinate. // whereas Pos0 is relative to the module's but is the unrotated coordinate.
@ -1572,7 +1572,7 @@ void EAGLE_PLUGIN::packageHole( MODULE* aModule, wxXmlNode* aTree ) const
// Mechanical purpose only: // Mechanical purpose only:
// no offset, no net name, no pad name allowed // no offset, no net name, no pad name allowed
// pad->SetOffset( wxPoint( 0, 0 ) ); // pad->SetOffset( wxPoint( 0, 0 ) );
// pad->SetPadName( wxEmptyString ); // pad->SetName( wxEmptyString );
wxPoint padpos( kicad_x( e.x ), kicad_y( e.y ) ); wxPoint padpos( kicad_x( e.x ), kicad_y( e.y ) );
@ -1601,7 +1601,7 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, wxXmlNode* aTree ) const
D_PAD* pad = new D_PAD( aModule ); D_PAD* pad = new D_PAD( aModule );
aModule->PadsList().PushBack( pad ); aModule->PadsList().PushBack( pad );
pad->SetPadName( FROM_UTF8( e.name.c_str() ) ); pad->SetName( FROM_UTF8( e.name.c_str() ) );
pad->SetShape( PAD_SHAPE_RECT ); pad->SetShape( PAD_SHAPE_RECT );
pad->SetAttribute( PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB_SMD );

View File

@ -128,7 +128,7 @@ static void build_pad_testpoints( BOARD *aPcb,
if( rk.access != -1 ) if( rk.access != -1 )
{ {
rk.netname = pad->GetNetname(); rk.netname = pad->GetNetname();
rk.pin = pad->GetPadName(); rk.pin = pad->GetName();
rk.refdes = module->GetReference(); rk.refdes = module->GetReference();
rk.midpoint = false; // XXX MAYBE need to be computed (how?) rk.midpoint = false; // XXX MAYBE need to be computed (how?)
const wxSize& drill = pad->GetDrillSize(); const wxSize& drill = pad->GetDrillSize();

View File

@ -660,7 +660,7 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb )
layer = module->GetFlag() ? "BOTTOM" : "TOP"; layer = module->GetFlag() ? "BOTTOM" : "TOP";
} }
pinname = pad->GetPadName(); pinname = pad->GetName();
if( pinname.IsEmpty() ) if( pinname.IsEmpty() )
pinname = wxT( "none" ); pinname = wxT( "none" );
@ -801,7 +801,7 @@ static void CreateSignalsSection( FILE* aFile, BOARD* aPcb )
msg.Printf( wxT( "NODE %s %s" ), msg.Printf( wxT( "NODE %s %s" ),
GetChars( module->GetReference() ), GetChars( module->GetReference() ),
GetChars( pad->GetPadName() ) ); GetChars( pad->GetName() ) );
fputs( TO_UTF8( msg ), aFile ); fputs( TO_UTF8( msg ), aFile );
fputs( "\n", aFile ); fputs( "\n", aFile );

View File

@ -303,7 +303,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
kplate = IDF3::PTH; kplate = IDF3::PTH;
// hole type // hole type
tstr = TO_UTF8( pad->GetPadName() ); tstr = TO_UTF8( pad->GetName() );
if( tstr.empty() || !tstr.compare( "0" ) || !tstr.compare( "~" ) if( tstr.empty() || !tstr.compare( "0" ) || !tstr.compare( "~" )
|| ( kplate == IDF3::NPTH ) || ( kplate == IDF3::NPTH )

View File

@ -719,7 +719,7 @@ bool PCB_EDIT_FRAME::DoGenFootprintsReport( const wxString& aFullFilename, bool
for( D_PAD* pad = Module->PadsList(); pad != NULL; pad = pad->Next() ) for( D_PAD* pad = Module->PadsList(); pad != NULL; pad = pad->Next() )
{ {
fprintf( rptfile, "$PAD \"%s\"\n", TO_UTF8( pad->GetPadName() ) ); fprintf( rptfile, "$PAD \"%s\"\n", TO_UTF8( pad->GetName() ) );
int layer = 0; int layer = 0;
if( pad->GetLayerSet()[B_Cu] ) if( pad->GetLayerSet()[B_Cu] )

View File

@ -667,7 +667,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader )
// and set to the pin name of the netlist on instantiation. Many gEDA // and set to the pin name of the netlist on instantiation. Many gEDA
// bare footprints use identical strings for name and number, so this // bare footprints use identical strings for name and number, so this
// can be a bit confusing. // can be a bit confusing.
pad->SetPadName( parameters[paramCnt-3] ); pad->SetName( parameters[paramCnt-3] );
int x1 = parseInt( parameters[2], conv_unit ); int x1 = parseInt( parameters[2], conv_unit );
int x2 = parseInt( parameters[4], conv_unit ); int x2 = parseInt( parameters[4], conv_unit );
@ -749,7 +749,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader )
// Pcbnew pad name is used for electrical connection calculations. // Pcbnew pad name is used for electrical connection calculations.
// Accordingly it should be mapped to gEDA's pin/pad number, // Accordingly it should be mapped to gEDA's pin/pad number,
// which is used for the same purpose. // which is used for the same purpose.
pad->SetPadName( parameters[paramCnt-3] ); pad->SetName( parameters[paramCnt-3] );
wxPoint padPos( parseInt( parameters[2], conv_unit ), wxPoint padPos( parseInt( parameters[2], conv_unit ),
parseInt( parameters[3], conv_unit ) ); parseInt( parameters[3], conv_unit ) );

View File

@ -1264,7 +1264,7 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
} }
m_out->Print( aNestLevel, "(pad %s %s %s", m_out->Print( aNestLevel, "(pad %s %s %s",
m_out->Quotew( aPad->GetPadName() ).c_str(), m_out->Quotew( aPad->GetName() ).c_str(),
type, shape ); type, shape );
m_out->Print( 0, " (at %s", FMT_IU( aPad->GetPos0() ).c_str() ); m_out->Print( 0, " (at %s", FMT_IU( aPad->GetPos0() ).c_str() );

View File

@ -1453,7 +1453,7 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
} }
// chances are both were ASCII, but why take chances? // chances are both were ASCII, but why take chances?
pad->SetPadName( padname ); pad->SetName( padname );
pad->SetShape( PAD_SHAPE_T( padshape ) ); pad->SetShape( PAD_SHAPE_T( padshape ) );
pad->SetSize( wxSize( size_x, size_y ) ); pad->SetSize( wxSize( size_x, size_y ) );
pad->SetDelta( wxSize( delta_x, delta_y ) ); pad->SetDelta( wxSize( delta_x, delta_y ) );

View File

@ -215,7 +215,7 @@ MODULE* PCB_EDIT_FRAME::CreateMuWaveBaseFootprint( const wxString& aValue,
pad->SetLayerSet( F_Cu ); pad->SetLayerSet( F_Cu );
Line.Printf( wxT( "%d" ), pad_num ); Line.Printf( wxT( "%d" ), pad_num );
pad->SetPadName( Line ); pad->SetName( Line );
pad_num++; pad_num++;
} }
@ -329,7 +329,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
break; break;
case 1: //Stub : case 1: //Stub :
pad->SetPadName( wxT( "1" ) ); pad->SetName( wxT( "1" ) );
pad = pad->Next(); pad = pad->Next();
pad->SetY0( -( gap_size + pad->GetSize().y ) / 2 ); pad->SetY0( -( gap_size + pad->GetSize().y ) / 2 );
pad->SetSize( wxSize( pad->GetSize().x, gap_size ) ); pad->SetSize( wxSize( pad->GetSize().x, gap_size ) );

View File

@ -369,7 +369,7 @@ MODULE* MWAVE::CreateMicrowaveInductor( INDUCTOR_PATTERN& inductorPattern,
module->PadsList().PushFront( pad ); module->PadsList().PushFront( pad );
pad->SetPadName( "1" ); pad->SetName( "1" );
pad->SetPosition( inductorPattern.m_End ); pad->SetPosition( inductorPattern.m_End );
pad->SetPos0( pad->GetPosition() - module->GetPosition() ); pad->SetPos0( pad->GetPosition() - module->GetPosition() );
@ -384,7 +384,7 @@ MODULE* MWAVE::CreateMicrowaveInductor( INDUCTOR_PATTERN& inductorPattern,
module->PadsList().Insert( newpad, pad->Next() ); module->PadsList().Insert( newpad, pad->Next() );
pad = newpad; pad = newpad;
pad->SetPadName( "2" ); pad->SetName( "2" );
pad->SetPosition( inductorPattern.m_Start ); pad->SetPosition( inductorPattern.m_Start );
pad->SetPos0( pad->GetPosition() - module->GetPosition() ); pad->SetPos0( pad->GetPosition() - module->GetPosition() );

View File

@ -142,11 +142,11 @@ void PCB_BASE_FRAME::AddPad( MODULE* aModule, bool draw )
if( pad->GetAttribute() != PAD_ATTRIB_HOLE_NOT_PLATED ) if( pad->GetAttribute() != PAD_ATTRIB_HOLE_NOT_PLATED )
{ {
padName = GetNextPadName( GetDesignSettings() padName = GetNextPadName( GetDesignSettings()
.m_Pad_Master.GetPadName() ); .m_Pad_Master.GetName() );
} }
pad->SetPadName( padName ); pad->SetName( padName );
GetDesignSettings().m_Pad_Master.SetPadName( padName ); GetDesignSettings().m_Pad_Master.SetName( padName );
aModule->CalculateBoundingBox(); aModule->CalculateBoundingBox();
SetMsgPanel( pad ); SetMsgPanel( pad );

View File

@ -374,7 +374,7 @@ void PCB::DoPCBComponents( XNODE* aNode,
break; break;
mNode->GetAttribute( wxT( "Name" ), &propValue ); mNode->GetAttribute( wxT( "Name" ), &propValue );
mc->SetPadName( str, propValue ); mc->SetName( str, propValue );
mNode = mNode->GetNext(); mNode = mNode->GetNext();
} }
else else

View File

@ -372,7 +372,7 @@ void PCB_MODULE::DoLayerContentsObjects( XNODE* aNode,
} }
void PCB_MODULE::SetPadName( wxString aPin, wxString aName ) void PCB_MODULE::SetName( wxString aPin, wxString aName )
{ {
int i; int i;
long num; long num;
@ -465,7 +465,7 @@ void PCB_MODULE::Parse( XNODE* aNode, wxStatusBar* aStatusBar,
break; break;
mNode->GetAttribute( wxT( "Name" ), &propValue ); mNode->GetAttribute( wxT( "Name" ), &propValue );
SetPadName( str, propValue ); SetName( str, propValue );
mNode = mNode->GetNext(); mNode = mNode->GetNext();
} }
else else

View File

@ -57,7 +57,7 @@ public:
wxString aDefaultMeasurementUnit, wxString aDefaultMeasurementUnit,
wxString aActualConversion ); wxString aActualConversion );
void SetPadName( wxString aPin, wxString aName ); void SetName( wxString aPin, wxString aName );
virtual void Parse( XNODE* aNode, wxStatusBar* aStatusBar, virtual void Parse( XNODE* aNode, wxStatusBar* aStatusBar,
wxString aDefaultMeasurementUnit, wxString aActualConversion ); wxString aDefaultMeasurementUnit, wxString aActualConversion );

View File

@ -245,7 +245,7 @@ void PCB_PAD::AddToModule( MODULE* aModule, int aRotation, bool aEncapsulatedPad
// actually this is a thru-hole pad // actually this is a thru-hole pad
pad->SetLayerSet( LSET::AllCuMask() | LSET( 2, B_Mask, F_Mask ) ); pad->SetLayerSet( LSET::AllCuMask() | LSET( 2, B_Mask, F_Mask ) );
pad->SetPadName( m_name.text ); pad->SetName( m_name.text );
if( padShapeName == wxT( "Oval" ) if( padShapeName == wxT( "Oval" )
|| padShapeName == wxT( "Ellipse" ) || padShapeName == wxT( "Ellipse" )

View File

@ -623,7 +623,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
if( m_pcbSettings.m_padNumbers ) if( m_pcbSettings.m_padNumbers )
{ {
const wxString& padName = aPad->GetPadName(); const wxString& padName = aPad->GetName();
textpos.y = -textpos.y; textpos.y = -textpos.y;
double tsize = 1.5 * padsize.x / padName.Length(); double tsize = 1.5 * padsize.x / padName.Length();
tsize = std::min( tsize, size ); tsize = std::min( tsize, size );

View File

@ -2248,7 +2248,7 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent )
std::unique_ptr< D_PAD > pad( new D_PAD( aParent ) ); std::unique_ptr< D_PAD > pad( new D_PAD( aParent ) );
NeedSYMBOLorNUMBER(); NeedSYMBOLorNUMBER();
pad->SetPadName( FromUTF8() ); pad->SetName( FromUTF8() );
T token = NextTok(); T token = NextTok();

View File

@ -80,7 +80,7 @@ void BRDITEMS_PLOTTER::PlotPad( D_PAD* aPad, COLOR4D aColor, EDA_DRAW_MODE_T aPl
gbr_metadata.SetCopper( true ); gbr_metadata.SetCopper( true );
if( isOnExternalCopperLayer ) if( isOnExternalCopperLayer )
gbr_metadata.SetPadName( aPad->GetPadName() ); gbr_metadata.SetPadName( aPad->GetName() );
gbr_metadata.SetNetName( aPad->GetNetname() ); gbr_metadata.SetNetName( aPad->GetNetname() );
@ -88,7 +88,7 @@ void BRDITEMS_PLOTTER::PlotPad( D_PAD* aPad, COLOR4D aColor, EDA_DRAW_MODE_T aPl
// when this is the case, they have no pad name and/or are not plated. // when this is the case, they have no pad name and/or are not plated.
// In this case gerber files have slightly different attributes. // In this case gerber files have slightly different attributes.
if( aPad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED || if( aPad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED ||
aPad->GetPadName().IsEmpty() ) aPad->GetName().IsEmpty() )
gbr_metadata.m_NetlistMetadata.m_NotInNet = true; gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
if( !isOnExternalCopperLayer || !isPadOnBoardTechLayers ) if( !isOnExternalCopperLayer || !isPadOnBoardTechLayers )

View File

@ -27,7 +27,7 @@ def smdRectPad(module,size,pos,name):
pad.SetAttribute(PAD_ATTRIB_SMD) pad.SetAttribute(PAD_ATTRIB_SMD)
pad.SetLayerSet(pad.SMDMask()) pad.SetLayerSet(pad.SMDMask())
pad.SetPos0(pos) pad.SetPos0(pos)
pad.SetPadName(name) pad.SetName(name)
return pad return pad
for n in range (0,pads): for n in range (0,pads):

View File

@ -27,7 +27,7 @@ for y in range (0,10):
pt = wxPointMM(1.27*x,1.27*y) pt = wxPointMM(1.27*x,1.27*y)
pad.SetPos0(pt); pad.SetPos0(pt);
#pad.SetPosition(pt) #pad.SetPosition(pt)
pad.SetPadName(str(n)) pad.SetName(str(n))
module.Add(pad) module.Add(pad)
n+=1 n+=1
@ -42,7 +42,7 @@ print map( lambda x: x.GetReference() , list(pcb.GetModules()))
for m in pcb.GetModules(): for m in pcb.GetModules():
for p in m.Pads(): for p in m.Pads():
print p.GetPadName(), p.GetPosition(), p.GetOffset() print p.GetName(), p.GetPosition(), p.GetOffset()
# pcb.GetDesignSettings() # pcb.GetDesignSettings()

View File

@ -51,7 +51,7 @@ class FPC_FootprintWizard(FootprintWizardBase.FootprintWizard):
pad.SetLayerSet( pad.SMDMask() ) pad.SetLayerSet( pad.SMDMask() )
pad.SetPos0(pos) pad.SetPos0(pos)
pad.SetPosition(pos) pad.SetPosition(pos)
pad.SetPadName(name) pad.SetName(name)
return pad return pad
def CheckParameters(self): def CheckParameters(self):

View File

@ -165,7 +165,7 @@ class PadGridArray(PadArray):
posY = pin1posY + (self.py * y) posY = pin1posY + (self.py * y)
pos = dc.TransformPoint(posX, posY) pos = dc.TransformPoint(posX, posY)
pad = self.GetPad(x == 0 and y == 0, pos) pad = self.GetPad(x == 0 and y == 0, pos)
pad.SetPadName(self.GetName(x,y)) pad.SetName(self.GetName(x,y))
self.AddPad(pad) self.AddPad(pad)
class EPADGridArray(PadGridArray): class EPADGridArray(PadGridArray):
@ -207,7 +207,7 @@ class PadZGridArray(PadArray):
pos = dc.TransformPoint(posX, posY) pos = dc.TransformPoint(posX, posY)
pad = self.GetPad(padnum == 0, pos) pad = self.GetPad(padnum == 0, pos)
pad.SetPadName(self.GetName(padnum)) pad.SetName(self.GetName(padnum))
self.AddPad(pad) self.AddPad(pad)
line += 1 line += 1
@ -255,7 +255,7 @@ class PadCircleArray(PadArray):
pos_y = -math.cos(angle * math.pi / 180) * self.r pos_y = -math.cos(angle * math.pi / 180) * self.r
pos = dc.TransformPoint(pos_x, pos_y) pos = dc.TransformPoint(pos_x, pos_y)
pad = self.GetPad(pin == 0, pos) pad = self.GetPad(pin == 0, pos)
pad.SetPadName(self.GetName(pin)) pad.SetName(self.GetName(pin))
self.AddPad(pad) self.AddPad(pad)
class PadCustomArray(PadArray): class PadCustomArray(PadArray):
@ -277,5 +277,5 @@ class PadCustomArray(PadArray):
for i in range(len(self.array)): for i in range(len(self.array)):
pos = dc.TransformPoint(self.array[i][0], self.array[i][1]) pos = dc.TransformPoint(self.array[i][0], self.array[i][1])
pad = self.GetPad(i == 0, pos) pad = self.GetPad(i == 0, pos)
pad.SetPadName(self.GetName(i)) pad.SetName(self.GetName(i))
self.AddPad(pad) self.AddPad(pad)

View File

@ -74,7 +74,7 @@ class PadStaggeredZGridArray(PA.PadArray):
pos = dc.TransformPoint(posX, posY) pos = dc.TransformPoint(posX, posY)
pad = self.GetPad(padnum == 0, pos) pad = self.GetPad(padnum == 0, pos)
pad.SetPadName(self.GetName(padnum)) pad.SetName(self.GetName(padnum))
self.AddPad(pad) self.AddPad(pad)
line += 1 line += 1

View File

@ -150,7 +150,7 @@ class QFNWizard(FootprintWizardBase.FootprintWizard):
layers = pcbnew.LSET(pcbnew.F_Mask) layers = pcbnew.LSET(pcbnew.F_Mask)
layers.AddLayer(pcbnew.F_Cu) layers.AddLayer(pcbnew.F_Cu)
layers.AddLayer(pcbnew.F_Paste) layers.AddLayer(pcbnew.F_Paste)
epad.SetPadName(epad_num) epad.SetName(epad_num)
array = PA.EPADGridArray( epad, epad_ny, epad_nx, epad_l, epad_w, pcbnew.wxPoint(0,0) ) array = PA.EPADGridArray( epad, epad_ny, epad_nx, epad_l, epad_w, pcbnew.wxPoint(0,0) )
array.SetFirstPadInArray(epad_num) array.SetFirstPadInArray(epad_num)

View File

@ -86,7 +86,7 @@ class QRCodeWizard(FootprintWizardBase.FootprintWizard):
layerset.AddLayer(pcbnew.F_Mask) layerset.AddLayer(pcbnew.F_Mask)
pad.SetLayerSet( layerset ) pad.SetLayerSet( layerset )
pad.SetPosition(pcbnew.wxPoint(xposition,yposition)) pad.SetPosition(pcbnew.wxPoint(xposition,yposition))
pad.SetPadName("1") pad.SetName("1")
self.module.Add(pad) self.module.Add(pad)
if self.UseSilkS: if self.UseSilkS:
polygon=self.drawSquareArea(pcbnew.F_SilkS, self.X, xposition, yposition) polygon=self.drawSquareArea(pcbnew.F_SilkS, self.X, xposition, yposition)

View File

@ -70,7 +70,7 @@ class TouchSliderWizard(FootprintWizardBase.FootprintWizard):
pad.SetLayerSet(pad.ConnSMDMask()) pad.SetLayerSet(pad.ConnSMDMask())
pad.SetPos0(pos) pad.SetPos0(pos)
pad.SetPosition(pos) pad.SetPosition(pos)
pad.SetPadName(name) pad.SetName(name)
return pad return pad
@ -82,7 +82,7 @@ class TouchSliderWizard(FootprintWizardBase.FootprintWizard):
pad.SetLayerSet(pad.ConnSMDMask()) pad.SetLayerSet(pad.ConnSMDMask())
pad.SetPos0(pos) pad.SetPos0(pos)
pad.SetPosition(pos) pad.SetPosition(pos)
pad.SetPadName(name) pad.SetName(name)
pad.SetDelta(wxSize(left_right*size[1],up_down*size[0])) pad.SetDelta(wxSize(left_right*size[1],up_down*size[0]))
return pad return pad

View File

@ -562,7 +562,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
PIN* pin = new PIN( image ); PIN* pin = new PIN( image );
padName = pad->GetPadName(); padName = pad->GetName();
pin->pin_id = TO_UTF8( padName ); pin->pin_id = TO_UTF8( padName );
if( padName!=wxEmptyString && pinmap.find( padName )==pinmap.end() ) if( padName!=wxEmptyString && pinmap.find( padName )==pinmap.end() )

View File

@ -5,7 +5,7 @@ pcb = pcbnew.GetBoard()
for m in pcb.GetModules(): for m in pcb.GetModules():
print m.GetPosition() print m.GetPosition()
for p in m.Pads(): for p in m.Pads():
print "p=>",p.GetPosition(),p.GetPadName() print "p=>",p.GetPosition(),p.GetName()
print p.GetPosition() print p.GetPosition()

View File

@ -5,4 +5,4 @@ pcb = pcbnew.GetBoard()
for m in pcb.GetModules(): for m in pcb.GetModules():
print m.GetReference(),"(",m.GetValue(),") at ", m.GetPosition() print m.GetReference(),"(",m.GetValue(),") at ", m.GetPosition()
for p in m.Pads(): for p in m.Pads():
print " pad",p.GetPadName(), "at",p.GetPosition() print " pad",p.GetName(), "at",p.GetPosition()

View File

@ -209,8 +209,8 @@ int MODULE_EDITOR_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
// Rename pad and store the old name // Rename pad and store the old name
wxString newName = wxString::Format( wxT( "%s%d" ), padPrefix.c_str(), padNumber++ ); wxString newName = wxString::Format( wxT( "%s%d" ), padPrefix.c_str(), padNumber++ );
oldNames[newName] = pad->GetPadName(); oldNames[newName] = pad->GetName();
pad->SetPadName( newName ); pad->SetName( newName );
pad->SetSelected(); pad->SetSelected();
getView()->Update( pad ); getView()->Update( pad );
} }
@ -218,12 +218,12 @@ int MODULE_EDITOR_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
// ..or restore the old name if it was enumerated and clicked again // ..or restore the old name if it was enumerated and clicked again
else if( pad->IsSelected() && evt->IsClick( BUT_LEFT ) ) else if( pad->IsSelected() && evt->IsClick( BUT_LEFT ) )
{ {
auto it = oldNames.find( pad->GetPadName() ); auto it = oldNames.find( pad->GetName() );
wxASSERT( it != oldNames.end() ); wxASSERT( it != oldNames.end() );
if( it != oldNames.end() ) if( it != oldNames.end() )
{ {
pad->SetPadName( it->second ); pad->SetName( it->second );
oldNames.erase( it ); oldNames.erase( it );
} }