7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 17:53:45 +00:00

pcbnew: added Placement Rule Area properties to class ZONE:

- RuleAreaType: distinction between Keepout and Placement rule areas
- RuleAreaExpression: custom DRC language expression for assigning components for Placement rules
This commit is contained in:
Tomasz Wlostowski 2023-12-31 13:19:41 +01:00
parent 8bb4dce288
commit 05fc8199dc
4 changed files with 27 additions and 0 deletions

View File

@ -116,6 +116,8 @@ void ZONE::InitDataFromSrcInCopyCtor( const ZONE& aZone )
m_zoneName = aZone.m_zoneName;
m_priority = aZone.m_priority;
m_isRuleArea = aZone.m_isRuleArea;
m_ruleAreaExpression = aZone.m_ruleAreaExpression;
m_ruleAreaType = aZone.m_ruleAreaType;
SetLayerSet( aZone.GetLayerSet() );
m_doNotAllowCopperPour = aZone.m_doNotAllowCopperPour;
@ -550,6 +552,7 @@ void ZONE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>&
{
msg.Empty();
// fixme placement
if( GetDoNotAllowVias() )
AccumulateDescription( msg, _( "No vias" ) );

View File

@ -709,6 +709,8 @@ public:
* Accessors to parameters used in Rule Area zones:
*/
bool GetIsRuleArea() const { return m_isRuleArea; }
RULE_AREA_TYPE GetRuleAreaType() const { return m_ruleAreaType; }
const wxString& GetRuleAreaExpression( ) const { return m_ruleAreaExpression; }
bool GetDoNotAllowCopperPour() const { return m_doNotAllowCopperPour; }
bool GetDoNotAllowVias() const { return m_doNotAllowVias; }
bool GetDoNotAllowTracks() const { return m_doNotAllowTracks; }
@ -716,6 +718,8 @@ public:
bool GetDoNotAllowFootprints() const { return m_doNotAllowFootprints; }
void SetIsRuleArea( bool aEnable ) { m_isRuleArea = aEnable; }
void SetRuleAreaType( RULE_AREA_TYPE aType ) { m_ruleAreaType = aType; }
void SetRuleAreaExpression( const wxString& aExpr ) { m_ruleAreaExpression = aExpr; }
void SetDoNotAllowCopperPour( bool aEnable ) { m_doNotAllowCopperPour = aEnable; }
void SetDoNotAllowVias( bool aEnable ) { m_doNotAllowVias = aEnable; }
void SetDoNotAllowTracks( bool aEnable ) { m_doNotAllowTracks = aEnable; }
@ -824,6 +828,8 @@ protected:
* It will be never filled, and DRC should test for pads, tracks and vias
*/
bool m_isRuleArea;
RULE_AREA_TYPE m_ruleAreaType;
wxString m_ruleAreaExpression;
/* A zone outline can be a teardrop zone with different rules for priority
* (always bigger priority than copper zones) and never removed from a

View File

@ -83,6 +83,7 @@ ZONE_SETTINGS::ZONE_SETTINGS()
SetDoNotAllowFootprints( false );
m_TeardropType = TEARDROP_TYPE::TD_NONE;
m_ruleAreaType = RULE_AREA_TYPE::KEEPOUT; // for backwards compatibility
}
@ -152,6 +153,8 @@ ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE& aSource )
m_cornerSmoothingType = aSource.GetCornerSmoothingType();
m_cornerRadius = aSource.GetCornerRadius();
m_isRuleArea = aSource.GetIsRuleArea();
m_ruleAreaExpression = aSource.GetRuleAreaExpression();
m_ruleAreaType = aSource.GetRuleAreaType();
m_keepoutDoNotAllowCopperPour = aSource.GetDoNotAllowCopperPour();
m_keepoutDoNotAllowVias = aSource.GetDoNotAllowVias();
m_keepoutDoNotAllowTracks = aSource.GetDoNotAllowTracks();
@ -190,6 +193,8 @@ void ZONE_SETTINGS::ExportSetting( ZONE& aTarget, bool aFullExport ) const
aTarget.SetCornerSmoothingType( m_cornerSmoothingType );
aTarget.SetCornerRadius( m_cornerRadius );
aTarget.SetIsRuleArea( GetIsRuleArea() );
aTarget.SetRuleAreaType( GetRuleAreaType() );
aTarget.SetRuleAreaExpression( GetRuleAreaExpression() );
aTarget.SetDoNotAllowCopperPour( GetDoNotAllowCopperPour() );
aTarget.SetDoNotAllowVias( GetDoNotAllowVias() );
aTarget.SetDoNotAllowTracks( GetDoNotAllowTracks() );

View File

@ -62,6 +62,12 @@ enum class ISLAND_REMOVAL_MODE
AREA
};
enum class RULE_AREA_TYPE
{
KEEPOUT = 0,
PLACEMENT
};
/**
* ZONE_SETTINGS
* handles zones parameters.
@ -125,11 +131,14 @@ private:
*/
bool m_isRuleArea;
RULE_AREA_TYPE m_ruleAreaType;
bool m_keepoutDoNotAllowCopperPour;
bool m_keepoutDoNotAllowVias;
bool m_keepoutDoNotAllowTracks;
bool m_keepoutDoNotAllowPads;
bool m_keepoutDoNotAllowFootprints;
wxString m_ruleAreaExpression;
ISLAND_REMOVAL_MODE m_removeIslands;
long long int m_minIslandArea;
@ -187,6 +196,8 @@ public:
* Accessors to parameters used in Rule Area zones:
*/
bool GetIsRuleArea() const { return m_isRuleArea; }
RULE_AREA_TYPE GetRuleAreaType() const { return m_ruleAreaType; }
const wxString& GetRuleAreaExpression( ) const { return m_ruleAreaExpression; }
bool GetDoNotAllowCopperPour() const { return m_keepoutDoNotAllowCopperPour; }
bool GetDoNotAllowVias() const { return m_keepoutDoNotAllowVias; }
bool GetDoNotAllowTracks() const { return m_keepoutDoNotAllowTracks; }
@ -194,6 +205,8 @@ public:
bool GetDoNotAllowFootprints() const { return m_keepoutDoNotAllowFootprints; }
void SetIsRuleArea( bool aEnable ) { m_isRuleArea = aEnable; }
void SetRuleAreaType( RULE_AREA_TYPE aType ) { m_ruleAreaType = aType; }
void SetRuleAreaExpression( const wxString& aExpr ) { m_ruleAreaExpression = aExpr; }
void SetDoNotAllowCopperPour( bool aEnable ) { m_keepoutDoNotAllowCopperPour = aEnable; }
void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; }
void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; }