40 std::vector<SCH_PIN*> pinList = aSymbol->
GetPins();
47 for(
unsigned ii = 1; ii < pinList.size(); ii++ )
52 if(
pin->GetNumber() !=
next->GetNumber() )
57 if(
pin->GetBodyStyle() != 0 &&
next->GetBodyStyle() != 0 )
59 if(
pin->GetBodyStyle() !=
next->GetBodyStyle() )
66 if(
pin->GetName() !=
"~" && !
pin->GetName().IsEmpty() )
67 pinName =
" '" +
pin->GetName() +
"'";
69 if(
next->GetName() !=
"~" && !
next->GetName().IsEmpty() )
70 nextName =
" '" +
next->GetName() +
"'";
74 if(
pin->GetUnit() == 0 ||
next->GetUnit() == 0 )
76 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
77 " conflicts with pin %s%s at location <b>(%s, %s)</b>"
78 " in %s body style." ),
91 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
92 " conflicts with pin %s%s at location <b>(%s, %s)</b>"
93 " in units %s and %s of %s body style." ),
109 if(
pin->GetUnit() == 0 ||
next->GetUnit() == 0 )
111 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
112 " conflicts with pin %s%s at location <b>(%s, %s)</b>." ),
124 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
125 " conflicts with pin %s%s at location <b>(%s, %s)</b>"
126 " in units %s and %s." ),
140 msg += wxT(
"<br><br>" );
141 aMessages.push_back( msg );
171 wxString illegal_end( wxT(
"0123456789?" ) );
172 wxUniChar last_char = reference_base.Last();
174 if( illegal_end.Find( last_char ) != wxNOT_FOUND )
176 msg.Printf(
_(
"<b>Warning: reference prefix</b><br>prefix ending by '%s' can create"
177 " issues if saved in a symbol library" ),
179 msg += wxT(
"<br><br>" );
180 aMessages.push_back( msg );
185 std::vector<SCH_PIN*> pinList = aSymbol->
GetPins();
194 const int clamped_grid_size = ( aGridForPins < min_grid_size ) ? min_grid_size : aGridForPins;
204 msg.Printf(
_(
"<b>A Power Symbol should have only one unit</b><br><br>" ) );
205 aMessages.push_back( msg );
210 msg.Printf(
_(
"<b>A Power Symbol should not have DeMorgan variants</b><br><br>" ) );
211 aMessages.push_back( msg );
214 if( pinList.size() != 1 )
216 msg.Printf(
_(
"<b>A Power Symbol should have only one pin</b><br><br>" ) );
217 aMessages.push_back( msg );
225 msg.Printf(
_(
"<b>Suspicious Power Symbol</b><br>"
226 "Only an input or output power pin has meaning<br><br>" ) );
227 aMessages.push_back( msg );
232 msg.Printf(
_(
"<b>Suspicious Power Symbol</b><br>"
233 "Invisible input power pins are no longer required<br><br>" ) );
234 aMessages.push_back( msg );
241 wxString pinName =
pin->GetName();
243 if( pinName.IsEmpty() || pinName ==
"~" )
246 pinName =
"'" + pinName +
"'";
250 && !
pin->IsVisible() )
257 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
258 " in %s body style." ),
267 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
268 " in unit %c of %s body style." ),
273 'A' +
pin->GetUnit() - 1,
281 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>." ),
289 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
295 'A' +
pin->GetUnit() - 1 );
299 msg += wxT(
"<br>" );
300 msg +=
_(
"(Hidden power pins will drive their pin names on to any connected nets.)" );
301 msg += wxT(
"<br><br>" );
302 aMessages.push_back( msg );
305 if( ( (
pin->GetPosition().x % clamped_grid_size) != 0 )
306 || ( (
pin->GetPosition().y % clamped_grid_size) != 0 ) )
315 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
316 " of %s body style." ),
325 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
326 " in unit %c of %s body style." ),
331 'A' +
pin->GetUnit() - 1,
339 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>." ),
347 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
353 'A' +
pin->GetUnit() - 1 );
357 msg += wxT(
"<br><br>" );
358 aMessages.push_back( msg );
389 msg.Printf(
_(
"<b>Graphic circle has radius = 0</b> at location <b>(%s, %s)</b>." ),
392 msg += wxT(
"<br>" );
393 aMessages.push_back( msg );
400 msg.Printf(
_(
"<b>Graphic rectangle has size 0</b> at location <b>(%s, %s)</b>." ),
403 msg += wxT(
"<br>" );
404 aMessages.push_back( msg );
constexpr EDA_IU_SCALE schIUScale
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
wxString SHAPE_T_asString() const
virtual const wxString & GetText() const
Return the string associated with the text object.
Define a library symbol object.
bool IsPower() const override
std::vector< SCH_PIN * > GetPins(int aUnit=0, int aBodyStyle=0) const
Return a list of pin object pointers from the draw item list.
bool HasAlternateBodyStyle() const override
Test if symbol has more than one body conversion type (DeMorgan).
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
SCH_FIELD & GetReferenceField() const
Return reference to the reference designator field.
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
int GetUnitCount() const override
Base class for any item which can be embedded within the SCHEMATIC container class,...
static wxString GetBodyStyleDescription(int aBodyStyle)
const wxString & GetNumber() const
VECTOR2I GetPosition() const override
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
@ ARC
use RECTANGLE instead of RECT to avoid collision in a Windows header
This file contains miscellaneous commonly used macros and functions.
#define UNIMPLEMENTED_FOR(type)
@ PT_POWER_OUT
output of a regulator: intended to be connected to power input pins
@ PT_POWER_IN
power input (GND, VCC for ICs). Must be connected to a power output.
constexpr int MilsToIU(int mils) const
static bool sort_by_pin_number(const SCH_PIN *ref, const SCH_PIN *tst)
void CheckDuplicatePins(LIB_SYMBOL *aSymbol, std::vector< wxString > &aMessages, UNITS_PROVIDER *aUnitsProvider)
void CheckLibSymbol(LIB_SYMBOL *aSymbol, std::vector< wxString > &aMessages, int aGridForPins, UNITS_PROVIDER *aUnitsProvider)
Check a lib symbol to find incorrect settings Pins not on a valid grid Pins duplicated Conflict with ...
static void CheckLibSymbolGraphics(LIB_SYMBOL *aSymbol, std::vector< wxString > &aMessages, UNITS_PROVIDER *aUnitsProvider)