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 return CreatePinList( aSymbol, aPath,
true );
93 SCH_SCREEN* screen = m_schematic->RootScreen();
95 path.push_back( &m_schematic->Root() );
97 const LIB_ID dfn = makeFp( wxS(
"Package_DFN_QFN" ), wxS(
"DFN-8-1EP" ) );
99 m_libSym = std::make_unique<LIB_SYMBOL>(
"LM358",
nullptr );
101 for(
const wxString& number : { wxString(
"1" ), wxString(
"4" ) } )
104 pin->SetNumber( number );
106 pin->SetPosition(
VECTOR2I( number ==
"1" ? -508000 : 508000, 0 ) );
107 m_libSym->AddDrawItem(
pin );
110 PIN_MAP map( wxS(
"DFN-8-EP" ) );
111 map.
SetEntry( wxS(
"4" ), wxS(
"[4,9]" ) );
112 m_libSym->PinMaps().AddOrReplace( map );
113 m_libSym->SetAssociatedFootprints( { { dfn, wxS(
"DFN-8-EP" ) } } );
122 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
123 m_schematic->ConnectionGraph()->Recalculate( sheets,
true );
125 TEST_NETLIST_EXPORTER exporter( m_schematic.get() );
126 std::vector<PIN_INFO> pins = exporter.Pins( sym, sheets[0] );
130 bool hasPadOne =
false;
134 if(
info.num == wxS(
"1" ) )
136 else if(
info.num == wxS(
"4" ) )
137 netForFour =
info.netName;
138 else if(
info.num == wxS(
"9" ) )
139 netForNine =
info.netName;
142 BOOST_CHECK( hasPadOne );
143 BOOST_CHECK( !netForFour.IsEmpty() );
144 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