diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 2c8fa3d73d..023a61edee 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -241,7 +241,22 @@ void DIALOG_PLOT::reInitDialog() m_DRCExclusionsWarning->Show(); } else + { m_DRCExclusionsWarning->Hide(); + } + + 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 ); + } } @@ -407,9 +422,13 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) 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() ) @@ -917,3 +936,16 @@ void DIALOG_PLOT::onRunDRC( wxCommandEvent& event ) } } + +void DIALOG_PLOT::onBoardSetup( wxHyperlinkEvent& aEvent ) +{ + PCB_EDIT_FRAME* parent = dynamic_cast( GetParent() ); + + if( parent ) + { + parent->ShowBoardSetupDialog( _( "Solder Mask/Paste" ) ); + + // Update warnings on return to this dialog + reInitDialog(); + } +} diff --git a/pcbnew/dialogs/dialog_plot.h b/pcbnew/dialogs/dialog_plot.h index 59d29aed38..2e6d478499 100644 --- a/pcbnew/dialogs/dialog_plot.h +++ b/pcbnew/dialogs/dialog_plot.h @@ -74,6 +74,7 @@ private: void CreateDrillFile( wxCommandEvent& event ) override; void OnGerberX2Checked( wxCommandEvent& event ) override; void onRunDRC( wxCommandEvent& event ) override; + void onBoardSetup( wxHyperlinkEvent& aEvent ) override; // other functions void init_Dialog(); // main initialization diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp index 17993fe3c7..319b3acf86 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 Jul 10 2019) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -163,14 +163,36 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr 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_SizerSolderMaskAlert->Add( m_bitmapAlert, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - m_staticTextAlert = new wxStaticText( this, wxID_ANY, _("Global solder mask min width and/or margin are not set to 0\nMost of board houses expect a 0 value and use their constraints, especially for solder mask min width.\nPlease ensure the solder mask min width (and margin value) are valid\nUse non 0 values only when required."), wxDefaultPosition, wxDefaultSize, 0 ); + wxBoxSizer* bSizerWarningText; + bSizerWarningText = new wxBoxSizer( wxVERTICAL ); + + m_staticTextAlert = new wxStaticText( this, wxID_ANY, _("Global solder mask min width and/or margin are not set to 0. Most board houses"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextAlert->Wrap( -1 ); - m_SizerSolderMaskAlert->Add( m_staticTextAlert, 0, wxALL, 5 ); + bSizerWarningText->Add( m_staticTextAlert, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bSizerSecondLine; + bSizerSecondLine = new wxBoxSizer( wxHORIZONTAL ); + + m_staticTextAlert1 = new wxStaticText( this, wxID_ANY, _("expect 0 and use their constraints, especially for solder mask min width."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextAlert1->Wrap( 580 ); + bSizerSecondLine->Add( m_staticTextAlert1, 0, wxTOP, 2 ); - m_PlotOptionsSizer->Add( m_SizerSolderMaskAlert, 1, wxEXPAND, 5 ); + bSizerSecondLine->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_boardSetup = new wxHyperlinkCtrl( this, wxID_ANY, _("Board setup"), wxT("http://www.wxformbuilder.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + bSizerSecondLine->Add( m_boardSetup, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); + + + bSizerWarningText->Add( bSizerSecondLine, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + m_SizerSolderMaskAlert->Add( bSizerWarningText, 1, wxEXPAND, 5 ); + + + m_PlotOptionsSizer->Add( m_SizerSolderMaskAlert, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 ); m_GerberOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Gerber Options") ), wxHORIZONTAL ); @@ -447,6 +469,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); m_layerCheckListBox->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ), NULL, this ); m_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); + m_boardSetup->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_PLOT_BASE::onBoardSetup ), NULL, this ); m_useGerberX2Format->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this ); m_DXF_plotModeOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this ); m_buttonDRC->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this ); @@ -468,6 +491,7 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE() m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); m_layerCheckListBox->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ), NULL, this ); m_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); + m_boardSetup->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_PLOT_BASE::onBoardSetup ), NULL, this ); m_useGerberX2Format->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this ); m_DXF_plotModeOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this ); m_buttonDRC->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp index 43ff26027d..3a873551c8 100644 --- a/pcbnew/dialogs/dialog_plot_base.fbp +++ b/pcbnew/dialogs/dialog_plot_base.fbp @@ -14,7 +14,6 @@ dialog_plot_base 1000 none - 1 Dialog_Plot_base @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -1666,8 +1664,8 @@ - 5 - wxEXPAND + 10 + wxEXPAND|wxRIGHT|wxLEFT 1 @@ -1676,7 +1674,7 @@ protected 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 0 1 @@ -1734,63 +1732,220 @@ 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/or margin are not set to 0 Most of board houses expect a 0 value and use their constraints, especially for solder mask min width. Please ensure the solder mask min width (and margin value) are valid Use non 0 values only when required. - 0 - - 0 - - - 0 + wxEXPAND + 1 + - 1 - m_staticTextAlert - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 + bSizerWarningText + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 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/or margin are not set to 0. Most board houses + 0 + + 0 + + + 0 + + 1 + m_staticTextAlert + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + + bSizerSecondLine + wxHORIZONTAL + none + + 2 + wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + expect 0 and use their constraints, especially for solder mask min width. + 0 + + 0 + + + 0 + + 1 + m_staticTextAlert1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + 580 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 2 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + + wxID_ANY + Board setup + + 0 + + + 0 + + 1 + m_boardSetup + + 1 + + + protected + 1 + + Resizable + 1 + + wxHL_DEFAULT_STYLE + ; ; forward_declare + 0 + + http://www.wxformbuilder.org + + + + + onBoardSetup + + + + diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h index b33e629379..587cddce27 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 Jul 10 2019) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -32,6 +32,7 @@ class WX_HTML_REPORT_PANEL; #include #include #include +#include #include #include #include @@ -88,6 +89,8 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxBoxSizer* m_SizerSolderMaskAlert; wxStaticBitmap* m_bitmapAlert; wxStaticText* m_staticTextAlert; + wxStaticText* m_staticTextAlert1; + wxHyperlinkCtrl* m_boardSetup; wxStaticBoxSizer* m_GerberOptionsSizer; wxCheckBox* m_useGerberExtensions; wxCheckBox* m_generateGerberJobFile; @@ -135,6 +138,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); } virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); } + virtual void onBoardSetup( wxHyperlinkEvent& event ) { event.Skip(); } virtual void OnGerberX2Checked( wxCommandEvent& event ) { event.Skip(); } virtual void OnChangeDXFPlotMode( wxCommandEvent& event ) { event.Skip(); } virtual void onRunDRC( wxCommandEvent& event ) { event.Skip(); }