about the new detail view dialog

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: about the new detail view dialog

Post by uwestoehr »

wandererfan wrote: Sat Apr 18, 2020 3:24 pm
Yes, I understand this. But in the current configuration, there is no need to close the dialog to see the update. The tab key will trigger an update, as will changing focus to another widget. The enter key should do it also, but that is trapped somewhere and never delivered to the widget in the dialog.
The enter key closes the dialog and the tab key leaveds the field. But I want to see the effect of addiing e.g. 3 mm to the y-position. Howevr, that one must press TAB just so see the change in a dialog is nothing users can know because in all other dialogs of FC this is not necessaryx.
The issue was that the recompute was being triggered by the dialog for every keystroke in the changed field. So if you wanted to change the X position of the highlight from 350 mm to 500 mm the recalculation would be done approximately 6 times - 3 backspaces to remove the old value, then 3 keys to enter the new value.
Yes, but is the problem of 6 recomputations? I still cannot see anything special. Very large files will always need more calculation power. E.g. I got samples from KBWBE (a2plus author) that are large and for them even create a simple part view can take minutes. But OK, everybody knows that CAD needs some CPU and GPU power.
And such large files as his examples re in general not capable to construct with FC, because also the Sketcher and PartDesign takes ages and sometimes Windows kills FC because it becomes unresponsive. But we are here not talking about extreme cases that in general can break FC.
I believe I was using "screwjack_assembly.fcstd". The initial section origin point is too far to the right, and trying to move the position back to the origin triggered the loop/slow response.
This file make Windows kill FC because it becomes unresponsive. So it is broken in general. Directly after opening I see theses errors:

Code: Select all

Traceback (most recent call last):
  File "C:\Users\USti\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_viewProviderProxies.py", line 288, in onChanged
    setattr( cMirror, prop, getattr( obj, prop) )
<class 'AttributeError'>: 'FeaturePython' object has no attribute 'Suppressed'
Traceback (most recent call last):
  File "C:\Users\USti\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_viewProviderProxies.py", line 288, in onChanged
    setattr( cMirror, prop, getattr( obj, prop) )
<class 'AttributeError'>: 'FeaturePython' object has no attribute 'Suppressed'
Traceback (most recent call last):
  File "C:\Users\USti\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_viewProviderProxies.py", line 288, in onChanged
    setattr( cMirror, prop, getattr( obj, prop) )
<class 'AttributeError'>: 'FeaturePython' object has no attribute 'Suppressed'
Traceback (most recent call last):
  File "C:\Users\USti\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_viewProviderProxies.py", line 288, in onChanged
    setattr( cMirror, prop, getattr( obj, prop) )
<class 'AttributeError'>: 'FeaturePython' object has no attribute 'Suppressed'
Traceback (most recent call last):
  File "C:\Users\USti\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_viewProviderProxies.py", line 288, in onChanged
    setattr( cMirror, prop, getattr( obj, prop) )
<class 'AttributeError'>: 'FeaturePython' object has no attribute 'Suppressed'
Traceback (most recent call last):
  File "C:\Users\USti\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_viewProviderProxies.py", line 288, in onChanged
    setattr( cMirror, prop, getattr( obj, prop) )
<class 'AttributeError'>: 'FeaturePython' object has no attribute 'Suppressed'
Adding a detail view (current master) to the existing view in the file sends FC to an endless loop and Windows jumps in to end this. Do you have another real-world file that proves that 6 recomputations can make harm?
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: about the new detail view dialog

Post by wandererfan »

uwestoehr wrote: Sun Apr 19, 2020 11:22 pm The enter key closes the dialog and the tab key leaveds the field. But I want to see the effect of addiing e.g. 3 mm to the y-position. Howevr, that one must press TAB just so see the change in a dialog is nothing users can know because in all other dialogs of FC this is not necessaryx.
Change a SectionOrigin in the PropertyEditor. You must take a definite action (Tab, click another field, Enter) to apply the change. IMO, this is the proper behaviour for a data entry field.
This file make Windows kill FC because it becomes unresponsive. So it is broken in general. Directly after opening I see theses errors:
I do not get these messages. Different addon versions?
Do you have another real-world file that proves that 6 recomputations can make harm?
Try the attached file.

Also see this post: https://www.forum.freecadweb.org/viewto ... 35&t=45348

The unnecessary recomputes issue was huge in v0.18. A lot of work went into removing the extra computations.
Attachments
cad_3D_003 _v19.FCStd
(741.36 KiB) Downloaded 22 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: about the new detail view dialog

Post by uwestoehr »

wandererfan wrote: Mon Apr 20, 2020 1:51 am Change a SectionOrigin in the PropertyEditor.
If I remember correctly I once tried to change it but you said these immediate recomputations are not OK ;)
I do not get these messages. Different addon versions?
I have A2plus 4.46c
Try the attached file.
Thanks. This is nice work btw.!

However, this is what I mean, even with the most complex models I can get, I have no issue and I have an average Graphics card and CPU. Here is a screencast:
screencast
screencast
P11vXEo4Oi.gif (130.27 KiB) Viewed 1329 times
(current master plus my pending PR)

Don't get me wrong. I have to rely on FC and use it now almost daily. There are many areas where FC is really slow therefore I take care of this. Therefore I tested this properly and as you can see, for the detail view dialog, everything is fine. So I think it is OK to allow immediate recomputations for this dialog.

Even for the section view the speed is in my opinion acceptable for this complex file, since every recomputation takes only about a second, so withing a minute you have plenty positions to play with.

Besides this, there are fields of TD that are really slow - on opening files. Opening the example file takes here more than 10 seconds. At first the 3D model is load, takes about 2 seconds, then about 10 seconds just to show the drawing.

This is my PC I am currently at: Ryzen 5 3600, 8 GB RAM.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: about the new detail view dialog

Post by wandererfan »

uwestoehr wrote: Mon Apr 20, 2020 11:08 pm Thanks. This is nice work btw.!
Not mine. @claus1982 is the artist.
Even for the section view the speed is in my opinion acceptable for this complex file, since every recomputation takes only about a second, so withing a minute you have plenty positions to play with.
I can live with this for the increment/decrement arrows, but data entry in the fields is completely frustrating at a second per keystroke. Can we figure out a way to treat the two situations differently?

There might also be a problem with the reference field. When trying to change it, I get commas inserted between characters and the field will only accept a small number (< 10) of characters. I will try to track this down in more detail.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: about the new detail view dialog

Post by wandererfan »

There might also be a problem with the reference field. When trying to change it, I get commas inserted between characters and the field will only accept a small number (< 10) of characters. I will try to track this down in more detail.
This is a false alarm. The problem exists, but not in your branch. Sorry for the noise.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: about the new detail view dialog

Post by uwestoehr »

wandererfan wrote: Wed Apr 22, 2020 12:33 am I can live with this for the increment/decrement arrows, but data entry in the fields is completely frustrating at a second per keystroke. Can we figure out a way to treat the two situations differently?
But this is what my patch does by using the Qt keyboardTracking flag. Works here as it should. Not for you on Linux? What Qt version do you have?

But even then, how many keystrokes do one do in a field within a second. My test with your file file that for the section dialog, entering e.g. "9.8" needs 3 seconds. This is indeed not nice, but note that my patch does not yet affect the section dialog, only the detail view dialog. And for the detail view dialog even 3 keystrokes in a row don't make troubles (see my screencast 2 posts above, where I pressed quickly the arrow key in a row).

So I opt to put in my patch and then we investigate how to sanitize the section dialog.

Besides this and in general, of course I want to hear if and how the Qt keyboardTracking flag behaves.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: about the new detail view dialog

Post by wandererfan »

uwestoehr wrote: Sat Apr 25, 2020 4:11 pm But this is what my patch does by using the Qt keyboardTracking flag. Works here as it should. Not for you on Linux? What Qt version do you have?
Recompiled your latest this morning.

Here it is still 1 keystroke = 1 recompute

OS: Linux Mint 19.2 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20668 +8 (Git)
Build type: Unknown
Branch: TD-DetailWork
Hash: 1440dbcc094917bfee3eefb407974a1f10980827
Python version: 3.6.9
Qt version: 5.9.5 <<<<<<<
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)

I'm downloading newer Qt now. Will let you know if any difference.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: about the new detail view dialog

Post by wandererfan »

uwestoehr wrote: Sat Apr 25, 2020 4:11 pm What Qt version do you have?
!@#$%^~~!!!

No change with Qt5.12.

OS: Linux Mint 19.2 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20655 +5 (Git)
Build type: debug
Branch: TD-DetailWork
Hash: b4758bdfd484bae0f4769591b77590c9366d7c72
Python version: 3.6.9
Qt version: 5.12.8 <<<<<<<<<<
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: about the new detail view dialog

Post by uwestoehr »

wandererfan wrote: Mon Apr 27, 2020 3:03 pm No change with Qt5.12.
I see the same on Manjaro Linux and even at Windows after a complete recompilation. Maybe it is a Qt issue.

However, as I wrote:
So I opt to put in my patch
As I have shown, the detail dialog can handles 3 recomputes in a row even with your complex example file on average PCs and the PR fixes further issues. At the weekend I will take some time to find a better solution or workaround for the flag issue that we could improve the usability of the section view dialog as well.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: about the new detail view dialog

Post by uwestoehr »

uwestoehr wrote: Tue Apr 28, 2020 11:59 pm I see the same on Manjaro Linux and even at Windows after a complete recompilation. Maybe it is a Qt issue.
It is not, it is a FC issue: https://forum.freecadweb.org/viewtopic.php?f=10&t=47030

So here it the patch but without the slot signal change:
https://github.com/FreeCAD/FreeCAD/pull/3365
Post Reply