From 93c7f65d96130c7165d412945668293f571cf2e9 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 2 May 2018 10:31:10 +0200 Subject: [PATCH] mask clearance parameters: use clearances only for pads on copper layers, and never for pads on technical layers only. --- pcbnew/class_pad.cpp | 24 +++- pcbnew/class_pad.h | 26 ++-- ...og_edit_footprint_for_BoardEditor_base.cpp | 12 +- ...og_edit_footprint_for_BoardEditor_base.fbp | 86 +++++++++++- ...alog_edit_footprint_for_BoardEditor_base.h | 6 +- ...alog_edit_footprint_for_fp_editor_base.cpp | 12 +- ...alog_edit_footprint_for_fp_editor_base.fbp | 86 +++++++++++- ...dialog_edit_footprint_for_fp_editor_base.h | 6 +- pcbnew/dialogs/dialog_mask_clearance_base.cpp | 15 ++- pcbnew/dialogs/dialog_mask_clearance_base.fbp | 89 ++++++++++++- pcbnew/dialogs/dialog_mask_clearance_base.h | 9 +- pcbnew/dialogs/dialog_pad_properties.h | 5 + pcbnew/dialogs/dialog_pad_properties_base.cpp | 42 +++--- pcbnew/dialogs/dialog_pad_properties_base.fbp | 122 +++++++++++++++--- pcbnew/dialogs/dialog_pad_properties_base.h | 9 +- 15 files changed, 474 insertions(+), 75 deletions(-) diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 75540aaefd..c4a48c8e8f 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -1,9 +1,9 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -576,7 +576,17 @@ int D_PAD::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const int D_PAD::GetSolderMaskMargin() const { + // The pad inherits the margin only to calculate a default shape, + // therefore only if it is also a copper layer + // Pads defined only on mask layers (and perhaps on other tech layers) use the shape + // defined by the pad settings only + bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any(); + + if( !isOnCopperLayer ) + return 0; + int margin = m_LocalSolderMaskMargin; + MODULE* module = GetParent(); if( module ) @@ -609,8 +619,18 @@ int D_PAD::GetSolderMaskMargin() const wxSize D_PAD::GetSolderPasteMargin() const { + // The pad inherits the margin only to calculate a default shape, + // therefore only if it is also a copper layer. + // Pads defined only on mask layers (and perhaps on other tech layers) use the shape + // defined by the pad settings only + bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any(); + + if( !isOnCopperLayer ) + return wxSize( 0, 0 ); + int margin = m_LocalSolderPasteMargin; double mratio = m_LocalSolderPasteMarginRatio; + MODULE* module = GetParent(); if( module ) diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index 7eeb28943d..e251304e79 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -1,8 +1,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -454,23 +454,29 @@ public: * Function GetSolderMaskMargin * @return the margin for the solder mask layer * usually > 0 (mask shape bigger than pad - * value is + * For pads also on copper layers, the value (used to build a default shape) is * 1 - the local value - * 2 - if null, the parent footprint value - * 1 - if null, the global value + * 2 - if 0, the parent footprint value + * 3 - if 0, the global value + * For pads NOT on copper layers, the value is the local value because there is + * not default shape to build */ int GetSolderMaskMargin() const; /** * Function GetSolderPasteMargin * @return the margin for the solder mask layer - * usually < 0 (mask shape smaller than pad + * usually < 0 (mask shape smaller than pad) * because the margin can be dependent on the pad size, the margin has a x and a y value - * value is + * + * For pads also on copper layers, the value (used to build a default shape) is * 1 - the local value - * 2 - if null, the parent footprint value - * 1 - if null, the global value - */ + * 2 - if 0, the parent footprint value + * 3 - if 0, the global value + * + * For pads NOT on copper layers, the value is the local value because there is + * not default shape to build + */ wxSize GetSolderPasteMargin() const; void SetZoneConnection( ZoneConnection aType ) { m_ZoneConnection = aType; } diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.cpp index c46ae36953..1034fbc77b 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "widgets/text_ctrl_eval.h" @@ -212,7 +212,7 @@ DIALOG_FOOTPRINT_BOARD_EDITOR_BASE::DIALOG_FOOTPRINT_BOARD_EDITOR_BASE( wxWindow bSizer11->Add( bSizer10, 1, wxEXPAND, 5 ); - m_staticTextInfo = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Set clearances to 0 to use global values"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfo = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Set clearances to 0 to use global values."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfo->Wrap( -1 ); m_staticTextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); @@ -230,6 +230,12 @@ DIALOG_FOOTPRINT_BOARD_EDITOR_BASE::DIALOG_FOOTPRINT_BOARD_EDITOR_BASE( wxWindow bSizer11->Add( m_staticTextInfoValNeg, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_staticTextInfo2 = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("These values are used only to build the mask shape\nof pads on copper layers."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfo2->Wrap( -1 ); + m_staticTextInfo2->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + + bSizer11->Add( m_staticTextInfo2, 0, wxALL, 5 ); + sbSizerLocalProperties->Add( bSizer11, 0, wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.fbp b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.fbp index 0adb42e084..26a573ee42 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.fbp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.fbp @@ -14,7 +14,6 @@ dialog_edit_footprint_for_BoardEditor_base 1000 none - 1 dialog_edit_footprint_for_BoardEditor_base @@ -3089,7 +3088,7 @@ 0 0 wxID_ANY - Set clearances to 0 to use global values + Set clearances to 0 to use global values. 0 @@ -3306,6 +3305,89 @@ + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,92,-1,70,0 + 0 + 0 + wxID_ANY + These values are used only to build the mask shape of pads on copper layers. + + 0 + + + 0 + + 1 + m_staticTextInfo2 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.h b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.h index 2b97e6de4b..b97e533367 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.h +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.h @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __DIALOG_EDIT_FOOTPRINT_FOR_BOARDEDITOR_BASE_H__ @@ -11,6 +11,7 @@ #include #include #include +class DIALOG_SHIM; class TEXT_CTRL_EVAL; #include "dialog_shim.h" @@ -91,6 +92,7 @@ class DIALOG_FOOTPRINT_BOARD_EDITOR_BASE : public DIALOG_SHIM wxStaticText* m_staticTextInfo; wxStaticText* m_staticTextInfoValPos; wxStaticText* m_staticTextInfoValNeg; + wxStaticText* m_staticTextInfo2; wxStaticText* m_staticTextNetClearance; TEXT_CTRL_EVAL* m_NetClearanceValueCtrl; wxStaticText* m_NetClearanceUnits; diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.cpp index 7b5f74b279..c2df8b1e47 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "widgets/text_ctrl_eval.h" @@ -149,7 +149,7 @@ DIALOG_FOOTPRINT_FP_EDITOR_BASE::DIALOG_FOOTPRINT_FP_EDITOR_BASE( wxWindow* pare wxStaticBoxSizer* sbSizer8; sbSizer8 = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Local Clearance Values:") ), wxVERTICAL ); - m_staticTextInfo = new wxStaticText( sbSizer8->GetStaticBox(), wxID_ANY, _("Set clearances to 0 to use global values"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfo = new wxStaticText( sbSizer8->GetStaticBox(), wxID_ANY, _("Set clearances to 0 to use global values."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfo->Wrap( -1 ); m_staticTextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); @@ -167,6 +167,12 @@ DIALOG_FOOTPRINT_FP_EDITOR_BASE::DIALOG_FOOTPRINT_FP_EDITOR_BASE( wxWindow* pare sbSizer8->Add( m_staticTextInfoValNeg, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_staticTextInfo2 = new wxStaticText( sbSizer8->GetStaticBox(), wxID_ANY, _("These values are used only to build the mask shape\nof pads on copper layers."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfo2->Wrap( -1 ); + m_staticTextInfo2->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + + sbSizer8->Add( m_staticTextInfo2, 0, wxALL, 5 ); + wxFlexGridSizer* fgSizer1; fgSizer1 = new wxFlexGridSizer( 5, 3, 0, 0 ); fgSizer1->AddGrowableCol( 1 ); diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.fbp b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.fbp index 8099393bca..ec862bd7aa 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.fbp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.fbp @@ -14,7 +14,6 @@ dialog_edit_footprint_for_fp_editor_base 1000 none - 1 dialog_edit_footprint_for_fp_editor_base @@ -2200,7 +2199,7 @@ 0 0 wxID_ANY - Set clearances to 0 to use global values + Set clearances to 0 to use global values. 0 @@ -2417,6 +2416,89 @@ + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,92,-1,70,0 + 0 + 0 + wxID_ANY + These values are used only to build the mask shape of pads on copper layers. + + 0 + + + 0 + + 1 + m_staticTextInfo2 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxEXPAND diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.h b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.h index d0263b74f6..764baad204 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.h +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor_base.h @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __DIALOG_EDIT_FOOTPRINT_FOR_FP_EDITOR_BASE_H__ @@ -11,6 +11,7 @@ #include #include #include +class DIALOG_SHIM; class TEXT_CTRL_EVAL; #include "dialog_shim.h" @@ -76,6 +77,7 @@ class DIALOG_FOOTPRINT_FP_EDITOR_BASE : public DIALOG_SHIM wxStaticText* m_staticTextInfo; wxStaticText* m_staticTextInfoValPos; wxStaticText* m_staticTextInfoValNeg; + wxStaticText* m_staticTextInfo2; wxStaticText* m_staticTextNetClearance; TEXT_CTRL_EVAL* m_NetClearanceValueCtrl; wxStaticText* m_NetClearanceUnits; diff --git a/pcbnew/dialogs/dialog_mask_clearance_base.cpp b/pcbnew/dialogs/dialog_mask_clearance_base.cpp index ee133a5661..94ff4927d7 100644 --- a/pcbnew/dialogs/dialog_mask_clearance_base.cpp +++ b/pcbnew/dialogs/dialog_mask_clearance_base.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 22 2017) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "dialog_mask_clearance_base.h" @@ -24,9 +24,15 @@ DIALOG_PADS_MASK_CLEARANCE_BASE::DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* pare wxBoxSizer* bMainUpperSizer; bMainUpperSizer = new wxBoxSizer( wxVERTICAL ); - m_staticTextInfo = new wxStaticText( this, wxID_ANY, _("Note: for clearance values:\n- a positive value means a mask bigger than a pad\n- a negative value means a mask smaller than a pad\n"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfo = new wxStaticText( this, wxID_ANY, _("Note: for clearance values:\n- a positive value means a mask bigger than a pad.\n- a negative value means a mask smaller than a pad."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfo->Wrap( -1 ); - bMainUpperSizer->Add( m_staticTextInfo, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + bMainUpperSizer->Add( m_staticTextInfo, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + m_staticTextInfo2 = new wxStaticText( this, wxID_ANY, _("These global values are used only to build the mask shape\nof pads on copper layers."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfo2->Wrap( -1 ); + m_staticTextInfo2->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + + bMainUpperSizer->Add( m_staticTextInfo2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bMainUpperSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); @@ -119,7 +125,6 @@ DIALOG_PADS_MASK_CLEARANCE_BASE::DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* pare this->SetSizer( bMainSizer ); this->Layout(); - bMainSizer->Fit( this ); } DIALOG_PADS_MASK_CLEARANCE_BASE::~DIALOG_PADS_MASK_CLEARANCE_BASE() diff --git a/pcbnew/dialogs/dialog_mask_clearance_base.fbp b/pcbnew/dialogs/dialog_mask_clearance_base.fbp index 13ef67eda1..17b56719a4 100644 --- a/pcbnew/dialogs/dialog_mask_clearance_base.fbp +++ b/pcbnew/dialogs/dialog_mask_clearance_base.fbp @@ -44,7 +44,7 @@ DIALOG_PADS_MASK_CLEARANCE_BASE - -1,-1 + 393,332 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Pads Mask Clearance @@ -104,7 +104,7 @@ none 5 - wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_HORIZONTAL|wxALL 0 1 @@ -134,7 +134,7 @@ 0 0 wxID_ANY - Note: for clearance values: - a positive value means a mask bigger than a pad - a negative value means a mask smaller than a pad + Note: for clearance values: - a positive value means a mask bigger than a pad. - a negative value means a mask smaller than a pad. 0 @@ -185,6 +185,89 @@ + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,92,-1,70,0 + 0 + 0 + wxID_ANY + These global values are used only to build the mask shape of pads on copper layers. + + 0 + + + 0 + + 1 + m_staticTextInfo2 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxEXPAND | wxALL diff --git a/pcbnew/dialogs/dialog_mask_clearance_base.h b/pcbnew/dialogs/dialog_mask_clearance_base.h index cbbfa50f9f..70448bb364 100644 --- a/pcbnew/dialogs/dialog_mask_clearance_base.h +++ b/pcbnew/dialogs/dialog_mask_clearance_base.h @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 22 2017) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __DIALOG_MASK_CLEARANCE_BASE_H__ @@ -11,6 +11,8 @@ #include #include #include +class DIALOG_SHIM; + #include "dialog_shim.h" #include #include @@ -41,6 +43,7 @@ class DIALOG_PADS_MASK_CLEARANCE_BASE : public DIALOG_SHIM protected: wxStaticText* m_staticTextInfo; + wxStaticText* m_staticTextInfo2; wxStaticLine* m_staticline1; wxStaticText* m_MaskClearanceTitle; wxTextCtrl* m_SolderMaskMarginCtrl; @@ -69,7 +72,7 @@ class DIALOG_PADS_MASK_CLEARANCE_BASE : public DIALOG_SHIM public: - DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pads Mask Clearance"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pads Mask Clearance"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 393,332 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_PADS_MASK_CLEARANCE_BASE(); }; diff --git a/pcbnew/dialogs/dialog_pad_properties.h b/pcbnew/dialogs/dialog_pad_properties.h index 6bc9b61b05..4987287535 100644 --- a/pcbnew/dialogs/dialog_pad_properties.h +++ b/pcbnew/dialogs/dialog_pad_properties.h @@ -119,6 +119,11 @@ private: void OnResize( wxSizeEvent& event ); void OnCancel( wxCommandEvent& event ) override; + void updateUITextWarning( wxUpdateUIEvent& event ) override + { + event.Enable( ( m_dummyPad->GetLayerSet() & LSET::AllCuMask() ).any() ); + } + void OnPadShapeSelection( wxCommandEvent& event ) override; void OnDrillShapeSelected( wxCommandEvent& event ) override; void onChangePadMode( wxCommandEvent& event ) override; diff --git a/pcbnew/dialogs/dialog_pad_properties_base.cpp b/pcbnew/dialogs/dialog_pad_properties_base.cpp index fd1eb5955b..ea3f9d44d7 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pad_properties_base.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "widgets/text_ctrl_eval.h" @@ -400,17 +400,23 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind wxBoxSizer* bSizerClearance; bSizerClearance = new wxBoxSizer( wxVERTICAL ); - m_staticTextWarning = new wxStaticText( m_localSettingsPanel, wxID_ANY, _("Set fields to 0 to use parent or global values"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextWarning = new wxStaticText( m_localSettingsPanel, wxID_ANY, _("Set fields to 0 to use parent or global values."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextWarning->Wrap( -1 ); m_staticTextWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); bSizerClearance->Add( m_staticTextWarning, 0, wxALL, 5 ); + m_staticTextInfo = new wxStaticText( m_localSettingsPanel, wxID_ANY, _("These parameters are used only by pads on copper layers.\nPads only on technical layers do not use these parameters."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfo->Wrap( -1 ); + m_staticTextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + + bSizerClearance->Add( m_staticTextInfo, 0, wxALL, 5 ); + m_staticTextInfoPosValue = new wxStaticText( m_localSettingsPanel, wxID_ANY, _("Positive clearance means area bigger than the pad (usual for mask clearance)."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfoPosValue->Wrap( -1 ); m_staticTextInfoPosValue->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); - bSizerClearance->Add( m_staticTextInfoPosValue, 0, wxALL, 5 ); + bSizerClearance->Add( m_staticTextInfoPosValue, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_staticTextInfoNegVal = new wxStaticText( m_localSettingsPanel, wxID_ANY, _("Negative clearance means area smaller than the pad (usual for paste clearance)."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfoNegVal->Wrap( -1 ); @@ -652,36 +658,36 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_staticModuleSideValue->Wrap( -1 ); sbSizeModuleInfo->Add( m_staticModuleSideValue, 0, wxALL|wxBOTTOM|wxTOP, 5 ); - wxBoxSizer* bSizer23; - bSizer23 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizerParentInfo; + bSizerParentInfo = new wxBoxSizer( wxHORIZONTAL ); m_staticTitleModuleRot = new wxStaticText( sbSizeModuleInfo->GetStaticBox(), wxID_ANY, _("Rotation:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTitleModuleRot->Wrap( -1 ); - bSizer23->Add( m_staticTitleModuleRot, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + bSizerParentInfo->Add( m_staticTitleModuleRot, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - bSizer23->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizerParentInfo->Add( 0, 0, 1, wxEXPAND, 5 ); m_staticModuleRotValue = new wxStaticText( sbSizeModuleInfo->GetStaticBox(), wxID_ANY, _("180.0"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticModuleRotValue->Wrap( -1 ); - bSizer23->Add( m_staticModuleRotValue, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + bSizerParentInfo->Add( m_staticModuleRotValue, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - sbSizeModuleInfo->Add( bSizer23, 1, wxEXPAND, 5 ); - - - sbSizeModuleInfo->Add( 0, 0, 1, wxEXPAND, 5 ); + sbSizeModuleInfo->Add( bSizerParentInfo, 1, wxEXPAND, 5 ); bSizerDisplayPad->Add( sbSizeModuleInfo, 0, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 8 ); + + bSizerDisplayPad->Add( 0, 0, 1, wxEXPAND, 5 ); + m_panelShowPad = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 220,-1 ), wxFULL_REPAINT_ON_RESIZE|wxSIMPLE_BORDER ); m_panelShowPad->SetBackgroundColour( wxColour( 0, 0, 0 ) ); - bSizerDisplayPad->Add( m_panelShowPad, 12, wxRIGHT|wxTOP|wxEXPAND, 10 ); + bSizerDisplayPad->Add( m_panelShowPad, 12, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 10 ); m_panelShowPadGal = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), wxDefaultSize, m_galOptions, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO); - bSizerDisplayPad->Add( m_panelShowPadGal, 12, wxEXPAND|wxRIGHT|wxTOP, 10 ); + bSizerDisplayPad->Add( m_panelShowPadGal, 12, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 10 ); m_cbShowPadOutline = new wxCheckBox( this, wxID_ANY, _("Show pad in outline mode"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerDisplayPad->Add( m_cbShowPadOutline, 0, wxBOTTOM|wxRIGHT|wxTOP, 5 ); @@ -693,7 +699,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind bSizerDisplayPad->Add( m_staticline13, 0, wxALL|wxEXPAND, 4 ); - bSizerUpper->Add( bSizerDisplayPad, 1, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 10 ); + bSizerUpper->Add( bSizerDisplayPad, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 10 ); m_MainSizer->Add( bSizerUpper, 1, wxEXPAND, 5 ); @@ -744,6 +750,8 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_PadLayerDraft->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_PadLayerECO1->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_PadLayerECO2->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); + m_staticTextWarning->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PAD_PROPERTIES_BASE::updateUITextWarning ), NULL, this ); + m_staticTextInfo->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PAD_PROPERTIES_BASE::updateUiTextInfo ), NULL, this ); m_NetClearanceValueCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_listCtrlPrimitives->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_PAD_PROPERTIES_BASE::onPrimitiveDClick ), NULL, this ); m_listCtrlPrimitives->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this ); @@ -791,6 +799,8 @@ DIALOG_PAD_PROPERTIES_BASE::~DIALOG_PAD_PROPERTIES_BASE() m_PadLayerDraft->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_PadLayerECO1->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_PadLayerECO2->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); + m_staticTextWarning->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PAD_PROPERTIES_BASE::updateUITextWarning ), NULL, this ); + m_staticTextInfo->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PAD_PROPERTIES_BASE::updateUiTextInfo ), NULL, this ); m_NetClearanceValueCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_listCtrlPrimitives->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_PAD_PROPERTIES_BASE::onPrimitiveDClick ), NULL, this ); m_listCtrlPrimitives->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_pad_properties_base.fbp b/pcbnew/dialogs/dialog_pad_properties_base.fbp index 5c38d6b616..23a9af5d9a 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pad_properties_base.fbp @@ -14,7 +14,6 @@ dialog_pad_properties_base 1000 none - 1 dialog_pad_properties_base @@ -7041,7 +7040,7 @@ 0 0 wxID_ANY - Set fields to 0 to use parent or global values + Set fields to 0 to use parent or global values. 0 @@ -7089,13 +7088,96 @@ - + updateUITextWarning 5 wxALL 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,92,-1,70,0 + 0 + 0 + wxID_ANY + These parameters are used only by pads on copper layers. Pads only on technical layers do not use these parameters. + + 0 + + + 0 + + 1 + m_staticTextInfo + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + updateUiTextInfo + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 1 1 @@ -10349,7 +10431,7 @@ 10 - wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 1 200,-1 @@ -10462,13 +10544,13 @@ - + 5 wxEXPAND 1 - + - bSizer23 + bSizerParentInfo wxHORIZONTAL none @@ -10566,7 +10648,7 @@ 5 - wxBOTTOM|wxLEFT|wxRIGHT + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -10649,21 +10731,21 @@ - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 10 - wxRIGHT|wxTOP|wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 12 1 @@ -10743,7 +10825,7 @@ 10 - wxEXPAND|wxRIGHT|wxTOP + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 12 1 diff --git a/pcbnew/dialogs/dialog_pad_properties_base.h b/pcbnew/dialogs/dialog_pad_properties_base.h index a80bc65cb8..e018e50df8 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.h +++ b/pcbnew/dialogs/dialog_pad_properties_base.h @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __DIALOG_PAD_PROPERTIES_BASE_H__ @@ -11,7 +11,9 @@ #include #include #include +class DIALOG_SHIM; class TEXT_CTRL_EVAL; +class wxListView; #include "dialog_shim.h" #include @@ -137,6 +139,7 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxCheckBox* m_PadLayerECO2; wxPanel* m_localSettingsPanel; wxStaticText* m_staticTextWarning; + wxStaticText* m_staticTextInfo; wxStaticText* m_staticTextInfoPosValue; wxStaticText* m_staticTextInfoNegVal; wxStaticText* m_staticTextNetClearance; @@ -197,6 +200,8 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM virtual void OnSetLayers( wxCommandEvent& event ) { event.Skip(); } virtual void onCornerSizePercentChange( wxCommandEvent& event ) { event.Skip(); } virtual void OnDrillShapeSelected( wxCommandEvent& event ) { event.Skip(); } + virtual void updateUITextWarning( wxUpdateUIEvent& event ) { event.Skip(); } + virtual void updateUiTextInfo( wxUpdateUIEvent& event ) { event.Skip(); } virtual void onPrimitiveDClick( wxMouseEvent& event ) { event.Skip(); } virtual void OnPrimitiveSelection( wxListEvent& event ) { event.Skip(); } virtual void onDeletePrimitive( wxCommandEvent& event ) { event.Skip(); }