Sim: Reverse diode model pin order to match diode symbols
This commit is contained in:
parent
3a9ed47bf0
commit
cff508fb3b
|
@ -284,6 +284,7 @@ set( EESCHEMA_SRCS
|
|||
sim/sim_lib_mgr.cpp
|
||||
sim/sim_model.cpp
|
||||
sim/sim_model_behavioral.cpp
|
||||
sim/sim_model_diode.cpp
|
||||
sim/sim_model_ideal.cpp
|
||||
sim/sim_model_mutual_inductor.cpp
|
||||
sim/sim_model_kibis.cpp
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <sim/sim_model.h>
|
||||
#include <sim/sim_model_behavioral.h>
|
||||
#include <sim/sim_model_diode.h>
|
||||
#include <sim/sim_model_ideal.h>
|
||||
#include <sim/sim_model_mutual_inductor.h>
|
||||
#include <sim/sim_model_ngspice.h>
|
||||
|
@ -915,6 +916,9 @@ std::unique_ptr<SIM_MODEL> SIM_MODEL::Create( TYPE aType )
|
|||
case TYPE::SW_I:
|
||||
return std::make_unique<SIM_MODEL_SWITCH>( aType );
|
||||
|
||||
case TYPE::D:
|
||||
return std::make_unique<SIM_MODEL_DIODE>();
|
||||
|
||||
case TYPE::V:
|
||||
case TYPE::I:
|
||||
case TYPE::V_SIN:
|
||||
|
|
|
@ -48,12 +48,6 @@ std::vector<std::string> SPICE_GENERATOR_NGSPICE::CurrentNames( const SPICE_ITEM
|
|||
fmt::format( "I({}:g)", aItem.refName ),
|
||||
fmt::format( "I({}:s)", aItem.refName ) };
|
||||
|
||||
case SIM_MODEL::DEVICE_TYPE_::R:
|
||||
case SIM_MODEL::DEVICE_TYPE_::C:
|
||||
case SIM_MODEL::DEVICE_TYPE_::L:
|
||||
case SIM_MODEL::DEVICE_TYPE_::D:
|
||||
return SPICE_GENERATOR::CurrentNames( aItem );
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( "Unhandled model device type in SIM_MODEL_NGSPICE" );
|
||||
return {};
|
||||
|
@ -62,22 +56,8 @@ std::vector<std::string> SPICE_GENERATOR_NGSPICE::CurrentNames( const SPICE_ITEM
|
|||
|
||||
|
||||
SIM_MODEL_NGSPICE::SIM_MODEL_NGSPICE( TYPE aType ) :
|
||||
SIM_MODEL_SPICE( aType, std::make_unique<SPICE_GENERATOR_NGSPICE>( *this ) )
|
||||
SIM_MODEL_NGSPICE( aType, std::make_unique<SPICE_GENERATOR_NGSPICE>( *this ) )
|
||||
{
|
||||
const MODEL_INFO& modelInfo = ModelInfo( getModelType() );
|
||||
|
||||
for( const SIM_MODEL::PARAM::INFO& paramInfo : modelInfo.instanceParams )
|
||||
{
|
||||
// For now, only the geometry parameters.
|
||||
if( paramInfo.category == SIM_MODEL::PARAM::CATEGORY::PRINCIPAL
|
||||
|| paramInfo.category == SIM_MODEL::PARAM::CATEGORY::GEOMETRY )
|
||||
{
|
||||
AddParam( paramInfo, getIsOtherVariant() );
|
||||
}
|
||||
}
|
||||
|
||||
for( const SIM_MODEL::PARAM::INFO& paramInfo : modelInfo.modelParams )
|
||||
AddParam( paramInfo, getIsOtherVariant() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -161,6 +141,27 @@ void SIM_MODEL_NGSPICE::SetParamFromSpiceCode( const std::string& aParamName,
|
|||
}
|
||||
|
||||
|
||||
SIM_MODEL_NGSPICE::SIM_MODEL_NGSPICE( TYPE aType,
|
||||
std::unique_ptr<SPICE_GENERATOR> aSpiceGenerator ) :
|
||||
SIM_MODEL_SPICE( aType, std::move( aSpiceGenerator ) )
|
||||
{
|
||||
const MODEL_INFO& modelInfo = ModelInfo( getModelType() );
|
||||
|
||||
for( const SIM_MODEL::PARAM::INFO& paramInfo : modelInfo.instanceParams )
|
||||
{
|
||||
// For now, only the geometry parameters.
|
||||
if( paramInfo.category == SIM_MODEL::PARAM::CATEGORY::PRINCIPAL
|
||||
|| paramInfo.category == SIM_MODEL::PARAM::CATEGORY::GEOMETRY )
|
||||
{
|
||||
AddParam( paramInfo, getIsOtherVariant() );
|
||||
}
|
||||
}
|
||||
|
||||
for( const SIM_MODEL::PARAM::INFO& paramInfo : modelInfo.modelParams )
|
||||
AddParam( paramInfo, getIsOtherVariant() );
|
||||
}
|
||||
|
||||
|
||||
bool SIM_MODEL_NGSPICE::canSilentlyIgnoreParam( const std::string& aParamName )
|
||||
{
|
||||
// Ignore the purely informative LTspice-specific parameters "mfg" and "type".
|
||||
|
|
|
@ -103,6 +103,8 @@ protected:
|
|||
|
||||
static const MODEL_INFO& ModelInfo( MODEL_TYPE aType );
|
||||
|
||||
SIM_MODEL_NGSPICE( TYPE aType, std::unique_ptr<SPICE_GENERATOR> aSpiceGenerator );
|
||||
|
||||
private:
|
||||
bool requiresSpiceModelLine() const override { return false; }
|
||||
|
||||
|
|
|
@ -185,11 +185,11 @@
|
|||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(symbol "VSIN_0_0"
|
||||
(arc (start 0 0) (mid -0.635 0.635) (end -1.27 0)
|
||||
(arc (start 0 0) (mid -0.635 0.6323) (end -1.27 0)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(arc (start 0 0) (mid 0.635 -0.635) (end 1.27 0)
|
||||
(arc (start 0 0) (mid 0.635 -0.6323) (end 1.27 0)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
|
@ -400,7 +400,7 @@
|
|||
(property "Datasheet" "~" (at 151.765 96.52 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Sim_Device" "DIODE" (at 151.765 96.52 0)
|
||||
(property "Sim_Device" "D" (at 151.765 96.52 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Sim_Name" "DIODE1" (at 151.765 96.52 0)
|
||||
|
@ -409,9 +409,6 @@
|
|||
(property "Sim_Library" "diode.lib" (at 151.765 96.52 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Sim_Pins" "2 1" (at 151.765 96.52 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid cb1986eb-8b78-41be-ab05-5001090a2a65))
|
||||
(pin "2" (uuid edfbe61b-6d1d-45a6-bfef-e48a694e79db))
|
||||
(instances
|
||||
|
|
Loading…
Reference in New Issue