47 std::unique_ptr<SCHEMATIC> schematic = std::make_unique<SCHEMATIC>( &
project );
50 BOOST_REQUIRE_EQUAL( schematic->Hierarchy().size(), 1U );
56 std::vector<SCH_SYMBOL*> symbols;
58 for(
const wxString& ref : { wxS(
"R?" ), wxS(
"R?" ), wxS(
"R1" ) } )
63 symbols.push_back( symbol );
66 std::map<wxString, wxString> footprints = { { wxS(
"R?" ), wxS(
"lib:R_0603" ) },
67 { wxS(
"R1" ), wxS(
"lib:R_0805" ) } };
84 std::unique_ptr<SCHEMATIC> schematic = std::make_unique<SCHEMATIC>( &
project );
91 std::vector<SCH_SYMBOL*> symbols;
93 for(
const wxString& ref : { wxS(
"R1" ), wxS(
"R2" ) } )
98 symbols.push_back( symbol );
101 symbols[0]->SetFootprintFieldText( wxS(
"cache:SOIC8" ) );
102 symbols[1]->SetFootprintFieldText( wxS(
"mine:SOIC8" ) );
104 std::map<wxString, wxString> footprints = { { wxS(
"R1" ), wxS(
"cache:SOIC8_1" ) },
105 { wxS(
"R2" ), wxS(
"cache:SOIC8_1" ) } };
118 std::unique_ptr<SCHEMATIC> schematic;
121 std::vector<SCH_SHEET_PATH> paths;
125 if(
path.LastScreen()->GetFileName().EndsWith(
"LEDs.kicad_sch" ) )
126 paths.push_back(
path );
129 BOOST_REQUIRE_EQUAL( paths.size(), 2 );
137 if( symbol->
GetRef( &paths[0] ) != symbol->
GetRef( &paths[1] ) )
146 const wxString first = shared->
GetRef( &paths[0] );
147 const wxString second = shared->
GetRef( &paths[1] );
151 std::map<wxString, wxString>
split = { { first, wxS(
"cache:SOIC8_1" ) }, { second, wxS(
"mine:SOIC8" ) } };
156 std::map<wxString, wxString> agreed = { { first, wxS(
"cache:SOIC8_1" ) }, { second, wxS(
"cache:SOIC8_1" ) } };
Define a library symbol object.
const LIB_ID & GetLibId() const override
static REPORTER & GetInstance()
virtual SETTINGS_MANAGER & GetSettingsManager() const
Container for project specific data.
virtual const wxString & GetText() const override
Return the string associated with the text object.
Base class for any item which can be embedded within the SCHEMATIC container class,...
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
void SetFootprintFieldText(const wxString &aFootprint)
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
PGM_BASE & Pgm()
The global program "get" accessor.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
static std::vector< std::string > split(const std::string &aStr, const std::string &aDelim)
Split the input string into a vector of output strings.
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")