LibrePCB Developers Documentation
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 SExpression;
37
38/*******************************************************************************
39 * Class BoardDesignRules
40 ******************************************************************************/
41
45class BoardDesignRules final {
46 Q_DECLARE_TR_FUNCTIONS(BoardDesignRules)
47
48public:
49 // Constructors / Destructor
50 BoardDesignRules() noexcept;
52 explicit BoardDesignRules(const SExpression& node);
53 ~BoardDesignRules() noexcept;
54
55 // Getters: Stop Mask
56 const UnsignedLength& getStopMaskMaxViaDiameter() const noexcept {
58 }
60 return mStopMaskClearance;
61 }
62
63 // Getters: Solder Paste
66 }
67
68 // Getters: Pad Annular Ring
69 bool getPadCmpSideAutoAnnularRing() const noexcept {
71 }
72 bool getPadInnerAutoAnnularRing() const noexcept {
74 }
75 const BoundedUnsignedRatio& getPadAnnularRing() const noexcept {
76 return mPadAnnularRing;
77 }
78
79 // Getters: Via Annular Ring
80 const BoundedUnsignedRatio& getViaAnnularRing() const noexcept {
81 return mViaAnnularRing;
82 }
83
84 // Setters
85 void setStopMaskMaxViaDiameter(const UnsignedLength& dia) noexcept {
87 }
88 void setStopMaskClearance(const BoundedUnsignedRatio& value) noexcept {
89 mStopMaskClearance = value;
90 }
91 void setSolderPasteClearance(const BoundedUnsignedRatio& value) noexcept {
93 }
94 void setPadCmpSideAutoAnnularRing(bool enabled) noexcept {
96 }
97 void setPadInnerAutoAnnularRing(bool enabled) noexcept {
99 }
101 mPadAnnularRing = value;
102 }
104 mViaAnnularRing = value;
105 }
106
107 // General Methods
108 void restoreDefaults() noexcept;
109
115 void serialize(SExpression& root) const;
116
117 // Helper Methods
118 bool doesViaRequireStopMaskOpening(const Length& drillDia) const noexcept;
119
120 // Operator Overloadings
121 BoardDesignRules& operator=(const BoardDesignRules& rhs) noexcept;
122 bool operator==(const BoardDesignRules& rhs) const noexcept;
123 bool operator!=(const BoardDesignRules& rhs) const noexcept {
124 return !(*this == rhs);
125 }
126
127private: // Methods
128 static bool parsePadAutoAnnular(const SExpression& node);
129
130private: // Data
131 // Stop Mask
134
135 // Solder Paste
137
138 // Pad Annular Ring
142
143 // Via Annular Ring
145};
146
147/*******************************************************************************
148 * End of File
149 ******************************************************************************/
150
151} // namespace librepcb
152
153#endif
The BoardDesignRules class.
Definition: boarddesignrules.h:45
const BoundedUnsignedRatio & getPadAnnularRing() const noexcept
Definition: boarddesignrules.h:75
UnsignedLength mStopMaskMaxViaDrillDiameter
Definition: boarddesignrules.h:132
bool getPadCmpSideAutoAnnularRing() const noexcept
Definition: boarddesignrules.h:69
void setPadInnerAutoAnnularRing(bool enabled) noexcept
Definition: boarddesignrules.h:97
const BoundedUnsignedRatio & getStopMaskClearance() const noexcept
Definition: boarddesignrules.h:59
const BoundedUnsignedRatio & getSolderPasteClearance() const noexcept
Definition: boarddesignrules.h:64
void setSolderPasteClearance(const BoundedUnsignedRatio &value) noexcept
Definition: boarddesignrules.h:91
void setPadCmpSideAutoAnnularRing(bool enabled) noexcept
Definition: boarddesignrules.h:94
BoundedUnsignedRatio mStopMaskClearance
Definition: boarddesignrules.h:133
bool mPadCmpSideAutoAnnularRing
Definition: boarddesignrules.h:139
~BoardDesignRules() noexcept
Definition: boarddesignrules.cpp:83
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition: boarddesignrules.cpp:94
static bool parsePadAutoAnnular(const SExpression &node)
Definition: boarddesignrules.cpp:176
BoundedUnsignedRatio mSolderPasteClearance
Definition: boarddesignrules.h:136
BoundedUnsignedRatio mViaAnnularRing
Percentage of the drill diameter.
Definition: boarddesignrules.h:144
const UnsignedLength & getStopMaskMaxViaDiameter() const noexcept
Definition: boarddesignrules.h:56
void setPadAnnularRing(const BoundedUnsignedRatio &value)
Definition: boarddesignrules.h:100
bool doesViaRequireStopMaskOpening(const Length &drillDia) const noexcept
Definition: boarddesignrules.cpp:130
const BoundedUnsignedRatio & getViaAnnularRing() const noexcept
Definition: boarddesignrules.h:80
BoardDesignRules() noexcept
Definition: boarddesignrules.cpp:38
void setViaAnnularRing(const BoundedUnsignedRatio &value)
Definition: boarddesignrules.h:103
void restoreDefaults() noexcept
Definition: boarddesignrules.cpp:90
bool mPadInnerAutoAnnularRing
Definition: boarddesignrules.h:140
void setStopMaskClearance(const BoundedUnsignedRatio &value) noexcept
Definition: boarddesignrules.h:88
void setStopMaskMaxViaDiameter(const UnsignedLength &dia) noexcept
Definition: boarddesignrules.h:85
BoundedUnsignedRatio mPadAnnularRing
Definition: boarddesignrules.h:141
bool getPadInnerAutoAnnularRing() const noexcept
Definition: boarddesignrules.h:72
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:83
The SExpression class.
Definition: sexpression.h:69
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696