From 27c80e8a2ebe06fcd45530d70cb2e31ac3079b15 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 5 Jun 2020 16:06:03 +0200 Subject: [PATCH] Solder mask clearance default value: set default to 0, taking advice from both Ucamco and Eurocircuits. Update message in plot dialog about best solder mask clearance value. Show warning in plot dialog if these values are no 0. --- include/board_design_settings.h | 5 +- pcbnew/dialogs/dialog_plot.cpp | 12 + pcbnew/dialogs/dialog_plot_base.cpp | 44 +- pcbnew/dialogs/dialog_plot_base.fbp | 405 ++++++++++++------ pcbnew/dialogs/dialog_plot_base.h | 8 +- .../panel_setup_mask_and_paste_base.cpp | 4 +- .../panel_setup_mask_and_paste_base.fbp | 4 +- .../dialogs/panel_setup_mask_and_paste_base.h | 2 +- 8 files changed, 340 insertions(+), 144 deletions(-) diff --git a/include/board_design_settings.h b/include/board_design_settings.h index 5392d73471..0ad8fa330f 100644 --- a/include/board_design_settings.h +++ b/include/board_design_settings.h @@ -51,7 +51,10 @@ #define DEFAULT_PCB_EDGE_THICKNESS 0.15 -#define DEFAULT_SOLDERMASK_CLEARANCE 0.05 // soldermask to pad clearance +// soldermask to pad clearance. The default is 0 because usually board houses +// create a clearance depending on their fab process: +// mask material, color, price ... +#define DEFAULT_SOLDERMASK_CLEARANCE 0.0 // DEFAULT_SOLDERMASK_MIN_WIDTH is only used in Gerber files: soldermask minimum size. // Set to 0, because using non 0 value creates an annoying issue in Gerber files: diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index ff99b67545..095bac51ab 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -396,6 +396,18 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) // this option exist only in DXF format: m_DXF_plotModeOpt->Enable( getPlotFormat() == PLOT_FORMAT::DXF ); + // The alert message about non 0 solder mask min width and margin is shown + // only in gerber format and if min mask width or mask margin is not 0 + BOARD* board = m_parent->GetBoard(); + const BOARD_DESIGN_SETTINGS& brd_settings = board->GetDesignSettings(); + + if( getPlotFormat() == PLOT_FORMAT::GERBER && + ( brd_settings.m_SolderMaskMargin || brd_settings.m_SolderMaskMinWidth ) ) + m_PlotOptionsSizer->Show( m_SizerSolderMaskAlert ); + else + m_PlotOptionsSizer->Hide( m_SizerSolderMaskAlert ); + + switch( getPlotFormat() ) { case PLOT_FORMAT::SVG: diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp index 4efe51b9d9..7364ea07b4 100644 --- a/pcbnew/dialogs/dialog_plot_base.cpp +++ b/pcbnew/dialogs/dialog_plot_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -160,6 +160,18 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_PlotOptionsSizer->Add( sbOptionsSizer, 0, wxALL|wxEXPAND, 5 ); + m_SizerSolderMaskAlert = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapAlert = new wxStaticBitmap( this, wxID_ANY, wxArtProvider::GetBitmap( wxART_WARNING, wxART_CMN_DIALOG ), wxDefaultPosition, wxDefaultSize, 0 ); + m_SizerSolderMaskAlert->Add( m_bitmapAlert, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextAlert = new wxStaticText( this, wxID_ANY, _("Global solder mask min width and margin are not set to 0\nMost of board houses expect a 0 value and use their constraints\nPlease ensure the solder mask min width and margin value are valid\nand use a non 0 value only when required."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextAlert->Wrap( -1 ); + m_SizerSolderMaskAlert->Add( m_staticTextAlert, 0, wxALL, 5 ); + + + m_PlotOptionsSizer->Add( m_SizerSolderMaskAlert, 1, wxEXPAND, 5 ); + m_GerberOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Gerber Options") ), wxHORIZONTAL ); wxGridBagSizer* gbSizer2; @@ -174,6 +186,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr gbSizer2->Add( m_useGerberExtensions, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_generateGerberJobFile = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Generate Gerber job file"), wxDefaultPosition, wxDefaultSize, 0 ); + m_generateGerberJobFile->SetValue(true); m_generateGerberJobFile->SetToolTip( _("Generate a Gerber job file that contains info about the board,\nand the list of generated Gerber plot files") ); gbSizer2->Add( m_generateGerberJobFile, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); @@ -266,12 +279,12 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_widthAdjustLabel = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("Track width correction:"), wxDefaultPosition, wxDefaultSize, 0 ); m_widthAdjustLabel->Wrap( -1 ); - fgSizer2->Add( m_widthAdjustLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + fgSizer2->Add( m_widthAdjustLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_widthAdjustCtrl = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_widthAdjustCtrl->SetToolTip( _("Set global width correction for exact width postscript output.\nThese width correction is intended to compensate tracks width and also pads and vias size errors.\nThe reasonable width correction value must be in a range of [-(MinTrackWidth-1), +(MinClearanceValue-1)] in decimils.") ); - fgSizer2->Add( m_widthAdjustCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 ); + fgSizer2->Add( m_widthAdjustCtrl, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); m_widthAdjustUnits = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_widthAdjustUnits->Wrap( -1 ); @@ -286,25 +299,34 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_PlotOptionsSizer->Add( m_PSOptionsSizer, 0, wxALL|wxEXPAND, 5 ); - m_SizerDXF_options = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("DXF Options") ), wxVERTICAL ); + m_SizerDXF_options = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("DXF Options") ), wxHORIZONTAL ); + + wxBoxSizer* bSizerdxfLeft; + bSizerdxfLeft = new wxBoxSizer( wxVERTICAL ); m_DXF_plotModeOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Plot graphic items using their contours"), wxDefaultPosition, wxDefaultSize, 0 ); m_DXF_plotModeOpt->SetValue(true); m_DXF_plotModeOpt->SetToolTip( _("Uncheck to plot graphic items using their center lines") ); - m_SizerDXF_options->Add( m_DXF_plotModeOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizerdxfLeft->Add( m_DXF_plotModeOpt, 0, wxALL, 5 ); m_DXF_plotTextStrokeFontOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Use Pcbnew font to plot texts"), wxDefaultPosition, wxDefaultSize, 0 ); m_DXF_plotTextStrokeFontOpt->SetToolTip( _("Check to use Pcbnew stroke font\nUncheck to plot oneline ASCII texts as editable text (using DXF font)") ); - m_SizerDXF_options->Add( m_DXF_plotTextStrokeFontOpt, 0, wxALL, 5 ); + bSizerdxfLeft->Add( m_DXF_plotTextStrokeFontOpt, 0, wxALL, 5 ); + + + m_SizerDXF_options->Add( bSizerdxfLeft, 1, wxEXPAND, 5 ); + + + m_SizerDXF_options->Add( 20, 0, 0, 0, 5 ); - wxBoxSizer* dxfSizer1; - dxfSizer1 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* dxfSizerRight; + dxfSizerRight = new wxBoxSizer( wxHORIZONTAL ); DXF_exportUnitsLabel = new wxStaticText( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Export units:"), wxDefaultPosition, wxDefaultSize, 0 ); DXF_exportUnitsLabel->Wrap( -1 ); - dxfSizer1->Add( DXF_exportUnitsLabel, 0, wxALIGN_CENTER|wxALIGN_LEFT|wxALL, 5 ); + dxfSizerRight->Add( DXF_exportUnitsLabel, 0, wxALIGN_CENTER|wxALIGN_LEFT|wxALL, 5 ); wxString m_DXF_plotUnitsChoices[] = { _("Inches"), _("Millimeters") }; int m_DXF_plotUnitsNChoices = sizeof( m_DXF_plotUnitsChoices ) / sizeof( wxString ); @@ -312,10 +334,10 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_DXF_plotUnits->SetSelection( 0 ); m_DXF_plotUnits->SetToolTip( _("The units to use for the exported DXF file") ); - dxfSizer1->Add( m_DXF_plotUnits, 0, wxALIGN_CENTER|wxALL, 5 ); + dxfSizerRight->Add( m_DXF_plotUnits, 0, wxALIGN_CENTER|wxALL, 5 ); - m_SizerDXF_options->Add( dxfSizer1, 1, wxEXPAND, 5 ); + m_SizerDXF_options->Add( dxfSizerRight, 1, wxEXPAND, 5 ); m_PlotOptionsSizer->Add( m_SizerDXF_options, 0, wxEXPAND|wxALL, 5 ); diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp index 7c7c0a32e6..55020bf8b0 100644 --- a/pcbnew/dialogs/dialog_plot_base.fbp +++ b/pcbnew/dialogs/dialog_plot_base.fbp @@ -14,6 +14,7 @@ dialog_plot_base 1000 none + 1 Dialog_Plot_base @@ -25,6 +26,7 @@ 1 1 UI + 0 1 0 @@ -45,7 +47,7 @@ -1,-1 DIALOG_PLOT_BASE - 762,749 + 762,689 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Plot @@ -1663,6 +1665,136 @@ + + 5 + wxEXPAND + 1 + + + m_SizerSolderMaskAlert + wxHORIZONTAL + protected + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + Load From Art Provider; wxART_WARNING; wxART_CMN_DIALOG + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_bitmapAlert + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Global solder mask min width and margin are not set to 0 Most of board houses expect a 0 value and use their constraints Please ensure the solder mask min width and margin value are valid and use a non 0 value only when required. + 0 + + 0 + + + 0 + + 1 + m_staticTextAlert + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 wxALL|wxEXPAND @@ -1778,7 +1910,7 @@ 1 0 - 0 + 1 1 1 @@ -2671,7 +2803,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -2732,7 +2864,7 @@ 5 - wxEXPAND|wxBOTTOM|wxRIGHT + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 0 1 @@ -2932,136 +3064,157 @@ DXF Options m_SizerDXF_options - wxVERTICAL + wxHORIZONTAL 1 protected - + 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Plot graphic items using their contours - - 0 - - - 0 + wxEXPAND + 1 + - 1 - m_DXF_plotModeOpt - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Uncheck to plot graphic items using their center lines - - wxFILTER_NONE - wxDefaultValidator - - - - - OnChangeDXFPlotMode + bSizerdxfLeft + wxVERTICAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Plot graphic items using their contours + + 0 + + + 0 + + 1 + m_DXF_plotModeOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Uncheck to plot graphic items using their center lines + + wxFILTER_NONE + wxDefaultValidator + + + + + OnChangeDXFPlotMode + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Use Pcbnew font to plot texts + + 0 + + + 0 + + 1 + m_DXF_plotTextStrokeFontOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Check to use Pcbnew stroke font Uncheck to plot oneline ASCII texts as editable text (using DXF font) + + wxFILTER_NONE + wxDefaultValidator + + + + + + - + 5 - wxALL + 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Use Pcbnew font to plot texts - - 0 - - - 0 - - 1 - m_DXF_plotTextStrokeFontOpt - 1 - - + + 0 protected - 1 - - Resizable - 1 - - - - 0 - Check to use Pcbnew stroke font Uncheck to plot oneline ASCII texts as editable text (using DXF font) - - wxFILTER_NONE - wxDefaultValidator - - - - + 20 @@ -3070,7 +3223,7 @@ 1 - dxfSizer1 + dxfSizerRight wxHORIZONTAL none diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h index 6390330d87..b33e629379 100644 --- a/pcbnew/dialogs/dialog_plot_base.h +++ b/pcbnew/dialogs/dialog_plot_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -31,6 +31,7 @@ class WX_HTML_REPORT_PANEL; #include #include #include +#include #include #include #include @@ -84,6 +85,9 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxCheckBox* m_plotMirrorOpt; wxCheckBox* m_plotPSNegativeOpt; wxCheckBox* m_zoneFillCheck; + wxBoxSizer* m_SizerSolderMaskAlert; + wxStaticBitmap* m_bitmapAlert; + wxStaticText* m_staticTextAlert; wxStaticBoxSizer* m_GerberOptionsSizer; wxCheckBox* m_useGerberExtensions; wxCheckBox* m_generateGerberJobFile; @@ -141,7 +145,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM public: - DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 762,749 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 762,689 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_PLOT_BASE(); void DIALOG_PLOT_BASEOnContextMenu( wxMouseEvent &event ) diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste_base.cpp b/pcbnew/dialogs/panel_setup_mask_and_paste_base.cpp index a9e300d471..2e7afe94a9 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste_base.cpp +++ b/pcbnew/dialogs/panel_setup_mask_and_paste_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -38,7 +38,7 @@ PANEL_SETUP_MASK_AND_PASTE_BASE::PANEL_SETUP_MASK_AND_PASTE_BASE( wxWindow* pare m_bitmapWarning = new wxStaticBitmap( this, wxID_ANY, wxArtProvider::GetBitmap( wxART_WARNING, wxART_OTHER ), wxDefaultPosition, wxDefaultSize, 0 ); bSizer4->Add( m_bitmapWarning, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_staticTextInfoMaskMinWidth = new wxStaticText( this, wxID_ANY, _("Note: Set Solder mask minimum bridge width to 0,\nunless your board house asks for a specific value"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfoMaskMinWidth = new wxStaticText( this, wxID_ANY, _("Note: Set Solder mask minimum bridge width and Solder mask clearance to 0,\nunless your board house asks for a specific value"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfoMaskMinWidth->Wrap( -1 ); m_staticTextInfoMaskMinWidth->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste_base.fbp b/pcbnew/dialogs/panel_setup_mask_and_paste_base.fbp index 32fe06d466..a7ec50c851 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste_base.fbp +++ b/pcbnew/dialogs/panel_setup_mask_and_paste_base.fbp @@ -14,6 +14,7 @@ panel_setup_mask_and_paste_base 1000 none + 1 panel_setup_mask_and_paste_base @@ -25,6 +26,7 @@ 1 1 UI + 0 1 0 @@ -293,7 +295,7 @@ 0 0 wxID_ANY - Note: Set Solder mask minimum bridge width to 0, unless your board house asks for a specific value + Note: Set Solder mask minimum bridge width and Solder mask clearance to 0, unless your board house asks for a specific value 0 0 diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste_base.h b/pcbnew/dialogs/panel_setup_mask_and_paste_base.h index 9504920ab3..00978b3369 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste_base.h +++ b/pcbnew/dialogs/panel_setup_mask_and_paste_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE!