LibrePCB Developers Documentation
boarddesignrulechecksettings.h
Go to the documentation of this file.
1 /*
2  * LibrePCB - Professional EDA for everyone!
3  * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4  * https://librepcb.org/
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (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, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef LIBREPCB_CORE_BOARDDESIGNRULECHECKSETTINGS_H
21 #define LIBREPCB_CORE_BOARDDESIGNRULECHECKSETTINGS_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../../../types/length.h"
27 
28 #include <QtCore>
29 
30 /*******************************************************************************
31  * Namespace / Forward Declarations
32  ******************************************************************************/
33 namespace librepcb {
34 
35 class SExpression;
36 
37 /*******************************************************************************
38  * Class BoardDesignRuleCheckSettings
39  ******************************************************************************/
40 
45 public:
46  // Types
47  enum class AllowedSlots : int {
48  None = 0,
51  Any = 3,
52  };
53 
54  // Constructors / Destructor
57  const BoardDesignRuleCheckSettings& other) noexcept;
58  explicit BoardDesignRuleCheckSettings(const SExpression& node);
60 
61  // Getters
62  const UnsignedLength& getMinCopperCopperClearance() const noexcept {
64  }
65  const UnsignedLength& getMinCopperBoardClearance() const noexcept {
67  }
68  const UnsignedLength& getMinCopperNpthClearance() const noexcept {
70  }
71  const UnsignedLength& getMinDrillDrillClearance() const noexcept {
73  }
74  const UnsignedLength& getMinDrillBoardClearance() const noexcept {
76  }
79  }
80  const UnsignedLength& getMinCopperWidth() const noexcept {
81  return mMinCopperWidth;
82  }
83  const UnsignedLength& getMinPthAnnularRing() const noexcept {
84  return mMinPthAnnularRing;
85  }
86  const UnsignedLength& getMinNpthDrillDiameter() const noexcept {
87  return mMinNpthDrillDiameter;
88  }
89  const UnsignedLength& getMinPthDrillDiameter() const noexcept {
90  return mMinPthDrillDiameter;
91  }
92  const UnsignedLength& getMinNpthSlotWidth() const noexcept {
93  return mMinNpthSlotWidth;
94  }
95  const UnsignedLength& getMinPthSlotWidth() const noexcept {
96  return mMinPthSlotWidth;
97  }
98  const UnsignedLength& getMinSilkscreenWidth() const noexcept {
99  return mMinSilkscreenWidth;
100  }
101  const UnsignedLength& getMinSilkscreenTextHeight() const noexcept {
103  }
104  const UnsignedLength& getMinOutlineToolDiameter() const noexcept {
106  }
107  bool getBlindViasAllowed() const noexcept { return mBlindViasAllowed; }
108  bool getBuriedViasAllowed() const noexcept { return mBuriedViasAllowed; }
110  return mAllowedNpthSlots;
111  }
112  AllowedSlots getAllowedPthSlots() const noexcept { return mAllowedPthSlots; }
113 
114  // Setters
115  void setMinCopperCopperClearance(const UnsignedLength& value) noexcept {
117  }
118  void setMinCopperBoardClearance(const UnsignedLength& value) noexcept {
119  mMinCopperBoardClearance = value;
120  }
121  void setMinCopperNpthClearance(const UnsignedLength& value) noexcept {
122  mMinCopperNpthClearance = value;
123  }
124  void setMinDrillDrillClearance(const UnsignedLength& value) noexcept {
125  mMinDrillDrillClearance = value;
126  }
127  void setMinDrillBoardClearance(const UnsignedLength& value) noexcept {
128  mMinDrillBoardClearance = value;
129  }
130  void setMinSilkscreenStopmaskClearance(const UnsignedLength& value) noexcept {
132  }
133  void setMinCopperWidth(const UnsignedLength& value) noexcept {
134  mMinCopperWidth = value;
135  }
136  void setMinPthAnnularRing(const UnsignedLength& value) noexcept {
137  mMinPthAnnularRing = value;
138  }
139  void setMinNpthDrillDiameter(const UnsignedLength& value) noexcept {
140  mMinNpthDrillDiameter = value;
141  }
142  void setMinPthDrillDiameter(const UnsignedLength& value) noexcept {
143  mMinPthDrillDiameter = value;
144  }
145  void setMinNpthSlotWidth(const UnsignedLength& value) noexcept {
146  mMinNpthSlotWidth = value;
147  }
148  void setMinPthSlotWidth(const UnsignedLength& value) noexcept {
149  mMinPthSlotWidth = value;
150  }
151  void setMinSilkscreenWidth(const UnsignedLength& value) noexcept {
152  mMinSilkscreenWidth = value;
153  }
154  void setMinSilkscreenTextHeight(const UnsignedLength& value) noexcept {
155  mMinSilkscreenTextHeight = value;
156  }
157  void setMinOutlineToolDiameter(const UnsignedLength& value) noexcept {
158  mMinOutlineToolDiameter = value;
159  }
160  void setBlindViasAllowed(bool value) noexcept { mBlindViasAllowed = value; }
161  void setBuriedViasAllowed(bool value) noexcept { mBuriedViasAllowed = value; }
162  void setAllowedPthSlots(AllowedSlots value) noexcept {
163  mAllowedNpthSlots = value;
164  }
165  void setAllowedNpthSlots(AllowedSlots value) noexcept {
166  mAllowedPthSlots = value;
167  }
168 
169  // General Methods
170 
176  void serialize(SExpression& root) const;
177 
178  // Operator Overloadings
180  const BoardDesignRuleCheckSettings& rhs) noexcept;
181  bool operator==(const BoardDesignRuleCheckSettings& rhs) const noexcept;
182  bool operator!=(const BoardDesignRuleCheckSettings& rhs) const noexcept {
183  return !(*this == rhs);
184  }
185 
186 private: // Data
187  // Clearances
194 
195  // Minimum sizes
205 
206  // Allowed features
211 };
212 
213 /*******************************************************************************
214  * End of File
215  ******************************************************************************/
216 
217 } // namespace librepcb
218 
220 
221 #endif
AllowedSlots mAllowedNpthSlots
Definition: boarddesignrulechecksettings.h:209
BoardDesignRuleCheckSettings & operator=(const BoardDesignRuleCheckSettings &rhs) noexcept
Definition: boarddesignrulechecksettings.cpp:202
UnsignedLength mMinPthSlotWidth
Definition: boarddesignrulechecksettings.h:201
const UnsignedLength & getMinPthDrillDiameter() const noexcept
Definition: boarddesignrulechecksettings.h:89
bool getBlindViasAllowed() const noexcept
Definition: boarddesignrulechecksettings.h:107
UnsignedLength mMinOutlineToolDiameter
Definition: boarddesignrulechecksettings.h:204
AllowedSlots mAllowedPthSlots
Definition: boarddesignrulechecksettings.h:210
const UnsignedLength & getMinCopperBoardClearance() const noexcept
Definition: boarddesignrulechecksettings.h:65
const UnsignedLength & getMinDrillDrillClearance() const noexcept
Definition: boarddesignrulechecksettings.h:71
UnsignedLength mMinNpthSlotWidth
Definition: boarddesignrulechecksettings.h:200
const UnsignedLength & getMinDrillBoardClearance() const noexcept
Definition: boarddesignrulechecksettings.h:74
void setMinDrillBoardClearance(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:127
Definition: occmodel.cpp:77
const UnsignedLength & getMinPthSlotWidth() const noexcept
Definition: boarddesignrulechecksettings.h:95
const UnsignedLength & getMinOutlineToolDiameter() const noexcept
Definition: boarddesignrulechecksettings.h:104
void setMinDrillDrillClearance(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:124
UnsignedLength mMinPthDrillDiameter
Definition: boarddesignrulechecksettings.h:199
bool operator!=(const BoardDesignRuleCheckSettings &rhs) const noexcept
Definition: boarddesignrulechecksettings.h:182
UnsignedLength mMinNpthDrillDiameter
Definition: boarddesignrulechecksettings.h:198
void setBuriedViasAllowed(bool value) noexcept
Definition: boarddesignrulechecksettings.h:161
UnsignedLength mMinCopperBoardClearance
Definition: boarddesignrulechecksettings.h:189
UnsignedLength mMinCopperWidth
Definition: boarddesignrulechecksettings.h:196
const UnsignedLength & getMinSilkscreenTextHeight() const noexcept
Definition: boarddesignrulechecksettings.h:101
UnsignedLength mMinDrillDrillClearance
Definition: boarddesignrulechecksettings.h:191
bool operator==(const BoardDesignRuleCheckSettings &rhs) const noexcept
Definition: boarddesignrulechecksettings.cpp:226
void setAllowedPthSlots(AllowedSlots value) noexcept
Definition: boarddesignrulechecksettings.h:162
void setMinSilkscreenWidth(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:151
Any kind of slot is allowed (including curves).
void setMinPthDrillDiameter(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:142
bool getBuriedViasAllowed() const noexcept
Definition: boarddesignrulechecksettings.h:108
void setMinNpthSlotWidth(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:145
bool mBuriedViasAllowed
Definition: boarddesignrulechecksettings.h:208
BoardDesignRuleCheckSettings() noexcept
Definition: boarddesignrulechecksettings.cpp:77
void setMinPthSlotWidth(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:148
void setMinPthAnnularRing(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:136
void setBlindViasAllowed(bool value) noexcept
Definition: boarddesignrulechecksettings.h:160
void setMinNpthDrillDiameter(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:139
void setMinSilkscreenTextHeight(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:154
UnsignedLength mMinDrillBoardClearance
Definition: boarddesignrulechecksettings.h:192
UnsignedLength mMinSilkscreenWidth
Definition: boarddesignrulechecksettings.h:202
const UnsignedLength & getMinCopperWidth() const noexcept
Definition: boarddesignrulechecksettings.h:80
UnsignedLength mMinSilkscreenStopmaskClearance
Definition: boarddesignrulechecksettings.h:193
void setMinCopperCopperClearance(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:115
UnsignedLength mMinPthAnnularRing
Definition: boarddesignrulechecksettings.h:197
UnsignedLength mMinCopperCopperClearance
Definition: boarddesignrulechecksettings.h:188
const UnsignedLength & getMinCopperCopperClearance() const noexcept
Definition: boarddesignrulechecksettings.h:62
const UnsignedLength & getMinSilkscreenStopmaskClearance() const noexcept
Definition: boarddesignrulechecksettings.h:77
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition: boarddesignrulechecksettings.cpp:155
void setMinCopperWidth(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:133
void setAllowedNpthSlots(AllowedSlots value) noexcept
Definition: boarddesignrulechecksettings.h:165
void setMinCopperNpthClearance(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:121
const UnsignedLength & getMinPthAnnularRing() const noexcept
Definition: boarddesignrulechecksettings.h:83
~BoardDesignRuleCheckSettings() noexcept
Definition: boarddesignrulechecksettings.cpp:148
AllowedSlots getAllowedNpthSlots() const noexcept
Definition: boarddesignrulechecksettings.h:109
const UnsignedLength & getMinNpthSlotWidth() const noexcept
Definition: boarddesignrulechecksettings.h:92
void setMinOutlineToolDiameter(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:157
void setMinSilkscreenStopmaskClearance(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:130
UnsignedLength mMinSilkscreenTextHeight
Definition: boarddesignrulechecksettings.h:203
const UnsignedLength & getMinSilkscreenWidth() const noexcept
Definition: boarddesignrulechecksettings.h:98
The BoardDesignRuleCheckSettings class.
Definition: boarddesignrulechecksettings.h:44
AllowedSlots
Definition: boarddesignrulechecksettings.h:47
bool mBlindViasAllowed
Definition: boarddesignrulechecksettings.h:207
AllowedSlots getAllowedPthSlots() const noexcept
Definition: boarddesignrulechecksettings.h:112
void setMinCopperBoardClearance(const UnsignedLength &value) noexcept
Definition: boarddesignrulechecksettings.h:118
const UnsignedLength & getMinNpthDrillDiameter() const noexcept
Definition: boarddesignrulechecksettings.h:86
The SExpression class.
Definition: sexpression.h:69
const UnsignedLength & getMinCopperNpthClearance() const noexcept
Definition: boarddesignrulechecksettings.h:68
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696
UnsignedLength mMinCopperNpthClearance
Definition: boarddesignrulechecksettings.h:190