Consolidation of Component Class implementation

- Moves functionality to FOOTPRINT class from BOARD_ITEM
- Renames DRC property from ComponentClass to Component_Class
- Adds DRC checks QA for A.Component_Class and a.hasComponentClass('x')
This commit is contained in:
JamesJCode
2024-10-24 20:11:35 +01:00
parent 43c3cd57eb
commit db072a524c
12 changed files with 2672 additions and 35 deletions
+6 -2
View File
@@ -1234,8 +1234,12 @@ static void hasComponentClassFunc( LIBEVAL::CONTEXT* aCtx, void* self )
result->SetDeferredEval(
[item, arg]() -> double
{
BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
const COMPONENT_CLASS* compClass = boardItem->GetComponentClass();
FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( item );
if( !footprint )
return 0.0;
const COMPONENT_CLASS* compClass = footprint->GetComponentClass();
if( compClass && compClass->ContainsClassName( arg->AsString() ) )
return 1.0;