Rename Prj() on schematic to avoid conflict with global function

This commit is contained in:
Mark Roszko 2025-08-07 23:21:41 -04:00
parent 1a4eba56a7
commit 5895c27f4a
32 changed files with 91 additions and 92 deletions

View File

@ -2466,7 +2466,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
m_net_name_to_subgraphs_map[subgraph->m_driver_connection->Name()].push_back( subgraph );
}
std::shared_ptr<NET_SETTINGS>& netSettings = m_schematic->Prj().GetProjectFile().m_NetSettings;
std::shared_ptr<NET_SETTINGS>& netSettings = m_schematic->Project().GetProjectFile().m_NetSettings;
std::map<wxString, std::set<wxString>> oldAssignments =
netSettings->GetNetclassLabelAssignments();
std::set<wxString> affectedNetclassNetAssignments;

View File

@ -227,7 +227,7 @@ void EESCHEMA_JOBS_HANDLER::InitRenderSettings( SCH_RENDER_SETTINGS* aRenderSett
{
wxString msg;
FILENAME_RESOLVER resolve;
resolve.SetProject( &aSch->Prj() );
resolve.SetProject( &aSch->Project() );
resolve.SetProgramBase( &Pgm() );
wxString absolutePath = resolve.ResolvePath( path, wxGetCwd(),
@ -272,7 +272,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPlot( JOB* aJob )
return CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE;
aJob->SetTitleBlock( sch->RootScreen()->GetTitleBlock() );
sch->Prj().ApplyTextVars( aJob->GetVarOverrides() );
sch->Project().ApplyTextVars( aJob->GetVarOverrides() );
std::unique_ptr<SCH_RENDER_SETTINGS> renderSettings = std::make_unique<SCH_RENDER_SETTINGS>();
InitRenderSettings( renderSettings.get(), aPlotJob->m_theme, sch, aPlotJob->m_drawingSheet );
@ -310,7 +310,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPlot( JOB* aJob )
case JOB_PAGE_SIZE::PAGE_SIZE_AUTO: pageSizeSelect = PageFormatReq::PAGE_SIZE_AUTO; break;
}
wxString outPath = aPlotJob->GetFullOutputPath( &sch->Prj() );
wxString outPath = aPlotJob->GetFullOutputPath( &sch->Project() );
if( !PATHS::EnsurePathExists( outPath, !aPlotJob->GetOutputPathIsDirectory() ) )
{
@ -364,7 +364,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportNetlist( JOB* aJob )
return CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE;
aJob->SetTitleBlock( sch->RootScreen()->GetTitleBlock() );
sch->Prj().ApplyTextVars( aJob->GetVarOverrides() );
sch->Project().ApplyTextVars( aJob->GetVarOverrides() );
// Annotation warning check
SCH_REFERENCE_LIST referenceList;
@ -453,7 +453,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportNetlist( JOB* aJob )
aNetJob->SetConfiguredOutputPath( fn.GetFullName() );
}
wxString outPath = aNetJob->GetFullOutputPath( &sch->Prj() );
wxString outPath = aNetJob->GetFullOutputPath( &sch->Project() );
if( !PATHS::EnsurePathExists( outPath, true ) )
{
@ -482,7 +482,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportBom( JOB* aJob )
return CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE;
aJob->SetTitleBlock( sch->RootScreen()->GetTitleBlock() );
sch->Prj().ApplyTextVars( aJob->GetVarOverrides() );
sch->Project().ApplyTextVars( aJob->GetVarOverrides() );
// Annotation warning check
SCH_REFERENCE_LIST referenceList;
@ -672,7 +672,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportBom( JOB* aJob )
aBomJob->SetConfiguredOutputPath( fn.GetFullName() );
}
wxString outPath = aBomJob->GetFullOutputPath( &sch->Prj() );
wxString outPath = aBomJob->GetFullOutputPath( &sch->Project() );
if( !PATHS::EnsurePathExists( outPath, true ) )
{
@ -761,7 +761,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPythonBom( JOB* aJob )
return CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE;
aJob->SetTitleBlock( sch->RootScreen()->GetTitleBlock() );
sch->Prj().ApplyTextVars( aJob->GetVarOverrides() );
sch->Project().ApplyTextVars( aJob->GetVarOverrides() );
// Annotation warning check
SCH_REFERENCE_LIST referenceList;
@ -800,7 +800,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPythonBom( JOB* aJob )
aNetJob->SetConfiguredOutputPath( fn.GetFullName() );
}
wxString outPath = aNetJob->GetFullOutputPath( &sch->Prj() );
wxString outPath = aNetJob->GetFullOutputPath( &sch->Project() );
if( !PATHS::EnsurePathExists( outPath, true ) )
{
@ -1114,7 +1114,7 @@ int EESCHEMA_JOBS_HANDLER::JobSchErc( JOB* aJob )
return CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE;
aJob->SetTitleBlock( sch->RootScreen()->GetTitleBlock() );
sch->Prj().ApplyTextVars( aJob->GetVarOverrides() );
sch->Project().ApplyTextVars( aJob->GetVarOverrides() );
if( ercJob->GetConfiguredOutputPath().IsEmpty() )
{
@ -1129,7 +1129,7 @@ int EESCHEMA_JOBS_HANDLER::JobSchErc( JOB* aJob )
ercJob->SetConfiguredOutputPath( fn.GetFullName() );
}
wxString outPath = ercJob->GetFullOutputPath( &sch->Prj() );
wxString outPath = ercJob->GetFullOutputPath( &sch->Project() );
if( !PATHS::EnsurePathExists( outPath, true ) )
{
@ -1154,7 +1154,7 @@ int EESCHEMA_JOBS_HANDLER::JobSchErc( JOB* aJob )
std::unique_ptr<DS_PROXY_VIEW_ITEM> drawingSheet( getDrawingSheetProxyView( sch ) );
ercTester.RunTests( drawingSheet.get(), nullptr, m_kiway->KiFACE( KIWAY::FACE_CVPCB ),
&sch->Prj(), m_progressReporter );
&sch->Project(), m_progressReporter );
markersProvider->SetSeverities( ercJob->m_severity );
@ -1194,7 +1194,7 @@ DS_PROXY_VIEW_ITEM* EESCHEMA_JOBS_HANDLER::getDrawingSheetProxyView( SCHEMATIC*
{
DS_PROXY_VIEW_ITEM* drawingSheet =
new DS_PROXY_VIEW_ITEM( schIUScale, &aSch->RootScreen()->GetPageSettings(),
&aSch->Prj(), &aSch->RootScreen()->GetTitleBlock(),
&aSch->Project(), &aSch->RootScreen()->GetTitleBlock(),
aSch->GetProperties() );
drawingSheet->SetPageNumber( TO_UTF8( aSch->RootScreen()->GetPageNumber() ) );

View File

@ -188,7 +188,7 @@ void ERC_TESTER::TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet )
auto unresolved =
[this]( wxString str )
{
str = ExpandEnvVarSubstitutions( str, &m_schematic->Prj() );
str = ExpandEnvVarSubstitutions( str, &m_schematic->Project() );
return str.Matches( wxS( "*${*}*" ) );
};
@ -247,7 +247,7 @@ void ERC_TESTER::TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet )
wsItems.SetFileName( wxS( "dummyFilename" ) );
wsItems.SetSheetName( wxS( "dummySheet" ) );
wsItems.SetSheetLayer( wxS( "dummyLayer" ) );
wsItems.SetProject( &m_schematic->Prj() );
wsItems.SetProject( &m_schematic->Project() );
wsItems.BuildDrawItemsList( aDrawingSheet->GetPageInfo(), aDrawingSheet->GetTitleBlock() );
}
@ -682,7 +682,7 @@ int ERC_TESTER::TestMissingUnits()
int ERC_TESTER::TestMissingNetclasses()
{
int err_count = 0;
std::shared_ptr<NET_SETTINGS>& settings = m_schematic->Prj().GetProjectFile().NetSettings();
std::shared_ptr<NET_SETTINGS>& settings = m_schematic->Project().GetProjectFile().NetSettings();
wxString defaultNetclass = settings->GetDefaultNetclass()->GetName();
auto logError =
@ -1472,7 +1472,7 @@ int ERC_TESTER::TestLibSymbolIssues()
{
wxCHECK( m_schematic, 0 );
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &m_schematic->Prj() );
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &m_schematic->Project() );
wxString msg;
int err_count = 0;
@ -1840,7 +1840,7 @@ int ERC_TESTER::TestSimModelIssues()
{
WX_STRING_REPORTER reporter;
int err_count = 0;
SIM_LIB_MGR libMgr( &m_schematic->Prj() );
SIM_LIB_MGR libMgr( &m_schematic->Project() );
for( SCH_SHEET_PATH& sheet : m_sheetList )
{

View File

@ -432,7 +432,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
}
// Ensure there is only one legacy library loaded and that it is the cache library.
SYMBOL_LIBS* legacyLibs = PROJECT_SCH::SchLibs( &Schematic().Prj() );
SYMBOL_LIBS* legacyLibs = PROJECT_SCH::SchLibs( &Schematic().Project() );
if( legacyLibs->GetLibraryCount() == 0 )
{

View File

@ -64,7 +64,7 @@ std::string NAME_GENERATOR::Generate( const std::string& aProposedName )
NETLIST_EXPORTER_SPICE::NETLIST_EXPORTER_SPICE( SCHEMATIC* aSchematic ) :
NETLIST_EXPORTER_BASE( aSchematic ),
m_libMgr( &aSchematic->Prj() )
m_libMgr( &aSchematic->Project() )
{
std::vector<EMBEDDED_FILES*> embeddedFilesStack;
embeddedFilesStack.push_back( aSchematic->GetEmbeddedFiles() );
@ -562,7 +562,7 @@ void NETLIST_EXPORTER_SPICE::writeInclude( OUTPUTFORMATTER& aFormatter, unsigned
const wxString& aPath )
{
// First, expand env vars, if any.
wxString expandedPath = ExpandEnvVarSubstitutions( aPath, &m_schematic->Prj() );
wxString expandedPath = ExpandEnvVarSubstitutions( aPath, &m_schematic->Project() );
// Path may have been authored by someone on a Windows box; convert it to UNIX format
expandedPath.Replace( '\\', '/' );
@ -572,7 +572,7 @@ void NETLIST_EXPORTER_SPICE::writeInclude( OUTPUTFORMATTER& aFormatter, unsigned
if( aNetlistOptions & OPTION_ADJUST_INCLUDE_PATHS )
{
// Look for the library in known search locations.
fullPath = ResolveFile( expandedPath, &Pgm().GetLocalEnvVariables(), &m_schematic->Prj() );
fullPath = ResolveFile( expandedPath, &Pgm().GetLocalEnvVariables(), &m_schematic->Project() );
if( fullPath.IsEmpty() )
{

View File

@ -35,7 +35,7 @@ void NETLIST_EXPORTER_SPICE_MODEL::WriteHead( OUTPUTFORMATTER& aFormatter,
{
aFormatter.Print( 0, "*\n" );
aFormatter.Print( 0, "\n" );
aFormatter.Print( 0, ".subckt %s\n", TO_UTF8( m_schematic->Prj().GetProjectName() ) );
aFormatter.Print( 0, ".subckt %s\n", TO_UTF8( m_schematic->Project().GetProjectName() ) );
for( auto const& [key, port] : m_ports )
{

View File

@ -600,7 +600,7 @@ XNODE* NETLIST_EXPORTER_XML::makeDesignHeader()
// which Eeschema tool
xdesign->AddChild( node( wxT( "tool" ), wxT( "Eeschema " ) + GetBuildVersion() ) );
const std::map<wxString, wxString>& properties = m_schematic->Prj().GetTextVars();
const std::map<wxString, wxString>& properties = m_schematic->Project().GetTextVars();
for( const std::pair<const wxString, wxString>& prop : properties )
{
@ -626,7 +626,7 @@ XNODE* NETLIST_EXPORTER_XML::makeDesignHeader()
xsheet->AddAttribute( wxT( "tstamps" ), sheet.PathAsString() );
TITLE_BLOCK tb = screen->GetTitleBlock();
PROJECT* prj = &m_schematic->Prj();
PROJECT* prj = &m_schematic->Project();
xsheet->AddChild( xtitleBlock = node( wxT( "title_block" ) ) );
@ -683,7 +683,7 @@ XNODE* NETLIST_EXPORTER_XML::makeDesignHeader()
XNODE* NETLIST_EXPORTER_XML::makeLibraries()
{
XNODE* xlibs = node( wxT( "libraries" ) ); // auto_ptr
SYMBOL_LIB_TABLE* symbolLibTable = PROJECT_SCH::SchSymbolLibTable( &m_schematic->Prj() );
SYMBOL_LIB_TABLE* symbolLibTable = PROJECT_SCH::SchSymbolLibTable( &m_schematic->Project() );
for( std::set<wxString>::iterator it = m_libraries.begin(); it!=m_libraries.end(); ++it )
{

View File

@ -266,7 +266,7 @@ wxString SCH_FIELD::GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtraT
text = ExpandTextVars( text, &labelResolver );
else if( Schematic() )
{
text = ExpandTextVars( text, &Schematic()->Prj() );
text = ExpandTextVars( text, &Schematic()->Project() );
text = ExpandTextVars( text, &schematicResolver );
}
}
@ -739,7 +739,7 @@ void SCH_FIELD::OnScintillaCharAdded( SCINTILLA_TRICKS* aScintillaTricks,
{
NULL_REPORTER devnull;
SCH_SHEET_PATH& sheet = schematic->CurrentSheet();
SIM_LIB_MGR mgr( &schematic->Prj() );
SIM_LIB_MGR mgr( &schematic->Project() );
std::vector<EMBEDDED_FILES*> embeddedFilesStack;
embeddedFilesStack.push_back( schematic->GetEmbeddedFiles() );
@ -804,7 +804,7 @@ void SCH_FIELD::OnScintillaCharAdded( SCINTILLA_TRICKS* aScintillaTricks,
if( label )
label->GetContextualTextVars( &autocompleteTokens );
for( std::pair<wxString, wxString> entry : schematic->Prj().GetTextVars() )
for( std::pair<wxString, wxString> entry : schematic->Project().GetTextVars() )
autocompleteTokens.push_back( entry.first );
}

View File

@ -349,7 +349,7 @@ wxString SCH_IO_ALTIUM::getLibName()
if( m_libName.IsEmpty() )
{
// Try to come up with a meaningful name
m_libName = m_schematic->Prj().GetProjectName();
m_libName = m_schematic->Project().GetProjectName();
if( m_libName.IsEmpty() )
{
@ -370,7 +370,7 @@ wxString SCH_IO_ALTIUM::getLibName()
wxFileName SCH_IO_ALTIUM::getLibFileName()
{
wxFileName fn( m_schematic->Prj().GetProjectPath(), getLibName(),
wxFileName fn( m_schematic->Project().GetProjectPath(), getLibName(),
FILEEXT::KiCadSymbolLibFileExtension );
return fn;
@ -401,7 +401,7 @@ SCH_SHEET* SCH_IO_ALTIUM::LoadSchematicProject( SCHEMATIC* aSchematic, const std
sheet->SetScreen( screen );
kicad_fn.SetExt( FILEEXT::KiCadSchematicFileExtension );
kicad_fn.SetPath( aSchematic->Prj().GetProjectPath() );
kicad_fn.SetPath( aSchematic->Project().GetProjectPath() );
sheet->SetFileName( fn.GetFullPath() );
screen->SetFileName( sheet->GetFileName() );
@ -501,7 +501,7 @@ SCH_SHEET* SCH_IO_ALTIUM::LoadSchematicFile( const wxString& aFileName, SCHEMATI
rootScreen->m_sheetInstances.emplace_back( sheetInstance );
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &m_schematic->Prj() );
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &m_schematic->Project() );
wxCHECK_MSG( libTable, nullptr, "Could not load symbol lib table." );
@ -544,7 +544,7 @@ SCH_SHEET* SCH_IO_ALTIUM::LoadSchematicFile( const wxString& aFileName, SCHEMATI
}
}
std::shared_ptr<NET_SETTINGS>& netSettings = m_schematic->Prj().GetProjectFile().NetSettings();
std::shared_ptr<NET_SETTINGS>& netSettings = m_schematic->Project().GetProjectFile().NetSettings();
if( minWireWidth < std::numeric_limits<int>::max() )
netSettings->GetDefaultNetclass()->SetWireWidth( minWireWidth );
@ -904,7 +904,7 @@ void SCH_IO_ALTIUM::ParseAltiumSch( const wxString& aFileName )
// Map the loaded Altium file to the project file.
wxFileName projectFileName = loadAltiumFileName;
projectFileName.SetPath( m_schematic->Prj().GetProjectPath() );
projectFileName.SetPath( m_schematic->Project().GetProjectPath() );
projectFileName.SetExt( FILEEXT::KiCadSchematicFileExtension );
sheet->SetFileName( projectFileName.GetFullName() );
screen->SetFileName( projectFileName.GetFullPath() );
@ -4266,7 +4266,7 @@ void SCH_IO_ALTIUM::ParseParameter( const std::map<wxString, wxString>& aPropert
}
else
{
m_schematic->Prj().GetTextVars()[ paramName ] = elem.text;
m_schematic->Project().GetTextVars()[ paramName ] = elem.text;
}
}
else

View File

@ -588,7 +588,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSheets()
ReplaceIllegalFileNameChars( &filename );
filename += wxT( "." ) + wxString( FILEEXT::KiCadSchematicFileExtension );
wxFileName fn( m_schematic->Prj().GetProjectPath() + filename );
wxFileName fn( m_schematic->Project().GetProjectPath() + filename );
m_rootSheet->GetScreen()->SetFileName( fn.GetFullPath() );
m_sheetMap.insert( { rootSheetID, m_rootSheet } );
@ -1541,7 +1541,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadTextVariables()
return true;
};
PROJECT* pj = &m_schematic->Prj();
PROJECT* pj = &m_schematic->Project();
if( pj )
{
@ -2487,7 +2487,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets( const LAYER_ID&
sheet->GetField( FIELD_T::SHEET_FILENAME )->SetText( filename );
wxFileName fn( m_schematic->Prj().GetProjectPath() + filename );
wxFileName fn( m_schematic->Project().GetProjectPath() + filename );
sheet->GetScreen()->SetFileName( fn.GetFullPath() );
aParentSheet.Last()->GetScreen()->Append( sheet );
instance.push_back( sheet );

View File

@ -101,14 +101,14 @@ SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFi
csaLoader.Load( aSchematic, rootSheet );
// SAVE SYMBOLS TO PROJECT LIBRARY:
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Prj() );
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Project() );
wxCHECK_MSG( libTable, nullptr, "Could not load symbol lib table." );
wxFileName prj_fn = aSchematic->Prj().GetProjectFullName();
wxFileName prj_fn = aSchematic->Project().GetProjectFullName();
wxString libName = CADSTAR_SCH_ARCHIVE_LOADER::CreateLibName( prj_fn, nullptr );
wxFileName libFileName( aSchematic->Prj().GetProjectPath(), libName,
wxFileName libFileName( aSchematic->Project().GetProjectPath(), libName,
FILEEXT::KiCadSymbolLibFileExtension );
IO_RELEASER<SCH_IO> sch_plugin( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
@ -124,7 +124,7 @@ SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFi
new SYMBOL_LIB_TABLE_ROW( libName, libTableUri, wxString( "KiCad" ) ) );
// Save project symbol library table.
wxFileName libtab_fn( aSchematic->Prj().GetProjectPath(),
wxFileName libtab_fn( aSchematic->Project().GetProjectPath(),
SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
// So output formatter goes out of scope and closes the file before reloading.
@ -134,8 +134,8 @@ SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFi
}
// Relaod the symbol library table.
aSchematic->Prj().SetElem( PROJECT::ELEM::SYMBOL_LIB_TABLE, NULL );
PROJECT_SCH::SchSymbolLibTable( &aSchematic->Prj() );
aSchematic->Project().SetElem( PROJECT::ELEM::SYMBOL_LIB_TABLE, NULL );
PROJECT_SCH::SchSymbolLibTable( &aSchematic->Project() );
}
// set properties to prevent save file on every symbol save

View File

@ -118,7 +118,7 @@ wxString SCH_IO_EAGLE::getLibName()
if( m_libName.IsEmpty() )
{
// Try to come up with a meaningful name
m_libName = m_schematic->Prj().GetProjectName();
m_libName = m_schematic->Project().GetProjectName();
if( m_libName.IsEmpty() )
{
@ -143,7 +143,7 @@ wxFileName SCH_IO_EAGLE::getLibFileName()
wxCHECK( m_schematic, fn );
fn.Assign( m_schematic->Prj().GetProjectPath(), getLibName(),
fn.Assign( m_schematic->Project().GetProjectPath(), getLibName(),
FILEEXT::KiCadSymbolLibFileExtension );
return fn;
@ -421,7 +421,7 @@ SCH_SHEET* SCH_IO_EAGLE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC
m_sheetPath.SetPageNumber( wxT( "1" ) );
}
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &m_schematic->Prj() );
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &m_schematic->Project() );
wxCHECK_MSG( libTable, nullptr, wxT( "Could not load symbol lib table." ) );
@ -440,7 +440,7 @@ SCH_SHEET* SCH_IO_EAGLE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC
wxT( "KiCad" ) ) );
// Save project symbol library table.
wxFileName fn( m_schematic->Prj().GetProjectPath(),
wxFileName fn( m_schematic->Project().GetProjectPath(),
SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
// So output formatter goes out of scope and closes the file before reloading.
@ -450,8 +450,8 @@ SCH_SHEET* SCH_IO_EAGLE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC
}
// Reload the symbol library table.
m_schematic->Prj().SetElem( PROJECT::ELEM::SYMBOL_LIB_TABLE, nullptr );
PROJECT_SCH::SchSymbolLibTable( &m_schematic->Prj() );
m_schematic->Project().SetElem( PROJECT::ELEM::SYMBOL_LIB_TABLE, nullptr );
PROJECT_SCH::SchSymbolLibTable( &m_schematic->Project() );
}
m_eagleDoc = std::make_unique<EAGLE_DOC>( currentNode, this );
@ -1815,7 +1815,7 @@ void SCH_IO_EAGLE::loadInstance( const std::unique_ptr<EINSTANCE>& aInstance,
// assume that footprint library is identical to project name
if( !package.IsEmpty() )
{
wxString footprint = m_schematic->Prj().GetProjectName() + wxT( ":" ) + package;
wxString footprint = m_schematic->Project().GetProjectName() + wxT( ":" ) + package;
symbol->GetField( FIELD_T::FOOTPRINT )->SetText( footprint );
}
@ -1988,7 +1988,7 @@ void SCH_IO_EAGLE::loadInstance( const std::unique_ptr<EINSTANCE>& aInstance,
symbol->AddHierarchicalReference( m_sheetPath.Path(), refPrefix + reference, unit );
// Save the pin positions
SYMBOL_LIB_TABLE& schLibTable = *PROJECT_SCH::SchSymbolLibTable( &m_schematic->Prj() );
SYMBOL_LIB_TABLE& schLibTable = *PROJECT_SCH::SchSymbolLibTable( &m_schematic->Project() );
LIB_SYMBOL* libSymbol = schLibTable.LoadSymbol( symbol->GetLibId() );
wxCHECK( libSymbol, /*void*/ );
@ -2091,7 +2091,7 @@ EAGLE_LIBRARY* SCH_IO_EAGLE::loadLibrary( const ELIBRARY* aLibrary, EAGLE_LIBRAR
if( m_schematic )
{
// assume that footprint library is identical to project name
libName = m_schematic->Prj().GetProjectName();
libName = m_schematic->Project().GetProjectName();
}
else
{

View File

@ -645,7 +645,7 @@ SCH_SHEET* SCH_IO_EASYEDA::LoadSchematicFile( const wxString& aFileName, SCHEMAT
const_cast<KIID&>( rootSheet->m_Uuid ) = screen->GetUuid();
}
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Prj() );
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Project() );
wxCHECK_MSG( libTable, nullptr, wxS( "Could not load symbol lib table." ) );
LoadSchematic( aSchematic, rootSheet, aFileName );

View File

@ -456,12 +456,12 @@ SCH_SHEET* SCH_IO_EASYEDAPRO::LoadSchematicFile( const wxString& aFileName,
screen->SetFileName( aFileName );
rootSheet->SetScreen( screen );
// Virtual root sheet UUID must be the same as the schematic file UUID.
const_cast<KIID&>( rootSheet->m_Uuid ) = screen->GetUuid();
}
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Prj() );
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Project() );
wxCHECK_MSG( libTable, nullptr, wxS( "Could not load symbol lib table." ) );
SCH_EASYEDAPRO_PARSER parser( nullptr, nullptr );
@ -616,7 +616,7 @@ SCH_SHEET* SCH_IO_EASYEDAPRO::LoadSchematicFile( const wxString& aFileName,
libTable->InsertRow( new SYMBOL_LIB_TABLE_ROW( libName, libTableUri, wxS( "KiCad" ) ) );
// Save project symbol library table.
wxFileName fn( aSchematic->Prj().GetProjectPath(),
wxFileName fn( aSchematic->Project().GetProjectPath(),
SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
// So output formatter goes out of scope and closes the file before reloading.
@ -626,8 +626,8 @@ SCH_SHEET* SCH_IO_EASYEDAPRO::LoadSchematicFile( const wxString& aFileName,
}
// Relaod the symbol library table.
aSchematic->Prj().SetElem( PROJECT::ELEM::SYMBOL_LIB_TABLE, NULL );
PROJECT_SCH::SchSymbolLibTable( &aSchematic->Prj() );
aSchematic->Project().SetElem( PROJECT::ELEM::SYMBOL_LIB_TABLE, NULL );
PROJECT_SCH::SchSymbolLibTable( &aSchematic->Project() );
}
// set properties to prevent save file on every symbol save

View File

@ -151,13 +151,13 @@ SCH_SHEET* SCH_IO_KICAD_LEGACY::LoadSchematicFile( const wxString& aFileName, SC
}
if( m_path.IsEmpty() )
m_path = aSchematic->Prj().GetProjectPath();
m_path = aSchematic->Project().GetProjectPath();
wxLogTrace( traceSchLegacyPlugin, "Normalized append path \"%s\".", m_path );
}
else
{
m_path = aSchematic->Prj().GetProjectPath();
m_path = aSchematic->Project().GetProjectPath();
}
m_currentPath.push( m_path );

View File

@ -127,13 +127,13 @@ SCH_SHEET* SCH_IO_KICAD_SEXPR::LoadSchematicFile( const wxString& aFileName, SCH
}
if( m_path.IsEmpty() )
m_path = aSchematic->Prj().GetProjectPath();
m_path = aSchematic->Project().GetProjectPath();
wxLogTrace( traceSchPlugin, "Normalized append path \"%s\".", m_path );
}
else
{
m_path = aSchematic->Prj().GetProjectPath();
m_path = aSchematic->Project().GetProjectPath();
}
m_currentPath.push( m_path );
@ -148,7 +148,7 @@ SCH_SHEET* SCH_IO_KICAD_SEXPR::LoadSchematicFile( const wxString& aFileName, SCH
// Do not use wxPATH_UNIX as option in MakeRelativeTo(). It can create incorrect
// relative paths on Windows, because paths have a disk identifier (C:, D: ...)
relPath.MakeRelativeTo( aSchematic->Prj().GetProjectPath() );
relPath.MakeRelativeTo( aSchematic->Project().GetProjectPath() );
newSheet->SetFileName( relPath.GetFullPath() );
m_rootSheet = newSheet.get();
@ -1064,7 +1064,7 @@ void SCH_IO_KICAD_SEXPR::saveSheet( SCH_SHEET* aSheet, const SCH_SHEET_LIST& aSh
wxString projectName;
if( sheetInstances[i].m_Path[0] == rootSheetUuid )
projectName = m_schematic->Prj().GetProjectName();
projectName = m_schematic->Project().GetProjectName();
else
projectName = sheetInstances[i].m_ProjectName;

View File

@ -171,7 +171,7 @@ void LTSPICE_SCHEMATIC::Load( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet,
ascFiles[ascFiles[i].ParentIndex].Sheet->GetScreen()->Append( curSheet );
curSheet->GetScreen()->SetFileName( m_schematic->Prj().GetProjectPath() + sheetName + ".kicad_sch" );
curSheet->GetScreen()->SetFileName( m_schematic->Project().GetProjectPath() + sheetName + ".kicad_sch" );
}
else
{

View File

@ -71,7 +71,7 @@ SCH_SHEET* SCH_IO_LTSPICE::LoadSchematicFile( const wxString& aFileName, SCHEMAT
const_cast<KIID&>( rootSheet->m_Uuid ) = screen->GetUuid();
}
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Prj() );
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Project() );
wxCHECK_MSG( libTable, nullptr, "Could not load symbol lib table." );

View File

@ -386,8 +386,7 @@ std::shared_ptr<NETCLASS> SCH_ITEM::GetEffectiveNetClass( const SCH_SHEET_PATH*
if( schematic )
{
std::shared_ptr<NET_SETTINGS>& netSettings =
schematic->Prj().GetProjectFile().m_NetSettings;
std::shared_ptr<NET_SETTINGS>& netSettings = schematic->Project().GetProjectFile().m_NetSettings;
SCH_CONNECTION* connection = Connection( aSheet );
if( connection )

View File

@ -123,12 +123,12 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_OPTS& aPlotOpts,
wxCHECK( m_schematic, /* void */ );
// Allocate the plotter and set the job level parameter
PDF_PLOTTER* plotter = new PDF_PLOTTER( &m_schematic->Prj() );
PDF_PLOTTER* plotter = new PDF_PLOTTER( &m_schematic->Project() );
plotter->SetRenderSettings( aRenderSettings );
plotter->SetColorMode( !aPlotOpts.m_blackAndWhite );
plotter->SetCreator( wxT( "Eeschema-PDF" ) );
plotter->SetTitle( ExpandTextVars( m_schematic->RootScreen()->GetTitleBlock().GetTitle(),
&m_schematic->Prj() ) );
&m_schematic->Project() ) );
wxString msg;
wxFileName plotFileName;
@ -261,7 +261,7 @@ void SCH_PLOTTER::plotOneSheetPDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
wxString sheetPath = m_schematic->CurrentSheet().PathHumanReadable();
const PAGE_INFO& actualPage = aScreen->GetPageSettings(); // page size selected in schematic
PlotDrawingSheet( aPlotter, &aScreen->Schematic()->Prj(),
PlotDrawingSheet( aPlotter, &aScreen->Schematic()->Project(),
aScreen->GetTitleBlock(),
actualPage,
aScreen->Schematic()->GetProperties(),
@ -475,7 +475,7 @@ bool SCH_PLOTTER::plotOneSheetPS( const wxString& aFileName, SCH_SCREEN* aScreen
wxString sheetPath = m_schematic->CurrentSheet().PathHumanReadable();
COLOR4D color = plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET );
PlotDrawingSheet( plotter, &aScreen->Schematic()->Prj(),
PlotDrawingSheet( plotter, &aScreen->Schematic()->Project(),
aScreen->GetTitleBlock(),
aPageInfo, aScreen->Schematic()->GetProperties(),
aScreen->GetPageNumber(), aScreen->GetPageCount(), sheetName, sheetPath,
@ -654,7 +654,7 @@ bool SCH_PLOTTER::plotOneSheetSVG( const wxString& aFileName, SCH_SCREEN* aScree
wxString sheetPath = m_schematic->CurrentSheet().PathHumanReadable();
COLOR4D color = plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET );
PlotDrawingSheet( plotter, &aScreen->Schematic()->Prj(),
PlotDrawingSheet( plotter, &aScreen->Schematic()->Project(),
aScreen->GetTitleBlock(),
actualPage, aScreen->Schematic()->GetProperties(),
aScreen->GetPageNumber(),
@ -802,7 +802,7 @@ bool SCH_PLOTTER::plotOneSheetDXF( const wxString& aFileName, SCH_SCREEN* aScree
wxString sheetPath = m_schematic->CurrentSheet().PathHumanReadable();
COLOR4D color = plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET );
PlotDrawingSheet( plotter, &m_schematic->Prj(),
PlotDrawingSheet( plotter, &m_schematic->Project(),
aScreen->GetTitleBlock(),
pageInfo,
aScreen->Schematic()->GetProperties(), aScreen->GetPageNumber(),

View File

@ -667,10 +667,10 @@ void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
wxString msg;
std::vector<SCH_SYMBOL*> symbols;
SYMBOL_LIB_TABLE* libs = PROJECT_SCH::SchSymbolLibTable( &Schematic()->Prj() );
SYMBOL_LIB_TABLE* libs = PROJECT_SCH::SchSymbolLibTable( &Schematic()->Project() );
// This will be a nullptr if an s-expression schematic is loaded.
SYMBOL_LIBS* legacyLibs = PROJECT_SCH::SchLibs( &Schematic()->Prj() );
SYMBOL_LIBS* legacyLibs = PROJECT_SCH::SchLibs( &Schematic()->Project() );
for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
@ -1739,7 +1739,7 @@ bool SCH_SCREEN::InProjectPath() const
wxCHECK( Schematic() && !m_fileName.IsEmpty(), false );
wxFileName thisScreenFn( m_fileName );
wxFileName thisProjectFn( Schematic()->Prj().GetProjectFullName() );
wxFileName thisProjectFn( Schematic()->Project().GetProjectFullName() );
wxCHECK( thisProjectFn.IsAbsolute(), false );
@ -2146,7 +2146,7 @@ void SCH_SCREEN::MigrateSimModels()
for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
SIM_MODEL::MigrateSimModel<SCH_SYMBOL>( *symbol, &Schematic()->Prj() );
SIM_MODEL::MigrateSimModel<SCH_SYMBOL>( *symbol, &Schematic()->Project() );
}
}

View File

@ -244,7 +244,7 @@ bool SCH_SHEET::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, in
}
}
PROJECT* project = &schematic->Prj();
PROJECT* project = &schematic->Project();
// We cannot resolve text variables initially on load as we need to first load the screen and
// then parse the hierarchy. So skip the resolution if the screen isn't set yet

View File

@ -1252,7 +1252,7 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, i
int precision = precisionStr.IsEmpty() ? 3 : precisionStr[0] - '0';
wxString range = rangeStr.IsEmpty() ? wxString( wxS( "~A" ) ) : rangeStr;
SIM_LIB_MGR simLibMgr( &schematic->Prj() );
SIM_LIB_MGR simLibMgr( &schematic->Project() );
std::vector<EMBEDDED_FILES*> embeddedFilesStack;
embeddedFilesStack.push_back( schematic->GetEmbeddedFiles() );

View File

@ -115,7 +115,7 @@ void SCH_VIEW::DisplaySheet( const SCH_SCREEN *aScreen )
Add( item );
m_drawingSheet.reset( new DS_PROXY_VIEW_ITEM( schIUScale, &aScreen->GetPageSettings(),
&aScreen->Schematic()->Prj(),
&aScreen->Schematic()->Project(),
&aScreen->GetTitleBlock(),
aScreen->Schematic()->GetProperties() ) );
m_drawingSheet->SetPageNumber( TO_UTF8( aScreen->GetPageNumber() ) );

View File

@ -100,7 +100,7 @@ public:
void Reset();
/// Return a reference to the project this schematic is part of
PROJECT& Prj() const { return *m_project; }
PROJECT& Project() const { return *m_project; }
void SetProject( PROJECT* aPrj );
const std::map<wxString, wxString>* GetProperties() { return &m_properties; }

View File

@ -62,7 +62,7 @@ std::string SPICE_GENERATOR_IBIS::IbisDevice( const SPICE_ITEM& aItem, SCHEMATIC
bool diffMode = GetFieldValue( &aItem.fields, SIM_LIBRARY_IBIS::DIFF_FIELD, true, 0 ) == "1";
WX_STRING_REPORTER reporter;
SIM_LIB_MGR mgr( &aSchematic->Prj() );
SIM_LIB_MGR mgr( &aSchematic->Project() );
std::vector<EMBEDDED_FILES*> embeddedFilesStack;
embeddedFilesStack.push_back( aSchematic->GetEmbeddedFiles() );

View File

@ -132,7 +132,7 @@ wxFileName KI_TEST::SCHEMATIC_TEST_FIXTURE::GetSchematicPath( const wxString& aB
template <typename Exporter>
wxString TEST_NETLIST_EXPORTER_FIXTURE<Exporter>::GetNetlistPath( bool aTest )
{
wxFileName netFile = m_schematic->Prj().GetProjectFullName();
wxFileName netFile = m_schematic->Project().GetProjectFullName();
if( aTest )
netFile.SetName( netFile.GetName() + "_test" );

View File

@ -121,7 +121,7 @@ void LoadSchematic( SETTINGS_MANAGER& aSettingsManager, const wxString& aRelPath
{
if( aSchematic )
{
PROJECT* prj = &aSchematic->Prj();
PROJECT* prj = &aSchematic->Project();
aSchematic->SetProject( nullptr );
aSettingsManager.UnloadProject( prj, false );

View File

@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE( TestMultiNetclasses )
{
LoadSchematic( "multinetclasses" );
std::shared_ptr<NET_SETTINGS>& netSettings = m_schematic->Prj().GetProjectFile().m_NetSettings;
std::shared_ptr<NET_SETTINGS>& netSettings = m_schematic->Project().GetProjectFile().m_NetSettings;
std::shared_ptr<NETCLASS> nc = netSettings->GetEffectiveNetClass( "/BUS.SIGNAL" );
BOOST_CHECK_EQUAL( nc->GetName(), "CLASS2,CLASS1,Default" );

View File

@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE( TestInProjectPath )
// File is in a completely different path with the same folder depth.
testFn.SetPath( "/home/foo/kicad" );
wxFileName projectFn( m_schematic->Prj().GetProjectFullName() );
wxFileName projectFn( m_schematic->Project().GetProjectFullName() );
// Just in case someone has a build path with no subfolders.
BOOST_CHECK( testFn.GetDirCount() < projectFn.GetDirCount() );

View File

@ -99,7 +99,7 @@ public:
wxString GetNetlistPath( bool aTest = false ) override
{
wxFileName netFile = m_schematic->Prj().GetProjectFullName();
wxFileName netFile = m_schematic->Project().GetProjectFullName();
if( aTest )
netFile.SetName( netFile.GetName() + "_test" );

View File

@ -53,7 +53,7 @@ public:
wxString GetNetlistPath( bool aTest = false ) override
{
wxFileName netFile = m_schematic->Prj().GetProjectFullName();
wxFileName netFile = m_schematic->Project().GetProjectFullName();
if( aTest )
netFile.SetName( netFile.GetName() + "_test" );