Change label type should affect all instances

Bug #1558611 reported by Stephen Bernhoeft
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Expired
Wishlist
Unassigned

Bug Description

RMB On a Global Label having 2 or more instances.

Choose "Change type" to "Hierarchical".

Only the selected label instance changes. I think all instances of the same label should be changed.

Application: kicad
Version: 4.0.1-stable release build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1009,GCC 5.2.0,wx containers,compatible with 2.8)
Platform: Windows 7 (build 7601, Service Pack 1), 32 bit, Little endian, wxMSW
Boost version: 1.59.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=ON
         KICAD_SCRIPTING_MODULES=ON
         KICAD_SCRIPTING_WXPYTHON=ON
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON

Tags: eeschema
Revision history for this message
Stephen Bernhoeft (reg-abelgratis) wrote :

Another little problem.

Label orientations have inconsistent meanings (I think I memntioned this before).

So if I change the TYPE of a "Left-oriented Global label" I get a label facing the other way!

The meanings should be the same.

See "Kicad-Hierach_Label_anchor_left.jpg" and "Kicad- Label orientations have inconsistent meanings.jpg"

Revision history for this message
Stephen Bernhoeft (reg-abelgratis) wrote :
Revision history for this message
Stephen Bernhoeft (reg-abelgratis) wrote :

Kicad-Hierach Label To Local.jpg

Revision history for this message
Stephen Bernhoeft (reg-abelgratis) wrote :

Kicad- Local label orientated differently.jpg

Revision history for this message
Stephen Bernhoeft (reg-abelgratis) wrote :

Kicad- Label orientations have inconsistent meanings.jpg

I think I mentioned this "inconsistency" before (or something similar)

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Why do you think that all labels with the same name should be changed? This is just as dangerous as not updating all labels with the same name. It is completely dependent on what you are trying to accomplish. I'm not convinced that your request is a good idea. I suppose that Eeschema could ask the user if they want to change all instances of a label name but that adds yet another dialog to dismiss so I'm not sure if the fix would be any better than the current behavior. It would only be different.

Please do not add other issues to a bug report. This makes it difficult to track bugs. Your label consistency issues should be in a separate bug report.

Revision history for this message
xzcvczx (xzcvczx) wrote :

there is also a previous bug report about label orientation

Revision history for this message
Stephen Bernhoeft (reg-abelgratis) wrote :

Re "Why do you think that all labels with the same name should be changed?".

Because presumably they were all identical electrically originally, and the user decided upon a more meaningful/less confusing/etc name. That is what has been the case on several occasions with my designs anyhow.

I liken it to re-naming ('re-factoring') a variable in a program. It's a pain (and error-prone) to do each one by hand. It's faster (but dangerous) to search/replace; not that I can do that in KiCad of course.

Wayne: Suppose you have a good reason to change a node name, and that node exists across multiple sheets - what would you do? You are bound to slip up if you do CTRL-F, then plod through each label instance; it's unworkable.

BTW No separate dialog is required, just a "change all instances" check-box.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1558611] Re: Change label type should affect all instances

Consider this scenario. You have multiple labels with the same name (a
node) but you discover one label that you inadvertently misnamed (wrong
node). You change the label to the correct name and Eeschema silently
changes all other instances of that label name. Now you have an
electrical connection or connections that were not intended. This is
the law of unintended consequences that many users overlook when
suggesting a feature.

I understand you desire to not have to retype the same label for all
instances even though find/replace would work fine in this case. In
fact find/replace would allow you to skip label names in the scenario
described above where a complete replace would not.

On 3/17/2016 6:12 PM, Stephen Bernhoeft wrote:
> Re "Why do you think that all labels with the same name should be
> changed?".
>
> Because presumably they were all identical electrically originally, and the user decided upon a more meaningful/less confusing/etc name. That is what has been the case on several occasions with my designs anyhow.
>
> I liken it to re-naming ('re-factoring') a variable in a program. It's a pain (and error-prone) to do each one by hand. It's faster (but dangerous) to search/replace; not that I can do that in KiCad of course.
>
>
> Wayne: Suppose you have a good reason to change a node name, and that node exists across multiple sheets - what would you do? You are bound to slip up if you do CTRL-F, then plod through each label instance; it's unworkable.
>
> BTW No separate dialog is required, just a "change all instances" check-
> box.
>

Revision history for this message
Artsiom Shchatsko (cioma) wrote :

IMHO, it would be better to ask the user if all instances or just this one has to be changed.

Revision history for this message
Stephen Bernhoeft (reg-abelgratis) wrote :

Hi,

..............................
Q1: "You have multiple labels with the same name (a node) but you discover one label that you inadvertently misnamed (wrong
node)."

A1: In this case, the user would not tick the "Replace all" check-box. This should be disabled by default.
..............................

Q2: "Eeschema silently changes all other instances of that label name."

Well ... yes - If I *want all* of them changed, that would be what I'd like. However, a "third way" exists, namely "Prompt each replace". This could be checked by default, and only enabled if "Replace all" is checked. So this double-checks you want each instance. The program iterates all instances for you, but shows a (Yes/No) button each time. At any point you can also stop the operation.
..............................

I'm attaching a screenshot from "PSPad" which has a similar feature, and (usefully in my view) combines search in files and search/replace in files. The edit box is disabled where the cursor is - you have to explicitly choose "Replace With".

Would you consider something incorporating siamilar features in KiCad? The way it's set up in PSPad, one would not accidently get the unwanted result "silent" nightmare you mentioned.

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

I have WAY more often renamed a label to connect something to a different net than to rename the entire net. A "rename net" feature that renamed all of them might be nice, but this is definitely not a bug.

Changed in kicad:
importance: Undecided → Wishlist
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

What you are describing and what is shown in the image you posted is
Find/Replace which is the purpose of the Find/Replace dialog. I'm not
opposed to adding object filtering to the find/replace dialog but it
would be low on my priority list since the basic find/replace
functionality is already implemented.

On 3/18/2016 5:42 AM, Stephen Bernhoeft wrote:
> Hi,
>
> ..............................
> Q1: "You have multiple labels with the same name (a node) but you discover one label that you inadvertently misnamed (wrong
> node)."
>
> A1: In this case, the user would not tick the "Replace all" check-box. This should be disabled by default.
> ..............................
>
> Q2: "Eeschema silently changes all other instances of that label name."
>
> Well ... yes - If I *want all* of them changed, that would be what I'd like. However, a "third way" exists, namely "Prompt each replace". This could be checked by default, and only enabled if "Replace all" is checked. So this double-checks you want each instance. The program iterates all instances for you, but shows a (Yes/No) button each time. At any point you can also stop the operation.
> ..............................
>
> I'm attaching a screenshot from "PSPad" which has a similar feature, and
> (usefully in my view) combines search in files and search/replace in
> files. The edit box is disabled where the cursor is - you have to
> explicitly choose "Replace With".
>
> Would you consider something incorporating siamilar features in KiCad?
> The way it's set up in PSPad, one would not accidently get the unwanted
> result "silent" nightmare you mentioned.
>
> ** Attachment added: "KiCad - PSPad Search_Replace_In_FIles.jpg"
> https://bugs.launchpad.net/kicad/+bug/1558611/+attachment/4602971/+files/KiCad%20-%20PSPad%20Search_Replace_In_FIles.jpg
>

Revision history for this message
Stephen Bernhoeft (reg-abelgratis) wrote :

Thanks for your help Wayne.

As I understand it, the feature:

   "Change type of [all] labels having name xyz" From <TYPE_1> to <TYPE_2>"

might one day fit onto the Find/Replace.

---
P.S.
---
Re: Existing Dialog. As a test, I tried to change "A_VDD" to A_VDD_TEST_123 using the dialog mentioned. Both "Replace" and "Replace All" are disabled, see attached. No doubt this is my misapprehension, something I've overlooked?

I tried both a common component value (100n) and a label (A_VDD) in the "Search For" box. I also tried ticking more boxes.
Still the "Replace" and "Replace All" buttons are disabled.

The strings I'm looking for do exist on the schematic.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Did you try clicking find first? Until at least one occurrence of the
search text is found, the replace and replace all buttons are disabled.
 This behavior is a bit confusing and has been raised in another bug report.

On 3/23/2016 11:31 AM, Stephen Bernhoeft wrote:
> Thanks for your help Wayne.
>
> As I understand it, the feature:
>
> "Change type of [all] labels having name xyz" From <TYPE_1> to
> <TYPE_2>"
>
> might one day fit onto the Find/Replace.
>
>
> ---
> P.S.
> ---
> Re: Existing Dialog. As a test, I tried to change "A_VDD" to A_VDD_TEST_123 using the dialog mentioned. Both "Replace" and "Replace All" are disabled, see attached. No doubt this is my misapprehension, something I've overlooked?
>
> I tried both a common component value (100n) and a label (A_VDD) in the "Search For" box. I also tried ticking more boxes.
> Still the "Replace" and "Replace All" buttons are disabled.
>
> The strings I'm looking for do exist on the schematic.
>

Revision history for this message
Stephen Bernhoeft (reg-abelgratis) wrote :

That was it Wayne.

tags: added: eeschema
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Some propose (used by one programming IDE that I use): if I just press <Enter> only this instance is changed but, if I press <Shift>+<Enter> all instance of that variable in my code file is changed.

Or simple add a check box to the dialog box "change all instances". (I see some usability, and I agree with @Wayne).

Jeff Young (jeyjey)
Changed in kicad:
status: New → Opinion
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. Try searching for "lp:#1558611" on https://gitlab.com/kicad/code/kicad/-/issues

Changed in kicad:
status: Opinion → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.