LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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 MsgInvalidImageFile
61 ******************************************************************************/
62
67 Q_DECLARE_TR_FUNCTIONS(MsgInvalidImageFile)
68
69public:
76
77 // Constructors / Destructor
79 explicit MsgInvalidImageFile(const QString& fileName, Error error,
80 const QString& details) noexcept;
82 : RuleCheckMessage(other) {}
83 virtual ~MsgInvalidImageFile() noexcept {}
84
85private:
86 static QString buildMessagePattern(Error error) noexcept;
87 static QString buildDescription(const QString& details) noexcept;
88};
89
90/*******************************************************************************
91 * Class MsgMissingSymbolName
92 ******************************************************************************/
93
98 Q_DECLARE_TR_FUNCTIONS(MsgMissingSymbolName)
99
100public:
101 // Constructors / Destructor
102 MsgMissingSymbolName() noexcept;
104 : RuleCheckMessage(other) {}
105 virtual ~MsgMissingSymbolName() noexcept {}
106};
107
108/*******************************************************************************
109 * Class MsgMissingSymbolValue
110 ******************************************************************************/
111
116 Q_DECLARE_TR_FUNCTIONS(MsgMissingSymbolValue)
117
118public:
119 // Constructors / Destructor
120 MsgMissingSymbolValue() noexcept;
122 : RuleCheckMessage(other) {}
123 virtual ~MsgMissingSymbolValue() noexcept {}
124};
125
126/*******************************************************************************
127 * Class MsgNonFunctionalSymbolPinInversionSign
128 ******************************************************************************/
129
134 Q_DECLARE_TR_FUNCTIONS(MsgNonFunctionalSymbolPinInversionSign)
135
136public:
137 // Constructors / Destructor
140 std::shared_ptr<const SymbolPin> pin) noexcept;
145
146 // Getters
147 const std::shared_ptr<const SymbolPin>& getPin() const noexcept {
148 return mPin;
149 }
150
151private:
152 std::shared_ptr<const SymbolPin> mPin;
153};
154
155/*******************************************************************************
156 * Class MsgSymbolOriginNotInCenter
157 ******************************************************************************/
158
163 Q_DECLARE_TR_FUNCTIONS(MsgSymbolOriginNotInCenter)
164
165public:
166 // Constructors / Destructor
168 explicit MsgSymbolOriginNotInCenter(const Point& center) noexcept;
170 : RuleCheckMessage(other), mCenter(other.mCenter) {}
171 virtual ~MsgSymbolOriginNotInCenter() noexcept {}
172
173 // Getters
174 const Point& getCenter() const noexcept { return mCenter; }
175
176private:
178};
179
180/*******************************************************************************
181 * Class MsgOverlappingSymbolPins
182 ******************************************************************************/
183
188 Q_DECLARE_TR_FUNCTIONS(MsgOverlappingSymbolPins)
189
190public:
191 // Constructors / Destructor
194 QVector<std::shared_ptr<const SymbolPin>> pins) noexcept;
196 : RuleCheckMessage(other), mPins(other.mPins) {}
197 virtual ~MsgOverlappingSymbolPins() noexcept {}
198
199 // Getters
200 const QVector<std::shared_ptr<const SymbolPin>>& getPins() const noexcept {
201 return mPins;
202 }
203
204private:
205 static QString buildMessage(
206 const QVector<std::shared_ptr<const SymbolPin>>& pins) noexcept;
207
208private: // Data
209 QVector<std::shared_ptr<const SymbolPin>> mPins;
210};
211
212/*******************************************************************************
213 * Class MsgSymbolPinNotOnGrid
214 ******************************************************************************/
215
220 Q_DECLARE_TR_FUNCTIONS(MsgSymbolPinNotOnGrid)
221
222public:
223 // Constructors / Destructor
225 MsgSymbolPinNotOnGrid(std::shared_ptr<const SymbolPin> pin,
226 const PositiveLength& gridInterval) noexcept;
228 : RuleCheckMessage(other),
229 mPin(other.mPin),
230 mGridInterval(other.mGridInterval) {}
231 virtual ~MsgSymbolPinNotOnGrid() noexcept {}
232
233 // Getters
234 const std::shared_ptr<const SymbolPin>& getPin() const noexcept {
235 return mPin;
236 }
237 const PositiveLength& getGridInterval() const noexcept {
238 return mGridInterval;
239 }
240
241private:
242 std::shared_ptr<const SymbolPin> mPin;
244};
245
246/*******************************************************************************
247 * Class MsgWrongSymbolTextLayer
248 ******************************************************************************/
249
254 Q_DECLARE_TR_FUNCTIONS(MsgWrongSymbolTextLayer)
255
256public:
257 // Constructors / Destructor
259 MsgWrongSymbolTextLayer(std::shared_ptr<const Text> text,
260 const Layer& expectedLayer) noexcept;
262 : RuleCheckMessage(other),
263 mText(other.mText),
264 mExpectedLayer(other.mExpectedLayer) {}
265 virtual ~MsgWrongSymbolTextLayer() noexcept {}
266
267 // Getters
268 std::shared_ptr<const Text> getText() const noexcept { return mText; }
269 const Layer& getExpectedLayer() const noexcept { return *mExpectedLayer; }
270
271private:
272 std::shared_ptr<const Text> mText;
274};
275
276/*******************************************************************************
277 * End of File
278 ******************************************************************************/
279
280} // namespace librepcb
281
282#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 MsgInvalidImageFile class.
Definition symbolcheckmessages.h:66
static QString buildDescription(const QString &details) noexcept
Definition symbolcheckmessages.cpp:72
Error
Definition symbolcheckmessages.h:70
MsgInvalidImageFile(const MsgInvalidImageFile &other) noexcept
Definition symbolcheckmessages.h:81
virtual ~MsgInvalidImageFile() noexcept
Definition symbolcheckmessages.h:83
static QString buildMessagePattern(Error error) noexcept
Definition symbolcheckmessages.cpp:62
The MsgMissingSymbolName class.
Definition symbolcheckmessages.h:97
MsgMissingSymbolName(const MsgMissingSymbolName &other) noexcept
Definition symbolcheckmessages.h:103
virtual ~MsgMissingSymbolName() noexcept
Definition symbolcheckmessages.h:105
MsgMissingSymbolName() noexcept
Definition symbolcheckmessages.cpp:87
The MsgMissingSymbolValue class.
Definition symbolcheckmessages.h:115
virtual ~MsgMissingSymbolValue() noexcept
Definition symbolcheckmessages.h:123
MsgMissingSymbolValue(const MsgMissingSymbolValue &other) noexcept
Definition symbolcheckmessages.h:121
MsgMissingSymbolValue() noexcept
Definition symbolcheckmessages.cpp:101
The MsgNonFunctionalSymbolPinInversionSign class.
Definition symbolcheckmessages.h:133
virtual ~MsgNonFunctionalSymbolPinInversionSign() noexcept
Definition symbolcheckmessages.h:144
MsgNonFunctionalSymbolPinInversionSign(const MsgNonFunctionalSymbolPinInversionSign &other) noexcept
Definition symbolcheckmessages.h:141
std::shared_ptr< const SymbolPin > mPin
Definition symbolcheckmessages.h:152
const std::shared_ptr< const SymbolPin > & getPin() const noexcept
Definition symbolcheckmessages.h:147
The MsgOverlappingSymbolPins class.
Definition symbolcheckmessages.h:187
const QVector< std::shared_ptr< const SymbolPin > > & getPins() const noexcept
Definition symbolcheckmessages.h:200
QVector< std::shared_ptr< const SymbolPin > > mPins
Definition symbolcheckmessages.h:209
virtual ~MsgOverlappingSymbolPins() noexcept
Definition symbolcheckmessages.h:197
MsgOverlappingSymbolPins(const MsgOverlappingSymbolPins &other) noexcept
Definition symbolcheckmessages.h:195
static QString buildMessage(const QVector< std::shared_ptr< const SymbolPin > > &pins) noexcept
Definition symbolcheckmessages.cpp:176
The MsgSymbolOriginNotInCenter class.
Definition symbolcheckmessages.h:162
virtual ~MsgSymbolOriginNotInCenter() noexcept
Definition symbolcheckmessages.h:171
const Point mCenter
Definition symbolcheckmessages.h:177
MsgSymbolOriginNotInCenter(const MsgSymbolOriginNotInCenter &other) noexcept
Definition symbolcheckmessages.h:169
const Point & getCenter() const noexcept
Definition symbolcheckmessages.h:174
The MsgSymbolPinNotOnGrid class.
Definition symbolcheckmessages.h:219
virtual ~MsgSymbolPinNotOnGrid() noexcept
Definition symbolcheckmessages.h:231
PositiveLength mGridInterval
Definition symbolcheckmessages.h:243
const PositiveLength & getGridInterval() const noexcept
Definition symbolcheckmessages.h:237
MsgSymbolPinNotOnGrid(const MsgSymbolPinNotOnGrid &other) noexcept
Definition symbolcheckmessages.h:227
std::shared_ptr< const SymbolPin > mPin
Definition symbolcheckmessages.h:242
const std::shared_ptr< const SymbolPin > & getPin() const noexcept
Definition symbolcheckmessages.h:234
The MsgWrongSymbolTextLayer class.
Definition symbolcheckmessages.h:253
virtual ~MsgWrongSymbolTextLayer() noexcept
Definition symbolcheckmessages.h:265
MsgWrongSymbolTextLayer(const MsgWrongSymbolTextLayer &other) noexcept
Definition symbolcheckmessages.h:261
const Layer & getExpectedLayer() const noexcept
Definition symbolcheckmessages.h:269
std::shared_ptr< const Text > getText() const noexcept
Definition symbolcheckmessages.h:268
std::shared_ptr< const Text > mText
Definition symbolcheckmessages.h:272
const Layer * mExpectedLayer
Definition symbolcheckmessages.h:273
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
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:810