KiCad PCB EDA Suite
|
#include <sim_lib_mgr.h>
Public Member Functions | |
SIM_LIB_MGR (const PROJECT *aPrj, REPORTER *aReporter=nullptr) | |
virtual | ~SIM_LIB_MGR ()=default |
void | SetReporter (REPORTER *aReporter) |
void | Clear () |
void | SetLibrary (const wxString &aLibraryPath) |
SIM_MODEL & | CreateModel (SIM_MODEL::TYPE aType, const std::vector< LIB_PIN * > &aPins) |
SIM_MODEL & | CreateModel (const SIM_MODEL *aBaseModel, const std::vector< LIB_PIN * > &aPins) |
template<typename T > | |
SIM_MODEL & | CreateModel (const SIM_MODEL *aBaseModel, const std::vector< LIB_PIN * > &aPins, const std::vector< T > &aFields) |
SIM_LIBRARY::MODEL | CreateModel (const SCH_SHEET_PATH *aSheetPath, SCH_SYMBOL &aSymbol) |
template<typename T > | |
SIM_LIBRARY::MODEL | CreateModel (const std::vector< T > &aFields, const std::vector< LIB_PIN * > &aPins, bool aResolved) |
template<typename T > | |
SIM_LIBRARY::MODEL | CreateModel (const wxString &aLibraryPath, const std::string &aBaseModelName, const std::vector< T > &aFields, const std::vector< LIB_PIN * > &aPins) |
void | SetModel (int aIndex, std::unique_ptr< SIM_MODEL > aModel) |
std::map< wxString, std::reference_wrapper< const SIM_LIBRARY > > | GetLibraries () const |
std::vector< std::reference_wrapper< SIM_MODEL > > | GetModels () const |
std::string | ResolveEmbeddedLibraryPath (const std::string &aLibPath, const std::string &aRelativeLib) |
Static Public Member Functions | |
static wxString | ResolveLibraryPath (const wxString &aLibraryPath, const PROJECT *aProject) |
Private Attributes | |
const PROJECT * | m_project |
REPORTER * | m_reporter |
std::map< wxString, std::unique_ptr< SIM_LIBRARY > > | m_libraries |
std::vector< std::unique_ptr< SIM_MODEL > > | m_models |
Definition at line 40 of file sim_lib_mgr.h.
Definition at line 42 of file sim_lib_mgr.cpp.
|
virtualdefault |
void SIM_LIB_MGR::Clear | ( | ) |
Definition at line 49 of file sim_lib_mgr.cpp.
References m_libraries, and m_models.
Referenced by SetLibrary().
SIM_LIBRARY::MODEL SIM_LIB_MGR::CreateModel | ( | const SCH_SHEET_PATH * | aSheetPath, |
SCH_SYMBOL & | aSymbol | ||
) |
Definition at line 183 of file sim_lib_mgr.cpp.
References CreateModel(), SCH_SYMBOL::GetAllLibPins(), SCH_SYMBOL::GetFieldCount(), SCH_SYMBOL::GetFields(), SCH_SYMBOL::GetRef(), SIM_MODEL::InferSimModel(), SIM_LIBRARY::MODEL::model, REFERENCE_FIELD, SIM_MODEL::SetIsStoredInValue(), SIM_VALUE_GRAMMAR::SI, SIM_DEVICE_TYPE_FIELD, SIM_PARAMS_FIELD, SIM_PINS_FIELD, and SIM_TYPE_FIELD.
SIM_MODEL & SIM_LIB_MGR::CreateModel | ( | const SIM_MODEL * | aBaseModel, |
const std::vector< LIB_PIN * > & | aPins | ||
) |
Definition at line 158 of file sim_lib_mgr.cpp.
References SIM_MODEL::Create(), m_models, and m_reporter.
SIM_MODEL & SIM_LIB_MGR::CreateModel | ( | const SIM_MODEL * | aBaseModel, |
const std::vector< LIB_PIN * > & | aPins, | ||
const std::vector< T > & | aFields | ||
) |
Definition at line 167 of file sim_lib_mgr.cpp.
References SIM_MODEL::Create(), m_models, and m_reporter.
SIM_LIBRARY::MODEL SIM_LIB_MGR::CreateModel | ( | const std::vector< T > & | aFields, |
const std::vector< LIB_PIN * > & | aPins, | ||
bool | aResolved | ||
) |
Definition at line 249 of file sim_lib_mgr.cpp.
References SIM_MODEL::Create(), CreateModel(), SIM_MODEL::GetFieldValue(), SIM_LIBRARY::LIBRARY_FIELD, m_models, m_reporter, and SIM_LIBRARY::NAME_FIELD.
SIM_LIBRARY::MODEL SIM_LIB_MGR::CreateModel | ( | const wxString & | aLibraryPath, |
const std::string & | aBaseModelName, | ||
const std::vector< T > & | aFields, | ||
const std::vector< LIB_PIN * > & | aPins | ||
) |
Definition at line 275 of file sim_lib_mgr.cpp.
References _, SIM_LIBRARY::Create(), SIM_MODEL::Create(), library, m_libraries, m_models, m_project, m_reporter, SIM_LIBRARY::NAME_FIELD, path, REPORTER::Report(), ResolveEmbeddedLibraryPath(), ResolveLibraryPath(), RPT_SEVERITY_ERROR, and IO_ERROR::What().
SIM_MODEL & SIM_LIB_MGR::CreateModel | ( | SIM_MODEL::TYPE | aType, |
const std::vector< LIB_PIN * > & | aPins | ||
) |
Definition at line 151 of file sim_lib_mgr.cpp.
References SIM_MODEL::Create(), m_models, and m_reporter.
Referenced by CreateModel(), SIM_MODEL::MigrateSimModel(), DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded(), NETLIST_EXPORTER_SPICE::readModel(), SCH_EDIT_FRAME::RefreshOperatingPointDisplay(), ERC_TESTER::TestSimModelIssues(), and SIMULATOR_FRAME::UpdateTunerValue().
std::map< wxString, std::reference_wrapper< const SIM_LIBRARY > > SIM_LIB_MGR::GetLibraries | ( | ) | const |
Definition at line 351 of file sim_lib_mgr.cpp.
References library, m_libraries, and path.
Referenced by NETLIST_EXPORTER_SPICE::writeIncludes().
std::vector< std::reference_wrapper< SIM_MODEL > > SIM_LIB_MGR::GetModels | ( | ) | const |
Definition at line 362 of file sim_lib_mgr.cpp.
References m_models.
std::string SIM_LIB_MGR::ResolveEmbeddedLibraryPath | ( | const std::string & | aLibPath, |
const std::string & | aRelativeLib | ||
) |
Definition at line 91 of file sim_lib_mgr.cpp.
References m_project, and ResolveLibraryPath().
Referenced by CreateModel(), and SetLibrary().
|
static |
Definition at line 56 of file sim_lib_mgr.cpp.
References _, PROJECT::AbsolutePath(), ExpandEnvVarSubstitutions(), Format(), and THROW_IO_ERROR.
Referenced by CreateModel(), SPICE_GENERATOR_KIBIS::IbisDevice(), ResolveEmbeddedLibraryPath(), and SetLibrary().
void SIM_LIB_MGR::SetLibrary | ( | const wxString & | aLibraryPath | ) |
Definition at line 130 of file sim_lib_mgr.cpp.
References Clear(), SIM_LIBRARY::Create(), library, m_libraries, m_project, m_reporter, path, REPORTER::Report(), ResolveEmbeddedLibraryPath(), ResolveLibraryPath(), and IO_ERROR::What().
void SIM_LIB_MGR::SetModel | ( | int | aIndex, |
std::unique_ptr< SIM_MODEL > | aModel | ||
) |
Definition at line 345 of file sim_lib_mgr.cpp.
References m_models.
|
inline |
Definition at line 46 of file sim_lib_mgr.h.
References m_reporter.
Referenced by NETLIST_EXPORTER_SPICE::WriteNetlist().
|
private |
Definition at line 86 of file sim_lib_mgr.h.
Referenced by Clear(), CreateModel(), GetLibraries(), and SetLibrary().
|
private |
Definition at line 87 of file sim_lib_mgr.h.
Referenced by Clear(), CreateModel(), GetModels(), and SetModel().
|
private |
Definition at line 84 of file sim_lib_mgr.h.
Referenced by CreateModel(), ResolveEmbeddedLibraryPath(), and SetLibrary().
|
private |
Definition at line 85 of file sim_lib_mgr.h.
Referenced by CreateModel(), SetLibrary(), and SetReporter().