KiCad PCB EDA Suite
panel_setup_feature_constraints.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 (C) 2019 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, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #include <board_design_settings.h>
25 #include <class_board.h> // for BOARD
26 #include <convert_to_biu.h> // for IU_PER_MM
27 #include <math/util.h>
29 #include <panel_setup_feature_constraints_base.h> // for PANEL_SETUP_FEATUR...
30 #include <pcb_edit_frame.h>
31 
32 #include <widgets/paged_dialog.h> // for PAGED_DIALOG
33 #include <widgets/unit_binder.h> // for UNIT_BINDER
34 #include <wx/treebook.h>
35 #include <wx/wx.h>
36 
37 
39  PCB_EDIT_FRAME* aFrame ) :
40  PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( aParent->GetTreebook() ),
41  m_trackMinWidth( aFrame, m_TrackMinWidthTitle, m_TrackMinWidthCtrl, m_TrackMinWidthUnits, true ),
42  m_viaMinSize( aFrame, m_ViaMinTitle, m_SetViasMinSizeCtrl, m_ViaMinUnits, true ),
43  m_viaMinDrill( aFrame, m_ViaMinDrillTitle, m_SetViasMinDrillCtrl, m_ViaMinDrillUnits, true ),
44  m_uviaMinSize( aFrame, m_uviaMinSizeLabel, m_uviaMinSizeCtrl, m_uviaMinSizeUnits, true ),
45  m_uviaMinDrill( aFrame, m_uviaMinDrillLabel, m_uviaMinDrillCtrl, m_uviaMinDrillUnits, true ),
46  m_holeToHoleMin( aFrame, m_HoleToHoleTitle, m_SetHoleToHoleCtrl, m_HoleToHoleUnits, true ),
47  m_edgeClearance( aFrame, m_EdgeClearanceLabel, m_EdgeClearanceCtrl, m_EdgeClearanceUnits, true ),
48  m_maxError( aFrame, m_maxErrorTitle, m_maxErrorCtrl, m_maxErrorUnits, true )
49 {
50  m_Frame = aFrame;
52 }
53 
54 
56 {
60 
63 
66 
68 
70 
73 
75 
78 
79  return true;
80 }
81 
82 
84 {
85  // Update tracks minimum values for DRC
87 
88  // Update vias minimum values for DRC
91 
94 
95  // Update microvias minimum values for DRC
98 
100 
102 
105 
106  m_BrdSettings->m_MaxError = Clamp<int>( IU_PER_MM * MINIMUM_ERROR_SIZE_MM,
107  m_maxError.GetValue(), IU_PER_MM * MAXIMUM_ERROR_SIZE_MM );
108 
110 
111  return true;
112 }
113 
114 
116 {
117  BOARD_DESIGN_SETTINGS* savedSettings = m_BrdSettings;
118 
119  m_BrdSettings = &aBoard->GetDesignSettings();
121 
122  m_BrdSettings = savedSettings;
123 }
124 
125 
127 {
128  wxObject* item =event.GetEventObject();
129 
130  if( item == m_cbOutlinePolygonBestQ )
131  m_cbOutlinePolygonFastest->SetValue( not m_cbOutlinePolygonBestQ->GetValue() );
132  else
133  m_cbOutlinePolygonBestQ->SetValue( not m_cbOutlinePolygonFastest->GetValue() );
134 }
void SetCopperEdgeClearance(int aDistance)
Function SetCopperEdgeClearance.
bool m_ProhibitOverlappingCourtyards
check for overlapping courtyards in DRC
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
#define MINIMUM_ERROR_SIZE_MM
int m_HoleToHoleMin
Min width of peninsula between two drilled holes.
void SetMinHoleSeparation(int aDistance)
Function SetMinHoleSeparation.
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
bool m_BlindBuriedViaAllowed
true to allow blind/buried vias
Class PANEL_SETUP_FEATURE_CONSTRAINTS_BASE.
int m_MicroViasMinSize
micro vias (not vias) min diameter
void onChangeOutlineOpt(wxCommandEvent &event) override
bool m_RequireCourtyards
require courtyard definitions in footprints
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:160
void SetProhibitOverlappingCourtyards(bool aProhibit)
Function SetProhibitOverlappingCourtyards.
bool m_ZoneUseNoOutlineInFill
Option to handle filled polygons in zones: the "legacy" option is using thick outlines around filled ...
#define MAXIMUM_ERROR_SIZE_MM
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
PCB_EDIT_FRAME is the main frame for Pcbnew.
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
PANEL_SETUP_FEATURE_CONSTRAINTS(PAGED_DIALOG *aParent, PCB_EDIT_FRAME *aFrame)
bool m_MicroViasAllowed
true to allow micro vias
BOARD * GetBoard() const
void SetRequireCourtyardDefinitions(bool aRequire)
Function SetRequireCourtyardDefinitions.
int m_MicroViasMinDrill
micro vias (not vias) min drill diameter
BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.