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 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
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 <core/optional.h>
27 
28 #include "pcb_track.h" // for VIATYPE_T
29 
30 class BOARD;
32 
33 namespace PNS {
34 
35 class ITEM;
36 
38 {
39 public:
41  m_minClearance( 0 ),
42  m_trackWidth( 155000 ),
43  m_trackWidthIsExplicit( true ),
45  m_viaDiameter( 600000 ),
46  m_viaDrill( 250000 ),
47  m_diffPairWidth( 125000 ),
48  m_diffPairGap( 180000 ),
49  m_diffPairViaGap( 180000 ),
51  m_holeToHole( 0 )
52  {};
53 
55 
56  void ClearLayerPairs();
57  void AddLayerPair( int aL1, int aL2 );
58 
59  int MinClearance() const { return m_minClearance; }
60  void SetMinClearance( int aClearance ) { m_minClearance = aClearance; }
61 
62  int TrackWidth() const { return m_trackWidth; }
63  void SetTrackWidth( int aWidth ) { m_trackWidth = aWidth; }
64 
66  void SetTrackWidthIsExplicit( bool aIsExplicit ) { m_trackWidthIsExplicit = aIsExplicit; }
67 
68  int DiffPairWidth() const { return m_diffPairWidth; }
69  int DiffPairGap() const { return m_diffPairGap; }
70 
71  int DiffPairViaGap() const
72  {
74  }
75 
77 
78  void SetDiffPairWidth( int aWidth ) { m_diffPairWidth = aWidth; }
79  void SetDiffPairGap( int aGap ) { m_diffPairGap = aGap; }
81  void SetDiffPairViaGap( int aGap ) { m_diffPairViaGap = aGap; }
82 
83  int ViaDiameter() const { return m_viaDiameter; }
84  void SetViaDiameter( int aDiameter ) { m_viaDiameter = aDiameter; }
85 
86  int ViaDrill() const { return m_viaDrill; }
87  void SetViaDrill( int aDrill ) { m_viaDrill = aDrill; }
88 
89  OPT<int> PairedLayer( int aLayerId )
90  {
91  if( m_layerPairs.find(aLayerId) == m_layerPairs.end() )
92  return OPT<int>();
93 
94  return m_layerPairs[aLayerId];
95  }
96 
97  int GetLayerTop() const;
98  int GetLayerBottom() const;
99 
100  void SetHoleToHole( int aHoleToHole ) { m_holeToHole = aHoleToHole; }
101  int GetHoleToHole() const { return m_holeToHole; }
102 
103  void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; }
104  VIATYPE ViaType() const { return m_viaType; }
105 
106 private:
110 
114 
119 
121 
122  std::map<int, int> m_layerPairs;
123 };
124 
125 }
126 
127 #endif // __PNS_SIZES_SETTINGS_H
void SetDiffPairViaGapSameAsTraceGap(bool aEnable)
void SetTrackWidthIsExplicit(bool aIsExplicit)
void SetViaDrill(int aDrill)
VIATYPE ViaType() const
void SetTrackWidth(int aWidth)
void SetDiffPairViaGap(int aGap)
void SetMinClearance(int aClearance)
bool TrackWidthIsExplicit() const
void SetViaType(VIATYPE aViaType)
VIATYPE
Definition: pcb_track.h:60
std::map< int, int > m_layerPairs
void SetHoleToHole(int aHoleToHole)
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
bool DiffPairViaGapSameAsTraceGap() const
void SetDiffPairGap(int aGap)
boost::optional< T > OPT
Definition: optional.h:7
void AddLayerPair(int aL1, int aL2)
void SetViaDiameter(int aDiameter)
Push and Shove diff pair dimensions (gap) settings dialog.
OPT< int > PairedLayer(int aLayerId)
void SetDiffPairWidth(int aWidth)
Container for design settings for a BOARD object.