39LIB_ID makeFp(
const wxString& aLibNick,
const wxString& aName )
43 id.SetLibItemName( aName );
52 explicit TEST_NETLIST_EXPORTER(
SCHEMATIC* aSchematic ) : NETLIST_EXPORTER_BASE( aSchematic ) {}
54 std::vector<PIN_INFO> Pins( SCH_SYMBOL* aSymbol,
const SCH_SHEET_PATH& aPath )
56 CONNECTIVITY_SCOPE connectivity( *
this );
57 return CreatePinList( aSymbol, aPath );
94 SCH_SCREEN* screen = m_schematic->RootScreen();
96 path.push_back( &m_schematic->Root() );
98 const LIB_ID dfn = makeFp( wxS(
"Package_DFN_QFN" ), wxS(
"DFN-8-1EP" ) );
100 m_libSym = std::make_unique<LIB_SYMBOL>(
"LM358",
nullptr );
102 for(
const wxString& number : { wxString(
"1" ), wxString(
"4" ) } )
105 pin->SetNumber( number );
107 pin->SetPosition(
VECTOR2I( number ==
"1" ? -508000 : 508000, 0 ) );
108 m_libSym->AddDrawItem(
pin );
111 PIN_MAP map( wxS(
"DFN-8-EP" ) );
112 map.
SetEntry( wxS(
"4" ), wxS(
"[4,9]" ) );
113 m_libSym->PinMaps().AddOrReplace( map );
114 m_libSym->SetAssociatedFootprints( { { dfn, wxS(
"DFN-8-EP" ) } } );
123 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
124 m_schematic->ConnectionGraph()->Recalculate( sheets,
true );
126 TEST_NETLIST_EXPORTER exporter( m_schematic.get() );
127 std::vector<PIN_INFO> pins = exporter.Pins( sym, sheets[0] );
131 bool hasPadOne =
false;
135 if(
info.num == wxS(
"1" ) )
137 else if(
info.num == wxS(
"4" ) )
138 netForFour =
info.netName;
139 else if(
info.num == wxS(
"9" ) )
140 netForNine =
info.netName;
143 BOOST_CHECK( hasPadOne );
144 BOOST_CHECK( !netForFour.IsEmpty() );
145 BOOST_CHECK( !netForNine.IsEmpty() );
A logical library item identifier and consists of various portions much like a URI.
int SetLibNickname(const UTF8 &aLibNickname)
Override the logical library name portion of the LIB_ID to aLibNickname.
An abstract class used for the netlist exporters that Eeschema supports.
void SetEntry(const wxString &aPinNumber, const wxString &aPadNumber)
Set the pad number for a symbol pin.
void SetText(const wxString &aText) override
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
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.
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
void UpdatePins()
Updates the cache of SCH_PIN objects for each pin.
void SetFootprintFieldText(const wxString &aFootprint)
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
@ PT_PASSIVE
pin for passive symbols: must be connected, and can be connected to any pin.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
SETTINGS_MANAGER m_settingsManager
std::unique_ptr< LIB_SYMBOL > m_libSym
PIN_MAP_NETLIST_FIXTURE()
std::unique_ptr< SCHEMATIC > m_schematic
@ REFERENCE
Field Reference of part, i.e. "IC21".
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I