KiCad PCB EDA Suite
|
Serializes/deserializes a SIM_MODEL for storage in LIB_FIELDs/SCH_FIELDs. More...
#include <sim_model_serializer.h>
Public Member Functions | |
virtual | ~SIM_MODEL_SERIALIZER ()=default |
SIM_MODEL_SERIALIZER (SIM_MODEL &aModel) | |
std::string | GenerateDevice () const |
std::string | GenerateDeviceSubtype () const |
std::string | GenerateValue () const |
std::string | GenerateParams () const |
std::string | GeneratePins () const |
std::string | GenerateEnable () const |
void | ParseValue (const std::string &aValue) |
bool | ParseParams (const std::string &aParams) |
void | ParsePins (const std::string &aPins) |
void | ParseEnable (const std::string &aEnable) |
Static Public Attributes | |
static constexpr auto | REFERENCE_FIELD = "Reference" |
static constexpr auto | VALUE_FIELD = "Value" |
Protected Member Functions | |
std::string | generateParamValuePair (const SIM_MODEL::PARAM &aParam) const |
Private Attributes | |
SIM_MODEL & | m_model |
Serializes/deserializes a SIM_MODEL for storage in LIB_FIELDs/SCH_FIELDs.
Definition at line 119 of file sim_model_serializer.h.
|
virtualdefault |
|
inline |
Definition at line 126 of file sim_model_serializer.h.
std::string SIM_MODEL_SERIALIZER::GenerateDevice | ( | ) | const |
Definition at line 58 of file sim_model_serializer.cpp.
References SIM_MODEL::GetDeviceInfo(), and m_model.
std::string SIM_MODEL_SERIALIZER::GenerateDeviceSubtype | ( | ) | const |
Definition at line 64 of file sim_model_serializer.cpp.
References SIM_MODEL::GetTypeInfo(), and m_model.
std::string SIM_MODEL_SERIALIZER::GenerateEnable | ( | ) | const |
Definition at line 156 of file sim_model_serializer.cpp.
References SIM_MODEL::IsEnabled(), and m_model.
std::string SIM_MODEL_SERIALIZER::GenerateParams | ( | ) | const |
Definition at line 82 of file sim_model_serializer.cpp.
References generateParamValuePair(), SIM_MODEL::GetBaseModel(), SIM_MODEL::GetParam(), SIM_MODEL::GetParamCount(), SIM_MODEL::GetParamOverride(), SIM_MODEL::HasPrimaryValue(), SIM_MODEL::IsStoredInValue(), m_model, and SIM_MODEL::PARAM::value.
|
protected |
Definition at line 302 of file sim_model_serializer.cpp.
References SIM_MODEL::PARAM::INFO::category, SIM_MODEL::PARAM::FLAGS, SIM_MODEL::PARAM::info, name, SIM_MODEL::PARAM::INFO::name, and SIM_MODEL::PARAM::value.
Referenced by GenerateParams().
std::string SIM_MODEL_SERIALIZER::GeneratePins | ( | ) | const |
Definition at line 124 of file sim_model_serializer.cpp.
References SIM_MODEL::GetPins(), m_model, and pin.
Referenced by SIM_MODEL::MigrateSimModel().
std::string SIM_MODEL_SERIALIZER::GenerateValue | ( | ) | const |
Definition at line 70 of file sim_model_serializer.cpp.
References SIM_MODEL::GetDeviceInfo(), SIM_MODEL::GetParamOverride(), and m_model.
void SIM_MODEL_SERIALIZER::ParseEnable | ( | const std::string & | aEnable | ) |
Definition at line 290 of file sim_model_serializer.cpp.
References m_model, and SIM_MODEL::SetIsEnabled().
bool SIM_MODEL_SERIALIZER::ParseParams | ( | const std::string & | aParams | ) |
Definition at line 193 of file sim_model_serializer.cpp.
References SIM_MODEL::GetParam(), SIM_MODEL::HasAutofill(), SIM_MODEL::HasPrimaryValue(), m_model, SIM_MODEL::PARAM::Matches(), SIM_MODEL::SetParamValue(), SIM_VALUE_GRAMMAR::SI, and THROW_IO_ERROR.
void SIM_MODEL_SERIALIZER::ParsePins | ( | const std::string & | aPins | ) |
Definition at line 259 of file sim_model_serializer.cpp.
References SIM_MODEL::AssignSymbolPinNumberToModelPin(), m_model, and THROW_IO_ERROR.
void SIM_MODEL_SERIALIZER::ParseValue | ( | const std::string & | aValue | ) |
Definition at line 162 of file sim_model_serializer.cpp.
References m_model, SIM_MODEL::SetIsStoredInValue(), SIM_MODEL::SetParamValue(), THROW_IO_ERROR, and SIM_VALUE::TYPE_FLOAT.
|
private |
Definition at line 144 of file sim_model_serializer.h.
Referenced by GenerateDevice(), GenerateDeviceSubtype(), GenerateEnable(), GenerateParams(), GeneratePins(), GenerateValue(), ParseEnable(), ParseParams(), ParsePins(), and ParseValue().
|
staticconstexpr |
Definition at line 122 of file sim_model_serializer.h.
|
staticconstexpr |
Definition at line 123 of file sim_model_serializer.h.