40 struct FOOTPRINT_FACE :
KIFACE
44 void Reset()
override {}
46 void GetActions( std::vector<TOOL_ACTION*>& )
const override {}
48 static void Pads(
const wxString& aFootprint,
PROJECT*, std::set<wxString>& aPads )
50 if( aFootprint ==
"Acceptance:3" )
52 else if( aFootprint ==
"Acceptance:2" )
53 aPads = {
"NO_NATIVE_PIN" };
59 return reinterpret_cast<void*
>( &Pads );
67 std::unique_ptr<SCHEMATIC> schematic;
69 std::vector<SCH_SHEET_PATH> paths;
73 if(
path.LastScreen()->GetFileName().EndsWith(
"ampli_ht.kicad_sch" ) )
74 paths.push_back(
path );
77 BOOST_REQUIRE_EQUAL( paths.size(), 2u );
80 paths[0].SetPageNumber(
"2" );
81 paths[1].SetPageNumber(
"3" );
86 auto* candidate =
static_cast<SCH_SYMBOL*
>( item );
88 if( candidate->GetLibId().GetLibItemName() ==
"R" )
97 BOOST_REQUIRE_LT( footprint.
Parse(
"Acceptance:2",
true ), 0 );
101 const auto pins = symbol->
GetPins( &paths[0] );
102 BOOST_REQUIRE_EQUAL( pins.size(), 2u );
103 const std::set<KIID>
expected{ pins[0]->m_Uuid, pins[1]->m_Uuid };
105 for(
bool backend : {
true,
false } )
108 schematic->RebuildConnectivity();
112 BOOST_TEST_CONTEXT(
"backend=" << backend <<
"; displayed=" << displayed.GetPageNumber() )
114 schematic->SetCurrentSheet( displayed );
116 tester.
TestPinMap( &face, &schematic->Project() );
117 std::set<KIID> found;
119 std::vector<SCH_MARKER*> markers;
123 auto* marker =
static_cast<SCH_MARKER*
>( item );
124 markers.push_back( marker );
125 const auto error = std::static_pointer_cast<ERC_ITEM>( marker->GetRCItem() );
128 || !
expected.contains( error->GetMainItemID() ) )
134 found.insert( error->GetMainItemID() );
135 BOOST_CHECK( error->IsSheetSpecific() );
136 BOOST_CHECK( error->MainItemHasSheetPath() );
138 if( error->IsSheetSpecific() && error->MainItemHasSheetPath() )
140 BOOST_CHECK( error->GetSpecificSheetPath().PathRef() == paths[0].PathRef() );
141 BOOST_CHECK( error->GetMainItemSheetPath().PathRef() == paths[0].PathRef() );
154 for(
bool backend : {
false,
true } )
159 schematic->RebuildConnectivity();
162 schematic->RefreshHierarchy();
164 BOOST_CHECK_NO_THROW( retained.
TestPinMap( &face, &schematic->Project() ) );
165 schematic->RootScreen()->Append( removed );
166 schematic->RefreshHierarchy();
167 std::vector<SCH_MARKER*> markers;
170 markers.push_back(
static_cast<SCH_MARKER*
>( item ) );
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
EE_TYPE OfType(KICAD_T aType) const
Runs the electrical rules checks and adds a SCH_MARKER for each violation.
int TestPinMap(KIFACE *aCvPcb, PROJECT *aProject)
Check pin-to-pad maps (issue #2282): stale pin references, duplicate pad targets, bad pads and unmapp...
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
void SetAssociatedFootprints(std::vector< ASSOCIATED_FOOTPRINT > aList)
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Container for data for KiCad programs.
Container for project specific data.
Base class for any item which can be embedded within the SCHEMATIC container class,...
EE_RTREE & Items()
Get the full RTree, usually for iterating.
void DeleteItem(SCH_ITEM *aItem)
Remove aItem from the linked list and deletes the object.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
std::vector< const SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet) const
Retrieve a list of the SCH_PINs for the given sheet path.
void SetFootprintFieldText(const wxString &aFootprint)
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
RAII class that sets an value at construction and resets it to the original value at destruction.
@ ERCE_PIN_MAP_UNMAPPED_PIN
A connected pin resolves to no footprint pad.
@ KIFACE_FOOTPRINT_PAD_NUMBERS
Function pointer type: void (*)( const wxString& aFootprint, PROJECT* aProject, std::set<wxString>& a...
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
Implement a participant in the KIWAY alchemy.
virtual wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKIWAY, int aCtlBits=0)=0
Create a wxWindow for the current project.
virtual bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway)=0
Called just once shortly after the DSO is loaded.
virtual void OnKifaceEnd()=0
Called just once just before the DSO is to be unloaded.
virtual void * IfaceOrAddress(int aDataId)=0
Return pointer to the requested object.
virtual void Reset()=0
Reloads global state.
virtual void GetActions(std::vector< TOOL_ACTION * > &aActions) const =0
Append this Kiface's registered actions to the given list.
BOOST_AUTO_TEST_CASE(ERCUnmappedPinsBindSharedInstancePaths)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
VECTOR3I expected(15, 30, 45)
BOOST_TEST_CONTEXT("Test Clearance")
BOOST_CHECK_EQUAL(result, "25.4")