Sim Model Editor: Fix displaying Ibis pin list

This commit is contained in:
Mikolaj Wielgus 2022-10-11 02:22:36 +02:00
parent d9eb76eae0
commit d47752ad75
2 changed files with 7 additions and 10 deletions

View File

@ -242,6 +242,7 @@ SIM_MODEL_KIBIS::SIM_MODEL_KIBIS( TYPE aType, SIM_MODEL_KIBIS& aSource,
ReadDataFields( 2, &aFields );
}
void SIM_MODEL_KIBIS::CreatePins( unsigned aSymbolPinCount )
{
SIM_MODEL::CreatePins( aSymbolPinCount );
@ -280,7 +281,7 @@ void SIM_MODEL_KIBIS::SetBaseModel( const SIM_MODEL& aBaseModel )
// to IBIS device model type we have multiple types of drivers available for the same sourced
// model. And we don't want to inherit the default values anyway. So we just store these models
// and use the only for Spice code generation.
m_sourceModel = &aBaseModel;
m_sourceModel = dynamic_cast<const SIM_MODEL_KIBIS*>( &aBaseModel );
}

View File

@ -69,19 +69,15 @@ public:
std::vector<std::pair<std::string, std::string>> GetIbisPins() const
{
return GetBaseModel()
? dynamic_cast<const SIM_MODEL_KIBIS*>( GetBaseModel() )->GetIbisPins()
: m_ibisPins;
};
return m_sourceModel ? m_sourceModel->GetIbisPins() : m_ibisPins;
}
std::vector<std::string> GetIbisModels() const { return m_ibisModels; };
std::string GetComponentName() const
{
return GetBaseModel()
? dynamic_cast<const SIM_MODEL_KIBIS*>( GetBaseModel() )->GetComponentName()
: m_componentName;
};
return m_sourceModel ? m_sourceModel->GetComponentName() : m_componentName;
}
const PARAM& GetParam( unsigned aParamIndex ) const override { return m_params.at( aParamIndex ); };
@ -103,7 +99,7 @@ private:
static std::vector<PARAM::INFO> makeRectWaveformParamInfos();
static std::vector<PARAM::INFO> makePrbsWaveformParamInfos();
const SIM_MODEL* m_sourceModel;
const SIM_MODEL_KIBIS* m_sourceModel;
std::vector<std::string> m_ibisModels;
std::vector<std::pair<std::string, std::string>> m_ibisPins;
std::string m_componentName;