Lattice2 icon indicating copy to clipboard operation
Lattice2 copied to clipboard

Unit mismatch on keyboard editing attachment angle

Open regularfry opened this issue 1 year ago • 1 comments

If you:

  1. Make a body
  2. Pick an edge on that body
  3. click Attached Placement
  4. Select Z tangent to edge mode (or Inertial CS, as long as it's not Deactivated)
  5. Focus the Around x-axis input field, selecting all the text in the field
  6. Press the 9 key (as though to type "90")

On 0.20.2 the Report view pops up with this message:

15:13:22  Traceback (most recent call last):
15:13:22    File "/Applications/FreeCAD.app/Contents/Resources/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py", line 265, in <lambda>
15:13:22      QtCore.QObject.connect(self.attachmentOffsetEdits[i], QtCore.SIGNAL('valueChanged(double)'), lambda val, i=i: self.attachmentOffsetChanged(i,val))
15:13:22    File "/Applications/FreeCAD.app/Contents/Resources/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py", line 394, in attachmentOffsetChanged
15:13:22      roll = Q(self.form.attachmentOffsetRoll.text()).getValueAs(deg)
15:13:22  ValueError: Unit mismatch

You get another backtrace in the Report view for each keypress.

I've checked whether anything similar happens for, for instance, attaching a datum plane to an edge, and it doesn't. This seems to be specific to Lattice2 in that other instances of the attachment editor don't seem to check for units on each keypress (or if they do, they swallow the error).

Now, on a relatively recent FreeCAD build from the master branch (f0560ac2 if you want to play along) it's worse, because this interacts badly with the new so-called "Non-Intrusive" notifications. If I do the same on that build, I get both the report view popping up, and a new error window which, because it's trying to show repeated backtraces, is big enough to cover half the screen, completely obscuring the combo view in its default location and, on my screen, the body itself in the 3d view. And because the notification display is supposed to go away on its own, there's no affordance to get rid of it. It's extremely jarring.

regularfry avatar Jun 06 '23 14:06 regularfry

yep, i know, the unit police is acting too harsh here. It is not entirely Lattice2-specific, i will have to make a fix into FreeCAD itself. I can monkey-patch it. Sorry, i can't promise to fix it soon.

DeepSOIC avatar Jun 06 '23 18:06 DeepSOIC