KiCad PCB EDA Suite
Loading...
Searching...
No Matches
symbol_checker.cpp File Reference
#include <vector>
#include <sch_symbol.h>
#include <eda_draw_frame.h>
#include <lib_shape.h>
#include <macros.h>

Go to the source code of this file.

Functions

static bool sort_by_pin_number (const LIB_PIN *ref, const LIB_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 pins at same location Incorrect Power Symbols illegal reference prefix (cannot ends by a digit or a '?') More...
 

Function Documentation

◆ CheckLibSymbol()

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 pins at same location Incorrect Power Symbols illegal reference prefix (cannot ends by a digit or a '?')

Parameters
aSymbolis the library symbol to check
aMessagesis a room to store error messages
aGridForPins(in IU) is the grid to test pin positions ( >= 25 mils ) should be 25, 50 or 100 mils (convered to IUs)
aUnitsProvidera frame to format coordinates in messages

Definition at line 49 of file symbol_checker.cpp.

References _, CheckLibSymbolGraphics(), LIB_ITEM::GetBodyStyleDescription(), LIB_SYMBOL::GetPins(), LIB_SYMBOL::GetReferenceField(), EDA_TEXT::GetText(), LIB_SYMBOL::GetUnitCount(), LIB_SYMBOL::GetUnitReference(), LIB_SYMBOL::HasAlternateBodyStyle(), LIB_SYMBOL::IsPower(), UNITS_PROVIDER::MessageTextFromValue(), EDA_IU_SCALE::MilsToIU(), next(), pin, PT_POWER_IN, PT_POWER_OUT, schIUScale, and sort_by_pin_number().

Referenced by EE_INSPECTION_TOOL::CheckSymbol().

◆ CheckLibSymbolGraphics()

◆ sort_by_pin_number()

bool sort_by_pin_number ( const LIB_PIN ref,
const LIB_PIN tst 
)
static

Definition at line 411 of file symbol_checker.cpp.

References LIB_ITEM::GetBodyStyle(), LIB_PIN::GetNumber(), and LIB_ITEM::GetUnit().

Referenced by CheckLibSymbol().