Changing logic to force-trigger annotations

59 views
Skip to first unread message

Andras Tantos

unread,
Sep 3, 2024, 2:46:15 PM9/3/24
to KiCad Developers
Hello all!

My name is Andras Tantos. I'm new to this group, but a relatively long-time user of KiCAD. I would like to suggest a change to the way KiCAD determines if annotation is needed for a schematic.

Right now the behavior is that if any reference ends with a '?' or not end with a number, the schematic is deemed not fully annotated. Since only fully annotated schematics can be synchronized, this prevents updating the PCB from the schematic.

The suggested new behavior would be to relax this and only deem the schematic unannotated if more than one component has the same reference, or if any of them have a terminal '?'.

Examples: placing a single capacitor with reference 'C' would be OK. Placing a second capacitor with the same reference would now force annotation. If the reference of the first capacitor is changed to 'BYPASS_C', the schematic would be considered fully annotated. If a capacitor with reference 'C?' is placed, the schematic is considered unannotated until the name is changed, even if only a single such entity exists.

Obviously multi-part symbols allow replication of reference. So, if U_CPU has two units (A and B), that's fine. If there are two unit A-s with the same reference (U_CPU again for the sake of argument) that would trigger annotation.

Why? This annotation logic aligns better with other packages such as Altium. Apart from the user-education part, this is important for imported projects: these schematic and PCB files can violate assumptions about component naming after import and would be impossible to synchronize further changes between PCB and schematic.

Why not? It's a change to existing behavior. Things that didn't work before would start working and can cause confusion. Libraries are usually developed with no '?' in the reference name, so as long as a single component is placed on the schematic no annotation would be triggered. This could potentially be confusing for users.

I have created a fork where I implemented this change. It seems to be working (CI is still running) and is ready for a pull-request. I wanted to have a discussion about it before submitting it though.

Thanks,
Andras

Seth Hillbrand

unread,
Sep 3, 2024, 4:13:13 PM9/3/24
to dev...@kicad.org
Hi Andras-

Push your branch to a draft Merge Request for discussion.

In general, relaxing this sort of antiquated constraint is a good thing.  However, there are many places that KiCad expects a prefix+number, so ensuring that you've addressed them all will be key to accepting this change.

Some things to consider: How do you reannotate a schematic?  If we know that a refdes ending in a number is annotated, then the number can be stripped and re-assigned.  If we don't, then we need some other way to know what the proper prefix is.  This would entail storing the prefix separately from the reference (see https://gitlab.com/kicad/code/kicad/-/issues/12079 for some more discussion)

Seth

KiCad Services Corporation Logo
Seth Hillbrand
Lead Developer
+1-530-302-5483
Long Beach, CA
www.kipro-pcb.com    in...@kipro-pcb.com


--
You received this message because you are subscribed to the Google Groups "KiCad Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devlist+u...@kicad.org.
To view this discussion on the web visit https://groups.google.com/a/kicad.org/d/msgid/devlist/6af07dfc-2ccb-46d2-9fb5-73bc7516ac95n%40kicad.org.

Andras Tantos

unread,
Sep 3, 2024, 7:56:29 PM9/3/24
to 'Seth Hillbrand' via KiCad Developers

You bring up a good point. My change only deals with not requiring an annotation under these circumstances. If automatic annotation (or re-annotation) is attempted, it retains the old behavior. Not sure if that's a good or bad thing, other tools have similar behavior; You either use automated annotation or you don't but can't really mix the two. One thing to note for sure is the default behavior of auto-annotating components as they are placed is pushing people towards using automated tools.

At any rate, I'll open a merge request to facilitate the discussion as you suggested and thanks!

Andras

You received this message because you are subscribed to a topic in the Google Groups "KiCad Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/a/kicad.org/d/topic/devlist/Y7xt_CFvAtA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to devlist+u...@kicad.org.
To view this discussion on the web visit https://groups.google.com/a/kicad.org/d/msgid/devlist/CAFdeG-pB5iWAmRgLv66jW2uyjTtdWu76Ov89Mx1op1CvxjxYqA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages