Pull some fixes from master.

This commit is contained in:
Jeff Young 2023-04-14 19:55:31 +01:00
parent 3573b97bfc
commit f67a477f65
1 changed files with 14 additions and 1 deletions

View File

@ -1030,15 +1030,28 @@ 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 and other symbols which have the reference starting with "#" are
// not included in simulation
if( symbol->GetRef( &sheet ).StartsWith( '#' )
|| symbol->GetFieldText( SIM_ENABLE_FIELD ) == wxT( "0" ) )
{
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 );