diff --git a/common/drc_rules.keywords b/common/drc_rules.keywords index 63304f9560..a9b15b5716 100644 --- a/common/drc_rules.keywords +++ b/common/drc_rules.keywords @@ -8,6 +8,7 @@ disallow footprint graphic hole +hole_to_hole inner layer length diff --git a/include/board_design_settings.h b/include/board_design_settings.h index d99e2ada82..108f711cbb 100644 --- a/include/board_design_settings.h +++ b/include/board_design_settings.h @@ -83,7 +83,8 @@ #define DEFAULT_MINTHROUGHDRILL 0.3 // through holes (not micro vias) min drill diameter #define DEFAULT_MICROVIASMINSIZE 0.2 // micro vias (not vias) min diameter #define DEFAULT_MICROVIASMINDRILL 0.1 // micro vias (not vias) min drill diameter -#define DEFAULT_HOLETOHOLEMIN 0.25 // separation between drilled hole edges +#define DEFAULT_HOLETOHOLEMIN 0.25 // minimum web thickness between two drilled holes +#define DEFAULT_HOLECLEARANCE 0.0 // copper-to-hole clearance #define DEFAULT_COPPEREDGECLEARANCE 0.01 // clearance between copper items and edge cuts #define LEGACY_COPPEREDGECLEARANCE -0.01 // A flag to indicate the legacy method (based @@ -239,7 +240,8 @@ public: int m_MicroViasMinSize; // micro vias min diameter int m_MicroViasMinDrill; // micro vias min drill diameter int m_CopperEdgeClearance; - int m_HoleToHoleMin; // Min width of peninsula between two drilled holes + int m_HoleClearance; // Hole to copper clearance + int m_HoleToHoleMin; // Min width of web between two drilled holes int m_SilkClearance; std::shared_ptr m_DRCEngine; diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 9ebe38b7b0..202f178456 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -142,6 +142,7 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: m_MicroViasMinSize = Millimeter2iu( DEFAULT_MICROVIASMINSIZE ); m_MicroViasMinDrill = Millimeter2iu( DEFAULT_MICROVIASMINDRILL ); m_CopperEdgeClearance = Millimeter2iu( DEFAULT_COPPEREDGECLEARANCE ); + m_HoleClearance = Millimeter2iu( DEFAULT_HOLECLEARANCE ); m_HoleToHoleMin = Millimeter2iu( DEFAULT_HOLETOHOLEMIN ); m_SilkClearance = Millimeter2iu( DEFAULT_SILKCLEARANCE ); @@ -224,6 +225,10 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: Millimeter2iu( DEFAULT_HOLETOHOLEMIN ), Millimeter2iu( 0.00 ), Millimeter2iu( 10.0 ), MM_PER_IU ) ); + m_params.emplace_back( new PARAM_SCALED( "rules.min_hole_clearance", &m_HoleClearance, + Millimeter2iu( DEFAULT_HOLECLEARANCE ), Millimeter2iu( 0.00 ), Millimeter2iu( 100.0 ), + MM_PER_IU ) ); + m_params.emplace_back( new PARAM_SCALED( "rules.min_silk_clearance", &m_SilkClearance, Millimeter2iu( DEFAULT_SILKCLEARANCE ), Millimeter2iu( 0.00 ), Millimeter2iu( 100.0 ), MM_PER_IU ) ); @@ -650,6 +655,7 @@ void BOARD_DESIGN_SETTINGS::initFromOther( const BOARD_DESIGN_SETTINGS& aOther ) m_MicroViasMinSize = aOther.m_MicroViasMinSize; m_MicroViasMinDrill = aOther.m_MicroViasMinDrill; m_CopperEdgeClearance = aOther.m_CopperEdgeClearance; + m_HoleClearance = aOther.m_HoleClearance; m_HoleToHoleMin = aOther.m_HoleToHoleMin; m_SilkClearance = aOther.m_SilkClearance; m_DRCSeverities = aOther.m_DRCSeverities; diff --git a/pcbnew/dialogs/panel_setup_feature_constraints.cpp b/pcbnew/dialogs/panel_setup_feature_constraints.cpp index f73f0160c3..3c28fc5bb9 100644 --- a/pcbnew/dialogs/panel_setup_feature_constraints.cpp +++ b/pcbnew/dialogs/panel_setup_feature_constraints.cpp @@ -44,6 +44,7 @@ PANEL_SETUP_FEATURE_CONSTRAINTS::PANEL_SETUP_FEATURE_CONSTRAINTS( PAGED_DIALOG* m_uviaMinSize( aFrame, m_uviaMinSizeLabel, m_uviaMinSizeCtrl, m_uviaMinSizeUnits, true ), m_uviaMinDrill( aFrame, m_uviaMinDrillLabel, m_uviaMinDrillCtrl, m_uviaMinDrillUnits, true ), m_holeToHoleMin( aFrame, m_HoleToHoleTitle, m_SetHoleToHoleCtrl, m_HoleToHoleUnits, true ), + m_holeClearance( aFrame, m_HoleClearanceLabel, m_HoleClearanceCtrl, m_HoleClearanceUnits, true ), m_edgeClearance( aFrame, m_EdgeClearanceLabel, m_EdgeClearanceCtrl, m_EdgeClearanceUnits, true ), m_silkClearance( aFrame, m_silkClearanceLabel, m_silkClearanceCtrl, m_silkClearanceUnits, true ), m_maxError( aFrame, m_maxErrorTitle, m_maxErrorCtrl, m_maxErrorUnits, true ) @@ -73,6 +74,7 @@ bool PANEL_SETUP_FEATURE_CONSTRAINTS::TransferDataToWindow() m_trackMinWidth.SetValue( m_BrdSettings->m_TrackMinWidth ); m_viaMinAnnulus.SetValue( m_BrdSettings->m_ViasMinAnnulus ); m_viaMinSize.SetValue(m_BrdSettings->m_ViasMinSize ); + m_holeClearance.SetValue( m_BrdSettings->m_HoleClearance ); m_edgeClearance.SetValue( m_BrdSettings->m_CopperEdgeClearance ); m_throughHoleMin.SetValue( m_BrdSettings->m_MinThroughDrill ); @@ -101,6 +103,9 @@ bool PANEL_SETUP_FEATURE_CONSTRAINTS::TransferDataFromWindow() if( !m_viaMinSize.Validate( 0, 10, EDA_UNITS::INCHES ) ) return false; + if( !m_holeClearance.Validate( 0, 10, EDA_UNITS::INCHES ) ) + return false; + if( !m_edgeClearance.Validate( 0, 10, EDA_UNITS::INCHES ) ) return false; @@ -126,6 +131,7 @@ bool PANEL_SETUP_FEATURE_CONSTRAINTS::TransferDataFromWindow() m_BrdSettings->m_TrackMinWidth = m_trackMinWidth.GetValue(); m_BrdSettings->m_ViasMinAnnulus = m_viaMinAnnulus.GetValue(); m_BrdSettings->m_ViasMinSize = m_viaMinSize.GetValue(); + m_BrdSettings->m_HoleClearance = m_holeClearance.GetValue(); m_BrdSettings->SetCopperEdgeClearance( m_edgeClearance.GetValue() ); m_BrdSettings->m_MinThroughDrill = m_throughHoleMin.GetValue(); diff --git a/pcbnew/dialogs/panel_setup_feature_constraints.h b/pcbnew/dialogs/panel_setup_feature_constraints.h index 221802c58d..2612cae0d8 100644 --- a/pcbnew/dialogs/panel_setup_feature_constraints.h +++ b/pcbnew/dialogs/panel_setup_feature_constraints.h @@ -50,6 +50,7 @@ public: UNIT_BINDER m_uviaMinSize; UNIT_BINDER m_uviaMinDrill; UNIT_BINDER m_holeToHoleMin; + UNIT_BINDER m_holeClearance; UNIT_BINDER m_edgeClearance; UNIT_BINDER m_silkClearance; UNIT_BINDER m_maxError; diff --git a/pcbnew/dialogs/panel_setup_feature_constraints_base.cpp b/pcbnew/dialogs/panel_setup_feature_constraints_base.cpp index 5d3b8f0d12..0ca849fe2a 100644 --- a/pcbnew/dialogs/panel_setup_feature_constraints_base.cpp +++ b/pcbnew/dialogs/panel_setup_feature_constraints_base.cpp @@ -167,7 +167,7 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi m_staticText23 = new wxStaticText( this, wxID_ANY, _("Copper"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText23->Wrap( -1 ); - fgFeatureConstraints->Add( m_staticText23, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_staticText23, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxLEFT, 4 ); fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -179,92 +179,106 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND, 5 ); m_bitmapClearance = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_bitmapClearance, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_bitmapClearance, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_clearanceTitle = new wxStaticText( this, wxID_ANY, _("Minimum clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_clearanceTitle->Wrap( -1 ); - fgFeatureConstraints->Add( m_clearanceTitle, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_clearanceTitle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_clearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_clearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + fgFeatureConstraints->Add( m_clearanceCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 7 ); m_clearanceUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_clearanceUnits->Wrap( -1 ); - fgFeatureConstraints->Add( m_clearanceUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_clearanceUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_bitmapMinTrackWidth = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_bitmapMinTrackWidth, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_bitmapMinTrackWidth, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_TrackMinWidthTitle = new wxStaticText( this, wxID_ANY, _("Minimum track width:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_TrackMinWidthTitle->Wrap( -1 ); - fgFeatureConstraints->Add( m_TrackMinWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 ); + fgFeatureConstraints->Add( m_TrackMinWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT, 5 ); m_TrackMinWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_TrackMinWidthCtrl->SetMinSize( wxSize( 120,-1 ) ); - fgFeatureConstraints->Add( m_TrackMinWidthCtrl, 0, wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND|wxALL, 5 ); + fgFeatureConstraints->Add( m_TrackMinWidthCtrl, 0, wxALIGN_LEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 7 ); m_TrackMinWidthUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_TrackMinWidthUnits->Wrap( -1 ); - fgFeatureConstraints->Add( m_TrackMinWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 ); + fgFeatureConstraints->Add( m_TrackMinWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT, 5 ); m_bitmapMinViaAnnulus = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_bitmapMinViaAnnulus, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_bitmapMinViaAnnulus, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_ViaMinAnnulusTitle = new wxStaticText( this, wxID_ANY, _("Minimum annular width:"), wxDefaultPosition, wxDefaultSize, 0 ); m_ViaMinAnnulusTitle->Wrap( -1 ); - fgFeatureConstraints->Add( m_ViaMinAnnulusTitle, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_ViaMinAnnulusTitle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_ViaMinAnnulusCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_ViaMinAnnulusCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + fgFeatureConstraints->Add( m_ViaMinAnnulusCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 7 ); m_ViaMinAnnulusUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_ViaMinAnnulusUnits->Wrap( -1 ); - fgFeatureConstraints->Add( m_ViaMinAnnulusUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_ViaMinAnnulusUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_bitmapMinViaDiameter = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_bitmapMinViaDiameter, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_bitmapMinViaDiameter, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_ViaMinTitle = new wxStaticText( this, wxID_ANY, _("Minimum via diameter:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_ViaMinTitle->Wrap( -1 ); - fgFeatureConstraints->Add( m_ViaMinTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 ); + fgFeatureConstraints->Add( m_ViaMinTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT, 5 ); m_SetViasMinSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_SetViasMinSizeCtrl, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_SetViasMinSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 7 ); m_ViaMinUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_ViaMinUnits->Wrap( -1 ); - fgFeatureConstraints->Add( m_ViaMinUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 ); + fgFeatureConstraints->Add( m_ViaMinUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT, 5 ); + + m_bitmapHoleClearance = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + fgFeatureConstraints->Add( m_bitmapHoleClearance, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_HoleClearanceLabel = new wxStaticText( this, wxID_ANY, _("Copper hole clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_HoleClearanceLabel->Wrap( -1 ); + fgFeatureConstraints->Add( m_HoleClearanceLabel, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_HoleClearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgFeatureConstraints->Add( m_HoleClearanceCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 7 ); + + m_HoleClearanceUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_HoleClearanceUnits->Wrap( -1 ); + fgFeatureConstraints->Add( m_HoleClearanceUnits, 0, wxALL, 5 ); m_bitmapEdgeClearance = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_bitmapEdgeClearance, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_bitmapEdgeClearance, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_EdgeClearanceLabel = new wxStaticText( this, wxID_ANY, _("Copper edge clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_EdgeClearanceLabel->Wrap( -1 ); - fgFeatureConstraints->Add( m_EdgeClearanceLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_EdgeClearanceLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_EdgeClearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_EdgeClearanceCtrl, 0, wxALL|wxEXPAND, 5 ); + fgFeatureConstraints->Add( m_EdgeClearanceCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 7 ); m_EdgeClearanceUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_EdgeClearanceUnits->Wrap( -1 ); - fgFeatureConstraints->Add( m_EdgeClearanceUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_EdgeClearanceUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline3, 0, wxTOP|wxEXPAND, 20 ); + fgFeatureConstraints->Add( m_staticline3, 0, wxTOP|wxEXPAND, 10 ); m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline4, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline4, 0, wxEXPAND|wxTOP, 10 ); m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline5, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline5, 0, wxEXPAND|wxTOP, 10 ); m_staticline6 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline6, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline6, 0, wxEXPAND|wxTOP, 10 ); m_staticText24 = new wxStaticText( this, wxID_ANY, _("Holes"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText24->Wrap( -1 ); - fgFeatureConstraints->Add( m_staticText24, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_staticText24, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 4 ); fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 ); @@ -276,48 +290,48 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 ); m_bitmapMinViaDrill = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_bitmapMinViaDrill, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_bitmapMinViaDrill, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_MinDrillTitle = new wxStaticText( this, wxID_ANY, _("Minimum through hole:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_MinDrillTitle->Wrap( -1 ); - fgFeatureConstraints->Add( m_MinDrillTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 ); + fgFeatureConstraints->Add( m_MinDrillTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT, 5 ); m_MinDrillCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_MinDrillCtrl, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_MinDrillCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 7 ); m_MinDrillUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_MinDrillUnits->Wrap( -1 ); - fgFeatureConstraints->Add( m_MinDrillUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 ); + fgFeatureConstraints->Add( m_MinDrillUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT, 5 ); m_bitmapMinHoleClearance = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_bitmapMinHoleClearance, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_bitmapMinHoleClearance, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_HoleToHoleTitle = new wxStaticText( this, wxID_ANY, _("Hole to hole clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_HoleToHoleTitle->Wrap( -1 ); - fgFeatureConstraints->Add( m_HoleToHoleTitle, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_HoleToHoleTitle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_SetHoleToHoleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_SetHoleToHoleCtrl, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_SetHoleToHoleCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 7 ); m_HoleToHoleUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_HoleToHoleUnits->Wrap( -1 ); - fgFeatureConstraints->Add( m_HoleToHoleUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_HoleToHoleUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_staticline8 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline8, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline8, 0, wxEXPAND|wxTOP, 10 ); m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline9, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline9, 0, wxEXPAND|wxTOP, 10 ); m_staticline10 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline10, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline10, 0, wxEXPAND|wxTOP, 10 ); m_staticline11 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline11, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline11, 0, wxEXPAND|wxTOP, 10 ); m_staticText25 = new wxStaticText( this, wxID_ANY, _("uVias"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText25->Wrap( -1 ); - fgFeatureConstraints->Add( m_staticText25, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_staticText25, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 4 ); fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 ); @@ -329,48 +343,48 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 ); m_bitmapMinuViaDiameter = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_bitmapMinuViaDiameter, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_bitmapMinuViaDiameter, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_uviaMinSizeLabel = new wxStaticText( this, wxID_ANY, _("Minimum uVia diameter:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_uviaMinSizeLabel->Wrap( -1 ); - fgFeatureConstraints->Add( m_uviaMinSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 ); + fgFeatureConstraints->Add( m_uviaMinSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT, 5 ); m_uviaMinSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_uviaMinSizeCtrl, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_uviaMinSizeCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 7 ); m_uviaMinSizeUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_uviaMinSizeUnits->Wrap( -1 ); - fgFeatureConstraints->Add( m_uviaMinSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 ); + fgFeatureConstraints->Add( m_uviaMinSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT, 5 ); m_bitmapMinuViaDrill = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_bitmapMinuViaDrill, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_bitmapMinuViaDrill, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_uviaMinDrillLabel = new wxStaticText( this, wxID_ANY, _("Minimum uVia drill:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_uviaMinDrillLabel->Wrap( -1 ); - fgFeatureConstraints->Add( m_uviaMinDrillLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 ); + fgFeatureConstraints->Add( m_uviaMinDrillLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT, 5 ); m_uviaMinDrillCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_uviaMinDrillCtrl, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_uviaMinDrillCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 7 ); m_uviaMinDrillUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_uviaMinDrillUnits->Wrap( -1 ); - fgFeatureConstraints->Add( m_uviaMinDrillUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 ); + fgFeatureConstraints->Add( m_uviaMinDrillUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT, 5 ); m_staticline111 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline111, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline111, 0, wxEXPAND|wxTOP, 10 ); m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline12, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline12, 0, wxEXPAND|wxTOP, 10 ); m_staticline13 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline13, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline13, 0, wxEXPAND|wxTOP, 10 ); m_staticline14 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - fgFeatureConstraints->Add( m_staticline14, 0, wxEXPAND|wxTOP, 20 ); + fgFeatureConstraints->Add( m_staticline14, 0, wxEXPAND|wxTOP, 10 ); m_staticText28 = new wxStaticText( this, wxID_ANY, _("Silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText28->Wrap( -1 ); - fgFeatureConstraints->Add( m_staticText28, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + fgFeatureConstraints->Add( m_staticText28, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 4 ); fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -386,14 +400,14 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi m_silkClearanceLabel = new wxStaticText( this, wxID_ANY, _("Minimum item clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_silkClearanceLabel->Wrap( -1 ); - fgFeatureConstraints->Add( m_silkClearanceLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_silkClearanceLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_silkClearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgFeatureConstraints->Add( m_silkClearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + fgFeatureConstraints->Add( m_silkClearanceCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 7 ); m_silkClearanceUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_silkClearanceUnits->Wrap( -1 ); - fgFeatureConstraints->Add( m_silkClearanceUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgFeatureConstraints->Add( m_silkClearanceUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); sbFeatureConstraints->Add( fgFeatureConstraints, 1, wxEXPAND|wxLEFT, 5 ); diff --git a/pcbnew/dialogs/panel_setup_feature_constraints_base.fbp b/pcbnew/dialogs/panel_setup_feature_constraints_base.fbp index a713af794c..43eacf9763 100644 --- a/pcbnew/dialogs/panel_setup_feature_constraints_base.fbp +++ b/pcbnew/dialogs/panel_setup_feature_constraints_base.fbp @@ -1381,8 +1381,8 @@ 0 0 - 5 - wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_HORIZONTAL + 4 + wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxLEFT 0 1 @@ -1473,7 +1473,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -1531,7 +1531,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -1591,8 +1591,8 @@ - 5 - wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND + 7 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM 0 1 @@ -1656,7 +1656,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 @@ -1717,7 +1717,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -1775,7 +1775,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT 0 1 @@ -1835,8 +1835,8 @@ - 5 - wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND|wxALL + 7 + wxALIGN_LEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM 0 1 @@ -1900,7 +1900,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT 0 1 @@ -1961,7 +1961,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2019,7 +2019,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -2079,8 +2079,8 @@ - 5 - wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND + 7 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM 0 1 @@ -2144,7 +2144,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 @@ -2205,7 +2205,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2263,7 +2263,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT 0 1 @@ -2323,8 +2323,8 @@ - 5 - wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL + 7 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM 0 1 @@ -2388,7 +2388,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT 0 1 @@ -2449,7 +2449,251 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_bitmapHoleClearance + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + + + + + 5 + wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Copper hole clearance: + 0 + + 0 + + + 0 + + 1 + m_HoleClearanceLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 7 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_HoleClearanceCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_HoleClearanceUnits + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2507,7 +2751,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -2567,8 +2811,8 @@ - 5 - wxALL|wxEXPAND + 7 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM 0 1 @@ -2632,7 +2876,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 @@ -2692,7 +2936,7 @@ - 20 + 10 wxTOP|wxEXPAND 0 @@ -2750,7 +2994,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -2808,7 +3052,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -2866,7 +3110,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -2924,8 +3168,8 @@ - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + 4 + wxALIGN_CENTER_HORIZONTAL|wxALL 0 1 @@ -3016,7 +3260,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -3074,7 +3318,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT 0 1 @@ -3134,8 +3378,8 @@ - 5 - wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL + 7 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM 0 1 @@ -3199,7 +3443,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT 0 1 @@ -3260,7 +3504,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -3318,7 +3562,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -3378,8 +3622,8 @@ - 5 - wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL + 7 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM 0 1 @@ -3443,7 +3687,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 @@ -3503,7 +3747,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -3561,7 +3805,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -3619,7 +3863,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -3677,7 +3921,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -3735,8 +3979,8 @@ - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + 4 + wxALIGN_CENTER_HORIZONTAL|wxALL 0 1 @@ -3827,7 +4071,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -3885,7 +4129,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT 0 1 @@ -3945,8 +4189,8 @@ - 5 - wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL + 7 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM 0 1 @@ -4010,7 +4254,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT 0 1 @@ -4071,7 +4315,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -4129,7 +4373,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT 0 1 @@ -4189,8 +4433,8 @@ - 5 - wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL + 7 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM 0 1 @@ -4254,7 +4498,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT 0 1 @@ -4314,7 +4558,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -4372,7 +4616,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -4430,7 +4674,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -4488,7 +4732,7 @@ - 20 + 10 wxEXPAND|wxTOP 0 @@ -4546,8 +4790,8 @@ - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + 4 + wxALIGN_CENTER_HORIZONTAL|wxALL 0 1 @@ -4648,7 +4892,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -4708,8 +4952,8 @@ - 5 - wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND + 7 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM 0 1 @@ -4773,7 +5017,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 diff --git a/pcbnew/dialogs/panel_setup_feature_constraints_base.h b/pcbnew/dialogs/panel_setup_feature_constraints_base.h index 13b6f13ab7..82a0bd03f9 100644 --- a/pcbnew/dialogs/panel_setup_feature_constraints_base.h +++ b/pcbnew/dialogs/panel_setup_feature_constraints_base.h @@ -75,6 +75,10 @@ class PANEL_SETUP_FEATURE_CONSTRAINTS_BASE : public wxPanel wxStaticText* m_ViaMinTitle; wxTextCtrl* m_SetViasMinSizeCtrl; wxStaticText* m_ViaMinUnits; + wxStaticBitmap* m_bitmapHoleClearance; + wxStaticText* m_HoleClearanceLabel; + wxTextCtrl* m_HoleClearanceCtrl; + wxStaticText* m_HoleClearanceUnits; wxStaticBitmap* m_bitmapEdgeClearance; wxStaticText* m_EdgeClearanceLabel; wxTextCtrl* m_EdgeClearanceCtrl; diff --git a/pcbnew/dialogs/panel_setup_rules.cpp b/pcbnew/dialogs/panel_setup_rules.cpp index ec2502b992..fba44fbbd5 100644 --- a/pcbnew/dialogs/panel_setup_rules.cpp +++ b/pcbnew/dialogs/panel_setup_rules.cpp @@ -237,6 +237,7 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) "length " "hole " "hole_clearance " + "hole_to_hole " "silk_clearance " "skew " "track_width " diff --git a/pcbnew/drc/drc_engine.cpp b/pcbnew/drc/drc_engine.cpp index 06fc7db547..2327c5fbb4 100644 --- a/pcbnew/drc/drc_engine.cpp +++ b/pcbnew/drc/drc_engine.cpp @@ -160,11 +160,15 @@ void DRC_ENGINE::loadImplicitRules() rule->AddConstraint( edgeClearanceConstraint ); DRC_CONSTRAINT holeClearanceConstraint( HOLE_CLEARANCE_CONSTRAINT ); - holeClearanceConstraint.Value().SetMin( bds.m_HoleToHoleMin ); + holeClearanceConstraint.Value().SetMin( bds.m_HoleClearance ); rule->AddConstraint( holeClearanceConstraint ); + DRC_CONSTRAINT holeToHoleConstraint( HOLE_TO_HOLE_CONSTRAINT ); + holeToHoleConstraint.Value().SetMin( bds.m_HoleToHoleMin ); + rule->AddConstraint( holeToHoleConstraint ); + DRC_CONSTRAINT courtyardClearanceConstraint( COURTYARD_CLEARANCE_CONSTRAINT ); - holeClearanceConstraint.Value().SetMin( 0 ); + holeToHoleConstraint.Value().SetMin( 0 ); rule->AddConstraint( courtyardClearanceConstraint ); DRC_CONSTRAINT diffPairGapConstraint( DIFF_PAIR_GAP_CONSTRAINT ); @@ -427,7 +431,7 @@ void DRC_ENGINE::loadImplicitRules() static wxString formatConstraint( const DRC_CONSTRAINT& constraint ) { - struct Formatter + struct FORMATTER { DRC_CONSTRAINT_TYPE_T type; wxString name; @@ -441,19 +445,22 @@ static wxString formatConstraint( const DRC_CONSTRAINT& constraint ) const auto value = c.GetValue(); if ( value.HasMin() ) - str += wxString::Format(" min: %d", value.Min() ); + str += wxString::Format( " min: %d", value.Min() ); + if ( value.HasOpt() ) - str += wxString::Format(" opt: %d", value.Opt() ); + str += wxString::Format( " opt: %d", value.Opt() ); + if ( value.HasMax() ) - str += wxString::Format(" max: %d", value.Max() ); + str += wxString::Format( " max: %d", value.Max() ); return str; }; - std::vector formats = + std::vector formats = { { CLEARANCE_CONSTRAINT, "clearance", formatMinMax }, { HOLE_CLEARANCE_CONSTRAINT, "hole_clearance", formatMinMax }, + { HOLE_TO_HOLE_CONSTRAINT, "hole_to_hole", formatMinMax }, { EDGE_CLEARANCE_CONSTRAINT, "edge_clearance", formatMinMax }, { HOLE_SIZE_CONSTRAINT, "hole_size", formatMinMax }, { COURTYARD_CLEARANCE_CONSTRAINT, "courtyard_clearance", formatMinMax }, @@ -467,13 +474,15 @@ static wxString formatConstraint( const DRC_CONSTRAINT& constraint ) { VIA_COUNT_CONSTRAINT, "via_count", formatMinMax } }; - for( auto& fmt : formats ) + for( FORMATTER& fmt : formats ) { if( fmt.type == constraint.m_Type ) { wxString rv = fmt.name + " "; + if( fmt.formatter ) rv += fmt.formatter( constraint ); + return rv; } } @@ -1112,8 +1121,8 @@ std::vector DRC_ENGINE::QueryConstraintsById( DRC_CONSTRAINT_TYP if( m_constraintMap.count( constraintID ) ) { - for ( CONSTRAINT_WITH_CONDITIONS* c : *m_constraintMap[constraintID] ) - rv.push_back( c->constraint ); + for ( CONSTRAINT_WITH_CONDITIONS* c : *m_constraintMap[constraintID] ) + rv.push_back( c->constraint ); } return rv; diff --git a/pcbnew/drc/drc_rule.h b/pcbnew/drc/drc_rule.h index aa236d7ad8..23ff3f9f82 100644 --- a/pcbnew/drc/drc_rule.h +++ b/pcbnew/drc/drc_rule.h @@ -43,6 +43,7 @@ enum DRC_CONSTRAINT_TYPE_T NULL_CONSTRAINT = 0, CLEARANCE_CONSTRAINT, HOLE_CLEARANCE_CONSTRAINT, + HOLE_TO_HOLE_CONSTRAINT, EDGE_CLEARANCE_CONSTRAINT, HOLE_SIZE_CONSTRAINT, COURTYARD_CLEARANCE_CONSTRAINT, diff --git a/pcbnew/drc/drc_rule_parser.cpp b/pcbnew/drc/drc_rule_parser.cpp index 5c61ef228f..78c5520bb9 100644 --- a/pcbnew/drc/drc_rule_parser.cpp +++ b/pcbnew/drc/drc_rule_parser.cpp @@ -264,7 +264,10 @@ void DRC_RULES_PARSER::parseConstraint( DRC_RULE* aRule ) if( (int) token == DSN_RIGHT || token == T_EOF ) { msg.Printf( _( "Missing constraint type.| Expected %s." ), - "'clearance', 'track_width', 'annular_width', 'hole', 'disallow'" ); + "'clearance', 'hole_clearance', 'edge_clearance', 'hole', 'hole_to_hole', " + "'courtyard_clearance', 'silk_clearance', 'track_width', 'annular_width', " + "'disallow', 'length', 'skew', 'via_count', 'diff_pair_gap' or " + "'diff_pair_uncoupled'" ); reportError( msg ); return; } @@ -275,6 +278,7 @@ void DRC_RULES_PARSER::parseConstraint( DRC_RULE* aRule ) case T_hole_clearance: constraint.m_Type = HOLE_CLEARANCE_CONSTRAINT; break; case T_edge_clearance: constraint.m_Type = EDGE_CLEARANCE_CONSTRAINT; break; case T_hole: constraint.m_Type = HOLE_SIZE_CONSTRAINT; break; + case T_hole_to_hole: constraint.m_Type = HOLE_TO_HOLE_CONSTRAINT; break; case T_courtyard_clearance: constraint.m_Type = COURTYARD_CLEARANCE_CONSTRAINT; break; case T_silk_clearance: constraint.m_Type = SILK_CLEARANCE_CONSTRAINT; break; case T_track_width: constraint.m_Type = TRACK_WIDTH_CONSTRAINT; break; diff --git a/pcbnew/drc/drc_test_provider_copper_clearance.cpp b/pcbnew/drc/drc_test_provider_copper_clearance.cpp index d35cfb7982..1be5ee0a26 100644 --- a/pcbnew/drc/drc_test_provider_copper_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_copper_clearance.cpp @@ -812,7 +812,7 @@ int DRC_TEST_PROVIDER_COPPER_CLEARANCE::GetNumPhases() const std::set DRC_TEST_PROVIDER_COPPER_CLEARANCE::GetConstraintTypes() const { - return { CLEARANCE_CONSTRAINT }; + return { CLEARANCE_CONSTRAINT, HOLE_CLEARANCE_CONSTRAINT }; } diff --git a/pcbnew/drc/drc_test_provider_hole_clearance.cpp b/pcbnew/drc/drc_test_provider_hole_clearance.cpp index 2e10e9ecab..608810bf08 100644 --- a/pcbnew/drc/drc_test_provider_hole_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_hole_clearance.cpp @@ -34,7 +34,7 @@ /* Holes clearance test. Checks pad and via holes for their mechanical clearances. Generated errors: - - DRCE_HOLE_CLEARANCE + - DRCE_DRILLED_HOLES_TOO_CLOSE TODO: vias-in-smd-pads check */ @@ -99,14 +99,14 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run() DRC_CONSTRAINT worstClearanceConstraint; - if( m_drcEngine->QueryWorstConstraint( HOLE_CLEARANCE_CONSTRAINT, worstClearanceConstraint ) ) + if( m_drcEngine->QueryWorstConstraint( HOLE_TO_HOLE_CONSTRAINT, worstClearanceConstraint ) ) { m_largestClearance = worstClearanceConstraint.GetValue().Min(); - reportAux( "Worst hole clearance : %d nm", m_largestClearance ); + reportAux( "Worst hole to hole : %d nm", m_largestClearance ); } else { - reportAux( "No hole clearance constraints found..." ); + reportAux( "No hole to hole constraints found..." ); return false; } @@ -134,13 +134,11 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run() if( !reportProgress( ii++, count, delta ) ) return false; - item->ClearFlags( SKIP_STRUCT ); - if( item->Type() == PCB_PAD_T ) { PAD* pad = static_cast( item ); - // Check for round hole + // We only care about drilled (ie: round) holes if( pad->GetDrillSize().x && pad->GetDrillSize().x == pad->GetDrillSize().y ) m_holeTree.Insert( item, m_largestClearance, F_Cu ); } @@ -148,7 +146,7 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run() { VIA* via = static_cast( item ); - // Check for drilled hole + // We only care about mechanically drilled (ie: non-laser) holes if( via->GetViaType() == VIATYPE::THROUGH ) m_holeTree.Insert( item, m_largestClearance, F_Cu ); } @@ -177,62 +175,16 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run() if( !reportProgress( ii++, count, delta ) ) break; - std::shared_ptr holeShape = getDrilledHoleShape( via ); - - m_holeTree.QueryColliding( via, F_Cu, F_Cu, - // Filter: - [&]( BOARD_ITEM* other ) -> bool - { - if( other->HasFlag( SKIP_STRUCT ) ) - return false; - - BOARD_ITEM* a = via; - BOARD_ITEM* b = other; - - // store canonical order so we don't collide in both directions - // (a:b and b:a) - if( static_cast( a ) > static_cast( b ) ) - std::swap( a, b ); - - if( checkedPairs.count( { a, b } ) ) - { - return false; - } - else - { - checkedPairs[ { a, b } ] = 1; - return true; - } - }, - // Visitor: - [&]( BOARD_ITEM* other ) -> bool - { - return testHoleAgainstHole( via, holeShape.get(), other ); - }, - m_largestClearance ); - - via->SetFlags( SKIP_STRUCT ); - } - - checkedPairs.clear(); - - for( FOOTPRINT* footprint : m_board->Footprints() ) - { - for( PAD* pad : footprint->Pads() ) + // We only care about mechanically drilled (ie: non-laser) holes + if( via->GetViaType() == VIATYPE::THROUGH ) { - if( !reportProgress( ii++, count, delta ) ) - break; + std::shared_ptr holeShape = getDrilledHoleShape( via ); - std::shared_ptr holeShape = getDrilledHoleShape( pad ); - - m_holeTree.QueryColliding( pad, F_Cu, F_Cu, + m_holeTree.QueryColliding( via, F_Cu, F_Cu, // Filter: [&]( BOARD_ITEM* other ) -> bool { - if( other->HasFlag( SKIP_STRUCT ) ) - return false; - - BOARD_ITEM* a = pad; + BOARD_ITEM* a = via; BOARD_ITEM* b = other; // store canonical order so we don't collide in both directions @@ -253,11 +205,55 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run() // Visitor: [&]( BOARD_ITEM* other ) -> bool { - return testHoleAgainstHole( pad, holeShape.get(), other ); + return testHoleAgainstHole( via, holeShape.get(), other ); }, m_largestClearance ); + } + } - pad->SetFlags( SKIP_STRUCT ); + checkedPairs.clear(); + + for( FOOTPRINT* footprint : m_board->Footprints() ) + { + for( PAD* pad : footprint->Pads() ) + { + if( !reportProgress( ii++, count, delta ) ) + break; + + // We only care about drilled (ie: round) holes + if( pad->GetDrillSize().x && pad->GetDrillSize().x == pad->GetDrillSize().y ) + { + std::shared_ptr holeShape = getDrilledHoleShape( pad ); + + m_holeTree.QueryColliding( pad, F_Cu, F_Cu, + // Filter: + [&]( BOARD_ITEM* other ) -> bool + { + BOARD_ITEM* a = pad; + BOARD_ITEM* b = other; + + // store canonical order so we don't collide in both directions + // (a:b and b:a) + if( static_cast( a ) > static_cast( b ) ) + std::swap( a, b ); + + if( checkedPairs.count( { a, b } ) ) + { + return false; + } + else + { + checkedPairs[ { a, b } ] = 1; + return true; + } + }, + // Visitor: + [&]( BOARD_ITEM* other ) -> bool + { + return testHoleAgainstHole( pad, holeShape.get(), other ); + }, + m_largestClearance ); + } } } @@ -291,7 +287,7 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::testHoleAgainstHole( BOARD_ITEM* aItem, S { std::shared_ptr drce = DRC_ITEM::Create( DRCE_DRILLED_HOLES_TOO_CLOSE ); - m_msg.Printf( _( "(%s clearance %s; actual %s)" ), + m_msg.Printf( _( "(%s min %s; actual %s)" ), constraint.GetName(), MessageTextFromValue( userUnits(), minClearance ), MessageTextFromValue( userUnits(), actual ) ); @@ -315,7 +311,7 @@ int DRC_TEST_PROVIDER_HOLE_CLEARANCE::GetNumPhases() const std::set DRC_TEST_PROVIDER_HOLE_CLEARANCE::GetConstraintTypes() const { - return { HOLE_CLEARANCE_CONSTRAINT }; + return { HOLE_TO_HOLE_CONSTRAINT }; }