Regression in git: PartDesign feature Hole UI broken

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
rynn
Posts: 226
Joined: Tue Jul 31, 2018 7:00 am

Regression in git: PartDesign feature Hole UI broken

Post by rynn » Tue Sep 29, 2020 6:18 pm

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 26 times
rynn
Posts: 226
Joined: Tue Jul 31, 2018 7:00 am

Re: Regression in git: PartDesign feature Hole UI broken

Post by rynn » Tue Sep 29, 2020 6:47 pm

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

Re: Regression in git: PartDesign feature Hole UI broken

Post by vocx » Sun Oct 11, 2020 5:16 pm

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
Posts: 9209
Joined: Thu Jan 05, 2017 9:03 pm

Re: Regression in git: PartDesign feature Hole UI broken

Post by Kunda1 » Sun Oct 18, 2020 1:19 pm

wmayer wrote: pinged by pinger macro
Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
wmayer
Site Admin
Posts: 16849
Joined: Thu Feb 19, 2009 10:32 am

Re: Regression in git: PartDesign feature Hole UI broken

Post by wmayer » Sun Oct 18, 2020 3:15 pm

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: 3
Joined: Wed Oct 28, 2020 2:13 am

Re: Regression in git: PartDesign feature Hole UI broken

Post by msundman » Wed Oct 28, 2020 7:26 pm

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
Site Admin
Posts: 16849
Joined: Thu Feb 19, 2009 10:32 am

Re: Regression in git: PartDesign feature Hole UI broken

Post by wmayer » Thu Oct 29, 2020 3:37 pm

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: 107
Joined: Mon May 21, 2018 2:16 pm

Re: Regression in git: PartDesign feature Hole UI broken

Post by mendy » Tue Nov 03, 2020 7:36 pm

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 319 times
rynn
Posts: 226
Joined: Tue Jul 31, 2018 7:00 am

Re: Regression in git: PartDesign feature Hole UI broken

Post by rynn » Tue Nov 03, 2020 9:30 pm

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
Site Admin
Posts: 16849
Joined: Thu Feb 19, 2009 10:32 am

Re: Regression in git: PartDesign feature Hole UI broken

Post by wmayer » Wed Nov 04, 2020 9:17 am

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

Who is online

Users browsing this forum: No registered users and 2 guests