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 );
175 wxString illegal_end( wxT(
"0123456789?" ) );
176 wxUniChar last_char = reference_base.Last();
178 if( illegal_end.Find( last_char ) != wxNOT_FOUND )
180 msg.Printf(
_(
"<b>Warning: reference prefix</b><br>prefix ending by '%s' can create"
181 " issues if saved in a symbol library" ),
183 msg += wxT(
"<br><br>" );
184 aMessages.push_back( msg );
189 std::vector<SCH_PIN*> pinList = aSymbol->
GetPins();
198 const int clamped_grid_size = ( aGridForPins < min_grid_size ) ? min_grid_size : aGridForPins;
208 msg.Printf(
_(
"<b>A Power Symbol should have only one unit</b><br><br>" ) );
209 aMessages.push_back( msg );
214 msg.Printf(
_(
"<b>A Power Symbol should not have DeMorgan variants</b><br><br>" ) );
215 aMessages.push_back( msg );
218 if( pinList.size() != 1 )
220 msg.Printf(
_(
"<b>A Power Symbol should have only one pin</b><br><br>" ) );
221 aMessages.push_back( msg );
229 msg.Printf(
_(
"<b>Suspicious Power Symbol</b><br>"
230 "Only an input or output power pin has meaning<br><br>" ) );
231 aMessages.push_back( msg );
236 msg.Printf(
_(
"<b>Suspicious Power Symbol</b><br>"
237 "Invisible input power pins are no longer required<br><br>" ) );
238 aMessages.push_back( msg );
245 wxString pinName =
pin->GetName();
247 if( pinName.IsEmpty() || pinName ==
"~" )
250 pinName =
"'" + pinName +
"'";
254 && !
pin->IsVisible() )
261 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
262 " in %s body style." ),
271 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
272 " in unit %c of %s body style." ),
277 'A' +
pin->GetUnit() - 1,
285 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>"
294 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
300 'A' +
pin->GetUnit() - 1 );
304 msg += wxT(
"<br>" );
305 msg +=
_(
"(Hidden power pins will drive their pin names on to any connected nets.)" );
306 msg += wxT(
"<br><br>" );
307 aMessages.push_back( msg );
310 if( ( (
pin->GetPosition().x % clamped_grid_size) != 0 )
311 || ( (
pin->GetPosition().y % clamped_grid_size) != 0 ) )
320 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
321 " of %s body style." ),
330 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
331 " in unit %c of %s body style." ),
336 'A' +
pin->GetUnit() - 1,
344 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>." ),
352 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
358 'A' +
pin->GetUnit() - 1 );
362 msg += wxT(
"<br><br>" );
363 aMessages.push_back( msg );
394 msg.Printf(
_(
"<b>Graphic circle has radius = 0</b> at location "
395 "<b>(%s, %s)</b>." ),
398 msg += wxT(
"<br>" );
399 aMessages.push_back( msg );
406 msg.Printf(
_(
"<b>Graphic rectangle has size 0</b> at location <b>(%s, %s)</b>." ),
409 msg += wxT(
"<br>" );
410 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.
wxString GetUnitReference(int aUnit) override
Return an identifier for aUnit for symbols with units.
bool IsGlobalPower() const override
int GetUnitCount() const override
SCH_FIELD & GetReferenceField()
Return reference to the reference designator field.
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().
@ 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)