[Possible Bug] when editing the value of a boundary condition and pressing ENTER, task disappears but still active

About the development of the FEM module/workbench.

Moderator: bernd

RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

[Possible Bug] when editing the value of a boundary condition and pressing ENTER, task disappears but still active

Post by RatonLaveur »

When editing Flow constraints in FEM Module, if pressing ENTER instead instead of clicking away from a field value input, the task disappears but remains active, thus locking FreeCAD.

How to repeat:

- Create an analysis
- Create a flow constraint
- Edit one of the numerical flow conditions and press ENTER instead of clicking away.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21068 (Git)
Build type: Release
Branch: master
Hash: 92fe9adebbff910c5a10d6230785a6b58935b677
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Switzerland (en_CH)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [Possible Bug] when editing the value of a boundary condition and pressing ENTER, task disappears but still active

Post by bernd »

I can not repeat.

Which constraint did you add, flow velocity, initial flow velocity or fluid ?
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: [Possible Bug] when editing the value of a boundary condition and pressing ENTER, task disappears but still active

Post by RatonLaveur »

Flow velocity. I'll try to repeat a few more times to get the hang of it.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [Possible Bug] when editing the value of a boundary condition and pressing ENTER, task disappears but still active

Post by bernd »

- start FreeCAD
- change to FEM
- make a new document
- add Analysis
- add a constraint flow velocity (the task panel will open automatically)
- click on the blue checkbox right beside the Velocity x, to activate the input field
- select the firs "0" and put in a "5" field will show 5.00 mm/min
- press Enter, Task panel will close
- For me the object closes the edit mode correct
- Means FreeCAD is not locked

Code: Select all

OS: Debian GNU/Linux 10 (buster) (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21124 (Git)
Build type: Unknown
Branch: master
Hash: 8fcd436de1e3233d9616571679a46b4d93c3e730
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: [Possible Bug] when editing the value of a boundary condition and pressing ENTER, task disappears but still active

Post by RatonLaveur »

Okay I had time to reproduce the bug. Was actually super easy :)

1. Load the file
AirFlow2DElmer.FCStd
(462.91 KiB) Downloaded 15 times
2. Double click the Analysis object to activate it (not necessary, just neater)
3. Double click the first ConstraintFlowVelocity (below ConstraintInitialFlowVelocity)
4. Click in the X field that reads -20 mm/s for edition
5. Backspace until no value is entered.
6. Press "20" then ENTER

Voilà!
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21068 (Git)
Build type: Release
Branch: master
Hash: 92fe9adebbff910c5a10d6230785a6b58935b677
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Switzerland (en_CH)

For completeness' sake I have taken the liberty of also running the bug in the most current portable build available and it works.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21255 (Git)
Build type: Release
Branch: master
Hash: dfdcd5351b686f1a452eb840b90cffff1b93c112
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Switzerland (en_CH)

And the report view...for fun.

LOL I cannot copy paste the report view, because the bug actually locks me out of freecad by being stuck in Task Edit Mode :)
So a screenshot will have to do.
2020-05-25 22_47_16-FreeCAD 0.19.png
2020-05-25 22_47_16-FreeCAD 0.19.png (16.33 KiB) Viewed 781 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [Possible Bug] when editing the value of a boundary condition and pressing ENTER, task disappears but still active

Post by bernd »

confirmed.

Two remarks.

- Try to make the file as simple as possible. Attached the example for this problem.
- really copy the error instead of makeing a screen. The search would find it than.

Code: Select all

Traceback (most recent call last):
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femviewprovider/view_constraint_initialflowvelocity.py", line 82, in accept
    self._applyWidgetChanges()
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femviewprovider/view_constraint_initialflowvelocity.py", line 120, in _applyWidgetChanges
    self._obj.VelocityX = float(quantity.getValueAs(unit))
<class 'ValueError'>: Unit mismatch

simplefile.FCStd
(6.62 KiB) Downloaded 16 times
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: [Possible Bug] when editing the value of a boundary condition and pressing ENTER, task disappears but still active

Post by RatonLaveur »

Hello Bernd,

Thanks for taking the time. Sure I'll try to simplify the file when I see something like this. My thinking was more to share the exact file that shows the issue.

Regarding copying the report view, I agree but CTRL-C (copying text from the report view) would not work because I was stuck in a task, it was trying to copy the ConstraintFlowVelocity object instead :) How did you do it?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [Possible Bug] when editing the value of a boundary condition and pressing ENTER, task disappears but still active

Post by bernd »

Found another problem ...

open file and double click on the object

Code: Select all

Traceback (most recent call last):
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femviewprovider/view_constraint_initialflowvelocity.py", line 49, in setEdit
    _TaskPanel
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femviewprovider/view_base_femobject.py", line 102, in setEdit
    task = TaskPanel(vobj.Object)
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femviewprovider/view_constraint_initialflowvelocity.py", line 62, in __init__
    self._mesh = membertools.get_single_member(analysis, "Fem::FemMeshObject")
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femtools/membertools.py", line 85, in get_single_member
    objs = get_member(analysis, t)
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/femtools/membertools.py", line 57, in get_member
    raise ValueError("Analysis must not be None")
<class 'ValueError'>: Analysis must not be None

simplefile_2.FCStd
(5.98 KiB) Downloaded 15 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [Possible Bug] when editing the value of a boundary condition and pressing ENTER, task disappears but still active

Post by bernd »

RatonLaveur wrote: Tue May 26, 2020 7:13 am Regarding copying the report view, I agree but CTRL-C (copying text from the report view) would not work because I was stuck in a task, it was trying to copy the ConstraintFlowVelocity object instead :) How did you do it?
no problem here, but nevermind if copy does not work a screen is the only possibility.
Post Reply