KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 The 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 <wx/string.h>
29
30#include <pcb_track_types.h> // for VIATYPE_T
31
32class BOARD;
34
35namespace PNS {
36
37class ITEM;
38
40{
41public:
43 m_clearance( 0 ),
44 m_minClearance( 0 ),
45 m_trackWidth( 155000 ),
49 m_viaDiameter( 600000 ),
50 m_viaDrill( 250000 ),
51 m_diffPairWidth( 125000 ),
52 m_diffPairGap( 180000 ),
53 m_diffPairViaGap( 180000 ),
55 m_holeToHole( 0 ),
57 {};
58
60
61 void ClearLayerPairs();
62 void AddLayerPair( int aL1, int aL2 );
63
64 // The working clearance, from the current net to anything else (without knowing the net of the
65 // other object). Specific clearance to another object may be resolved differently.
66 int Clearance() const { return m_clearance; }
67 void SetClearance( int aClearance ) { m_clearance = aClearance; }
68
69 // The absolute minimum clearance from the board
70 int MinClearance() const { return m_minClearance; }
71 void SetMinClearance( int aClearance ) { m_minClearance = aClearance; }
72
73 int TrackWidth() const { return m_trackWidth; }
74 void SetTrackWidth( int aWidth ) { m_trackWidth = aWidth; }
75
77 void SetTrackWidthIsExplicit( bool aIsExplicit ) { m_trackWidthIsExplicit = aIsExplicit; }
78
80 void SetBoardMinTrackWidth( int aWidth ) { m_boardMinTrackWidth = aWidth; }
81
82 int DiffPairWidth() const { return m_diffPairWidth; }
83 int DiffPairGap() const { return m_diffPairGap; }
84
89
91
92 void SetDiffPairWidth( int aWidth ) { m_diffPairWidth = aWidth; }
93 void SetDiffPairGap( int aGap ) { m_diffPairGap = aGap; }
94 void SetDiffPairViaGapSameAsTraceGap ( bool aEnable )
95 {
97 }
98
99 void SetDiffPairViaGap( int aGap ) { m_diffPairViaGap = aGap; }
100
101 int ViaDiameter() const { return m_viaDiameter; }
102 void SetViaDiameter( int aDiameter ) { m_viaDiameter = aDiameter; }
103
104 int ViaDrill() const { return m_viaDrill; }
105 void SetViaDrill( int aDrill ) { m_viaDrill = aDrill; }
106
107 std::optional<int> PairedLayer( int aLayerId )
108 {
109 if( m_layerPairs.find(aLayerId) == m_layerPairs.end() )
110 return std::optional<int>();
111
112 return m_layerPairs[aLayerId];
113 }
114
115 int GetLayerTop() const;
116 int GetLayerBottom() const;
117
118 void SetHoleToHole( int aHoleToHole ) { m_holeToHole = aHoleToHole; }
119 int GetHoleToHole() const { return m_holeToHole; }
120
121 void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; }
122 VIATYPE ViaType() const { return m_viaType; }
123
124 wxString GetClearanceSource() const { return m_clearanceSource; }
125 void SetClearanceSource( const wxString& aSource ) { m_clearanceSource = aSource; }
126
127 wxString GetWidthSource() const { return m_widthSource; }
128 void SetWidthSource( const wxString& aSource ) { m_widthSource = aSource; }
129
131 void SetDiffPairWidthSource( const wxString& aSource ) { m_diffPairWidthSource = aSource; }
132
133 wxString GetDiffPairGapSource() const { return m_diffPairGapSource; }
134 void SetDiffPairGapSource( const wxString& aSource ) { m_diffPairGapSource = aSource; }
135
136 void SetDiffPairHoleToHole( int aHoleToHole ) { m_diffPairHoleToHole = aHoleToHole; }
138
139private:
145
149
154
157
158 std::map<int, int> m_layerPairs;
159
164};
165
166}
167
168#endif // __PNS_SIZES_SETTINGS_H
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
Base class for PNS router board items.
Definition pns_item.h:98
void SetViaType(VIATYPE aViaType)
void SetTrackWidth(int aWidth)
void SetBoardMinTrackWidth(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.
Declarations of types for tracks and vias.
VIATYPE