20#include <boost/test/unit_test.hpp>
37struct PADS_SCH_IMPORT_FIXTURE
39 PADS_SCH_IMPORT_FIXTURE() : m_schematic( nullptr )
41 m_settingsManager.LoadProject(
"" );
42 m_schematic.SetProject( &m_settingsManager.Prj() );
46 ~PADS_SCH_IMPORT_FIXTURE()
51 SETTINGS_MANAGER m_settingsManager;
58BOOST_FIXTURE_TEST_SUITE( PadsSchImport, PADS_SCH_IMPORT_FIXTURE )
65 wxString padsFile = wxString::FromUTF8(
76 wxString kicadFile = wxString::FromUTF8(
86 BOOST_CHECK_NE( pi.get(),
nullptr );
94 wxString padsFile = wxString::FromUTF8(
104 std::vector<SCH_SYMBOL*> u1Symbols;
112 if( sym->
GetRef( &rootPath ) == wxT(
"U1" ) )
113 u1Symbols.push_back( sym );
116 BOOST_REQUIRE_EQUAL( u1Symbols.size(), 2u );
119 std::sort( u1Symbols.begin(), u1Symbols.end(),
122 return a->GetUnit() < b->GetUnit();
134 BOOST_CHECK( u1Symbols[0]->IsMultiUnit() );
150 wxString padsFile = wxString::FromUTF8(
152 +
"/plugins/pads/issue23420_codepage_schematic.txt" );
167 wxString padsFile = wxString::FromUTF8(
178 wxString padsFile = wxString::FromUTF8(
183 BOOST_CHECK_GT( names.GetCount(), 0u );
191 wxString padsFile = wxString::FromUTF8(
194 std::vector<LIB_SYMBOL*> symbols;
196 BOOST_CHECK_GT( symbols.size(), 0u );
207 wxString padsFile = wxString::FromUTF8(
213 BOOST_REQUIRE_GT( names.GetCount(), 0u );
225 wxString padsFile = wxString::FromUTF8(
229 BOOST_CHECK( sym ==
nullptr );
237 wxString padsFile = wxString::FromUTF8(
240 std::vector<LIB_SYMBOL*> symbols;
243 bool foundMultiUnit =
false;
247 if( sym && sym->GetUnitCount() > 1 )
249 foundMultiUnit =
true;
254 BOOST_CHECK( foundMultiUnit );
262 wxString padsFile = wxString::FromUTF8(
EE_TYPE OfType(KICAD_T aType) const
Define a library symbol object.
wxString GetName() const override
A SCH_IO derivation for loading PADS Logic schematic files.
LIB_SYMBOL * LoadSymbol(const wxString &aLibraryPath, const wxString &aPartName, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this...
void EnumerateSymbolLib(wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.
bool CanReadLibrary(const wxString &aFileName) const override
Checks if this IO object can read the specified library file/directory.
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
bool CanReadSchematicFile(const wxString &aFileName) const override
Checks if this SCH_IO can read the specified schematic file.
SCH_SHEET * LoadSchematicFile(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load information from some input file format that this SCH_IO implementation knows about,...
Base class for any item which can be embedded within the SCHEMATIC container class,...
EE_RTREE & Items()
Get the full RTree, usually for iterating.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
SCH_SCREEN * GetScreen() const
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(CanReadSchematicFile)
BOOST_CHECK_EQUAL(result, "25.4")