← Back to team overview

kicad-developers team mailing list archive

Issue with 'multiplicating' subpart id


I found something it could be related to the issue reported some time
ago. Also it prevents me to do Useful Paid Work (TM), so here the report.

In eeschema when you have a subsheet containing a part with a subpart
id, the reference is being corrupted with the subpart id. Example:

I have D25A in a subsheet (from the .sch file) => I enter it and see
D25AA !!

The A is getting appended to the base reference, so it gets D25A
+ A part id = D25AA. Ever funnier since on a wide hierarchy you get
stuff like Q5BBBB

Anyway: the damage is done here:

void SCH_SHEET_PATH::UpdateAllScreenReferences()
    EDA_ITEM* t = LastDrawList();

    while( t )
        if( t->Type() == SCH_COMPONENT_T )
            SCH_COMPONENT* component = (SCH_COMPONENT*) t; 
        // XXX (high tech debug technique)
            printf("UPDATING TO %ls\n", component->GetRef(this).c_str());
        // GetRef returns the value WITH the subpart ID, so it gets appended over and over
            component->GetField( REFERENCE )->SetText( component->GetRef( this ) );
            component->SetUnit( component->GetUnitSelection( this ) );

        t = t->Next();

I have found the problem, but I have NO IDEA on how to fix it (well, removing
the settext would fix it but I suppose sometimes it's useful...)

Lorenzo Marcantonio
Logos Srl

Attachment: smime.p7s
Description: S/MIME cryptographic signature