Make substrate and thermal junction nodes optional.

Fixes https://gitlab.com/kicad/code/kicad/issues/14083
This commit is contained in:
Jeff Young 2023-02-25 20:36:15 +00:00
parent 2a79a453ec
commit 1fdc81e68d
3 changed files with 19 additions and 5 deletions

View File

@ -590,8 +590,13 @@ void DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded( wxStyledTextEvent &aEven
SIM_LIB_MGR mgr( &Prj() );
SIM_MODEL& model = mgr.CreateModel( &sheet, *symbol ).model;
for( const std::string& pin : model.GetPinNames() )
autocompleteTokens.push_back( pin );
for( wxString pin : model.GetPinNames() )
{
if( pin.StartsWith( '<' ) && pin.EndsWith( '>' ) )
autocompleteTokens.push_back( pin.Mid( 1, pin.Length() - 2 ) );
else
autocompleteTokens.push_back( pin );
}
}
}
else

View File

@ -1005,12 +1005,21 @@ void SIM_MODEL::createPins( const std::vector<LIB_PIN*>& aSymbolPins )
for( unsigned modelPinIndex = 0; modelPinIndex < pinNames.size(); ++modelPinIndex )
{
wxString pinName = pinNames[ modelPinIndex ];
bool optional = false;
if( pinName.StartsWith( '<' ) && pinName.EndsWith( '>' ) )
{
pinName = pinName.Mid( 1, pinName.Length() - 2 );
optional = true;
}
if( modelPinIndex < aSymbolPins.size() )
{
AddPin( { pinNames.at( modelPinIndex ),
aSymbolPins[ modelPinIndex ]->GetNumber().ToStdString() } );
}
else
else if( !optional )
{
AddPin( { pinNames.at( modelPinIndex ), "" } );
}

View File

@ -190,7 +190,7 @@ struct MODEL_INFO_MAP
modelInfos[MODEL_TYPE::DIODE].instanceParams.emplace_back( "sens_cplx", 16, SIM_MODEL::PARAM::DIR_OUT, SIM_VALUE::TYPE_COMPLEX, "", SIM_MODEL::PARAM::CATEGORY::SUPERFLUOUS, "", "", "ac sensitivity", true );
modelInfos[MODEL_TYPE::BJT] = { "BJT", "NPN", "PNP", { "C", "B", "E", "S" }, "Bipolar Junction Transistor", {}, {} };
modelInfos[MODEL_TYPE::BJT] = { "BJT", "NPN", "PNP", { "C", "B", "E", "<S>" }, "Bipolar Junction Transistor", {}, {} };
// Model parameters
modelInfos[MODEL_TYPE::BJT].modelParams.emplace_back( "type", 309, SIM_MODEL::PARAM::DIR_OUT, SIM_VALUE::TYPE_STRING, "", SIM_MODEL::PARAM::CATEGORY::SUPERFLUOUS, "npn", "pnp", "NPN or PNP" );
modelInfos[MODEL_TYPE::BJT].modelParams.emplace_back( "npn", 101, SIM_MODEL::PARAM::DIR_INOUT, SIM_VALUE::TYPE_BOOL, "", SIM_MODEL::PARAM::CATEGORY::SUPERFLUOUS, "NaN", "NaN", "NPN type device" );
@ -400,7 +400,7 @@ struct MODEL_INFO_MAP
modelInfos[MODEL_TYPE::BJT].instanceParams.emplace_back( "dtemp", 8, SIM_MODEL::PARAM::DIR_INOUT, SIM_VALUE::TYPE_FLOAT, "°C", SIM_MODEL::PARAM::CATEGORY::SUPERFLUOUS, "", "", "instance temperature delta from circuit", true );
modelInfos[MODEL_TYPE::VBIC] = { "VBIC", "NPN", "PNP", { "C", "B", "E", "S", "TJ" }, "Vertical Bipolar Inter-Company Model", {}, {} };
modelInfos[MODEL_TYPE::VBIC] = { "VBIC", "NPN", "PNP", { "C", "B", "E", "<S>", "<TJ>" }, "Vertical Bipolar Inter-Company Model", {}, {} };
// Model parameters
modelInfos[MODEL_TYPE::VBIC].modelParams.emplace_back( "type", 305, SIM_MODEL::PARAM::DIR_OUT, SIM_VALUE::TYPE_STRING, "", SIM_MODEL::PARAM::CATEGORY::SUPERFLUOUS, "npn", "pnp", "NPN or PNP" );
modelInfos[MODEL_TYPE::VBIC].modelParams.emplace_back( "npn", 101, SIM_MODEL::PARAM::DIR_INOUT, SIM_VALUE::TYPE_BOOL, "", SIM_MODEL::PARAM::CATEGORY::SUPERFLUOUS, "NaN", "NaN", "NPN type device" );