ERC do not test power symbols for simulation model.

Fix also a minor cosmetic issue with ERCE_SIMULATION_MODEL messages.
Fixes #14463
https://gitlab.com/kicad/code/kicad/issues/14463
This commit is contained in:
jean-pierre charras 2023-04-01 10:16:44 +02:00
parent b80a9014ff
commit aaae50f2aa
1 changed files with 12 additions and 1 deletions

View File

@ -1029,15 +1029,26 @@ int ERC_TESTER::TestSimModelIssues()
for( SCH_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
// Power symbols are skipped: obviously they do not have a simulator model
const std::unique_ptr< LIB_SYMBOL >& libpart = symbol->GetLibSymbolRef();
if( libpart && libpart->IsPower() )
continue;
// Reset for each symbol
msg.Clear();
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
SIM_LIBRARY::MODEL model = libMgr.CreateModel( &sheet, *symbol );
if( !msg.IsEmpty() )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_SIMULATION_MODEL );
//Remove \n and \r at e.o.l if any:
msg.Trim();
ercItem->SetErrorMessage( msg );
ercItem->SetItems( symbol );