66 BOOST_CHECK_GT( checked, 0 );
91 const auto* symbol =
static_cast<SCH_SYMBOL*
>( item );
104 const wxString withoutCache =
directory.PathStr() +
"/legacy_power4.sch";
107 BOOST_CHECK( !m_schematic );
115 std::filesystem::copy( std::filesystem::path( source.ToStdString() ),
directory.Path(),
116 std::filesystem::copy_options::recursive );
121 BOOST_CHECK( defaults->HasWireWidth() );
122 BOOST_CHECK_GT( defaults->GetWireWidth(), 0 );
123 BOOST_CHECK( defaults->HasBusWidth() );
124 BOOST_CHECK_GT( defaults->GetBusWidth(), 0 );
130 for(
bool engine : {
false,
true } )
134 directory.PathStr() +
"/complex_hierarchy.sch",
false,
false, &settings.
Prj() ) );
136 BOOST_CHECK( &
Pgm().GetSettingsManager().
Prj() == active );
138 BOOST_CHECK( &schematic->Project() == &settings.
Prj() );
146 auto* symbol =
static_cast<SCH_SYMBOL*
>( item );
149 if( symbol->GetLibId().GetLibItemName() ==
UTF8(
"LM358N" ) )
160 bool checkedOutput =
false;
166 auto* symbol =
static_cast<SCH_SYMBOL*
>( item );
168 if( symbol->GetRef( &
path ) == wxS(
"U2" ) )
173 const auto wires =
path.LastScreen()->GetBusesAndWires( pos,
false );
174 BOOST_REQUIRE_EQUAL( wires.size(), 1 );
175 BOOST_CHECK_GT( wires.front()->GetPenWidth(), 0 );
180 checkedOutput =
true;
185 BOOST_CHECK( checkedOutput );
193 m_settingsManager.LoadProject(
"" );
194 m_schematic = std::make_unique<SCHEMATIC>( &m_settingsManager.Prj() );
195 m_schematic->Reset();
200 m_schematic->SetTopLevelSheets( { root } );
201 BOOST_REQUIRE_LT( m_schematic->RootScreen()->GetFileFormatVersionAtLoad(), 20230221 );
203 size_t mismatches = 0;
222 BOOST_REQUIRE_GT( mismatches, 0 );
223 m_schematic->RootScreen()->FixLegacyPowerSymbolMismatches();
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
static SCHEMATIC * LoadSchematic(const wxString &aFileName, bool aSetActive, bool aForceDefaultProject, PROJECT *aProject=nullptr, bool aCalculateConnectivity=true, REPORTER *aRootReporter=nullptr)
const UTF8 & GetLibItemName() const
Define a library symbol object.
bool IsGlobalPower() const override
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
std::shared_ptr< NETCLASS > GetDefaultNetclass() const
Gets the default netclass for the project.
virtual SETTINGS_MANAGER & GetSettingsManager() const
std::shared_ptr< NET_SETTINGS > & NetSettings()
Container for project specific data.
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
virtual PROJECT_FILE & GetProjectFile() const
virtual const wxString & GetText() const override
Return the string associated with the text object.
A SCH_IO derivation for loading schematic files created before the new s-expression file format.
LIB_SYMBOL * LoadSymbol(const wxString &aLibraryPath, const wxString &aAliasName, 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...
const wxString & GetError() const override
Return an error string to the caller.
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,...
Container class that holds multiple SCH_SCREEN objects in a 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.
std::vector< SCH_PIN * > GetAllLibPins() const
const LIB_ID & GetLibId() const override
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
void SetLibSymbol(LIB_SYMBOL *aLibSymbol)
Set this schematic symbol library symbol reference to aLibSymbol.
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
RAII class that sets an value at construction and resets it to the original value at destruction.
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.
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
PGM_BASE & Pgm()
The global program "get" accessor.
std::unique_ptr< SCHEMATIC > m_schematic
SETTINGS_MANAGER m_settingsManager
LEGACY_POWER_SYMBOLS_TEST_FIXTURE()
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_CASE(LegacyHeadlessLoadUsesItsProjectLibraries)
BOOST_FIXTURE_TEST_CASE(LegacyPowerFixup, LEGACY_POWER_SYMBOLS_TEST_FIXTURE)
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I