59 virtual bool Run()
override;
61 virtual const wxString
GetName()
const override
63 return wxT(
"schematic_parity" );
68 return wxT(
"Performs layout-vs-schematics integity check" );
82 return x->
GetReference().CmpNoCase( y->GetReference() ) < 0;
85 auto footprints = std::set<FOOTPRINT*, decltype( compare )>( compare );
93 auto ins = footprints.insert( footprint );
95 if( !ins.second && !( footprint->GetAttributes() &
FP_BOARD_ONLY ) )
98 drcItem->SetItems( footprint, *ins.first );
105 for(
unsigned ii = 0; ii < aNetlist.
GetCount(); ii++ )
110 if( footprint ==
nullptr )
116 msg.Printf(
_(
"Missing footprint %s (%s)" ),
122 drcItem->SetErrorMessage( msg );
132 if( !
pad->CanHaveNumber() )
136 const wxString& pcb_netname =
pad->GetNetname();
138 if( !pcb_netname.IsEmpty() && sch_net.
GetPinName().IsEmpty() )
141 msg.Printf(
_(
"No corresponding pin found in schematic." ) );
144 drcItem->SetErrorMessage( msg );
145 drcItem->SetItems(
pad );
148 else if( pcb_netname.IsEmpty() && !sch_net.
GetNetName().IsEmpty() )
151 msg.Printf(
_(
"Pad missing net given by schematic (%s)." ),
155 drcItem->SetErrorMessage( msg );
156 drcItem->SetItems(
pad );
159 else if( pcb_netname != sch_net.
GetNetName() )
162 msg.Printf(
_(
"Pad net (%s) doesn't match net given by schematic (%s)." ),
167 drcItem->SetErrorMessage( msg );
168 drcItem->SetItems(
pad );
173 for(
unsigned jj = 0; jj < component->
GetNetCount(); ++jj )
183 msg.Printf(
_(
"No pad found for pin %s in schematic." ),
187 drcItem->SetErrorMessage( msg );
188 drcItem->SetItems( footprint );
208 drcItem->SetItems( footprint );
219 if( !
reportPhase(
_(
"Checking PCB to schematic parity..." ) ) )
226 reportAux( wxT(
"No netlist provided, skipping schematic parity tests." ) );
Information pertinent to a Pcbnew printed circuit board.
FOOTPRINTS & Footprints()
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
Used to store the component pin name to net name (and pin function) associations stored in a netlist.
const wxString & GetNetName() const
const wxString & GetPinName() const
Store all of the related footprint information found in a netlist.
const COMPONENT_NET & GetNet(unsigned aIndex) const
const wxString & GetReference() const
const wxString & GetValue() const
unsigned GetNetCount() const
bool GetTestFootprints() const
bool IsErrorLimitExceeded(int error_code)
NETLIST * GetSchematicNetlist() const
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
DRC_TEST_PROVIDER_SCHEMATIC_PARITY()
virtual const wxString GetName() const override
virtual const wxString GetDescription() const override
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
virtual ~DRC_TEST_PROVIDER_SCHEMATIC_PARITY()
void testNetlist(NETLIST &aNetlist)
Represent a DRC "provider" which runs some DRC functions over a BOARD and spits out DRC_ITEM and posi...
virtual bool reportPhase(const wxString &aStageName)
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer)
void reportAux(const wxString &aMsg)
virtual void reportRuleStatistics()
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
unsigned GetCount() const
COMPONENT * GetComponentByReference(const wxString &aReference)
Return a COMPONENT by aReference.
COMPONENT * GetComponent(unsigned aIndex)
Return the COMPONENT at aIndex.
@ DRCE_DUPLICATE_FOOTPRINT
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULAR_WIDTH > dummy