Footprints: rename properties to fields for consistency with symbols

This commit is contained in:
Mike Williams 2023-05-02 08:19:39 -04:00
parent 40abb013ec
commit 028f500cd9
13 changed files with 26 additions and 26 deletions

View File

@ -25,7 +25,7 @@ DIALOG_FOOTPRINT_PROPERTIES_BASE::DIALOG_FOOTPRINT_PROPERTIES_BASE( wxWindow* pa
m_PanelPropertiesBoxSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerTexts;
sbSizerTexts = new wxStaticBoxSizer( new wxStaticBox( m_PanelGeneral, wxID_ANY, wxEmptyString ), wxVERTICAL );
sbSizerTexts = new wxStaticBoxSizer( new wxStaticBox( m_PanelGeneral, wxID_ANY, _("Fields") ), wxVERTICAL );
m_itemsGrid = new WX_GRID( sbSizerTexts->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), 0 );

View File

@ -187,7 +187,7 @@
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label"></property>
<property name="label">Fields</property>
<property name="minimum_size"></property>
<property name="name">sbSizerTexts</property>
<property name="orient">wxVERTICAL</property>

View File

@ -25,7 +25,7 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITO
m_PanelPropertiesBoxSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerTexts;
sbSizerTexts = new wxStaticBoxSizer( new wxStaticBox( m_PanelGeneral, wxID_ANY, wxEmptyString ), wxVERTICAL );
sbSizerTexts = new wxStaticBoxSizer( new wxStaticBox( m_PanelGeneral, wxID_ANY, _("Fields") ), wxVERTICAL );
m_itemsGrid = new WX_GRID( sbSizerTexts->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), 0 );

View File

@ -186,7 +186,7 @@
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label"></property>
<property name="label">Fields</property>
<property name="minimum_size"></property>
<property name="name">sbSizerTexts</property>
<property name="orient">wxVERTICAL</property>

View File

@ -180,7 +180,7 @@ FOOTPRINT::FOOTPRINT( const FOOTPRINT& aFootprint ) :
m_3D_Drawings = aFootprint.m_3D_Drawings;
m_doc = aFootprint.m_doc;
m_keywords = aFootprint.m_keywords;
m_properties = aFootprint.m_properties;
m_fields = aFootprint.m_fields;
m_privateLayers = aFootprint.m_privateLayers;
m_arflag = 0;
@ -354,7 +354,7 @@ FOOTPRINT& FOOTPRINT::operator=( FOOTPRINT&& aOther )
m_3D_Drawings = aOther.m_3D_Drawings;
m_doc = aOther.m_doc;
m_keywords = aOther.m_keywords;
m_properties = aOther.m_properties;
m_fields = aOther.m_fields;
m_privateLayers = aOther.m_privateLayers;
m_initial_comments = aOther.m_initial_comments;
@ -462,7 +462,7 @@ FOOTPRINT& FOOTPRINT::operator=( const FOOTPRINT& aOther )
m_3D_Drawings = aOther.m_3D_Drawings;
m_doc = aOther.m_doc;
m_keywords = aOther.m_keywords;
m_properties = aOther.m_properties;
m_fields = aOther.m_fields;
m_privateLayers = aOther.m_privateLayers;
m_initial_comments = aOther.m_initial_comments ?
@ -543,9 +543,9 @@ bool FOOTPRINT::ResolveTextVar( wxString* token, int aDepth ) const
}
}
}
else if( m_properties.count( *token ) )
else if( m_fields.count( *token ) )
{
*token = m_properties.at( *token );
*token = m_fields.at( *token );
return true;
}
@ -2811,7 +2811,7 @@ static struct FOOTPRINT_DESC
&FOOTPRINT::SetOrientationDegrees, &FOOTPRINT::GetOrientationDegrees,
PROPERTY_DISPLAY::PT_DEGREE ) );
const wxString groupFootprint = _HKI( "Footprint Properties" );
const wxString groupFootprint = _HKI( "Fields" );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Reference" ),
&FOOTPRINT::SetReference, &FOOTPRINT::GetReferenceAsString ),

View File

@ -573,14 +573,14 @@ public:
PCB_TEXT& Value() const { return *m_value; }
PCB_TEXT& Reference() const { return *m_reference; }
const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
const wxString& GetProperty( const wxString& aKey) { return m_properties[ aKey ]; }
bool HasProperty( const wxString& aKey)
const std::map<wxString, wxString>& GetFields() const { return m_fields; }
void SetFields( const std::map<wxString, wxString>& aFields ) { m_fields = aFields; }
const wxString& GetField( const wxString& aKey) { return m_fields[ aKey ]; }
bool HasField( const wxString& aKey)
{
return m_properties.find( aKey ) != m_properties.end();
return m_fields.find( aKey ) != m_fields.end();
}
void SetProperty( const wxString& aKey, const wxString& aVal ) { m_properties[ aKey ] = aVal; }
void SetField( const wxString& aKey, const wxString& aVal ) { m_fields[ aKey ] = aVal; }
bool IsBoardOnly() const { return m_attributes & FP_BOARD_ONLY; }
void SetBoardOnly( bool aIsBoardOnly = true )
@ -888,7 +888,7 @@ private:
LSET m_privateLayers; // Layers visible only in the footprint editor
std::vector<FP_3DMODEL> m_3D_Drawings; // 3D models.
std::map<wxString, wxString> m_properties;
std::map<wxString, wxString> m_fields;
wxArrayString* m_initial_comments; // s-expression comments in the footprint,
// lazily allocated only if needed for speed

View File

@ -343,7 +343,7 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint,
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
}
if( aPcbFootprint->GetProperties() != aNetlistComponent->GetProperties() )
if( aPcbFootprint->GetFields() != aNetlistComponent->GetProperties() )
{
if( m_isDryRun )
{
@ -356,7 +356,7 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint,
aPcbFootprint->GetReference() );
changed = true;
aPcbFootprint->SetProperties( aNetlistComponent->GetProperties() );
aPcbFootprint->SetFields( aNetlistComponent->GetProperties() );
}
m_reporter->Report( msg, RPT_SEVERITY_ACTION );

View File

@ -52,7 +52,7 @@ void COMPONENT::SetFootprint( FOOTPRINT* aFootprint )
aFootprint->SetValue( m_value );
aFootprint->SetFPID( m_fpid );
aFootprint->SetPath( path );
aFootprint->SetProperties( m_properties );
aFootprint->SetFields( m_properties );
}

View File

@ -2309,7 +2309,7 @@ void PCB_EDIT_FRAME::ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew,
// Updating other parameters
const_cast<KIID&>( aNew->m_Uuid ) = aExisting->m_Uuid;
aNew->SetProperties( aExisting->GetProperties() );
aNew->SetFields( aExisting->GetFields() );
aNew->SetPath( aExisting->GetPath() );
aCommit.Remove( aExisting );

View File

@ -993,8 +993,8 @@ static void getFieldFunc( LIBEVAL::CONTEXT* aCtx, void* self )
{
FOOTPRINT* fp = static_cast<FOOTPRINT*>( item );
if( fp->HasProperty( arg->AsString() ) )
return fp->GetProperty( arg->AsString() );
if( fp->HasField( arg->AsString() ) )
return fp->GetField( arg->AsString() );
}
return "";

View File

@ -95,7 +95,7 @@ void PlotInteractiveLayer( BOARD* aBoard, PLOTTER* aPlotter, const PCB_PLOT_PARA
_( "Value" ),
fp->Value().GetShownText( false ) ) );
for( const auto& [ name, value ] : fp->GetProperties() )
for( const auto& [name, value] : fp->GetFields() )
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), name, value ) );
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),

View File

@ -4067,7 +4067,7 @@ FOOTPRINT* PCB_PARSER::parseFOOTPRINT_unchecked( wxArrayString* aInitialComments
footprint->SetAttributes( attributes );
footprint->SetFPID( fpid );
footprint->SetProperties( properties );
footprint->SetFields( properties );
return footprint.release();
}

View File

@ -1118,7 +1118,7 @@ void PCB_PLUGIN::format( const FOOTPRINT* aFootprint, int aNestLevel ) const
m_out->Quotew( aFootprint->GetKeywords() ).c_str() );
}
const std::map<wxString, wxString>& props = aFootprint->GetProperties();
const std::map<wxString, wxString>& props = aFootprint->GetFields();
for( const std::pair<const wxString, wxString>& prop : props )
{