diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index da0316049a..9cc73e91a0 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -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.Empty(); +// fixme placement if( GetDoNotAllowVias() ) AccumulateDescription( msg, _( "No vias" ) ); diff --git a/pcbnew/zone.h b/pcbnew/zone.h index 27f7310be7..613e5860c5 100644 --- a/pcbnew/zone.h +++ b/pcbnew/zone.h @@ -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 diff --git a/pcbnew/zone_settings.cpp b/pcbnew/zone_settings.cpp index 2b8ea9b6e6..36f8ff035a 100644 --- a/pcbnew/zone_settings.cpp +++ b/pcbnew/zone_settings.cpp @@ -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() ); diff --git a/pcbnew/zone_settings.h b/pcbnew/zone_settings.h index aabc1df095..bf759d438b 100644 --- a/pcbnew/zone_settings.h +++ b/pcbnew/zone_settings.h @@ -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; }