Regression in git: PartDesign feature Hole UI broken

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
rynn
Posts: 467
Joined: Tue Jul 31, 2018 7:00 am

Regression in git: PartDesign feature Hole UI broken

Post by rynn »

In the git version, the UI of PartDesign hole discards the CutType.
Setting the type in the property-list works.

Take the attached example and try to set the hole cut type to “Countersink” oder “Counterbore” in the UI. It get’s displayed correctly while the dialog is open, but the moment you click O.K. the setting is lost.
Attachments
test.FCStd
(14.13 KiB) Downloaded 72 times
rynn
Posts: 467
Joined: Tue Jul 31, 2018 7:00 am

Re: Regression in git: PartDesign feature Hole UI broken

Post by rynn »

Prolem seems to be commit fe3f1b51b7be58367d08c5bb0f9f9d292671bb39
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Regression in git: PartDesign feature Hole UI broken

Post by vocx »

Direct link, git commit fe3f1b51b7.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Regression in git: PartDesign feature Hole UI broken

Post by Kunda1 »

wmayer wrote: pinged by pinger macro
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Regression in git: PartDesign feature Hole UI broken

Post by wmayer »

I have reverted this commit again. The problem is that the feature overrides the enumerations with the exact same values when clicking OK.

To fix the actual issue #0004371 it's better to handle this in the PropertyEnumeration. The current implementation is:

Code: Select all

void PropertyEnumeration::setEnums(const char **plEnums)
{
    // Setting the enum is done only once inside the constructor
    // but before the current index is already set. So, this needs
    // to be preserved.
    int index = _enum._index;
    _enum.setEnums(plEnums);
    _enum._index = index;
}
but this doesn't make much sense as it's not checked that the new enumeration has at least as many items as the old one.


See also:
https://forum.freecadweb.org/viewtopic.php?f=13&t=47584
https://forum.freecadweb.org/viewtopic.php?f=3&t=50611
msundman
Posts: 12
Joined: Wed Oct 28, 2020 2:13 am

Re: Regression in git: PartDesign feature Hole UI broken

Post by msundman »

wmayer wrote: Sun Oct 18, 2020 3:15 pm I have reverted this commit again.
OK, but now selecting a Hole Cut Type won't enable the Diameter field:
Image

When trying to OK the task it shows an error message and enables the field (and then you can set the diameter properly):
Image
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Regression in git: PartDesign feature Hole UI broken

Post by wmayer »

OK, but now selecting a Hole Cut Type won't enable the Diameter field:
With my version I cannot confirm this behaviour. When changing the type to Countersink or Counterbore the Diameter filed becomes active.


OS: Ubuntu 18.04.5 LTS (XFCE/xubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22865 (Git)
Build type: Debug
Branch: master
Hash: 3c307b7a3c222d66cb70695cdcf79606553fcb91
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
mendy
Posts: 262
Joined: Mon May 21, 2018 2:16 pm

Re: Regression in git: PartDesign feature Hole UI broken

Post by mendy »

msundman wrote: Wed Oct 28, 2020 7:26 pm OK, but now selecting a Hole Cut Type won't enable the Diameter field:
I too see this behavior in appimage

OS: Ubuntu 20.04.1 LTS (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22894 (Git) AppImage
Build type: Release
Branch: master
Hash: 9eb080488d970d313c538473e7272117ea0a7cd1
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)

also in daily

OS: Ubuntu 20.04.1 LTS (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 9eb080488d970d313c538473e7272117ea0a7cd1
Python version: 3.8.5
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)
Attachments
hole.gif
hole.gif (256.88 KiB) Viewed 2062 times
rynn
Posts: 467
Joined: Tue Jul 31, 2018 7:00 am

Re: Regression in git: PartDesign feature Hole UI broken

Post by rynn »

Yes.

As far as I can see, the read-only flags are set correct, but are not propagated to the UI.

I can fix it with this:

Code: Select all

+        ProfileBased::onChanged(&HoleCutDiameter);^M
+        ProfileBased::onChanged(&HoleCutDepth);^M
+        ProfileBased::onChanged(&HoleCutCountersinkAngle);^M
but I’m not sure if this is the correct way to do.
wmayer wrote: pinged by rynn
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Regression in git: PartDesign feature Hole UI broken

Post by wmayer »

but I’m not sure if this is the correct way to do.
This should be OK. The dialog has the method TaskHoleParameters::changedObject and can directly react on changes of the hole feature.
Feel free to create a PR.
Post Reply