LibrePCB Developers Documentation
symbolcheckmessages.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_SYMBOLCHECKMESSAGES_H
21#define LIBREPCB_CORE_SYMBOLCHECKMESSAGES_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../rulecheck/rulecheckmessage.h"
27#include "../../types/length.h"
28
29#include <QtCore>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class Layer;
37class SymbolPin;
38class Text;
39
40/*******************************************************************************
41 * Class MsgDuplicatePinName
42 ******************************************************************************/
43
48 Q_DECLARE_TR_FUNCTIONS(MsgDuplicatePinName)
49
50public:
51 // Constructors / Destructor
53 explicit MsgDuplicatePinName(const SymbolPin& pin) noexcept;
55 : RuleCheckMessage(other) {}
56 virtual ~MsgDuplicatePinName() noexcept {}
57};
58
59/*******************************************************************************
60 * Class MsgMissingSymbolName
61 ******************************************************************************/
62
67 Q_DECLARE_TR_FUNCTIONS(MsgMissingSymbolName)
68
69public:
70 // Constructors / Destructor
71 MsgMissingSymbolName() noexcept;
73 : RuleCheckMessage(other) {}
74 virtual ~MsgMissingSymbolName() noexcept {}
75};
76
77/*******************************************************************************
78 * Class MsgMissingSymbolValue
79 ******************************************************************************/
80
85 Q_DECLARE_TR_FUNCTIONS(MsgMissingSymbolValue)
86
87public:
88 // Constructors / Destructor
89 MsgMissingSymbolValue() noexcept;
91 : RuleCheckMessage(other) {}
92 virtual ~MsgMissingSymbolValue() noexcept {}
93};
94
95/*******************************************************************************
96 * Class MsgNonFunctionalSymbolPinInversionSign
97 ******************************************************************************/
98
103 Q_DECLARE_TR_FUNCTIONS(MsgNonFunctionalSymbolPinInversionSign)
104
105public:
106 // Constructors / Destructor
109 std::shared_ptr<const SymbolPin> pin) noexcept;
111 const MsgNonFunctionalSymbolPinInversionSign& other) noexcept
112 : RuleCheckMessage(other), mPin(other.mPin) {}
114
115 // Getters
116 const std::shared_ptr<const SymbolPin>& getPin() const noexcept {
117 return mPin;
118 }
119
120private:
121 std::shared_ptr<const SymbolPin> mPin;
122};
123
124/*******************************************************************************
125 * Class MsgSymbolOriginNotInCenter
126 ******************************************************************************/
127
132 Q_DECLARE_TR_FUNCTIONS(MsgSymbolOriginNotInCenter)
133
134public:
135 // Constructors / Destructor
137 explicit MsgSymbolOriginNotInCenter(const Point& center) noexcept;
139 : RuleCheckMessage(other), mCenter(other.mCenter) {}
140 virtual ~MsgSymbolOriginNotInCenter() noexcept {}
141
142 // Getters
143 const Point& getCenter() const noexcept { return mCenter; }
144
145private:
147};
148
149/*******************************************************************************
150 * Class MsgOverlappingSymbolPins
151 ******************************************************************************/
152
157 Q_DECLARE_TR_FUNCTIONS(MsgOverlappingSymbolPins)
158
159public:
160 // Constructors / Destructor
163 QVector<std::shared_ptr<const SymbolPin>> pins) noexcept;
165 : RuleCheckMessage(other), mPins(other.mPins) {}
166 virtual ~MsgOverlappingSymbolPins() noexcept {}
167
168 // Getters
169 const QVector<std::shared_ptr<const SymbolPin>>& getPins() const noexcept {
170 return mPins;
171 }
172
173private:
174 static QString buildMessage(
175 const QVector<std::shared_ptr<const SymbolPin>>& pins) noexcept;
176
177private: // Data
178 QVector<std::shared_ptr<const SymbolPin>> mPins;
179};
180
181/*******************************************************************************
182 * Class MsgSymbolPinNotOnGrid
183 ******************************************************************************/
184
189 Q_DECLARE_TR_FUNCTIONS(MsgSymbolPinNotOnGrid)
190
191public:
192 // Constructors / Destructor
194 MsgSymbolPinNotOnGrid(std::shared_ptr<const SymbolPin> pin,
195 const PositiveLength& gridInterval) noexcept;
197 : RuleCheckMessage(other),
198 mPin(other.mPin),
199 mGridInterval(other.mGridInterval) {}
200 virtual ~MsgSymbolPinNotOnGrid() noexcept {}
201
202 // Getters
203 const std::shared_ptr<const SymbolPin>& getPin() const noexcept {
204 return mPin;
205 }
206 const PositiveLength& getGridInterval() const noexcept {
207 return mGridInterval;
208 }
209
210private:
211 std::shared_ptr<const SymbolPin> mPin;
213};
214
215/*******************************************************************************
216 * Class MsgWrongSymbolTextLayer
217 ******************************************************************************/
218
223 Q_DECLARE_TR_FUNCTIONS(MsgWrongSymbolTextLayer)
224
225public:
226 // Constructors / Destructor
228 MsgWrongSymbolTextLayer(std::shared_ptr<const Text> text,
229 const Layer& expectedLayer) noexcept;
231 : RuleCheckMessage(other),
232 mText(other.mText),
233 mExpectedLayer(other.mExpectedLayer) {}
234 virtual ~MsgWrongSymbolTextLayer() noexcept {}
235
236 // Getters
237 std::shared_ptr<const Text> getText() const noexcept { return mText; }
238 const Layer& getExpectedLayer() const noexcept { return *mExpectedLayer; }
239
240private:
241 std::shared_ptr<const Text> mText;
243};
244
245/*******************************************************************************
246 * End of File
247 ******************************************************************************/
248
249} // namespace librepcb
250
251#endif
The Layer class provides all supported geometry layers.
Definition: layer.h:42
The MsgDuplicatePinName class.
Definition: symbolcheckmessages.h:47
MsgDuplicatePinName(const MsgDuplicatePinName &other) noexcept
Definition: symbolcheckmessages.h:54
virtual ~MsgDuplicatePinName() noexcept
Definition: symbolcheckmessages.h:56
The MsgMissingSymbolName class.
Definition: symbolcheckmessages.h:66
MsgMissingSymbolName(const MsgMissingSymbolName &other) noexcept
Definition: symbolcheckmessages.h:72
virtual ~MsgMissingSymbolName() noexcept
Definition: symbolcheckmessages.h:74
MsgMissingSymbolName() noexcept
Definition: symbolcheckmessages.cpp:55
The MsgMissingSymbolValue class.
Definition: symbolcheckmessages.h:84
virtual ~MsgMissingSymbolValue() noexcept
Definition: symbolcheckmessages.h:92
MsgMissingSymbolValue(const MsgMissingSymbolValue &other) noexcept
Definition: symbolcheckmessages.h:90
MsgMissingSymbolValue() noexcept
Definition: symbolcheckmessages.cpp:69
The MsgNonFunctionalSymbolPinInversionSign class.
Definition: symbolcheckmessages.h:102
virtual ~MsgNonFunctionalSymbolPinInversionSign() noexcept
Definition: symbolcheckmessages.h:113
MsgNonFunctionalSymbolPinInversionSign(const MsgNonFunctionalSymbolPinInversionSign &other) noexcept
Definition: symbolcheckmessages.h:110
std::shared_ptr< const SymbolPin > mPin
Definition: symbolcheckmessages.h:121
const std::shared_ptr< const SymbolPin > & getPin() const noexcept
Definition: symbolcheckmessages.h:116
The MsgOverlappingSymbolPins class.
Definition: symbolcheckmessages.h:156
const QVector< std::shared_ptr< const SymbolPin > > & getPins() const noexcept
Definition: symbolcheckmessages.h:169
QVector< std::shared_ptr< const SymbolPin > > mPins
Definition: symbolcheckmessages.h:178
virtual ~MsgOverlappingSymbolPins() noexcept
Definition: symbolcheckmessages.h:166
MsgOverlappingSymbolPins(const MsgOverlappingSymbolPins &other) noexcept
Definition: symbolcheckmessages.h:164
static QString buildMessage(const QVector< std::shared_ptr< const SymbolPin > > &pins) noexcept
Definition: symbolcheckmessages.cpp:144
The MsgSymbolOriginNotInCenter class.
Definition: symbolcheckmessages.h:131
virtual ~MsgSymbolOriginNotInCenter() noexcept
Definition: symbolcheckmessages.h:140
const Point mCenter
Definition: symbolcheckmessages.h:146
MsgSymbolOriginNotInCenter(const MsgSymbolOriginNotInCenter &other) noexcept
Definition: symbolcheckmessages.h:138
const Point & getCenter() const noexcept
Definition: symbolcheckmessages.h:143
The MsgSymbolPinNotOnGrid class.
Definition: symbolcheckmessages.h:188
virtual ~MsgSymbolPinNotOnGrid() noexcept
Definition: symbolcheckmessages.h:200
PositiveLength mGridInterval
Definition: symbolcheckmessages.h:212
const PositiveLength & getGridInterval() const noexcept
Definition: symbolcheckmessages.h:206
MsgSymbolPinNotOnGrid(const MsgSymbolPinNotOnGrid &other) noexcept
Definition: symbolcheckmessages.h:196
std::shared_ptr< const SymbolPin > mPin
Definition: symbolcheckmessages.h:211
const std::shared_ptr< const SymbolPin > & getPin() const noexcept
Definition: symbolcheckmessages.h:203
The MsgWrongSymbolTextLayer class.
Definition: symbolcheckmessages.h:222
virtual ~MsgWrongSymbolTextLayer() noexcept
Definition: symbolcheckmessages.h:234
MsgWrongSymbolTextLayer(const MsgWrongSymbolTextLayer &other) noexcept
Definition: symbolcheckmessages.h:230
const Layer & getExpectedLayer() const noexcept
Definition: symbolcheckmessages.h:238
std::shared_ptr< const Text > getText() const noexcept
Definition: symbolcheckmessages.h:237
std::shared_ptr< const Text > mText
Definition: symbolcheckmessages.h:241
const Layer * mExpectedLayer
Definition: symbolcheckmessages.h:242
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The RuleCheckMessage class.
Definition: rulecheckmessage.h:45
The SymbolPin class represents one pin of a symbol.
Definition: symbolpin.h:51
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812