KiCad PCB EDA Suite
Loading...
Searching...
No Matches
TEST_PROJECT Class Reference
Inheritance diagram for TEST_PROJECT:
PROJECT

Public Types

enum class  ELEM {
  LEGACY_SYMBOL_LIBS , SCH_SEARCH_STACK , S3DCACHE , SEARCH_STACK ,
  SCHEMATIC , BOARD , COUNT
}
 The set of _ELEM objects that a PROJECT can hold. More...
 
enum  LIB_TYPE_T { SYMBOL_LIB , FOOTPRINT_LIB , DESIGN_BLOCK_LIB , LIB_TYPE_COUNT }
 
enum  RSTRING_T {
  DOC_PATH , SCH_LIB_PATH , SCH_LIB_SELECT , VIEWER_3D_PATH ,
  VIEWER_3D_FILTER_INDEX , PCB_LIB_PATH , PCB_LIB_NICKNAME , PCB_FOOTPRINT ,
  PCB_FOOTPRINT_EDITOR_FP_NAME , PCB_FOOTPRINT_EDITOR_LIB_NICKNAME , PCB_FOOTPRINT_VIEWER_FP_NAME , PCB_FOOTPRINT_VIEWER_LIB_NICKNAME ,
  RSTRING_COUNT
}
 Retain a number of project specific wxStrings, enumerated here: More...
 

Public Member Functions

 TEST_PROJECT (const wxString &aPath)
 
const wxString GetProjectFullName () const override
 Return the full path and name of the project.
 
virtual bool TextVarResolver (wxString *aToken) const
 
virtual std::map< wxString, wxString > & GetTextVars () const
 
virtual void ApplyTextVars (const std::map< wxString, wxString > &aVarsMap)
 Applies the given var map, it will create or update existing vars.
 
int GetTextVarsTicker () const
 
void IncrementTextVarsTicker ()
 
int GetNetclassesTicker () const
 
void IncrementNetclassesTicker ()
 
virtual const wxString GetProjectPath () const
 Return the full path of the project.
 
virtual const wxString GetProjectDirectory () const
 Return the full path of the project DIRECTORY.
 
virtual const wxString GetProjectName () const
 Return the short name of the project.
 
virtual bool IsNullProject () const
 Check if this project is a null project (i.e.
 
virtual bool IsReadOnly () const
 
virtual void SetReadOnly (bool aReadOnly=true)
 
virtual bool IsLockOverrideGranted () const
 
virtual void SetLockOverrideGranted (bool aGranted=true)
 
virtual const wxString GetSheetName (const KIID &aSheetID)
 Return the name of the sheet identified by the given UUID.
 
virtual const wxString FootprintLibTblName () const
 Returns the path and filename of this project's footprint library table.
 
virtual const wxString SymbolLibTableName () const
 Return the path and file name of this projects symbol library table.
 
virtual const wxString DesignBlockLibTblName () const
 Return the path and file name of this projects design block library table.
 
void PinLibrary (const wxString &aLibrary, enum LIB_TYPE_T aLibType)
 
void UnpinLibrary (const wxString &aLibrary, enum LIB_TYPE_T aLibType)
 
virtual PROJECT_FILE & GetProjectFile () const
 
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings () const
 
virtual std::shared_ptr< KIGIT_COMMON > GetGitCommon () const
 This project's Git session, created empty on first use.
 
virtual bool AttachGitRepository ()
 Find the Git repository containing the project directory and bind it to the session.
 
virtual void ReleaseGitCommon ()
 Safely release the session's repository handle and drop the session.
 
virtual const wxString & GetRString (RSTRING_T aStringId)
 Return a "retained string", which is any session and project specific string identified in enum RSTRING_T.
 
virtual void SetRString (RSTRING_T aStringId, const wxString &aString)
 Store a "retained string", which is any session and project specific string identified in enum RSTRING_T.
 
virtual _ELEM * GetElem (PROJECT::ELEM aIndex)
 Get and set the elements for this project.
 
virtual void SetElem (PROJECT::ELEM aIndex, _ELEM *aElem)
 
void Clear ()
 Clear the _ELEMs and RSTRINGs.
 
virtual const wxString AbsolutePath (const wxString &aFileName) const
 Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
 
virtual FOOTPRINT_LIBRARY_ADAPTER * FootprintLibAdapter (KIWAY &aKiway)
 Fetches the footprint library adapter from the PCB editor instance.
 
virtual DESIGN_BLOCK_LIBRARY_ADAPTER * DesignBlockLibs ()
 Return the table of design block libraries.
 
void SetProjectLock (LOCKFILE *aLockFile)
 
LOCKFILE * GetProjectLock () const
 
void SaveToHistory (const wxString &aProjectPath, std::vector< HISTORY_FILE_DATA > &aFileData)
 Produce HISTORY_FILE_DATA entries for project files (.kicad_pro and .kicad_prl).
 
std::weak_ptr< void > GetHistoryLifetimeToken () const
 Liveness token handed to LOCAL_HISTORY::RegisterSaver so a shared autosave timer skips this project's saver once the project is destroyed instead of serializing freed memory.
 

Private Member Functions

virtual void elemsClear ()
 Delete all the _ELEMs and set their pointers to NULL.
 
virtual void setProjectFullName (const wxString &aFullPathAndName)
 Set the full directory, basename, and extension of the project.
 
virtual void setProjectFile (PROJECT_FILE *aFile)
 Set the backing store file for this project.
 
virtual void setLocalSettings (PROJECT_LOCAL_SETTINGS *aSettings)
 Set the local settings backing store.
 
const wxString libTableName (const wxString &aLibTableName) const
 Return the full path and file name of the project specific library table aLibTableName.
 

Private Attributes

wxString m_path
 
wxFileName m_project_name
 <fullpath>/<basename>.pro
 
bool m_readOnly
 No project files will be written to disk.
 
bool m_lockOverrideGranted
 User granted override at project level.
 
int m_textVarsTicker
 Update counter on text vars.
 
int m_netclassesTicker
 Update counter on netclasses.
 
PROJECT_FILE * m_projectFile
 Backing store for project data – owned by SETTINGS_MANAGER.
 
PROJECT_LOCAL_SETTINGS * m_localSettings
 Backing store for project local settings – owned by SETTINGS_MANAGER.
 
std::shared_ptr< KIGIT_COMMON > m_gitCommon
 Git session for the repository containing this project, created on first use.
 
std::map< KIID, wxString > m_sheetNames
 
std::array< wxString, RSTRING_COUNT > m_rstrings
 
std::array< _ELEM *, static_cast< unsigned int >(PROJECT::ELEM::COUNT)> m_elems
 
std::unique_ptr< LOCKFILE > m_project_lock
 Lock.
 
std::mutex m_designBlockLibsMutex
 Synchronise access to DesignBlockLibs()
 
std::shared_ptr< void > m_historyLifetime = std::make_shared<char>()
 Sentinel whose expiry signals to LOCAL_HISTORY that this project has been destroyed.
 

Detailed Description

Definition at line 32 of file test_jobs_output_archive.cpp.

Member Enumeration Documentation

◆ ELEM

enum class PROJECT::ELEM
stronginherited

The set of _ELEM objects that a PROJECT can hold.

Enumerator
LEGACY_SYMBOL_LIBS 
SCH_SEARCH_STACK 
S3DCACHE 
SEARCH_STACK 
SCHEMATIC 
BOARD 
COUNT 

Definition at line 68 of file project.h.

◆ LIB_TYPE_T

enum PROJECT::LIB_TYPE_T
inherited
Enumerator
SYMBOL_LIB 
FOOTPRINT_LIB 
DESIGN_BLOCK_LIB 
LIB_TYPE_COUNT 

Definition at line 189 of file project.h.

◆ RSTRING_T

enum PROJECT::RSTRING_T
inherited

Retain a number of project specific wxStrings, enumerated here:

Enumerator
DOC_PATH 
SCH_LIB_PATH 
SCH_LIB_SELECT 
VIEWER_3D_PATH 
VIEWER_3D_FILTER_INDEX 
PCB_LIB_PATH 
PCB_LIB_NICKNAME 
PCB_FOOTPRINT 
PCB_FOOTPRINT_EDITOR_FP_NAME 
PCB_FOOTPRINT_EDITOR_LIB_NICKNAME 
PCB_FOOTPRINT_VIEWER_FP_NAME 
PCB_FOOTPRINT_VIEWER_LIB_NICKNAME 
RSTRING_COUNT 

Definition at line 232 of file project.h.

Constructor & Destructor Documentation

◆ TEST_PROJECT()

TEST_PROJECT::TEST_PROJECT ( const wxString & aPath)
inlineexplicit

Definition at line 35 of file test_jobs_output_archive.cpp.

References m_path.

Member Function Documentation

◆ AbsolutePath()

const wxString PROJECT::AbsolutePath ( const wxString & aFileName) const
virtualinherited

◆ ApplyTextVars()

void PROJECT::ApplyTextVars ( const std::map< wxString, wxString > & aVarsMap)
virtualinherited

◆ AttachGitRepository()

bool PROJECT::AttachGitRepository ( )
virtualinherited

◆ Clear()

void PROJECT::Clear ( )
inlineinherited

Clear the _ELEMs and RSTRINGs.

Definition at line 288 of file project.h.

References elemsClear(), RSTRING_COUNT, and SetRString().

Referenced by setProjectFullName().

◆ DesignBlockLibs()

◆ DesignBlockLibTblName()

const wxString PROJECT::DesignBlockLibTblName ( ) const
virtualinherited

Return the path and file name of this projects design block library table.

Definition at line 312 of file project.cpp.

References FILEEXT::DesignBlockLibraryTableFileName, and libTableName().

◆ elemsClear()

void PROJECT::elemsClear ( )
privatevirtualinherited

Delete all the _ELEMs and set their pointers to NULL.

Definition at line 66 of file project.cpp.

References m_elems, and SetElem().

Referenced by Clear(), TEST_NETLISTS_FIXTURE, and ~PROJECT().

◆ FootprintLibAdapter()

FOOTPRINT_LIBRARY_ADAPTER * PROJECT::FootprintLibAdapter ( KIWAY & aKiway)
virtualinherited

Fetches the footprint library adapter from the PCB editor instance.

Definition at line 519 of file project.cpp.

References KIWAY::FACE_PCB, KIWAY::KiFACE(), kiface(), and KIFACE_FOOTPRINT_LIBRARY_ADAPTER.

◆ FootprintLibTblName()

const wxString PROJECT::FootprintLibTblName ( ) const
virtualinherited

Returns the path and filename of this project's footprint library table.

This project specific footprint library table not the global one.

Definition at line 306 of file project.cpp.

References FILEEXT::FootprintLibraryTableFileName, and libTableName().

◆ GetElem()

PROJECT::_ELEM * PROJECT::GetElem ( PROJECT::ELEM aIndex)
virtualinherited

Get and set the elements for this project.

This is a cross module API, therefore the _ELEM destructor is virtual and can point to a destructor function in another link image. Be careful that that program module is resident at time of destruction.

Summary: -#) cross module API. -#) PROJECT knows nothing about _ELEM objects except how to delete them and set and get pointers to them.

Definition at line 478 of file project.cpp.

References m_elems.

Referenced by PROJECT_PCB::Cleanup3DCache(), PROJECT_PCB::Get3DCacheManager(), PROJECT_SCH::LegacySchLibs(), and PROJECT_SCH::SchSearchS().

◆ GetGitCommon()

std::shared_ptr< KIGIT_COMMON > PROJECT::GetGitCommon ( ) const
virtualinherited

This project's Git session, created empty on first use.

The repository handle is null until AttachGitRepository() finds one.

UI thread only, the lazy creation is not synchronized. Background work takes a shared pointer captured on the UI thread instead.

Definition at line 84 of file project.cpp.

References GetProjectPath(), and m_gitCommon.

Referenced by AttachGitRepository(), KIGIT::ClearSyncWarnings(), PROJECT_TREE_PANE::gitCommon(), KICAD_MANAGER_CONTROL::NewFromRepository(), and KICAD_MANAGER_FRAME::OnCompareProjectBranches().

◆ GetHistoryLifetimeToken()

std::weak_ptr< void > PROJECT::GetHistoryLifetimeToken ( ) const
inlineinherited

Liveness token handed to LOCAL_HISTORY::RegisterSaver so a shared autosave timer skips this project's saver once the project is destroyed instead of serializing freed memory.

Definition at line 333 of file project.h.

References m_historyLifetime.

Referenced by KICAD_MANAGER_FRAME::ProjectChanged().

◆ GetLocalSettings()

◆ GetNetclassesTicker()

int PROJECT::GetNetclassesTicker ( ) const
inlineinherited

Definition at line 114 of file project.h.

References m_netclassesTicker.

◆ GetProjectDirectory()

const wxString PROJECT::GetProjectDirectory ( ) const
virtualinherited

Return the full path of the project DIRECTORY.

This is the path of the project file and will always be an absolute path, ending with a path separator.

Definition at line 282 of file project.cpp.

References m_project_name.

Referenced by PROJECT_SCH::SchSearchS().

◆ GetProjectFile()

virtual PROJECT_FILE & PROJECT::GetProjectFile ( ) const
inlinevirtualinherited

Definition at line 201 of file project.h.

References m_projectFile.

Referenced by DESIGN_BLOCK_TREE_MODEL_ADAPTER::AddLibraries(), FP_TREE_MODEL_ADAPTER::AddLibraries(), SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), KICAD_DIFF::PCB_MERGE_APPLIER::Apply(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), CVPCB_MAINFRAME::buildEquivalenceList(), CVPCB_MAINFRAME::BuildLibrariesList(), ChainBridgingDelayPerMm(), PCB_TUNING_PATTERN::CreateNew(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), KICAD_DIFF::PCB_DIFFER::Diff(), SCH_CONNECTIVITY::Dump(), SCH_CONNECTIVITY::Dump(), PCB_TUNING_PATTERN::EditStart(), EVT_UPDATE_UI_RANGE(), GenerateIpc2581File(), SCH_ITEM::GetEffectiveNetClass(), SCHEMATIC_SETTINGS::GetJunctionSize(), PCB_EDIT_FRAME::GetLastPath(), LEGACY_SYMBOL_LIBS::GetLibNamesAndPaths(), PCB_BASE_FRAME::GetLibraryItemsForListDialog(), SCH_BASE_FRAME::GetLibraryItemsForListDialog(), GetSheetName(), GetTextVars(), API_HANDLER_COMMON::handleGetNetClassAssignments(), API_HANDLER_COMMON::handleGetNetClasses(), API_HANDLER_COMMON::handleSetNetClassAssignments(), API_HANDLER_COMMON::handleSetNetClasses(), FIELDS_GRID_TABLE::initGrid(), EESCHEMA_JOBS_HANDLER::JobDowngrade(), EESCHEMA_JOBS_HANDLER::JobExportBom(), SCH_EDIT_FRAME::KiwayMailIn(), BOARD_LOADER::Load(), PCB_EDIT_FRAME::LoadDrawingSheet(), PCBNEW_JOBS_HANDLER::loadOverrideDrawingSheet(), PCB_EDIT_FRAME::LoadProjectSettings(), SIMULATOR_FRAME::LoadSettings(), DIALOG_BOARD_SETUP::onAuxiliaryAction(), DIALOG_SCHEMATIC_SETUP::onAuxiliaryAction(), PCB_EDIT_FRAME::OnBoardLoaded(), DIALOG_CONFIG_EQUFILES::OnOkClick(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_CONNECTIVITY::FACADE::Recalculate(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), ReloadOpenEditors(), PCBNEW_JOBS_HANDLER::runPcbMerge(), EESCHEMA_JOBS_HANDLER::runSchMerge(), SCH_EDIT_FRAME::SaveProject(), KICAD_MANAGER_CONTROL::SaveProjectAs(), PCB_EDIT_FRAME::SaveProjectLocalSettings(), SCH_EDIT_FRAME::saveProjectSettings(), ROUTER_TOOL::saveRouterDebugLog(), SIMULATOR_FRAME::SaveSettings(), DIALOG_EXPORT_2581::saveToProject(), API_HANDLER_PCB::setDrawingSheetFileName(), PCB_EDIT_FRAME::SetLastPath(), LEGACY_SYMBOL_LIBS::SetLibNamesAndPaths(), BOARD::SetProject(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SIMULATOR_FRAME::SIMULATOR_FRAME(), BOARD::SynchronizeComponentClasses(), DIALOG_EXPORT_2581::TransferDataToWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow(), SCH_API_SAVE::UpdateProjectFile(), SIMULATOR_FRAME::UpdateTitle(), and EDA_3D_VIEWER_FRAME::~EDA_3D_VIEWER_FRAME().

◆ GetProjectFullName()

const wxString TEST_PROJECT::GetProjectFullName ( ) const
inlineoverridevirtual

Return the full path and name of the project.

This is the same as the name of the project file (.pro prior to version 6 and .kicad_prj from version 6 onwards) and will always be an absolute path.

Reimplemented from PROJECT.

Definition at line 37 of file test_jobs_output_archive.cpp.

References m_path.

◆ GetProjectLock()

LOCKFILE * PROJECT::GetProjectLock ( ) const
inherited

Definition at line 548 of file project.cpp.

References m_project_lock.

◆ GetProjectName()

◆ GetProjectPath()

const wxString PROJECT::GetProjectPath ( ) const
virtualinherited

Return the full path of the project.

This is the path of the project file and will always be an absolute path, ending with a path separator.

Definition at line 276 of file project.cpp.

References m_project_name.

Referenced by DIALOG_MIGRATE_3D_MODELS::AutoMigrateByFilename(), DIALOG_MIGRATE_3D_MODELS::BoardHasUnresolvedWrlReferences(), BOOST_AUTO_TEST_CASE(), PCB_EDIT_FRAME::canCloseWindow(), SCH_EDIT_FRAME::canCloseWindow(), KICAD_MANAGER_FRAME::CloseProject(), PCB_CONTROL::CollectAndEmbed3DModels(), SCH_INSPECTION_TOOL::CompareSchematicWithHistory(), ConvertPathToFileUri(), DIALOG_MIGRATE_3D_MODELS::CountUnresolvedWrlReferences(), SCH_IO_LTSPICE_PARSER::CreateItems(), PCB_BASE_EDIT_FRAME::createNewLibrary(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), SCH_CONNECTIVITY::INPUT_STORE::ExternalSourcesChanged(), GetGitCommon(), DIALOG_PLOT_SCHEMATIC::getOutputPath(), SETTINGS_MANAGER::GetPathForSettingsFile(), SETTINGS_MANAGER::GetProjectForPath(), API_HANDLER_SYMBOL::handleGetOpenDocuments(), BOARD_LOADER::initializeLoadedBoard(), EESCHEMA_JOBS_HANDLER::JobDowngrade(), LTSPICE_SCHEMATIC::Load(), PCBNEW_JOBS_HANDLER::loadOverrideDrawingSheet(), SCH_EDIT_FRAME::LoadProject(), SCH_IO_KICAD_LEGACY::LoadSchematicFile(), SCH_IO_KICAD_SEXPR::LoadSchematicFile(), SCH_EDIT_FRAME::LoadSheetFromFile(), NormalizePath(), DIALOG_SIM_MODEL< T >::onBrowseButtonClick(), DIALOG_REMOTE_SYMBOL_CONFIG::onBrowseDestination(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_DESTINATION::onOutputPathBrowseClicked(), DIALOG_DRC::OnSaveReport(), DIALOG_ERC::OnSaveReport(), kiapi::common::PackProject(), PathIsInsideProject(), ReconcileImportedFootprints(), ReconcileImportedSymbols(), RegisterLocalFootprintLibraries(), RegisterLocalSymbolLibraries(), ReleaseGitCommon(), ReloadOpenEditors(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), ResolveFile(), JOBS_RUNNER::runSpecialArchive(), SETTINGS_MANAGER::SaveProject(), SCH_EDIT_FRAME::saveProjectSettings(), FILENAME_RESOLVER::SetProject(), DIALOG_EXPORT_NETLIST::TransferDataFromWindow(), SETTINGS_MANAGER::unloadProjectFile(), SCH_API_SAVE::UpdateProjectFile(), API_HANDLER_SCH::validateDocumentInternal(), API_HANDLER_SYMBOL::validateDocumentInternal(), API_HANDLER_COMMON::validateProject(), and SCH_EDIT_FRAME::WriteNetListFile().

◆ GetRString()

const wxString & PROJECT::GetRString ( RSTRING_T aStringId)
virtualinherited

Return a "retained string", which is any session and project specific string identified in enum RSTRING_T.

Retained strings are not written to disk, and are therefore good only for the current session.

Definition at line 459 of file project.cpp.

References m_rstrings.

Referenced by FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), SYMBOL_EDIT_FRAME::saveLibrary(), PCB_BASE_EDIT_FRAME::SelectLibrary(), and SCH_BASE_FRAME::SelectLibrary().

◆ GetSheetName()

const wxString PROJECT::GetSheetName ( const KIID & aSheetID)
virtualinherited

Return the name of the sheet identified by the given UUID.

Definition at line 433 of file project.cpp.

References KIID::AsString(), GetProjectFile(), and m_sheetNames.

◆ GetTextVars()

◆ GetTextVarsTicker()

int PROJECT::GetTextVarsTicker ( ) const
inlineinherited

Definition at line 111 of file project.h.

References m_textVarsTicker.

◆ IncrementNetclassesTicker()

void PROJECT::IncrementNetclassesTicker ( )
inlineinherited

◆ IncrementTextVarsTicker()

◆ IsLockOverrideGranted()

virtual bool PROJECT::IsLockOverrideGranted ( ) const
inlinevirtualinherited

Definition at line 163 of file project.h.

References m_lockOverrideGranted.

◆ IsNullProject()

bool PROJECT::IsNullProject ( ) const
virtualinherited

Check if this project is a null project (i.e.

the default project object created when no real project is open).

The null project still presents all the same project interface, but is not backed by any files, so saving it makes no sense.

Returns
true if this is an empty project.

Definition at line 294 of file project.cpp.

References m_project_name.

Referenced by AskSaveBoardFileName(), API_HANDLER_SYMBOL::handleGetOpenDocuments(), IsReadOnly(), and LEGACY_SYMBOL_LIBS::LoadAllLibraries().

◆ IsReadOnly()

virtual bool PROJECT::IsReadOnly ( ) const
inlinevirtualinherited

Definition at line 159 of file project.h.

References IsNullProject(), and m_readOnly.

Referenced by SETTINGS_MANAGER::SaveProject(), and SETTINGS_MANAGER::SaveProjectAs().

◆ libTableName()

const wxString PROJECT::libTableName ( const wxString & aLibTableName) const
privateinherited

Return the full path and file name of the project specific library table aLibTableName.

Definition at line 388 of file project.cpp.

References GetProjectFullName(), KIPLATFORM::ENV::GetUserConfigPath(), and path.

Referenced by DesignBlockLibTblName(), FootprintLibTblName(), and SymbolLibTableName().

◆ PinLibrary()

◆ ReleaseGitCommon()

void PROJECT::ReleaseGitCommon ( )
virtualinherited

Safely release the session's repository handle and drop the session.

Definition at line 165 of file project.cpp.

References GetProjectPath(), m_gitCommon, and KIGIT::PROJECT_GIT_UTILS::SafeFreeRepository().

Referenced by PROJECT_TREE_PANE::releaseGitRepo(), setProjectFullName(), PROJECT_TREE_PANE::WaitForGitOperations(), and ~PROJECT().

◆ SaveToHistory()

void PROJECT::SaveToHistory ( const wxString & aProjectPath,
std::vector< HISTORY_FILE_DATA > & aFileData )
inherited

Produce HISTORY_FILE_DATA entries for project files (.kicad_pro and .kicad_prl).

Uses sourcePath for file-copy semantics since project files are small. This method is used as a saver callback for LOCAL_HISTORY during autosave operations.

Parameters
aProjectPathThe path to check against this project's path
aFileDataOutput vector to append file-copy data for history inclusion

Definition at line 560 of file project.cpp.

References HISTORY_FILE_DATA::content, GetProjectFullName(), m_projectFile, FILEEXT::ProjectLocalSettingsFileExtension, HISTORY_FILE_DATA::relativePath, and HISTORY_FILE_DATA::sourcePath.

Referenced by KICAD_MANAGER_FRAME::ProjectChanged().

◆ SetElem()

◆ setLocalSettings()

virtual void PROJECT::setLocalSettings ( PROJECT_LOCAL_SETTINGS * aSettings)
inlineprivatevirtualinherited

Set the local settings backing store.

This should only be called by SETTINGS_MANAGER on load.

Parameters
aSettingsis the local settings object (may or may not exist on disk at this point)

Definition at line 373 of file project.h.

References m_localSettings.

◆ SetLockOverrideGranted()

virtual void PROJECT::SetLockOverrideGranted ( bool aGranted = true)
inlinevirtualinherited

Definition at line 165 of file project.h.

References m_lockOverrideGranted.

Referenced by KICAD_MANAGER_FRAME::LoadProject().

◆ setProjectFile()

virtual void PROJECT::setProjectFile ( PROJECT_FILE * aFile)
inlineprivatevirtualinherited

Set the backing store file for this project.

This should only be called by SETTINGS_MANAGER on load.

Parameters
aFileis a loaded PROJECT_FILE.

Definition at line 361 of file project.h.

References m_projectFile.

Referenced by SETTINGS_MANAGER::loadProjectFile().

◆ setProjectFullName()

void PROJECT::setProjectFullName ( const wxString & aFullPathAndName)
privatevirtualinherited

Set the full directory, basename, and extension of the project.

This is the name of the project file with full absolute path and it also defines the name of the project. The project name and the project file names are exactly the same, providing the project filename is absolute.

Definition at line 243 of file project.cpp.

References Clear(), GetProjectFullName(), m_project_name, FILEEXT::ProjectFileExtension, ReleaseGitCommon(), TO_UTF8, and tracePathsAndFiles.

Referenced by SETTINGS_MANAGER::SaveProjectAs(), and TEST_NETLISTS_FIXTURE.

◆ SetProjectLock()

void PROJECT::SetProjectLock ( LOCKFILE * aLockFile)
inherited

Definition at line 554 of file project.cpp.

References m_project_lock.

Referenced by KICAD_MANAGER_FRAME::ProjectChanged().

◆ SetReadOnly()

virtual void PROJECT::SetReadOnly ( bool aReadOnly = true)
inlinevirtualinherited

◆ SetRString()

void PROJECT::SetRString ( RSTRING_T aStringId,
const wxString & aString )
virtualinherited

Store a "retained string", which is any session and project specific string identified in enum RSTRING_T.

Retained strings are not written to disk, and are therefore good only for the current session.

Definition at line 448 of file project.cpp.

References m_rstrings.

Referenced by Clear(), PCB_EDIT_FRAME::ExportFootprintsToLibrary(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), SYMBOL_EDIT_FRAME::saveLibrary(), PCB_BASE_EDIT_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibrary(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), and FOOTPRINT_VIEWER_FRAME::setCurNickname().

◆ SymbolLibTableName()

const wxString PROJECT::SymbolLibTableName ( ) const
virtualinherited

Return the path and file name of this projects symbol library table.

Definition at line 300 of file project.cpp.

References libTableName(), and FILEEXT::SymbolLibraryTableFileName.

◆ TextVarResolver()

◆ UnpinLibrary()

Member Data Documentation

◆ m_designBlockLibsMutex

std::mutex PROJECT::m_designBlockLibsMutex
privateinherited

Synchronise access to DesignBlockLibs()

Definition at line 412 of file project.h.

Referenced by DesignBlockLibs().

◆ m_elems

std::array<_ELEM*,static_cast<unsigned int>( PROJECT::ELEM::COUNT )> PROJECT::m_elems
privateinherited
See also
this::Elem() and enum ELEM_T.

Definition at line 406 of file project.h.

Referenced by elemsClear(), GetElem(), PROJECT(), and SetElem().

◆ m_gitCommon

std::shared_ptr<KIGIT_COMMON> PROJECT::m_gitCommon
mutableprivateinherited

Git session for the repository containing this project, created on first use.

Definition at line 398 of file project.h.

Referenced by GetGitCommon(), and ReleaseGitCommon().

◆ m_historyLifetime

std::shared_ptr<void> PROJECT::m_historyLifetime = std::make_shared<char>()
privateinherited

Sentinel whose expiry signals to LOCAL_HISTORY that this project has been destroyed.

Definition at line 415 of file project.h.

Referenced by GetHistoryLifetimeToken().

◆ m_localSettings

PROJECT_LOCAL_SETTINGS* PROJECT::m_localSettings
privateinherited

Backing store for project local settings – owned by SETTINGS_MANAGER.

Definition at line 395 of file project.h.

Referenced by AttachGitRepository(), GetLocalSettings(), PROJECT(), and setLocalSettings().

◆ m_lockOverrideGranted

bool PROJECT::m_lockOverrideGranted
privateinherited

User granted override at project level.

Definition at line 387 of file project.h.

Referenced by IsLockOverrideGranted(), PROJECT(), and SetLockOverrideGranted().

◆ m_netclassesTicker

int PROJECT::m_netclassesTicker
privateinherited

Update counter on netclasses.

Definition at line 389 of file project.h.

Referenced by GetNetclassesTicker(), IncrementNetclassesTicker(), and PROJECT().

◆ m_path

wxString TEST_PROJECT::m_path
private

Definition at line 40 of file test_jobs_output_archive.cpp.

Referenced by GetProjectFullName(), and TEST_PROJECT().

◆ m_project_lock

std::unique_ptr<LOCKFILE> PROJECT::m_project_lock
privateinherited

Lock.

Definition at line 409 of file project.h.

Referenced by GetProjectLock(), and SetProjectLock().

◆ m_project_name

wxFileName PROJECT::m_project_name
privateinherited

<fullpath>/<basename>.pro

Definition at line 384 of file project.h.

Referenced by GetProjectDirectory(), GetProjectFullName(), GetProjectName(), GetProjectPath(), IsNullProject(), and setProjectFullName().

◆ m_projectFile

PROJECT_FILE* PROJECT::m_projectFile
privateinherited

Backing store for project data – owned by SETTINGS_MANAGER.

Definition at line 392 of file project.h.

Referenced by GetProjectFile(), PinLibrary(), PROJECT(), SaveToHistory(), setProjectFile(), TextVarResolver(), and UnpinLibrary().

◆ m_readOnly

bool PROJECT::m_readOnly
privateinherited

No project files will be written to disk.

Definition at line 386 of file project.h.

Referenced by IsReadOnly(), PROJECT(), and SetReadOnly().

◆ m_rstrings

std::array<wxString,RSTRING_COUNT> PROJECT::m_rstrings
privateinherited
See also
this::SetRString(), GetRString(), and enum RSTRING_T.

Definition at line 403 of file project.h.

Referenced by GetRString(), and SetRString().

◆ m_sheetNames

std::map<KIID, wxString> PROJECT::m_sheetNames
privateinherited

Definition at line 400 of file project.h.

Referenced by GetSheetName().

◆ m_textVarsTicker

int PROJECT::m_textVarsTicker
privateinherited

Update counter on text vars.

Definition at line 388 of file project.h.

Referenced by GetTextVarsTicker(), IncrementTextVarsTicker(), and PROJECT().


The documentation for this class was generated from the following file: