From b3b6637b44d0f8c75b5901f5b77cca7ffa3f2f37 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Thu, 22 Feb 2024 19:23:39 +0100 Subject: [PATCH] Altium: Don't load library parameters with an owner for now In Altium many objects can have parameters (including pins). For now we will drop library parameters belonging to any sub-components of a symbol. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17048 (cherry picked from commit 1a6e6a06eb63323c98ef0752f72743715b8d51cf) --- eeschema/sch_io/altium/sch_io_altium.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_io/altium/sch_io_altium.cpp b/eeschema/sch_io/altium/sch_io_altium.cpp index 29991a4243..46f49aeab3 100644 --- a/eeschema/sch_io/altium/sch_io_altium.cpp +++ b/eeschema/sch_io/altium/sch_io_altium.cpp @@ -3783,11 +3783,18 @@ void SCH_IO_ALTIUM::ParseLibParameter( const std::map& aProp { ASCH_PARAMETER elem( aProperties ); - // Part ID 1 is the current library part. Part ID -1 means all parts + // Part ID 1 is the current library part. + // Part ID ALTIUM_COMPONENT_NONE(-1) means all parts // If a parameter is assigned to a specific element such as a pin, // we will need to handle it here. // TODO: Handle HIDDENNETNAME property (others?) - if( elem.ownerpartid != 1 && elem.ownerpartid != -1 ) + if( elem.ownerpartid != 1 && elem.ownerpartid != ALTIUM_COMPONENT_NONE ) + return; + + // If ownerindex is populated, this is parameter belongs to a subelement (e.g. pin). + // Ignore for now. + // TODO: Update this when KiCad supports parameters for any object + if( elem.ownerindex != ALTIUM_COMPONENT_NONE ) return; // TODO: fill in replacements from variant, sheet and project