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 MsgOverlappingSymbolPins
126 ******************************************************************************/
127
132 Q_DECLARE_TR_FUNCTIONS(MsgOverlappingSymbolPins)
133
134public:
135 // Constructors / Destructor
138 QVector<std::shared_ptr<const SymbolPin>> pins) noexcept;
140 : RuleCheckMessage(other), mPins(other.mPins) {}
141 virtual ~MsgOverlappingSymbolPins() noexcept {}
142
143 // Getters
144 const QVector<std::shared_ptr<const SymbolPin>>& getPins() const noexcept {
145 return mPins;
146 }
147
148private:
149 static QString buildMessage(
150 const QVector<std::shared_ptr<const SymbolPin>>& pins) noexcept;
151
152private: // Data
153 QVector<std::shared_ptr<const SymbolPin>> mPins;
154};
155
156/*******************************************************************************
157 * Class MsgSymbolPinNotOnGrid
158 ******************************************************************************/
159
164 Q_DECLARE_TR_FUNCTIONS(MsgSymbolPinNotOnGrid)
165
166public:
167 // Constructors / Destructor
169 MsgSymbolPinNotOnGrid(std::shared_ptr<const SymbolPin> pin,
170 const PositiveLength& gridInterval) noexcept;
172 : RuleCheckMessage(other),
173 mPin(other.mPin),
174 mGridInterval(other.mGridInterval) {}
175 virtual ~MsgSymbolPinNotOnGrid() noexcept {}
176
177 // Getters
178 const std::shared_ptr<const SymbolPin>& getPin() const noexcept {
179 return mPin;
180 }
181 const PositiveLength& getGridInterval() const noexcept {
182 return mGridInterval;
183 }
184
185private:
186 std::shared_ptr<const SymbolPin> mPin;
188};
189
190/*******************************************************************************
191 * Class MsgWrongSymbolTextLayer
192 ******************************************************************************/
193
198 Q_DECLARE_TR_FUNCTIONS(MsgWrongSymbolTextLayer)
199
200public:
201 // Constructors / Destructor
203 MsgWrongSymbolTextLayer(std::shared_ptr<const Text> text,
204 const Layer& expectedLayer) noexcept;
206 : RuleCheckMessage(other),
207 mText(other.mText),
208 mExpectedLayer(other.mExpectedLayer) {}
209 virtual ~MsgWrongSymbolTextLayer() noexcept {}
210
211 // Getters
212 std::shared_ptr<const Text> getText() const noexcept { return mText; }
213 const Layer& getExpectedLayer() const noexcept { return *mExpectedLayer; }
214
215private:
216 std::shared_ptr<const Text> mText;
218};
219
220/*******************************************************************************
221 * End of File
222 ******************************************************************************/
223
224} // namespace librepcb
225
226#endif
The Layer class provides all supported geometry layers.
Definition: layer.h:40
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:131
const QVector< std::shared_ptr< const SymbolPin > > & getPins() const noexcept
Definition: symbolcheckmessages.h:144
QVector< std::shared_ptr< const SymbolPin > > mPins
Definition: symbolcheckmessages.h:153
virtual ~MsgOverlappingSymbolPins() noexcept
Definition: symbolcheckmessages.h:141
MsgOverlappingSymbolPins(const MsgOverlappingSymbolPins &other) noexcept
Definition: symbolcheckmessages.h:139
static QString buildMessage(const QVector< std::shared_ptr< const SymbolPin > > &pins) noexcept
Definition: symbolcheckmessages.cpp:126
The MsgSymbolPinNotOnGrid class.
Definition: symbolcheckmessages.h:163
virtual ~MsgSymbolPinNotOnGrid() noexcept
Definition: symbolcheckmessages.h:175
PositiveLength mGridInterval
Definition: symbolcheckmessages.h:187
const PositiveLength & getGridInterval() const noexcept
Definition: symbolcheckmessages.h:181
MsgSymbolPinNotOnGrid(const MsgSymbolPinNotOnGrid &other) noexcept
Definition: symbolcheckmessages.h:171
std::shared_ptr< const SymbolPin > mPin
Definition: symbolcheckmessages.h:186
const std::shared_ptr< const SymbolPin > & getPin() const noexcept
Definition: symbolcheckmessages.h:178
The MsgWrongSymbolTextLayer class.
Definition: symbolcheckmessages.h:197
virtual ~MsgWrongSymbolTextLayer() noexcept
Definition: symbolcheckmessages.h:209
MsgWrongSymbolTextLayer(const MsgWrongSymbolTextLayer &other) noexcept
Definition: symbolcheckmessages.h:205
const Layer & getExpectedLayer() const noexcept
Definition: symbolcheckmessages.h:213
std::shared_ptr< const Text > getText() const noexcept
Definition: symbolcheckmessages.h:212
std::shared_ptr< const Text > mText
Definition: symbolcheckmessages.h:216
const Layer * mExpectedLayer
Definition: symbolcheckmessages.h:217
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