KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_mask_and_paste.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20
21#include <pcb_edit_frame.h>
25
26
28 PCB_EDIT_FRAME* aFrame ) :
29 PANEL_SETUP_MASK_AND_PASTE_BASE( aParentWindow ),
35{
36 m_Frame = aFrame;
37 m_BrdSettings = &m_Frame->GetBoard()->GetDesignSettings();
38
39 m_staticTextInfoPaste->SetFont( KIUI::GetInfoFont( this ).Italic() );
40
41 // Update label text and tooltip for combined offset + ratio field
42 m_pasteMarginLabel->SetLabel( _( "Solder paste clearance:" ) );
43 m_pasteMarginLabel->SetToolTip( _( "Solder paste clearance relative to pad size.\n"
44 "Enter an absolute value (e.g., -0.1mm), a percentage "
45 "(e.g., -5%), or both (e.g., -0.1mm - 5%).\n"
46 "This value can be superseded by local values for a "
47 "footprint or a pad." ) );
48
49 // Hide the old ratio controls - they're no longer needed
50 m_pasteMarginRatioLabel->Show( false );
51 m_pasteMarginRatioCtrl->Show( false );
52 m_pasteMarginRatioUnits->Show( false );
53}
54
55
57{
58 m_maskExpansion.SetValue( m_BrdSettings->m_SolderMaskExpansion );
59 m_maskMinWidth.SetValue( m_BrdSettings->m_SolderMaskMinWidth );
60 m_maskToCopperClearance.SetValue( m_BrdSettings->m_SolderMaskToCopperClearance );
61 m_tentViasFront->SetValue( m_BrdSettings->m_TentViasFront );
62 m_tentViasBack->SetValue( m_BrdSettings->m_TentViasBack );
63
64 m_pasteMargin.SetOffsetValue( m_BrdSettings->m_SolderPasteMargin );
65 m_pasteMargin.SetRatioValue( m_BrdSettings->m_SolderPasteMarginRatio );
66
67 m_allowBridges->SetValue( m_BrdSettings->m_AllowSoldermaskBridgesInFPs );
68
69 return true;
70}
71
72
74{
75 // These are all stored in project file, not board, so no need for OnModify()
76 m_BrdSettings->m_SolderMaskExpansion = m_maskExpansion.GetIntValue();
77 m_BrdSettings->m_SolderMaskMinWidth = m_maskMinWidth.GetIntValue();
78 m_BrdSettings->m_SolderMaskToCopperClearance = m_maskToCopperClearance.GetIntValue();
79 m_BrdSettings->m_TentViasFront = m_tentViasFront->GetValue();
80 m_BrdSettings->m_TentViasBack = m_tentViasBack->GetValue();
81
82 m_BrdSettings->m_SolderPasteMargin = m_pasteMargin.GetOffsetValue().value_or( 0 );
83 m_BrdSettings->m_SolderPasteMarginRatio = m_pasteMargin.GetRatioValue().value_or( 0.0 );
84
85 m_BrdSettings->m_AllowSoldermaskBridgesInFPs = m_allowBridges->GetValue();
86
87 return true;
88}
89
90
92{
93 BOARD_DESIGN_SETTINGS* savedSettings = m_BrdSettings;
94
97
98 m_BrdSettings = savedSettings;
99}
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition board.cpp:1149
PANEL_SETUP_MASK_AND_PASTE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
PANEL_SETUP_MASK_AND_PASTE(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame)
BOARD_DESIGN_SETTINGS * m_BrdSettings
The main frame for Pcbnew.
#define _(s)
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)