56 wxString illegal_end( wxT(
"0123456789?" ) );
57 wxUniChar last_char = reference_base.Last();
59 if( illegal_end.Find( last_char ) != wxNOT_FOUND )
61 msg.Printf(
_(
"<b>Warning: reference prefix</b><br>prefix ending by '%s' can create"
62 " issues if saved in a symbol library" ),
64 msg += wxT(
"<br><br>" );
65 aMessages.push_back( msg );
82 const int clamped_grid_size = ( aGridForPins < min_grid_size ) ? min_grid_size : aGridForPins;
84 for(
unsigned ii = 1; ii < pinList.size(); ii++ )
89 if(
pin->GetNumber() !=
next->GetNumber() )
94 if(
pin->GetConvert() != 0 &&
next->GetConvert() != 0 )
96 if(
pin->GetConvert() !=
next->GetConvert() )
103 if(
pin->GetName() !=
"~" && !
pin->GetName().IsEmpty() )
104 pinName =
" '" +
pin->GetName() +
"'";
106 if(
next->GetName() !=
"~" && !
next->GetName().IsEmpty() )
107 nextName =
" '" +
next->GetName() +
"'";
111 if(
pin->GetUnit() == 0 ||
next->GetUnit() == 0 )
113 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%.3f, %.3f)</b>"
114 " conflicts with pin %s%s at location <b>(%.3f, %.3f)</b>"
127 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%.3f, %.3f)</b>"
128 " conflicts with pin %s%s at location <b>(%.3f, %.3f)</b>"
129 " in units %s and %s of converted." ),
144 if(
pin->GetUnit() == 0 ||
next->GetUnit() == 0 )
146 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
147 " conflicts with pin %s%s at location <b>(%s, %s)</b>." ),
159 msg.Printf(
_(
"<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
160 " conflicts with pin %s%s at location <b>(%s, %s)</b>"
161 " in units %s and %s." ),
175 msg += wxT(
"<br><br>" );
176 aMessages.push_back( msg );
187 msg.Printf(
_(
"<b>A Power Symbol should have only one unit</b><br><br>" ) );
188 aMessages.push_back( msg );
193 msg.Printf(
_(
"<b>A Power Symbol should have no convert option</b><br><br>" ) );
194 aMessages.push_back( msg );
197 if( pinList.size() != 1 )
199 msg.Printf(
_(
"<b>A Power Symbol should have only one pin</b><br><br>" ) );
200 aMessages.push_back( msg );
208 msg.Printf(
_(
"<b>Suspicious Power Symbol</b><br>"
209 "Only an input or output power pin has meaning<br><br>" ) );
210 aMessages.push_back( msg );
215 msg.Printf(
_(
"<b>Suspicious Power Symbol</b><br>"
216 "Invisible input power pins are no longer required<br><br>" ) );
217 aMessages.push_back( msg );
224 wxString pinName =
pin->GetName();
226 if( pinName.IsEmpty() || pinName ==
"~" )
229 pinName =
"'" + pinName +
"'";
233 && !
pin->IsVisible() )
240 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
249 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
250 " in unit %c of converted." ),
255 'A' +
pin->GetUnit() - 1 );
262 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>." ),
270 msg.Printf(
_(
"Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
276 'A' +
pin->GetUnit() - 1 );
280 msg += wxT(
"<br>" );
281 msg +=
_(
"(Hidden power pins will drive their pin names on to any connected nets.)" );
282 msg += wxT(
"<br><br>" );
283 aMessages.push_back( msg );
286 if( ( (
pin->GetPosition().x % clamped_grid_size) != 0 )
287 || ( (
pin->GetPosition().y % clamped_grid_size) != 0 ) )
294 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
303 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%.3s, %.3s)</b>"
304 " in unit %c of converted." ),
309 'A' +
pin->GetUnit() - 1 );
316 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>." ),
324 msg.Printf(
_(
"<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
330 'A' +
pin->GetUnit() - 1 );
334 msg += wxT(
"<br><br>" );
335 aMessages.push_back( msg );
constexpr EDA_IU_SCALE schIUScale
The base class for create windows for drawing purpose.
virtual const wxString & GetText() const
Return the string associated with the text object.
const wxString & GetNumber() const
Define a library symbol object.
LIB_FIELD & GetReferenceField()
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
For items with units, return the number of units.
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0) const
Return a list of pin object pointers from the draw item list.
bool HasConversion() const
Test if symbol has more than one body conversion type (DeMorgan).
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
@ 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
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 ...
static bool sort_by_pin_number(const LIB_PIN *ref, const LIB_PIN *tst)