42 std::vector<SCH_PIN*> pinList = aSymbol->
GetPins();
49 for(
unsigned ii = 1; ii < pinList.size(); ii++ )
54 if(
pin->GetNumber() !=
next->GetNumber() )
59 if(
pin->GetBodyStyle() != 0 &&
next->GetBodyStyle() != 0 )
61 if(
pin->GetBodyStyle() !=
next->GetBodyStyle() )
68 if( !
pin->GetName().IsEmpty() )
69 pinName =
" '" +
pin->GetName() +
"'";
71 if( !
next->GetName().IsEmpty() )
72 nextName =
" '" +
next->GetName() +
"'";
76 if(
pin->GetUnit() == 0 ||
next->GetUnit() == 0 )
78 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
79 " conflicts with pin %s%s at location <b>(%s, %s)</b>"
80 " in %s body style." ),
93 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
94 " conflicts with pin %s%s at location <b>(%s, %s)</b>"
95 " in units %s and %s of %s body style." ),
111 if(
pin->GetUnit() == 0 ||
next->GetUnit() == 0 )
113 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
114 " conflicts with pin %s%s at location <b>(%s, %s)</b>." ),
126 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
127 " conflicts with pin %s%s at location <b>(%s, %s)</b>"
128 " in units %s and %s." ),
142 msg += wxT(
"<br><br>" );
143 aMessages.push_back( msg );
176 if( reference_base.IsEmpty() )
178 aMessages.push_back(
_(
"<b>Warning: reference is empty</b><br><br>" ) );
182 wxString illegal_end( wxT(
"0123456789?" ) );
183 wxUniChar last_char = reference_base.Last();
185 if( illegal_end.Find( last_char ) != wxNOT_FOUND )
187 msg.Printf(
_(
"<b>Warning: reference prefix</b><br>prefix ending by '%s' can create"
188 " issues if saved in a symbol library" ),
190 msg += wxT(
"<br><br>" );
191 aMessages.push_back( msg );
197 std::vector<SCH_PIN*> pinList = aSymbol->
GetPins();
206 const int clamped_grid_size = ( aGridForPins < min_grid_size ) ? min_grid_size : aGridForPins;
216 msg.Printf(
_(
"<b>A Power Symbol should have only one unit</b><br><br>" ) );
217 aMessages.push_back( msg );
222 msg.Printf(
_(
"<b>A Power Symbol should not have DeMorgan variants</b><br><br>" ) );
223 aMessages.push_back( msg );
226 if( pinList.size() != 1 )
228 msg.Printf(
_(
"<b>A Power Symbol should have only one pin</b><br><br>" ) );
229 aMessages.push_back( msg );
237 msg.Printf(
_(
"<b>Suspicious Power Symbol</b><br>"
238 "Only an input or output power pin has meaning<br><br>" ) );
239 aMessages.push_back( msg );
244 msg.Printf(
_(
"<b>Suspicious Power Symbol</b><br>"
245 "Invisible input power pins are no longer required<br><br>" ) );
246 aMessages.push_back( msg );
253 wxString pinName =
pin->GetName();
255 if( pinName.IsEmpty() || pinName ==
"~" )
258 pinName =
"'" + pinName +
"'";
262 && !
pin->IsVisible() )
269 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
270 " in %s body style." ),
279 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
280 " in unit %c of %s body style." ),
285 'A' +
pin->GetUnit() - 1,
293 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>"
302 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
308 'A' +
pin->GetUnit() - 1 );
312 msg += wxT(
"<br>" );
313 msg +=
_(
"(Hidden power pins will drive their pin names on to any connected nets.)" );
314 msg += wxT(
"<br><br>" );
315 aMessages.push_back( msg );
318 if( ( (
pin->GetPosition().x % clamped_grid_size) != 0 )
319 || ( (
pin->GetPosition().y % clamped_grid_size) != 0 ) )
328 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
329 " of %s body style." ),
338 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
339 " in unit %c of %s body style." ),
344 'A' +
pin->GetUnit() - 1,
352 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>." ),
360 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
366 'A' +
pin->GetUnit() - 1 );
370 msg += wxT(
"<br><br>" );
371 aMessages.push_back( msg );
402 msg.Printf(
_(
"<b>Graphic circle has radius = 0</b> at location "
403 "<b>(%s, %s)</b>." ),
406 msg += wxT(
"<br>" );
407 aMessages.push_back( msg );
414 msg.Printf(
_(
"<b>Graphic rectangle has size 0</b> at location <b>(%s, %s)</b>." ),
417 msg += wxT(
"<br>" );
418 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.
std::vector< SCH_PIN * > GetPins(int aUnit, int aBodyStyle) const
Return a list of pin object pointers from the draw item list.
bool IsPower() const override
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.
bool IsGlobalPower() const override
wxString GetBodyStyleDescription(int aBodyStyle, bool aLabel) const override
int GetUnitCount() const override
wxString GetUnitDisplayName(int aUnit, bool aLabel) const override
Return the user-defined display name for aUnit for symbols with units.
SCH_FIELD & GetReferenceField()
Return reference to the reference designator field.
Base class for any item which can be embedded within the SCHEMATIC container class,...
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().
@ RECTANGLE
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 library symbol to find incorrect settings.
static void CheckLibSymbolGraphics(LIB_SYMBOL *aSymbol, std::vector< wxString > &aMessages, UNITS_PROVIDER *aUnitsProvider)