Purge ghost tuning patterns.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18405
This commit is contained in:
Jeff Young
2024-12-28 20:38:01 +00:00
parent 015a320875
commit 6dfebe4e8a
2 changed files with 11 additions and 0 deletions
@@ -2179,6 +2179,13 @@ void PCB_IO_KICAD_SEXPR::format( const PCB_GROUP* aGroup ) const
void PCB_IO_KICAD_SEXPR::format( const PCB_GENERATOR* aGenerator ) const
{
// Some conditions appear to still be creating ghost tuning patterns. Don't save them.
if( aGenerator->GetGeneratorType() == wxT( "tuning_pattern" )
&& aGenerator->GetItems().empty() )
{
return;
}
m_out->Print( "(generated" );
KICAD_FORMAT::FormatUuid( m_out, aGenerator->m_Uuid );
@@ -6115,6 +6115,10 @@ void PCB_IO_KICAD_SEXPR_PARSER::parseGENERATOR( BOARD_ITEM* aParent )
}
}
}
// Previous versions had bugs which could save ghost tuning patterns. Ignore them.
if( genInfo.genType == wxT( "tuning_pattern" ) && genInfo.memberUuids.empty() )
m_generatorInfos.pop_back();
}