61 wxString illegal_end( wxT(
"0123456789?" ) );
62 wxUniChar last_char = reference_base.Last();
64 if( illegal_end.Find( last_char ) != wxNOT_FOUND )
66 msg.Printf(
_(
"<b>Warning: reference prefix</b><br>prefix ending by '%s' can create"
67 " issues if saved in a symbol library" ),
69 msg += wxT(
"<br><br>" );
70 aMessages.push_back( msg );
73 std::vector<SCH_PIN*> pinList = aSymbol->
GetPins();
86 const int clamped_grid_size = ( aGridForPins < min_grid_size ) ? min_grid_size : aGridForPins;
88 for(
unsigned ii = 1; ii < pinList.size(); ii++ )
93 if(
pin->GetNumber() !=
next->GetNumber() )
98 if(
pin->GetBodyStyle() != 0 &&
next->GetBodyStyle() != 0 )
100 if(
pin->GetBodyStyle() !=
next->GetBodyStyle() )
107 if(
pin->GetName() !=
"~" && !
pin->GetName().IsEmpty() )
108 pinName =
" '" +
pin->GetName() +
"'";
110 if(
next->GetName() !=
"~" && !
next->GetName().IsEmpty() )
111 nextName =
" '" +
next->GetName() +
"'";
115 if(
pin->GetUnit() == 0 ||
next->GetUnit() == 0 )
117 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
118 " conflicts with pin %s%s at location <b>(%s, %s)</b>"
119 " in %s body style." ),
132 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
133 " conflicts with pin %s%s at location <b>(%s, %s)</b>"
134 " in units %s and %s of %s body style." ),
150 if(
pin->GetUnit() == 0 ||
next->GetUnit() == 0 )
152 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
153 " conflicts with pin %s%s at location <b>(%s, %s)</b>." ),
165 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
166 " conflicts with pin %s%s at location <b>(%s, %s)</b>"
167 " in units %s and %s." ),
181 msg += wxT(
"<br><br>" );
182 aMessages.push_back( msg );
193 msg.Printf(
_(
"<b>A Power Symbol should have only one unit</b><br><br>" ) );
194 aMessages.push_back( msg );
199 msg.Printf(
_(
"<b>A Power Symbol should not have DeMorgan variants</b><br><br>" ) );
200 aMessages.push_back( msg );
203 if( pinList.size() != 1 )
205 msg.Printf(
_(
"<b>A Power Symbol should have only one pin</b><br><br>" ) );
206 aMessages.push_back( msg );
214 msg.Printf(
_(
"<b>Suspicious Power Symbol</b><br>"
215 "Only an input or output power pin has meaning<br><br>" ) );
216 aMessages.push_back( msg );
221 msg.Printf(
_(
"<b>Suspicious Power Symbol</b><br>"
222 "Invisible input power pins are no longer required<br><br>" ) );
223 aMessages.push_back( msg );
230 wxString pinName =
pin->GetName();
232 if( pinName.IsEmpty() || pinName ==
"~" )
235 pinName =
"'" + pinName +
"'";
239 && !
pin->IsVisible() )
246 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
247 " in %s body style." ),
256 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
257 " in unit %c of %s body style." ),
262 'A' +
pin->GetUnit() - 1,
270 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>." ),
278 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
284 'A' +
pin->GetUnit() - 1 );
288 msg += wxT(
"<br>" );
289 msg +=
_(
"(Hidden power pins will drive their pin names on to any connected nets.)" );
290 msg += wxT(
"<br><br>" );
291 aMessages.push_back( msg );
294 if( ( (
pin->GetPosition().x % clamped_grid_size) != 0 )
295 || ( (
pin->GetPosition().y % clamped_grid_size) != 0 ) )
304 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
305 " of %s body style." ),
314 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
315 " in unit %c of %s body style." ),
320 'A' +
pin->GetUnit() - 1,
328 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>." ),
336 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
342 'A' +
pin->GetUnit() - 1 );
346 msg += wxT(
"<br><br>" );
347 aMessages.push_back( msg );
378 msg.Printf(
_(
"<b>Graphic circle has radius = 0</b> at location <b>(%s, %s)</b>." ),
381 msg += wxT(
"<br>" );
382 aMessages.push_back( msg );
389 msg.Printf(
_(
"<b>Graphic rectangle has size 0</b> at location <b>(%s, %s)</b>." ),
392 msg += wxT(
"<br>" );
393 aMessages.push_back( msg );
constexpr EDA_IU_SCALE schIUScale
The base class for create windows for drawing purpose.
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)
static void CheckLibSymbolGraphics(LIB_SYMBOL *aSymbol, std::vector< wxString > &aMessages, EDA_DRAW_FRAME *aUnitsProvider)
void CheckLibSymbol(LIB_SYMBOL *aSymbol, std::vector< wxString > &aMessages, int aGridForPins, EDA_DRAW_FRAME *aUnitsProvider)
Check a lib symbol to find incorrect settings Pins not on a valid grid Pins duplicated Conflict with ...