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 <boost/optional.hpp>
27 
28 #include "../class_track.h" // for VIATYPE_T
29 
30 class BOARD;
32 
33 namespace PNS {
34 
35 class ITEM;
36 
38 
39 public:
41  m_trackWidth( 155000 ),
42  m_diffPairWidth( 125000 ),
43  m_diffPairGap( 180000 ),
44  m_diffPairViaGap( 180000 ),
45  m_viaDiameter( 600000 ),
46  m_viaDrill( 250000 ),
49  {};
50 
52 
53  void Init( BOARD* aBoard, ITEM* aStartItem = NULL, int aNet = -1 );
54  void ImportCurrent( BOARD_DESIGN_SETTINGS& aSettings );
55 
56  void ClearLayerPairs();
57  void AddLayerPair( int aL1, int aL2 );
58 
59  int TrackWidth() const { return m_trackWidth; }
60  void SetTrackWidth( int aWidth ) { m_trackWidth = aWidth; }
61 
62  int DiffPairWidth() const { return m_diffPairWidth; }
63  int DiffPairGap() const { return m_diffPairGap; }
64 
65  int DiffPairViaGap() const {
67  return m_diffPairGap;
68  else
69  return m_diffPairViaGap;
70  }
71 
73 
74  void SetDiffPairWidth( int aWidth ) { m_diffPairWidth = aWidth; }
75  void SetDiffPairGap( int aGap ) { m_diffPairGap = aGap; }
77  void SetDiffPairViaGap( int aGap ) { m_diffPairViaGap = aGap; }
78 
79  int ViaDiameter() const { return m_viaDiameter; }
80  void SetViaDiameter( int aDiameter ) { m_viaDiameter = aDiameter; }
81 
82  int ViaDrill() const { return m_viaDrill; }
83  void SetViaDrill( int aDrill ) { m_viaDrill = aDrill; }
84 
86  {
87  if( m_layerPairs.find(aLayerId) == m_layerPairs.end() )
88  return boost::optional<int>();
89 
90  return m_layerPairs[aLayerId];
91  }
92 
93  int GetLayerTop() const;
94  int GetLayerBottom() const;
95 
96  void SetViaType( VIATYPE_T aViaType ) { m_viaType = aViaType; }
97  VIATYPE_T ViaType() const { return m_viaType; }
98 
99 private:
100 
101  int inheritTrackWidth( ITEM* aItem );
102 
109 
111 
113 
114  std::map<int, int> m_layerPairs;
115 };
116 
117 }
118 
119 #endif // __PNS_SIZES_SETTINGS_H
Class ITEM.
Definition: pns_item.h:53
void SetDiffPairViaGapSameAsTraceGap(bool aEnable)
VIATYPE_T ViaType() const
void SetViaDrill(int aDrill)
boost::optional< int > PairedLayer(int aLayerId)
VIATYPE_T
Definition: class_track.h:49
void SetTrackWidth(int aWidth)
void SetDiffPairViaGap(int aGap)
void Init(BOARD *aBoard, ITEM *aStartItem=NULL, int aNet=-1)
int DiffPairViaGap() const
void ImportCurrent(BOARD_DESIGN_SETTINGS &aSettings)
int inheritTrackWidth(ITEM *aItem)
void SetViaType(VIATYPE_T aViaType)
bool DiffPairViaGapSameAsTraceGap() const
std::map< int, int > m_layerPairs
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
void SetDiffPairGap(int aGap)
void AddLayerPair(int aL1, int aL2)
int DiffPairWidth() const
void SetViaDiameter(int aDiameter)
Push and Shove diff pair dimensions (gap) settings dialog.
void SetDiffPairWidth(int aWidth)
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.