[regression] hole feature broken

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
uwestoehr
Veteran
Posts: 4960
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

[regression] hole feature broken

Post by uwestoehr »

Since git commit fe3f1b51b the hole feature is broken. Load for example this simple file with one hole:
Hole-bug.FCStd
testfile
(18.14 KiB) Downloaded 39 times
Its parameters are ISO fine, thread class 6G, Cheesehead, M3.5.

(When opening the file you get an error that the enumeration is invalid. This will be fixed with the PR below.)

But look at the Size, instead of M3.5 you get M1.2 and also the thread class is wrong. The reason is that in the routine
Hole::onChanged
we reset them:

Code: Select all

ThreadSize.setValue(0L);
ThreadClass.setValue(0L);
HoleCutType.setValue(0L);
The intention of the mentioned commit was to reset them when the hole type was changed. But when I debug, I see that just on loading the file Hole::onChanged is executed more than 60 times.

I tried to fix this so that on opening the file Hole::onChanged is not executed because nothing is changed, only the feature properties must be read out. But I cannot figure out how to achieve this. Can anybody give me a pointer please?

------------

Besides this, the hole task dialog does not initialize by reading the hole properties but by executing Hole::onChanged as well. A dialog should display initially just the feature properties and not invoke automatically any change action. I corrected that in this PR: https://github.com/FreeCAD/FreeCAD/pull/3897
TheMarkster
Veteran
Posts: 5318
Joined: Thu Apr 05, 2018 1:53 am

Re: [regression] hole feature broken

Post by TheMarkster »

Might need to block signals temporarily.
User avatar
uwestoehr
Veteran
Posts: 4960
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [regression] hole feature broken

Post by uwestoehr »

TheMarkster wrote: Sun Sep 27, 2020 3:09 pm Might need to block signals temporarily.
Thanks.
I am stuck to find out where the onChanged routine is executed the fist time and why it is executed just by opening a document. So I miss the start point to block its very first execution if nothing is actually changed.
Syres
Veteran
Posts: 2497
Joined: Thu Aug 09, 2018 11:14 am

Re: [regression] hole feature broken

Post by Syres »

uwestoehr wrote: Sun Sep 27, 2020 6:04 pm I am stuck to find out where the onChanged routine is executed the fist time and why it is executed just by opening a document. So I miss the start point to block its very first execution if nothing is actually changed.
Not sure whether this is still relevant to you : git commit 30bc9fc
@Werner took my (poor) PR https://github.com/FreeCAD/FreeCAD/pull/3799 , closed it and did the job properly!
Post Reply