LibrePCB Developers Documentation
Loading...
Searching...
No Matches
boarddesignrules.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_BOARDDESIGNRULES_H
21#define LIBREPCB_CORE_BOARDDESIGNRULES_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../types/boundedunsignedratio.h"
27#include "../../types/length.h"
28
29#include <QtCore>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class BoardDesignRuleCheckSettings;
37class SExpression;
38
39/*******************************************************************************
40 * Class BoardDesignRules
41 ******************************************************************************/
42
46class BoardDesignRules final {
47 Q_DECLARE_TR_FUNCTIONS(BoardDesignRules)
48
49public:
50 // Constructors / Destructor
51 BoardDesignRules() noexcept;
53 explicit BoardDesignRules(const SExpression& node);
54 ~BoardDesignRules() noexcept;
55
56 // Getters: Default Values
57 const PositiveLength& getDefaultTraceWidth() const noexcept {
58 return mDefaultTraceWidth;
59 }
62 }
63
64 // Getters: Stop Mask
69 return mStopMaskClearance;
70 }
71
72 // Getters: Solder Paste
75 }
76
77 // Getters: Pad Annular Ring
78 bool getPadCmpSideAutoAnnularRing() const noexcept {
80 }
81 bool getPadInnerAutoAnnularRing() const noexcept {
83 }
84 const BoundedUnsignedRatio& getPadAnnularRing() const noexcept {
85 return mPadAnnularRing;
86 }
87
88 // Getters: Via Annular Ring
89 const BoundedUnsignedRatio& getViaAnnularRing() const noexcept {
90 return mViaAnnularRing;
91 }
92
93 // Setters
94 void setDefaultTraceWidth(const PositiveLength& value) noexcept {
95 mDefaultTraceWidth = value;
96 }
97 void setDefaultViaDrillDiameter(const PositiveLength& value) noexcept {
99 }
100 void setStopMaskMaxViaDiameter(const UnsignedLength& dia) noexcept {
102 }
103 void setStopMaskClearance(const BoundedUnsignedRatio& value) noexcept {
104 mStopMaskClearance = value;
105 }
106 void setSolderPasteClearance(const BoundedUnsignedRatio& value) noexcept {
107 mSolderPasteClearance = value;
108 }
109 void setPadCmpSideAutoAnnularRing(bool enabled) noexcept {
111 }
112 void setPadInnerAutoAnnularRing(bool enabled) noexcept {
113 mPadInnerAutoAnnularRing = enabled;
114 }
116 mPadAnnularRing = value;
117 }
119 mViaAnnularRing = value;
120 }
121
122 // General Methods
123 void restoreDefaults() noexcept;
125
131 void serialize(SExpression& root) const;
132
133 // Helper Methods
134 bool doesViaRequireStopMaskOpening(const Length& drillDia) const noexcept;
135
136 // Operator Overloadings
137 BoardDesignRules& operator=(const BoardDesignRules& rhs) noexcept;
138 bool operator==(const BoardDesignRules& rhs) const noexcept;
139 bool operator!=(const BoardDesignRules& rhs) const noexcept {
140 return !(*this == rhs);
141 }
142
143private: // Methods
144 static bool parsePadAutoAnnular(const SExpression& node);
145
146private: // Data
147 // Default Values
150
151 // Stop Mask
154
155 // Solder Paste
157
158 // Pad Annular Ring
162
163 // Via Annular Ring
165};
166
167/*******************************************************************************
168 * End of File
169 ******************************************************************************/
170
171} // namespace librepcb
172
173#endif
The BoardDesignRuleCheckSettings class.
Definition boarddesignrulechecksettings.h:50
The BoardDesignRules class.
Definition boarddesignrules.h:46
void setDefaultViaDrillDiameter(const PositiveLength &value) noexcept
Definition boarddesignrules.h:97
void adjustToDrcSettings(const BoardDesignRuleCheckSettings &s) noexcept
Definition boarddesignrules.cpp:103
const BoundedUnsignedRatio & getPadAnnularRing() const noexcept
Definition boarddesignrules.h:84
const PositiveLength & getDefaultTraceWidth() const noexcept
Definition boarddesignrules.h:57
PositiveLength mDefaultTraceWidth
Definition boarddesignrules.h:148
UnsignedLength mStopMaskMaxViaDrillDiameter
Definition boarddesignrules.h:152
const PositiveLength & getDefaultViaDrillDiameter() const noexcept
Definition boarddesignrules.h:60
bool getPadCmpSideAutoAnnularRing() const noexcept
Definition boarddesignrules.h:78
void setPadInnerAutoAnnularRing(bool enabled) noexcept
Definition boarddesignrules.h:112
const BoundedUnsignedRatio & getStopMaskClearance() const noexcept
Definition boarddesignrules.h:68
const BoundedUnsignedRatio & getSolderPasteClearance() const noexcept
Definition boarddesignrules.h:73
void setSolderPasteClearance(const BoundedUnsignedRatio &value) noexcept
Definition boarddesignrules.h:106
void setPadCmpSideAutoAnnularRing(bool enabled) noexcept
Definition boarddesignrules.h:109
void setDefaultTraceWidth(const PositiveLength &value) noexcept
Definition boarddesignrules.h:94
BoundedUnsignedRatio mStopMaskClearance
Definition boarddesignrules.h:153
bool mPadCmpSideAutoAnnularRing
Definition boarddesignrules.h:159
~BoardDesignRules() noexcept
Definition boarddesignrules.cpp:92
PositiveLength mDefaultViaDrillDiameter
Definition boarddesignrules.h:149
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition boarddesignrules.cpp:128
static bool parsePadAutoAnnular(const SExpression &node)
Definition boarddesignrules.cpp:222
BoundedUnsignedRatio mSolderPasteClearance
Definition boarddesignrules.h:156
BoundedUnsignedRatio mViaAnnularRing
Percentage of the drill diameter.
Definition boarddesignrules.h:164
const UnsignedLength & getStopMaskMaxViaDiameter() const noexcept
Definition boarddesignrules.h:65
void setPadAnnularRing(const BoundedUnsignedRatio &value)
Definition boarddesignrules.h:115
bool doesViaRequireStopMaskOpening(const Length &drillDia) const noexcept
Definition boarddesignrules.cpp:170
const BoundedUnsignedRatio & getViaAnnularRing() const noexcept
Definition boarddesignrules.h:89
BoardDesignRules() noexcept
Definition boarddesignrules.cpp:39
void setViaAnnularRing(const BoundedUnsignedRatio &value)
Definition boarddesignrules.h:118
void restoreDefaults() noexcept
Definition boarddesignrules.cpp:99
bool mPadInnerAutoAnnularRing
Definition boarddesignrules.h:160
void setStopMaskClearance(const BoundedUnsignedRatio &value) noexcept
Definition boarddesignrules.h:103
void setStopMaskMaxViaDiameter(const UnsignedLength &dia) noexcept
Definition boarddesignrules.h:100
BoundedUnsignedRatio mPadAnnularRing
Definition boarddesignrules.h:161
bool getPadInnerAutoAnnularRing() const noexcept
Definition boarddesignrules.h:81
The BoundedUnsignedRatio class represents a ratio limited to a range specified by min/max values.
Definition boundedunsignedratio.h:46
The Length class is used to represent a length (for example 12.75 millimeters)
Definition length.h:82
The SExpression class.
Definition sexpression.h:69
Definition occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694