From 275afdc1d57622b51cafc7b2f6768649f306ad9a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 1 Jun 2022 12:47:03 +0100 Subject: [PATCH] Expose footprint ID, description and keywords to property system. (cherry picked from commit dee22a31d9c4906c823c9c2b1daddf56ee5c197f) --- pcbnew/footprint.cpp | 25 ++++++++++++++----------- pcbnew/footprint.h | 3 +++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 4433156797..f6c9480b25 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -2373,18 +2373,21 @@ static struct FOOTPRINT_DESC propMgr.AddProperty( new PROPERTY( _HKI( "Solderpaste Margin Override" ), &FOOTPRINT::SetLocalSolderPasteMargin, &FOOTPRINT::GetLocalSolderPasteMargin, PROPERTY_DISPLAY::DISTANCE ) ); - propMgr.AddProperty( new PROPERTY( _HKI( "Solderpaste Margin Ratio Override" ), - &FOOTPRINT::SetLocalSolderPasteMarginRatio, - &FOOTPRINT::GetLocalSolderPasteMarginRatio ) ); + propMgr.AddProperty( new PROPERTY( _HKI( "Solderpaste Margin Ratio Override" ), + &FOOTPRINT::SetLocalSolderPasteMarginRatio, + &FOOTPRINT::GetLocalSolderPasteMarginRatio ) ); propMgr.AddProperty( new PROPERTY( _HKI( "Thermal Relief Width" ), - &FOOTPRINT::SetThermalWidth, - &FOOTPRINT::GetThermalWidth, - PROPERTY_DISPLAY::DISTANCE ) ); + &FOOTPRINT::SetThermalWidth, &FOOTPRINT::GetThermalWidth, + PROPERTY_DISPLAY::DISTANCE ) ); propMgr.AddProperty( new PROPERTY( _HKI( "Thermal Relief Gap" ), - &FOOTPRINT::SetThermalGap, - &FOOTPRINT::GetThermalGap, - PROPERTY_DISPLAY::DISTANCE ) ); - // TODO zone connection, FPID? + &FOOTPRINT::SetThermalGap, &FOOTPRINT::GetThermalGap, + PROPERTY_DISPLAY::DISTANCE ) ); + propMgr.AddProperty( new PROPERTY( _HKI( "Library ID" ), + &FOOTPRINT::SetFPIDAsString, &FOOTPRINT::GetFPIDAsString ) ); + propMgr.AddProperty( new PROPERTY( _HKI( "Description" ), + &FOOTPRINT::SetDescription, &FOOTPRINT::GetDescription ) ); + propMgr.AddProperty( new PROPERTY( _HKI( "Keywords" ), + &FOOTPRINT::SetKeywords, &FOOTPRINT::GetKeywords ) ); + // TODO zone connection } } _FOOTPRINT_DESC; diff --git a/pcbnew/footprint.h b/pcbnew/footprint.h index 8a82ed307a..bf2fea0047 100644 --- a/pcbnew/footprint.h +++ b/pcbnew/footprint.h @@ -195,6 +195,9 @@ public: const LIB_ID& GetFPID() const { return m_fpid; } void SetFPID( const LIB_ID& aFPID ) { m_fpid = aFPID; } + const wxString GetFPIDAsString() const { return m_fpid.Format(); } + void SetFPIDAsString( const wxString& aFPID ) { m_fpid.Parse( aFPID ); } + const wxString& GetDescription() const { return m_doc; } void SetDescription( const wxString& aDoc ) { m_doc = aDoc; }