Add min clearance to DRC; rename Min Via Drill to Min Through Hole.

Also fixes a crash bug when ignoring a DRC violoation with multiple
markers.

Fixes https://gitlab.com/kicad/code/kicad/issues/2528
This commit is contained in:
Jeff Young 2020-05-04 22:05:30 +01:00
parent e39d145d72
commit e0da677d4d
17 changed files with 1776 additions and 790 deletions

View File

@ -54,6 +54,7 @@ chamfer
chamfer_ratio
circle
clearance
clearance_min
color
comment
company
@ -222,6 +223,7 @@ thermal_width
thermal_gap
thermal_bridge_width
thickness
through_hole_min
top
top_left
top_right

View File

@ -66,9 +66,10 @@
#define DEFAULT_CUSTOMDPAIRGAP 0.18
#define DEFAULT_CUSTOMDPAIRVIAGAP 0.18
#define DEFAULT_MINCLEARANCE 0.0 // overall min clearance
#define DEFAULT_TRACKMINWIDTH 0.2 // track width min value
#define DEFAULT_VIASMINSIZE 0.4 // vias (not micro vias) min diameter
#define DEFAULT_VIASMINDRILL 0.3 // vias (not micro vias) min drill diameter
#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
@ -198,9 +199,10 @@ public:
bool m_UseConnectedTrackWidth; // use width of existing track when creating a new,
// connected track
int m_MinClearance; // overall min clearance
int m_TrackMinWidth; // track min value for width ((min copper size value
int m_ViasMinSize; // vias (not micro vias) min diameter
int m_ViasMinDrill; // vias (not micro vias) min drill diameter
int m_MinThroughDrill; // through hole (not micro vias) min drill diameter
int m_MicroViasMinSize; // micro vias min diameter
int m_MicroViasMinDrill; // micro vias min drill diameter
int m_CopperEdgeClearance;

View File

@ -571,16 +571,17 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_useCustomTrackVia = false;
m_customTrackWidth = Millimeter2iu( DEFAULT_CUSTOMTRACKWIDTH );
m_customViaSize.m_Diameter = Millimeter2iu( DEFAULT_VIASMINSIZE );
m_customViaSize.m_Drill = Millimeter2iu( DEFAULT_VIASMINDRILL );
m_customViaSize.m_Drill = Millimeter2iu( DEFAULT_MINTHROUGHDRILL );
m_useCustomDiffPair = false;
m_customDiffPair.m_Width = Millimeter2iu( DEFAULT_CUSTOMDPAIRWIDTH );
m_customDiffPair.m_Gap = Millimeter2iu( DEFAULT_CUSTOMDPAIRGAP );
m_customDiffPair.m_ViaGap = Millimeter2iu( DEFAULT_CUSTOMDPAIRVIAGAP );
m_MinClearance = Millimeter2iu( DEFAULT_MINCLEARANCE );
m_TrackMinWidth = Millimeter2iu( DEFAULT_TRACKMINWIDTH );
m_ViasMinSize = Millimeter2iu( DEFAULT_VIASMINSIZE );
m_ViasMinDrill = Millimeter2iu( DEFAULT_VIASMINDRILL );
m_MinThroughDrill = Millimeter2iu( DEFAULT_MINTHROUGHDRILL );
m_MicroViasMinSize = Millimeter2iu( DEFAULT_MICROVIASMINSIZE );
m_MicroViasMinDrill = Millimeter2iu( DEFAULT_MICROVIASMINDRILL );
m_CopperEdgeClearance = Millimeter2iu( DEFAULT_COPPEREDGECLEARANCE );
@ -634,6 +635,11 @@ void BOARD_DESIGN_SETTINGS::AppendConfigs( BOARD* aBoard, std::vector<PARAM_CFG*
aResult->push_back( new PARAM_CFG_BOOL( wxT( "AllowBlindVias" ),
&m_BlindBuriedViaAllowed, false ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinClearance" ),
&m_MinClearance,
Millimeter2iu( DEFAULT_MINCLEARANCE ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinTrackWidth" ),
&m_TrackMinWidth,
Millimeter2iu( DEFAULT_TRACKMINWIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
@ -644,10 +650,10 @@ void BOARD_DESIGN_SETTINGS::AppendConfigs( BOARD* aBoard, std::vector<PARAM_CFG*
Millimeter2iu( DEFAULT_VIASMINSIZE ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinViaDrill" ),
&m_ViasMinDrill,
Millimeter2iu( DEFAULT_VIASMINDRILL ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
nullptr, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinThroughDrill" ),
&m_MinThroughDrill,
Millimeter2iu( DEFAULT_MINTHROUGHDRILL ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
nullptr, MM_PER_IU, wxT( "MinViaDrill" ) ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "MinMicroViaDiameter" ),
&m_MicroViasMinSize,

View File

@ -374,18 +374,24 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent )
break;
case 5:
{
m_BrdSettings.m_DRCSeverities[ rcItem->GetErrorCode() ] = RPT_SEVERITY_IGNORE;
m_brdEditor->GetBoard()->SetDesignSettings( m_BrdSettings );
for( MARKER_PCB* marker : m_brdEditor->GetBoard()->Markers() )
std::vector<MARKER_PCB*>& markers = m_brdEditor->GetBoard()->Markers();
for( unsigned i = 0; i < markers.size(); )
{
if( marker->GetRCItem()->GetErrorCode() == rcItem->GetErrorCode() )
m_brdEditor->GetBoard()->Delete( marker );
if( markers[i]->GetRCItem()->GetErrorCode() == rcItem->GetErrorCode() )
markers.erase( markers.begin() + i );
else
++i;
}
// Rebuild model and view
static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->SetProvider( m_markersProvider );
modified = true;
}
break;
case 6:

View File

@ -36,9 +36,10 @@
PANEL_SETUP_FEATURE_CONSTRAINTS::PANEL_SETUP_FEATURE_CONSTRAINTS( PAGED_DIALOG* aParent,
PCB_EDIT_FRAME* aFrame ) :
PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( aParent->GetTreebook() ),
m_minClearance( aFrame, m_clearanceTitle, m_clearanceCtrl, m_clearanceUnits, true ),
m_trackMinWidth( aFrame, m_TrackMinWidthTitle, m_TrackMinWidthCtrl, m_TrackMinWidthUnits, true ),
m_viaMinSize( aFrame, m_ViaMinTitle, m_SetViasMinSizeCtrl, m_ViaMinUnits, true ),
m_viaMinDrill( aFrame, m_ViaMinDrillTitle, m_SetViasMinDrillCtrl, m_ViaMinDrillUnits, true ),
m_throughHoleMin( aFrame, m_MinDrillTitle, m_MinDrillCtrl, m_MinDrillUnits, true ),
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 ),
@ -52,54 +53,68 @@ PANEL_SETUP_FEATURE_CONSTRAINTS::PANEL_SETUP_FEATURE_CONSTRAINTS( PAGED_DIALOG*
bool PANEL_SETUP_FEATURE_CONSTRAINTS::TransferDataToWindow()
{
m_trackMinWidth.SetValue( m_BrdSettings->m_TrackMinWidth );
m_viaMinSize.SetValue(m_BrdSettings->m_ViasMinSize );
m_viaMinDrill.SetValue( m_BrdSettings->m_ViasMinDrill );
m_OptAllowBlindBuriedVias->SetValue( m_BrdSettings->m_BlindBuriedViaAllowed );
m_OptAllowMicroVias->SetValue( m_BrdSettings->m_MicroViasAllowed );
m_uviaMinSize.SetValue( m_BrdSettings->m_MicroViasMinSize );
m_uviaMinDrill.SetValue( m_BrdSettings->m_MicroViasMinDrill );
m_holeToHoleMin.SetValue( m_BrdSettings->m_HoleToHoleMin );
m_edgeClearance.SetValue( m_BrdSettings->m_CopperEdgeClearance );
m_maxError.SetValue( m_BrdSettings->m_MaxError );
m_cbOutlinePolygonFastest->SetValue( m_BrdSettings->m_ZoneUseNoOutlineInFill );
m_cbOutlinePolygonBestQ->SetValue( !m_BrdSettings->m_ZoneUseNoOutlineInFill );
m_minClearance.SetValue( m_BrdSettings->m_MinClearance );
m_trackMinWidth.SetValue( m_BrdSettings->m_TrackMinWidth );
m_viaMinSize.SetValue(m_BrdSettings->m_ViasMinSize );
m_edgeClearance.SetValue( m_BrdSettings->m_CopperEdgeClearance );
m_throughHoleMin.SetValue( m_BrdSettings->m_MinThroughDrill );
m_holeToHoleMin.SetValue( m_BrdSettings->m_HoleToHoleMin );
m_uviaMinSize.SetValue( m_BrdSettings->m_MicroViasMinSize );
m_uviaMinDrill.SetValue( m_BrdSettings->m_MicroViasMinDrill );
return true;
}
bool PANEL_SETUP_FEATURE_CONSTRAINTS::TransferDataFromWindow()
{
// Update tracks minimum values for DRC
m_BrdSettings->m_TrackMinWidth = m_trackMinWidth.GetValue();
if( !m_minClearance.Validate( 0, Mils2iu( 10000 ) ) ) // 0 to 10 inches
return false;
// Update vias minimum values for DRC
m_BrdSettings->m_ViasMinSize = m_viaMinSize.GetValue();
m_BrdSettings->m_ViasMinDrill = m_viaMinDrill.GetValue();
if( !m_trackMinWidth.Validate( 0, Mils2iu( 10000 ) ) ) // 0 to 10 inches
return false;
if( !m_viaMinSize.Validate( 0, Mils2iu( 10000 ) ) ) // 0 to 10 inches
return false;
if( !m_edgeClearance.Validate( 0, Mils2iu( 10000 ) ) ) // 0 to 10 inches
return false;
if( !m_throughHoleMin.Validate( Mils2iu( 2 ), Mils2iu( 1000 ) ) ) // #107 to 1 inch
return false;
if( !m_holeToHoleMin.Validate( 0, Mils2iu( 10000 ) ) ) // 0 to 10 inches
return false;
m_BrdSettings->m_BlindBuriedViaAllowed = m_OptAllowBlindBuriedVias->GetValue();
m_BrdSettings->m_MicroViasAllowed = m_OptAllowMicroVias->GetValue();
// Update microvias minimum values for DRC
m_BrdSettings->m_MicroViasMinSize = m_uviaMinSize.GetValue();
m_BrdSettings->m_MicroViasMinDrill = m_uviaMinDrill.GetValue();
m_BrdSettings->SetMinHoleSeparation( m_holeToHoleMin.GetValue() );
m_BrdSettings->SetCopperEdgeClearance( m_edgeClearance.GetValue() );
m_BrdSettings->m_MaxError = Clamp<int>( IU_PER_MM * MINIMUM_ERROR_SIZE_MM,
m_maxError.GetValue(), IU_PER_MM * MAXIMUM_ERROR_SIZE_MM );
m_BrdSettings->m_ZoneUseNoOutlineInFill = m_cbOutlinePolygonFastest->GetValue();
m_BrdSettings->m_MinClearance = m_minClearance.GetValue();
m_BrdSettings->m_TrackMinWidth = m_trackMinWidth.GetValue();
m_BrdSettings->m_ViasMinSize = m_viaMinSize.GetValue();
m_BrdSettings->SetCopperEdgeClearance( m_edgeClearance.GetValue() );
m_BrdSettings->m_MinThroughDrill = m_throughHoleMin.GetValue();
m_BrdSettings->SetMinHoleSeparation( m_holeToHoleMin.GetValue() );
m_BrdSettings->m_MicroViasMinSize = m_uviaMinSize.GetValue();
m_BrdSettings->m_MicroViasMinDrill = m_uviaMinDrill.GetValue();
return true;
}
@ -112,6 +127,7 @@ bool PANEL_SETUP_FEATURE_CONSTRAINTS::Show( bool aShow )
// first displayed. However, on OSX 3.0.5 (at least), if another panel is displayed
// first then the icons will be blank unless they're set here.
m_bitmapZoneFillOpt->SetBitmap( KiBitmap( show_zone_xpm ) );
m_bitmapClearance->SetBitmap( KiBitmap( ps_diff_pair_gap_xpm ) );
m_bitmapMinTrackWidth->SetBitmap( KiBitmap( width_track_xpm ) );
m_bitmapMinViaDiameter->SetBitmap( KiBitmap( via_diameter_xpm ) );
m_bitmapMinViaDrill->SetBitmap( KiBitmap( via_hole_diameter_xpm ) );

View File

@ -42,9 +42,10 @@ private:
BOARD_DESIGN_SETTINGS* m_BrdSettings;
public:
UNIT_BINDER m_minClearance;
UNIT_BINDER m_trackMinWidth;
UNIT_BINDER m_viaMinSize;
UNIT_BINDER m_viaMinDrill;
UNIT_BINDER m_throughHoleMin;
UNIT_BINDER m_uviaMinSize;
UNIT_BINDER m_uviaMinDrill;
UNIT_BINDER m_holeToHoleMin;

View File

@ -17,6 +17,10 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
wxBoxSizer* sbFeatureRules;
sbFeatureRules = new wxBoxSizer( wxVERTICAL );
m_staticText26 = new wxStaticText( this, wxID_ANY, _("Allowed features"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText26->Wrap( -1 );
sbFeatureRules->Add( m_staticText26, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
wxFlexGridSizer* fgSizerViaOpt;
fgSizerViaOpt = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizerViaOpt->SetFlexibleDirection( wxBOTH );
@ -127,12 +131,38 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
wxFlexGridSizer* fgFeatureConstraints;
fgFeatureConstraints = new wxFlexGridSizer( 0, 4, 0, 0 );
fgFeatureConstraints->AddGrowableCol( 2 );
fgFeatureConstraints->SetFlexibleDirection( wxBOTH );
fgFeatureConstraints->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText23 = new wxStaticText( this, wxID_ANY, _("Copper"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText23->Wrap( -1 );
fgFeatureConstraints->Add( m_staticText23, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND, 5 );
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 );
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 );
m_clearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_clearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_clearanceUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_clearanceUnits->Wrap( -1 );
fgFeatureConstraints->Add( m_clearanceUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_bitmapMinTrackWidth = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_bitmapMinTrackWidth, 0, wxALL, 5 );
fgFeatureConstraints->Add( m_bitmapMinTrackWidth, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_TrackMinWidthTitle = new wxStaticText( this, wxID_ANY, _("Minimum track width:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_TrackMinWidthTitle->Wrap( -1 );
@ -147,20 +177,8 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
m_TrackMinWidthUnits->Wrap( -1 );
fgFeatureConstraints->Add( m_TrackMinWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
m_bitmapMinViaDiameter = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_bitmapMinViaDiameter, 0, wxALL, 5 );
fgFeatureConstraints->Add( m_bitmapMinViaDiameter, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_ViaMinTitle = new wxStaticText( this, wxID_ANY, _("Minimum via diameter:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_ViaMinTitle->Wrap( -1 );
@ -173,22 +191,88 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
m_ViaMinUnits->Wrap( -1 );
fgFeatureConstraints->Add( m_ViaMinUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
m_bitmapEdgeClearance = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_bitmapEdgeClearance, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 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 );
m_EdgeClearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_EdgeClearanceCtrl, 0, wxALL|wxEXPAND, 5 );
m_EdgeClearanceUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_EdgeClearanceUnits->Wrap( -1 );
fgFeatureConstraints->Add( m_EdgeClearanceUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgFeatureConstraints->Add( m_staticline3, 0, wxTOP|wxEXPAND, 20 );
m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgFeatureConstraints->Add( m_staticline4, 0, wxEXPAND|wxTOP, 20 );
m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgFeatureConstraints->Add( m_staticline5, 0, wxEXPAND|wxTOP, 20 );
m_staticline6 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgFeatureConstraints->Add( m_staticline6, 0, wxEXPAND|wxTOP, 20 );
m_staticText24 = new wxStaticText( this, wxID_ANY, _("Holes"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText24->Wrap( -1 );
fgFeatureConstraints->Add( m_staticText24, 0, wxALL, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
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, 5 );
fgFeatureConstraints->Add( m_bitmapMinViaDrill, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_ViaMinDrillTitle = new wxStaticText( this, wxID_ANY, _("Minimum via drill:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_ViaMinDrillTitle->Wrap( -1 );
fgFeatureConstraints->Add( m_ViaMinDrillTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 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 );
m_SetViasMinDrillCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_SetViasMinDrillCtrl, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_MinDrillCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_MinDrillCtrl, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_ViaMinDrillUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_ViaMinDrillUnits->Wrap( -1 );
fgFeatureConstraints->Add( m_ViaMinDrillUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
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 );
m_bitmapMinHoleClearance = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_bitmapMinHoleClearance, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 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 );
m_SetHoleToHoleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_SetHoleToHoleCtrl, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_HoleToHoleUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_HoleToHoleUnits->Wrap( -1 );
fgFeatureConstraints->Add( m_HoleToHoleUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_staticline8 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgFeatureConstraints->Add( m_staticline8, 0, wxEXPAND|wxTOP, 20 );
m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgFeatureConstraints->Add( m_staticline9, 0, wxEXPAND|wxTOP, 20 );
m_staticline10 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgFeatureConstraints->Add( m_staticline10, 0, wxEXPAND|wxTOP, 20 );
m_staticline11 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgFeatureConstraints->Add( m_staticline11, 0, wxEXPAND|wxTOP, 20 );
m_staticText25 = new wxStaticText( this, wxID_ANY, _("uVias"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText25->Wrap( -1 );
fgFeatureConstraints->Add( m_staticText25, 0, wxALL, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
@ -200,7 +284,7 @@ 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, 5 );
fgFeatureConstraints->Add( m_bitmapMinuViaDiameter, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_uviaMinSizeLabel = new wxStaticText( this, wxID_ANY, _("Minimum uVia diameter:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_uviaMinSizeLabel->Wrap( -1 );
@ -214,7 +298,7 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
fgFeatureConstraints->Add( m_uviaMinSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
m_bitmapMinuViaDrill = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_bitmapMinuViaDrill, 0, wxALL, 5 );
fgFeatureConstraints->Add( m_bitmapMinuViaDrill, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_uviaMinDrillLabel = new wxStaticText( this, wxID_ANY, _("Minimum uVia drill:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_uviaMinDrillLabel->Wrap( -1 );
@ -228,59 +312,7 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
fgFeatureConstraints->Add( m_uviaMinDrillUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxALL, 10 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
m_bitmapMinHoleClearance = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_bitmapMinHoleClearance, 0, wxALL, 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 );
m_SetHoleToHoleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_SetHoleToHoleCtrl, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
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( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND, 5 );
fgFeatureConstraints->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
m_bitmapEdgeClearance = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_bitmapEdgeClearance, 0, wxALL, 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 );
m_EdgeClearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_EdgeClearanceCtrl, 0, wxALL|wxEXPAND, 5 );
m_EdgeClearanceUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_EdgeClearanceUnits->Wrap( -1 );
fgFeatureConstraints->Add( m_EdgeClearanceUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
sbFeatureConstraints->Add( fgFeatureConstraints, 1, wxEXPAND|wxTOP|wxLEFT, 5 );
sbFeatureConstraints->Add( fgFeatureConstraints, 1, wxEXPAND|wxLEFT, 5 );
bMainSizer->Add( sbFeatureConstraints, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );

File diff suppressed because it is too large Load Diff

View File

@ -10,19 +10,19 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/valtext.h>
#include <wx/panel.h>
@ -37,6 +37,7 @@ class PANEL_SETUP_FEATURE_CONSTRAINTS_BASE : public wxPanel
private:
protected:
wxStaticText* m_staticText26;
wxStaticBitmap* m_bitmapBlindBuried;
wxCheckBox* m_OptAllowBlindBuriedVias;
wxStaticBitmap* m_bitmap_uVia;
@ -52,6 +53,11 @@ class PANEL_SETUP_FEATURE_CONSTRAINTS_BASE : public wxPanel
wxStaticBitmap* m_bitmapZoneFillOpt;
wxCheckBox* m_cbOutlinePolygonBestQ;
wxCheckBox* m_cbOutlinePolygonFastest;
wxStaticText* m_staticText23;
wxStaticBitmap* m_bitmapClearance;
wxStaticText* m_clearanceTitle;
wxTextCtrl* m_clearanceCtrl;
wxStaticText* m_clearanceUnits;
wxStaticBitmap* m_bitmapMinTrackWidth;
wxStaticText* m_TrackMinWidthTitle;
wxTextCtrl* m_TrackMinWidthCtrl;
@ -60,10 +66,28 @@ class PANEL_SETUP_FEATURE_CONSTRAINTS_BASE : public wxPanel
wxStaticText* m_ViaMinTitle;
wxTextCtrl* m_SetViasMinSizeCtrl;
wxStaticText* m_ViaMinUnits;
wxStaticBitmap* m_bitmapEdgeClearance;
wxStaticText* m_EdgeClearanceLabel;
wxTextCtrl* m_EdgeClearanceCtrl;
wxStaticText* m_EdgeClearanceUnits;
wxStaticLine* m_staticline3;
wxStaticLine* m_staticline4;
wxStaticLine* m_staticline5;
wxStaticLine* m_staticline6;
wxStaticText* m_staticText24;
wxStaticBitmap* m_bitmapMinViaDrill;
wxStaticText* m_ViaMinDrillTitle;
wxTextCtrl* m_SetViasMinDrillCtrl;
wxStaticText* m_ViaMinDrillUnits;
wxStaticText* m_MinDrillTitle;
wxTextCtrl* m_MinDrillCtrl;
wxStaticText* m_MinDrillUnits;
wxStaticBitmap* m_bitmapMinHoleClearance;
wxStaticText* m_HoleToHoleTitle;
wxTextCtrl* m_SetHoleToHoleCtrl;
wxStaticText* m_HoleToHoleUnits;
wxStaticLine* m_staticline8;
wxStaticLine* m_staticline9;
wxStaticLine* m_staticline10;
wxStaticLine* m_staticline11;
wxStaticText* m_staticText25;
wxStaticBitmap* m_bitmapMinuViaDiameter;
wxStaticText* m_uviaMinSizeLabel;
wxTextCtrl* m_uviaMinSizeCtrl;
@ -72,14 +96,6 @@ class PANEL_SETUP_FEATURE_CONSTRAINTS_BASE : public wxPanel
wxStaticText* m_uviaMinDrillLabel;
wxTextCtrl* m_uviaMinDrillCtrl;
wxStaticText* m_uviaMinDrillUnits;
wxStaticBitmap* m_bitmapMinHoleClearance;
wxStaticText* m_HoleToHoleTitle;
wxTextCtrl* m_SetHoleToHoleCtrl;
wxStaticText* m_HoleToHoleUnits;
wxStaticBitmap* m_bitmapEdgeClearance;
wxStaticText* m_EdgeClearanceLabel;
wxTextCtrl* m_EdgeClearanceCtrl;
wxStaticText* m_EdgeClearanceUnits;
// Virtual event handlers, overide them in your derived class
virtual void onChangeOutlineOpt( wxCommandEvent& event ) { event.Skip(); }

View File

@ -516,10 +516,11 @@ bool PANEL_SETUP_NETCLASSES::validateData()
wxString msg;
int minViaDia = m_ConstraintsPanel->m_viaMinSize.GetValue();
int minViaDrill = m_ConstraintsPanel->m_viaMinDrill.GetValue();
int minThroughHole = m_ConstraintsPanel->m_throughHoleMin.GetValue();
int minUViaDia = m_ConstraintsPanel->m_uviaMinSize.GetValue();
int minUViaDrill = m_ConstraintsPanel->m_uviaMinDrill.GetValue();
int minTrackWidth = m_ConstraintsPanel->m_trackMinWidth.GetValue();
int minClearance = m_ConstraintsPanel->m_minClearance.GetValue();
// Test net class parameters.
for( int row = 0; row < m_netclassGrid->GetNumberRows(); row++ )
@ -531,6 +532,14 @@ bool PANEL_SETUP_NETCLASSES::validateData()
if( !validateNetclassName( row, netclassName, false ) )
return false;
if( getNetclassValue( row, GRID_CLEARANCE ) < minClearance )
{
msg.Printf( _( "Clearance less than minimum clearance (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minClearance, true, true ) );
m_Parent->SetError( msg, this, m_netclassGrid, row, GRID_CLEARANCE );
return false;
}
if( getNetclassValue( row, GRID_TRACKSIZE ) < minTrackWidth )
{
msg.Printf( _( "Track width less than minimum track width (%s)." ),
@ -563,10 +572,10 @@ bool PANEL_SETUP_NETCLASSES::validateData()
return false;
}
if( getNetclassValue( row, GRID_VIADRILL ) < minViaDrill )
if( getNetclassValue( row, GRID_VIADRILL ) < minThroughHole )
{
msg.Printf( _( "Via drill less than minimum via drill (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minViaDrill, true, true ) );
StringFromValue( m_Frame->GetUserUnits(), minThroughHole, true, true ) );
m_Parent->SetError( msg, this, m_netclassGrid, row, GRID_VIADRILL );
return false;
}

View File

@ -222,8 +222,9 @@ bool PANEL_SETUP_TRACKS_AND_VIAS::validateData()
wxString msg;
int minViaDia = m_ConstraintsPanel->m_viaMinSize.GetValue();
int minViaDrill = m_ConstraintsPanel->m_viaMinDrill.GetValue();
int minThroughHole = m_ConstraintsPanel->m_throughHoleMin.GetValue();
int minTrackWidth = m_ConstraintsPanel->m_trackMinWidth.GetValue();
int minClearance = m_ConstraintsPanel->m_minClearance.GetValue();
// Test tracks
for( int row = 0; row < m_trackWidthsGrid->GetNumberRows(); ++row )
@ -267,10 +268,10 @@ bool PANEL_SETUP_TRACKS_AND_VIAS::validateData()
return false;
}
if( ValueFromString( m_Frame->GetUserUnits(), viaDrill ) < minViaDrill )
if( ValueFromString( m_Frame->GetUserUnits(), viaDrill ) < minThroughHole )
{
msg.Printf( _( "Via drill less than minimum via drill (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minViaDrill, true, true ) );
msg.Printf( _( "Via drill less than minimum through hole (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minThroughHole, true, true ) );
m_Parent->SetError( msg, this, m_viaSizesGrid, row, VIA_DRILL_COL );
return false;
}
@ -309,9 +310,10 @@ bool PANEL_SETUP_TRACKS_AND_VIAS::validateData()
return false;
}
if( ValueFromString( m_Frame->GetUserUnits(), gap ) < 0 )
if( ValueFromString( m_Frame->GetUserUnits(), gap ) < minClearance )
{
msg.Printf( _( "Differential pair gap cannot be negative." ) );
msg.Printf( _( "Differential pair gap less than minimum clearance (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minClearance, true, true ) );
m_Parent->SetError( msg, this, m_diffPairsGrid, row, 1 );
return false;
}
@ -321,9 +323,10 @@ bool PANEL_SETUP_TRACKS_AND_VIAS::validateData()
if( viaGap.IsEmpty() )
continue;
if( ValueFromString( m_Frame->GetUserUnits(), viaGap ) < 0 )
if( ValueFromString( m_Frame->GetUserUnits(), viaGap ) < minClearance )
{
msg.Printf( _( "Differential pair via gap cannot be negative." ) );
msg.Printf( _( "Differential pair via gap less than minimum clearance (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minClearance, true, true ) );
m_Parent->SetError( msg, this, m_diffPairsGrid, row, 2 );
return false;
}

View File

@ -564,13 +564,12 @@ bool DRC::doNetClass( const NETCLASSPTR& nc, wxString& msg )
const BOARD_DESIGN_SETTINGS& g = m_pcb->GetDesignSettings();
#if 0 // set to 1 when (if...) BOARD_DESIGN_SETTINGS has a m_MinClearance value
if( nc->GetClearance() < g.m_MinClearance )
{
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_NETCLASS_CLEARANCE );
msg.Printf( drcItem->GetErrorText() + _( " (board minimum %s; %s netclass %s)" ),
MessageTextFromValue( userUnits(), g.m_TrackClearance, true ),
MessageTextFromValue( userUnits(), g.m_MinClearance, true ),
nc->GetName(),
MessageTextFromValue( userUnits(), nc->GetClearance(), true ) );
@ -578,7 +577,6 @@ bool DRC::doNetClass( const NETCLASSPTR& nc, wxString& msg )
addMarkerToPcb( new MARKER_PCB( drcItem, wxPoint() ) );
ret = false;
}
#endif
if( nc->GetTrackWidth() < g.m_TrackMinWidth )
{
@ -608,12 +606,12 @@ bool DRC::doNetClass( const NETCLASSPTR& nc, wxString& msg )
ret = false;
}
if( nc->GetViaDrill() < g.m_ViasMinDrill )
if( nc->GetViaDrill() < g.m_MinThroughDrill )
{
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_NETCLASS_VIADRILLSIZE );
msg.Printf( drcItem->GetErrorText() + _( " (board minimum %s; %s netclass %s)" ),
MessageTextFromValue( userUnits(), g.m_ViasMinDrill, true ),
msg.Printf( drcItem->GetErrorText() + _( " (board min through hole %s; %s netclass %s)" ),
MessageTextFromValue( userUnits(), g.m_MinThroughDrill, true ),
nc->GetName(),
MessageTextFromValue( userUnits(), nc->GetViaDrill(), true ) );
@ -740,12 +738,12 @@ void DRC::testDrilledHoles()
continue;
if( !dsnSettings.Ignore( DRCE_TOO_SMALL_PAD_DRILL )
&& minDimension < dsnSettings.m_ViasMinDrill )
&& minDimension < dsnSettings.m_MinThroughDrill )
{
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_TOO_SMALL_PAD_DRILL );
msg.Printf( drcItem->GetErrorText() + _( " (board min via drill %s; actual %s)" ),
MessageTextFromValue( userUnits(), dsnSettings.m_ViasMinDrill, true ),
msg.Printf( drcItem->GetErrorText() + _( " (board min through hole %s; actual %s)" ),
MessageTextFromValue( userUnits(), dsnSettings.m_MinThroughDrill, true ),
MessageTextFromValue( userUnits(), minDimension, true ) );
drcItem->SetErrorMessage( msg );
@ -792,13 +790,13 @@ void DRC::testDrilledHoles()
}
else
{
if( !dsnSettings.Ignore( DRCE_TOO_SMALL_MICROVIA_DRILL )
&& via->GetDrillValue() < dsnSettings.m_ViasMinDrill )
if( !dsnSettings.Ignore( DRCE_TOO_SMALL_VIA_DRILL )
&& via->GetDrillValue() < dsnSettings.m_MinThroughDrill )
{
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_TOO_SMALL_VIA_DRILL );
msg.Printf( drcItem->GetErrorText() + _( " (board minimum %s; actual %s)" ),
MessageTextFromValue( userUnits(), dsnSettings.m_ViasMinDrill, true ),
msg.Printf( drcItem->GetErrorText() + _( " (board min through hole %s; actual %s)" ),
MessageTextFromValue( userUnits(), dsnSettings.m_MinThroughDrill, true ),
MessageTextFromValue( userUnits(), via->GetDrillValue(), true ) );
drcItem->SetErrorMessage( msg );

View File

@ -64,7 +64,7 @@ enum PCB_DRC_CODE {
DRCE_NETCLASS_TRACKWIDTH, ///< netclass has TrackWidth < board.m_designSettings->m_TrackMinWidth
DRCE_NETCLASS_CLEARANCE, ///< netclass has Clearance < board.m_designSettings->m_TrackClearance
DRCE_NETCLASS_VIASIZE, ///< netclass has ViaSize < board.m_designSettings->m_ViasMinSize
DRCE_NETCLASS_VIADRILLSIZE, ///< netclass has ViaDrillSize < board.m_designSettings->m_ViasMinDrill
DRCE_NETCLASS_VIADRILLSIZE, ///< netclass has ViaDrillSize < board.m_designSettings->m_MinThroughDrill
DRCE_NETCLASS_uVIASIZE, ///< netclass has ViaSize < board.m_designSettings->m_MicroViasMinSize
DRCE_NETCLASS_uVIADRILLSIZE, ///< netclass has ViaSize < board.m_designSettings->m_MicroViasMinDrill
DRCE_VIA_INSIDE_KEEPOUT, ///< Via in inside a keepout area

View File

@ -260,8 +260,8 @@ BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, const
if( m_min_via < designSettings.m_ViasMinSize )
designSettings.m_ViasMinSize = m_min_via;
if( m_min_hole < designSettings.m_ViasMinDrill )
designSettings.m_ViasMinDrill = m_min_hole;
if( m_min_hole < designSettings.m_MinThroughDrill )
designSettings.m_MinThroughDrill = m_min_hole;
if( m_rules->mdWireWire )
{

View File

@ -507,16 +507,18 @@ void PCB_IO::formatSetup( BOARD* aBoard, int aNestLevel ) const
m_out->Print( aNestLevel+1, "(trace_min %s)\n",
FormatInternalUnits( dsnSettings.m_TrackMinWidth ).c_str() );
m_out->Print( aNestLevel+1, "(clearance_min %s)\n",
FormatInternalUnits( dsnSettings.m_MinClearance ).c_str() );
m_out->Print( aNestLevel+1, "(via_min_size %s)\n",
FormatInternalUnits( dsnSettings.m_ViasMinSize ).c_str() );
m_out->Print( aNestLevel+1, "(through_hole_min %s)\n",
FormatInternalUnits( dsnSettings.m_MinThroughDrill ).c_str() );
// Save current default via size, for compatibility with older Pcbnew version;
m_out->Print( aNestLevel+1, "(via_size %s)\n",
FormatInternalUnits( dsnSettings.GetDefault()->GetViaDiameter() ).c_str() );
m_out->Print( aNestLevel+1, "(via_drill %s)\n",
FormatInternalUnits( dsnSettings.GetDefault()->GetViaDrill() ).c_str() );
m_out->Print( aNestLevel+1, "(via_min_size %s)\n",
FormatInternalUnits( dsnSettings.m_ViasMinSize ).c_str() );
m_out->Print( aNestLevel+1, "(via_min_drill %s)\n",
FormatInternalUnits( dsnSettings.m_ViasMinDrill ).c_str() );
// Save custom via dimensions list (the first is not saved here: it's the netclass value)
for( unsigned ii = 1; ii < dsnSettings.m_ViasDimensionsList.size(); ii++ )

View File

@ -1004,7 +1004,7 @@ void LEGACY_PLUGIN::loadSETUP()
else if( TESTLINE( "ViaMinDrill" ) )
{
BIU tmp = biuParse( line + SZ( "ViaMinDrill" ) );
bds.m_ViasMinDrill = tmp;
bds.m_MinThroughDrill = tmp;
}
else if( TESTLINE( "MicroViaSize" ) )

View File

@ -1475,6 +1475,11 @@ void PCB_PARSER::parseSetup()
NeedRIGHT();
break;
case T_clearance_min:
designSettings.m_MinClearance = parseBoardUnits( T_clearance_min );
NeedRIGHT();
break;
case T_trace_min:
designSettings.m_TrackMinWidth = parseBoardUnits( T_trace_min );
NeedRIGHT();
@ -1495,8 +1500,14 @@ void PCB_PARSER::parseSetup()
NeedRIGHT();
break;
case T_through_hole_min:
designSettings.m_MinThroughDrill = parseBoardUnits( T_through_hole_min );
NeedRIGHT();
break;
// Legacy token for T_through_hole_min
case T_via_min_drill:
designSettings.m_ViasMinDrill = parseBoardUnits( T_via_min_drill );
designSettings.m_MinThroughDrill = parseBoardUnits( T_via_min_drill );
NeedRIGHT();
break;