|
KiCad PCB EDA Suite
|
Functions | |
| bool | SaveSheetToFile (SCH_SHEET *aSheet, SCHEMATIC &aSchematic, const wxString &aPath) |
| Write a single sheet to disk via SCH_IO. | |
| void | UpdateProjectFile (SCHEMATIC &aSchematic, PROJECT &aProject) |
| Sync schematic metadata into the project file (.kicad_pro) and save it. | |
| bool | SaveSchematic (SCHEMATIC &aSchematic, PROJECT &aProject) |
| Save every screen in the hierarchy to its current path, then update the project file. | |
| bool | SaveSchematicCopy (SCHEMATIC &aSchematic, PROJECT &aProject, const wxString &aFileName, bool aCreateProject) |
| Save the root schematic to aFileName without changing the open document. | |
| bool | SaveSchematicAs (SCHEMATIC &aSchematic, PROJECT &aProject, const wxString &aFileName) |
| Save the schematic to aFileName and adopt it: the root sheet and screen are re-homed to the new path, the whole hierarchy is written, and the project is re-targeted to the new location (creating a project file if none exists there). | |
Save every screen in the hierarchy to its current path, then update the project file.
Definition at line 155 of file sch_api_save.cpp.
References SCH_SCREENS::BuildClientSheetPathList(), SCH_SCREEN::GetClientSheetPaths(), SCH_SCREENS::GetCount(), SCH_SCREEN::GetFileName(), SCH_SCREENS::GetScreen(), SCH_SCREENS::GetSheet(), SCHEMATIC::Root(), SCHEMATIC::RootScreen(), SaveSheetToFile(), BASE_SCREEN::SetContentModified(), BASE_SCREEN::SetVirtualPageNumber(), and UpdateProjectFile().
Referenced by HEADLESS_SCH_CONTEXT::SaveSchematic(), SCH_EDIT_FRAME_CONTEXT::SaveSchematic(), SaveSchematicAs(), and SaveSchematicCopy().
| bool SCH_API_SAVE::SaveSchematicAs | ( | SCHEMATIC & | aSchematic, |
| PROJECT & | aProject, | ||
| const wxString & | aFileName ) |
Save the schematic to aFileName and adopt it: the root sheet and screen are re-homed to the new path, the whole hierarchy is written, and the project is re-targeted to the new location (creating a project file if none exists there).
Used by the headless IPC API SaveDocumentAs handler; there is no frame, so no lock or file history is updated.
Definition at line 235 of file sch_api_save.cpp.
References EnsureFileExtension(), PGM_BASE::GetSettingsManager(), FILEEXT::KiCadSchematicFileExtension, Pgm(), FILEEXT::ProjectFileExtension, SCHEMATIC::Root(), SCHEMATIC::RootScreen(), SETTINGS_MANAGER::SaveProjectAs(), SaveSchematic(), SCH_SCREEN::SetFileName(), SCH_SHEET::SetFileName(), and PROJECT::SetReadOnly().
Referenced by HEADLESS_SCH_CONTEXT::SaveSchematicAs().
| bool SCH_API_SAVE::SaveSchematicCopy | ( | SCHEMATIC & | aSchematic, |
| PROJECT & | aProject, | ||
| const wxString & | aFileName, | ||
| bool | aCreateProject ) |
Save the root schematic to aFileName without changing the open document.
If aFileName matches the open root schematic, this delegates to SaveSchematic(). Otherwise only the root sheet is written (subsheets are not remapped).
When aCreateProject is true and the destination project file does not exist yet, a copy of the current project is written alongside the new schematic.
Definition at line 198 of file sch_api_save.cpp.
References SCH_SCREEN::GetFileName(), SCHEMATIC::GetTopLevelSheet(), Pgm(), FILEEXT::ProjectFileExtension, SCHEMATIC::RootScreen(), SaveSchematic(), and SaveSheetToFile().
Referenced by BOOST_AUTO_TEST_CASE(), HEADLESS_SCH_CONTEXT::SaveSchematicCopy(), and SCH_EDIT_FRAME_CONTEXT::SaveSchematicCopy().
| bool SCH_API_SAVE::SaveSheetToFile | ( | SCH_SHEET * | aSheet, |
| SCHEMATIC & | aSchematic, | ||
| const wxString & | aPath ) |
Write a single sheet to disk via SCH_IO.
Definition at line 44 of file sch_api_save.cpp.
References SCH_IO_MGR::GuessPluginTypeFromSchPath(), KIPLATFORM::IO::MakeWriteable(), and IO_ERROR::What().
Referenced by SaveSchematic(), and SaveSchematicCopy().
Sync schematic metadata into the project file (.kicad_pro) and save it.
Definition at line 83 of file sch_api_save.cpp.
References SCH_SCREEN::GetFileName(), SCH_SHEET::GetName(), PROJECT::GetProjectFile(), PROJECT::GetProjectPath(), TITLE_BLOCK::GetRevision(), PGM_BASE::GetSettingsManager(), PROJECT_FILE::GetSheets(), SCH_SCREEN::GetTitleBlock(), PROJECT_FILE::GetTopLevelSheets(), SCHEMATIC::GetTopLevelSheets(), SCHEMATIC::HasHierarchy(), SCHEMATIC::Hierarchy(), info, SCH_SHEET::IsVirtualRootSheet(), BASE_SCREEN::m_DrawingSheetFileName, PROJECT_FILE::m_IP2581Bom, SCHEMATIC_SETTINGS::m_SchDrawingSheetFileName, PROJECT_FILE::m_SchematicSettings, EDA_ITEM::m_Uuid, Pgm(), FILEEXT::ProjectFileExtension, SCHEMATIC::RecordERCExclusions(), SCHEMATIC::RefreshHierarchy(), SCHEMATIC::RootScreen(), SETTINGS_MANAGER::SaveProject(), and IP2581_BOM::schRevision.
Referenced by SaveSchematic().