Make LIB_ITEM::COMPARE_FLAGS really a flags field, and add ERC.

Before they were 1/2 treated as flags and 1/2 treated as a mode enum.

The ERC flag relaxes constraints on data that is settable in the
schematic editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/11018
This commit is contained in:
Jeff Young
2022-03-03 13:27:18 +00:00
parent 27db23eba0
commit 76535d8572
15 changed files with 39 additions and 34 deletions
+2 -1
View File
@@ -756,8 +756,9 @@ int ERC_TESTER::TestLibSymbolIssues()
}
std::unique_ptr<LIB_SYMBOL> flattenedSymbol = libSymbol->Flatten();
constexpr int flags = LIB_ITEM::COMPARE_FLAGS::EQUALITY | LIB_ITEM::COMPARE_FLAGS::ERC;
if( *flattenedSymbol != *libSymbolInSchematic )
if( flattenedSymbol->Compare( *libSymbolInSchematic, flags ) != 0 )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_LIB_SYMBOL_ISSUES );
ercItem->SetItems( symbol );