Change of Design_Rules->Clearance in Pcbnew not working when in OpenGL/Cairo mode

Bug #1462929 reported by Miloje Zecevic
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Unassigned

Bug Description

In Pcbnew in default canvas view, when changing Clearance value (Design Rules->Design Rules->Clearance), everything works as expected, i.e. clearance change is applied and routing lines takes new clearance into account.
But when switched to OpenGL/Cairo mode and clearance is changed, new clearance value is not taken into account but old value from default canvas view is still active. Switching back to default view finally takes new value into account.
This can be checked on any demo pcb that comes with KiCad.
I guess that correct behaving would be that current clearance value should be taken into account regardless of viewing mode.

KiCad data:

Application: kicad
Version: (2015-06-07 BZR 5721)-product release build
wxWidgets: Version 3.0.0 (debug,wchar_t,compiler with C++ ABI 1002,GCC 4.8.2,wx containers,compatible with 2.8)
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Boost version: 1.54.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

Kind Regards,
Miloje

Tags: gal pns
Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

Hi Miloje,

Couldn't reproduce it:
- entered Design Rules->Design Rules
- changed the clearance, clicked OK
- ran the router (pressed X)
- new clearance is working.

Perhaps you didn't restart the router tool after changing the clearance. Could you confirm, please?

Tom

Revision history for this message
Miloje Zecevic (miloje-zecevic) wrote :

Hi Tom,

Thank you for quick respond.
Yes, you are right, restarting the router (by pressing X) takes new clearance value into account.
It confused me since I had router icon active before changing the clearance value, so I didn't press X on the keyboard after that. I just assumed that currently active tool (in this case router) would automatically take new parameters into account.

Best Regards,
Miloje

Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

The router is an exception: it operates on a separate data model which is rebuilt when the router tool is activated (this is because of performance requirements). Unfortunately it causes issues like this one.

Best,
Tom

Revision history for this message
Miloje Zecevic (miloje-zecevic) wrote :

Hi Tom,

Thank you for clarifying this.

Best Regards,
Miloje

Changed in kicad:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

* WORKAROUND: exit and enter router tool again

Revision history for this message
Matthijs Kooijman (matthijskooijman) wrote :

I also ran into this bug today. When I also tried to change the pad clearance in an attempt to debug (which rebuilds this router data model and thus applies the new design rules clearance setting) things really behaved weirdly (though perfectly expected according to what I've learned from this bug report). Took me a while to figure out what was going on, and once I did I could find this report :-)

Wouldn't it be possible to just reload this data model whenever the design rules are changed? Or drop out of router mode if the design rules menu is opened? I'm not familiar with the codebase, so I'm not sure how elegant or ugly something like that would be, though.

Revision history for this message
Dan Weatherill (dan-weatherill) wrote :

This patch fixes this bug (by emitting a model change event when the design rules dialog is exited).
However, I may have done something "not allowed" in terms of directly dispatching an event.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1462929] Re: Change of Design_Rules->Clearance in Pcbnew not working when in OpenGL/Cairo mode

@Dan, what happens when the legacy canvas is active? In other words, is
the tool manager object pointer always valid? If not, your patch will
segfault. Please check this and let me know so I can get this patch merged.

On 1/6/2018 9:51 PM, Dan Weatherill wrote:
> This patch fixes this bug (by emitting a model change event when the design rules dialog is exited).
> However, I may have done something "not allowed" in terms of directly dispatching an event.
>
>
> ** Patch added: "0001-Send-model-change-event-on-design-rules-change.patch"
> https://bugs.launchpad.net/kicad/+bug/1462929/+attachment/5032159/+files/0001-Send-model-change-event-on-design-rules-change.patch
>

Changed in kicad:
milestone: none → 5.0.0-rc2
tags: added: gal pns
Revision history for this message
Jeff Young (jeyjey) wrote :

Ping.

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

I tested this patch the best I could and didn't find any issues. Maybe Tom or Orson can think of a reason not to do this. In the mean time, I merged your patch. Thanks. FYI, this patch had some trailing white space which I removed.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 4124019f41d50b0ed793cc06469cf37c6e285891
https://git.launchpad.net/kicad/patch/?id=4124019f41d50b0ed793cc06469cf37c6e285891

Changed in kicad:
status: Confirmed → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
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.