52 bool aForceDefaultProject,
PROJECT* aProject,
bool aCalculateConnectivity )
55 return LoadSchematic( aFileName, SCH_IO_MGR::SCH_KICAD, aSetActive, aForceDefaultProject,
56 aProject, aCalculateConnectivity );
58 return LoadSchematic( aFileName, SCH_IO_MGR::SCH_LEGACY, aSetActive, aForceDefaultProject,
59 aProject, aCalculateConnectivity );
62 return LoadSchematic( aFileName, SCH_IO_MGR::SCH_LEGACY, aSetActive, aForceDefaultProject, aProject,
63 aCalculateConnectivity );
68 SCH_IO_MGR::SCH_FILE_T aFormat,
70 bool aForceDefaultProject,
72 bool aCalculateConnectivity )
74 wxFileName pro = aFileName;
77 wxString projectPath = pro.GetFullPath();
91 if( !aForceDefaultProject )
95 if( wxFileExists( projectPath ) )
109 if( !
project || aForceDefaultProject )
115 schematic->CreateDefaultScreens();
117 wxFileName schFile = aFileName;
118 schFile.MakeAbsolute();
122 SCH_SHEET* rootSheet = pi->LoadSchematicFile( schFile.GetFullPath(), schematic );
125 schematic->SetTopLevelSheets( { rootSheet } );
134 SCH_SHEET_LIST sheetList = schematic->BuildSheetListSortedByPageNumbers();
138 screen->UpdateLocalLibSymbolLinks();
140 if( schematic->RootScreen()->GetFileFormatVersionAtLoad() < 20221002 )
145 if( schematic->RootScreen()->GetFileFormatVersionAtLoad() < 20230221 )
149 screen->MigrateSimModels();
153 schematic->ConnectionGraph()->Reset();
158 if( aCalculateConnectivity )
161 schematic->RecalculateConnections( &dummyCommit,
GLOBAL_CLEANUP, toolManager );
164 schematic->ResolveERCExclusionsPostUpdate();
166 schematic->SetSheetNumberAndCount();
167 schematic->RecomputeIntersheetRefs();
171 sheet.UpdateAllScreenReferences();
172 sheet.LastScreen()->TestDanglingEnds(
nullptr,
nullptr );
175 if( aCalculateConnectivity )
176 schematic->ConnectionGraph()->Recalculate( sheetList,
true );
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static void SetSchEditFrame(SCH_EDIT_FRAME *aSchEditFrame)
static SCH_EDIT_FRAME * s_SchEditFrame
static SCHEMATIC * LoadSchematic(const wxString &aFileName, bool aSetActive, bool aForceDefaultProject, PROJECT *aProject=nullptr, bool aCalculateConnectivity=true)
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
virtual SETTINGS_MANAGER & GetSettingsManager() const
Container for project specific data.
Holds all the data relating to one schematic.
Schematic editor (Eeschema) main window.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void FixLegacyPowerSymbolMismatches()
Fix legacy power symbols that have mismatched value text fields and invisible power pin names.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void UpdateSheetInstanceData(const std::vector< SCH_SHEET_INSTANCE > &aSheetInstances)
Update all of the sheet instance information using aSheetInstances.
void AnnotatePowerSymbols()
Silently annotate the not yet annotated power symbols of the entire hierarchy of the sheet path list.
void UpdateSymbolInstanceData(const std::vector< SCH_SYMBOL_INSTANCE > &aSymbolInstances)
Update all of the symbol instance information using aSymbolInstances.
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.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
PROJECT * GetProject(const wxString &aFullPath) const
Retrieve a loaded project by name.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
static const std::string LegacySchematicFileExtension
static const std::string ProjectFileExtension
static const std::string KiCadSchematicFileExtension
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
PGM_BASE & Pgm()
The global program "get" accessor.
std::vector< FAB_LAYER_COLOR > dummy
Definition of file extensions used in Kicad.