59 virtual bool Run()
override;
61 virtual const wxString
GetName()
const override 68 return wxT(
"Performs layout-vs-schematics integity check" );
86 return x->
GetReference().CmpNoCase( y->GetReference() ) < 0;
89 auto footprints = std::set<FOOTPRINT*, decltype( compare )>( compare );
97 auto ins = footprints.insert( footprint );
99 if( !ins.second && !( footprint->GetAttributes() &
FP_BOARD_ONLY ) )
102 drcItem->SetItems( footprint, *ins.first );
109 for(
unsigned ii = 0; ii < aNetlist.
GetCount(); ii++ )
114 if( footprint ==
nullptr )
119 m_msg.Printf(
_(
"Missing footprint %s (%s)" ),
125 drcItem->SetErrorMessage(
m_msg );
135 if( !
pad->CanHaveNumber() )
139 const wxString& pcb_netname =
pad->GetNetname();
141 if( !pcb_netname.IsEmpty() && sch_net.
GetPinName().IsEmpty() )
143 m_msg.Printf(
_(
"No corresponding pin found in schematic." ) );
146 drcItem->SetErrorMessage(
m_msg );
147 drcItem->SetItems(
pad );
150 else if( pcb_netname.IsEmpty() && !sch_net.
GetNetName().IsEmpty() )
152 m_msg.Printf(
_(
"Pad missing net given by schematic (%s)." ),
156 drcItem->SetErrorMessage(
m_msg );
157 drcItem->SetItems(
pad );
160 else if( pcb_netname != sch_net.
GetNetName() )
162 m_msg.Printf(
_(
"Pad net (%s) doesn't match net given by schematic (%s)." ),
167 drcItem->SetErrorMessage(
m_msg );
168 drcItem->SetItems(
pad );
173 for(
unsigned jj = 0; jj < component->
GetNetCount(); ++jj )
182 m_msg.Printf(
_(
"No pad found for pin %s in schematic." ),
186 drcItem->SetErrorMessage(
m_msg );
187 drcItem->SetItems( footprint );
207 drcItem->SetItems( footprint );
218 if( !
reportPhase(
_(
"Checking PCB to schematic parity..." ) ) )
225 reportAux( wxT(
"No netlist provided, skipping LVS." ) );
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
virtual ~DRC_TEST_PROVIDER_LVS()
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const wxPoint &aMarkerPos)
bool IsErrorLimitExceeded(int error_code)
virtual const wxString GetName() const override
unsigned GetCount() const
virtual void reportRuleStatistics()
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULAR_WIDTH > dummy
Used to store the component pin name to net name (and pin function) associations stored in a netlist.
const wxString & GetNetName() const
bool GetTestFootprints() const
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
virtual bool reportPhase(const wxString &aStageName)
unsigned GetNetCount() const
FOOTPRINTS & Footprints()
const wxString & GetReference() const
virtual std::set< DRC_CONSTRAINT_T > GetConstraintTypes() const override
const COMPONENT_NET & GetNet(unsigned aIndex) const
virtual const wxString GetDescription() const override
Store all of the related footprint information found in a netlist.
COMPONENT * GetComponent(unsigned aIndex)
Return the COMPONENT at aIndex.
Represent a DRC "provider" which runs some DRC functions over a BOARD and spits out #DRC_ITEMs and po...
NETLIST * GetSchematicNetlist() const
Information pertinent to a Pcbnew printed circuit board.
const wxString & GetPinName() const
void testFootprints(NETLIST &aNetlist)
const wxString & GetValue() const
COMPONENT * GetComponentByReference(const wxString &aReference)
Return a COMPONENT by aReference.
virtual void reportAux(wxString fmt,...)
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
int GetNumPhases() const override