KiCad PCB EDA Suite
pns_sizes_settings.h
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2014 CERN
5 * Copyright (C) 2016, 2023 KiCad Developers, see AUTHORS.txt for contributors.
6 * Author: Tomasz Wlostowski <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef __PNS_SIZES_SETTINGS_H
23#define __PNS_SIZES_SETTINGS_H
24
25#include <map>
26#include <optional>
27
28#include "pcb_track.h" // for VIATYPE_T
29
30class BOARD;
32
33namespace PNS {
34
35class ITEM;
36
38{
39public:
41 m_clearance( 0 ),
42 m_minClearance( 0 ),
43 m_trackWidth( 155000 ),
46 m_viaDiameter( 600000 ),
47 m_viaDrill( 250000 ),
48 m_diffPairWidth( 125000 ),
49 m_diffPairGap( 180000 ),
50 m_diffPairViaGap( 180000 ),
52 m_holeToHole( 0 ),
54 {};
55
57
58 void ClearLayerPairs();
59 void AddLayerPair( int aL1, int aL2 );
60
61 // The working clearance, from the current net to anything else (without knowing the net of the
62 // other object). Specific clearance to another object may be resolved differently.
63 int Clearance() const { return m_clearance; }
64 void SetClearance( int aClearance ) { m_clearance = aClearance; }
65
66 // The absolute minimum clearance from the board
67 int MinClearance() const { return m_minClearance; }
68 void SetMinClearance( int aClearance ) { m_minClearance = aClearance; }
69
70 int TrackWidth() const { return m_trackWidth; }
71 void SetTrackWidth( int aWidth ) { m_trackWidth = aWidth; }
72
74 void SetTrackWidthIsExplicit( bool aIsExplicit ) { m_trackWidthIsExplicit = aIsExplicit; }
75
76 int DiffPairWidth() const { return m_diffPairWidth; }
77 int DiffPairGap() const { return m_diffPairGap; }
78
79 int DiffPairViaGap() const
80 {
82 }
83
85
86 void SetDiffPairWidth( int aWidth ) { m_diffPairWidth = aWidth; }
87 void SetDiffPairGap( int aGap ) { m_diffPairGap = aGap; }
88 void SetDiffPairViaGapSameAsTraceGap ( bool aEnable )
89 {
91 }
92
93 void SetDiffPairViaGap( int aGap ) { m_diffPairViaGap = aGap; }
94
95 int ViaDiameter() const { return m_viaDiameter; }
96 void SetViaDiameter( int aDiameter ) { m_viaDiameter = aDiameter; }
97
98 int ViaDrill() const { return m_viaDrill; }
99 void SetViaDrill( int aDrill ) { m_viaDrill = aDrill; }
100
101 std::optional<int> PairedLayer( int aLayerId )
102 {
103 if( m_layerPairs.find(aLayerId) == m_layerPairs.end() )
104 return std::optional<int>();
105
106 return m_layerPairs[aLayerId];
107 }
108
109 int GetLayerTop() const;
110 int GetLayerBottom() const;
111
112 void SetHoleToHole( int aHoleToHole ) { m_holeToHole = aHoleToHole; }
113 int GetHoleToHole() const { return m_holeToHole; }
114
115 void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; }
116 VIATYPE ViaType() const { return m_viaType; }
117
118 wxString GetClearanceSource() const { return m_clearanceSource; }
119 void SetClearanceSource( const wxString& aSource ) { m_clearanceSource = aSource; }
120
121 wxString GetWidthSource() const { return m_widthSource; }
122 void SetWidthSource( const wxString& aSource ) { m_widthSource = aSource; }
123
125 void SetDiffPairWidthSource( const wxString& aSource ) { m_diffPairWidthSource = aSource; }
126
127 wxString GetDiffPairGapSource() const { return m_diffPairGapSource; }
128 void SetDiffPairGapSource( const wxString& aSource ) { m_diffPairGapSource = aSource; }
129
130 void SetDiffPairHoleToHole( int aHoleToHole ) { m_diffPairHoleToHole = aHoleToHole; }
132
133private:
138
142
147
150
151 std::map<int, int> m_layerPairs;
152
157};
158
159}
160
161#endif // __PNS_SIZES_SETTINGS_H
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:269
void SetViaType(VIATYPE aViaType)
VIATYPE ViaType() const
void SetTrackWidth(int aWidth)
void SetDiffPairViaGapSameAsTraceGap(bool aEnable)
bool DiffPairViaGapSameAsTraceGap() const
void SetDiffPairWidth(int aWidth)
void SetDiffPairWidthSource(const wxString &aSource)
void SetDiffPairGapSource(const wxString &aSource)
std::map< int, int > m_layerPairs
void SetDiffPairGap(int aGap)
void SetHoleToHole(int aHoleToHole)
void SetViaDrill(int aDrill)
wxString GetClearanceSource() const
void SetDiffPairViaGap(int aGap)
wxString GetDiffPairGapSource() const
void SetDiffPairHoleToHole(int aHoleToHole)
void SetMinClearance(int aClearance)
wxString GetDiffPairWidthSource() const
void AddLayerPair(int aL1, int aL2)
void SetClearance(int aClearance)
std::optional< int > PairedLayer(int aLayerId)
bool TrackWidthIsExplicit() const
void SetViaDiameter(int aDiameter)
int GetDiffPairHoleToHole() const
void SetClearanceSource(const wxString &aSource)
wxString GetWidthSource() const
void SetWidthSource(const wxString &aSource)
void SetTrackWidthIsExplicit(bool aIsExplicit)
Push and Shove diff pair dimensions (gap) settings dialog.
VIATYPE
Definition: pcb_track.h:65