Toolbits. SERIOUS EFFORT NEEDED

Here's the place for discussion related to CAM/CNC and the development of the Path module.
spanner888
Posts: 78
Joined: Tue May 28, 2019 10:51 am

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby spanner888 » Wed Nov 04, 2020 8:52 pm

dubstar-04 wrote:
Wed Nov 04, 2020 7:50 pm
you have to restart FreeCAD once you have changed setting for legacy tools.

Without a restart the noted error occurs.
Yes, that was my mistake, thanks for finding my error, I was pretty sure it was my mistake and not @sliptonic.
User avatar
sliptonic
Posts: 2160
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Wed Nov 04, 2020 9:01 pm

spanner888 wrote:
Wed Nov 04, 2020 8:52 pm
I was pretty sure it was my mistake and not @sliptonic.
NOW, you have made a mistake! :lol:
spanner888
Posts: 78
Joined: Tue May 28, 2019 10:51 am

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby spanner888 » Fri Nov 06, 2020 9:44 am

Made a start with testing, had a lot of interruptions and more coming, so just drop these minor issues here before they get lost.

Create new Path Job, accept defaults (press OK)
Expand Default Tool
Double click on EndMill- a New Task opens with Tool Shape and Attribute tabs.

Issue A: Title of task = "Form". Suggest title should be something like "Tool Bit Parameters"

Issue B: While in above Task form, clicked on property - immdiate FreeCAD crash
Can't reproduce this, so just mention in case someone else also gets.

Issue C: Change shape file to ballend, click ok to close task & following appears in report pane:
09:15:07 in _removebitbody
09:15:07 Traceback (most recent call last):
File "/home/spanner888/Documents/_source/freecad-build/Mod/Path/PathScripts/PathToolBitGui.py", line 147, in accept
self.editor.accept()
File "/home/spanner888/Documents/_source/freecad-build/Mod/Path/PathScripts/PathToolBitEdit.py", line 175, in accept
enabled = self.model.item(i, 0).checkState() == QtCore.Qt.Checked
<class 'AttributeError'>: 'NoneType' object has no attribute 'checkState'

Issue D: Confusing/changing Tool Names
Below is with default list of EndMills T1 to T9
Steps to reproduce:
Menu Path, Tool bit selector.
Select Tool, Click Add to Job.For example T3 is added as Tool Controller T004 (This is not the issue)
Open Toolbit library editor
Double click on ANY Toolbit, except the one just used to create new ToolController above, note Toolbit name matches that in greyed out toolbit list in center pane. Click OK or cancel and Toolbit name does NOT change.
Double click on the Toolbit just used to create new ToolCotroller above. Note Toolbit name has now changed to T005 in the editing pane.
Selecting OK will change Toolbit name in the library.
User avatar
sliptonic
Posts: 2160
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Fri Nov 06, 2020 4:34 pm

spanner888 wrote:
Fri Nov 06, 2020 9:44 am
Issue A: Title of task = "Form". Suggest title should be something like "Tool Bit Parameters"
Got it.
Issue B: While in above Task form, clicked on property - immdiate FreeCAD crash

Are you running a style sheet? I think this is the crash I referred to earlier. I can reproduce it reliably but only if FreeCAD has no stylesheet set. Others have not been able to reproduce it at all.
stylesheet.png
stylesheet.png (64.1 KiB) Viewed 476 times
Issue C: Change shape file to ballend, click ok to close task & following appears in report pane:
09:15:07 in _removebitbody
09:15:07 Traceback (most recent call last):
File "/home/spanner888/Documents/_source/freecad-build/Mod/Path/PathScripts/PathToolBitGui.py", line 147, in accept
self.editor.accept()
File "/home/spanner888/Documents/_source/freecad-build/Mod/Path/PathScripts/PathToolBitEdit.py", line 175, in accept
enabled = self.model.item(i, 0).checkState() == QtCore.Qt.Checked
<class 'AttributeError'>: 'NoneType' object has no attribute 'checkState'
I believe this is already fixed in my branch.
Issue D: Confusing/changing Tool Names
Below is with default list of EndMills T1 to T9
Steps to reproduce:
Menu Path, Tool bit selector.
Select Tool, Click Add to Job.For example T3 is added as Tool Controller T004 (This is not the issue)
Open Toolbit library editor
Double click on ANY Toolbit, except the one just used to create new ToolController above, note Toolbit name matches that in greyed out toolbit list in center pane. Click OK or cancel and Toolbit name does NOT change.
Double click on the Toolbit just used to create new ToolCotroller above. Note Toolbit name has now changed to T005 in the editing pane.
Selecting OK will change Toolbit name in the library.
Huh. Well THAT's interesting. :? I'll look at it.

Great stuff! Thanks spanner888
User avatar
sliptonic
Posts: 2160
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Fri Nov 06, 2020 7:01 pm

spanner888 wrote:
Fri Nov 06, 2020 9:44 am

Issue D: Confusing/changing Tool Names
Below is with default list of EndMills T1 to T9
Steps to reproduce:
Menu Path, Tool bit selector.
Select Tool, Click Add to Job.For example T3 is added as Tool Controller T004 (This is not the issue)
Open Toolbit library editor
Double click on ANY Toolbit, except the one just used to create new ToolController above, note Toolbit name matches that in greyed out toolbit list in center pane. Click OK or cancel and Toolbit name does NOT change.
Double click on the Toolbit just used to create new ToolCotroller above. Note Toolbit name has now changed to T005 in the editing pane.
Selecting OK will change Toolbit name in the library.
Huh. Well THAT's interesting. :? I'll look at it.
I now understand this but don't know how to solve it. First, ToolBits lead a kind of 'double life' They can exist as document objects inside an active document. When you create a tool controller for a ToolBit, the nested toolbit is one of these. Second, they exist as a file on the file system (.fctb) in your Bit directory. When you're building a Toolbit library, you're building a list of these files.

The Name property in the file is the default name (label) given to a Toolbit object when it's added to a document. But if there's already a document object with that label, it figures out a new one that's different because you can't have two document objects with the same label.

When you're in the toolbit library manager and edit a toolbit by double clicking, it temporarily creates the object in the tree. You can edit the properties and then save it and it will be written to disk and removed from the document.

One question that occurred to me when I was working on the UI is; What does it mean for a user to edit the ToolBit document object underneath a tool controller? Will the user assume that changes made here are persisted to the disk? (It isn't) Should editing in this way even be allowed?
mlampert
Posts: 1621
Joined: Fri Sep 16, 2016 9:28 pm

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby mlampert » Fri Nov 06, 2020 8:47 pm

I think the root of the problem is that we chose to use the ToolBit name as the name for ToolController (blame me for that poor choice) - now that both are in the tree they clash. We should give the ToolController a different label, maybe "TC-<ToolBitName>".

What adds to the confusion is the auto naming of FC adding 3 digits on conflict (or perceived conflict) - when most ppl (including the default library shipped with FC) already have a numeric postfix ...
spanner888
Posts: 78
Joined: Tue May 28, 2019 10:51 am

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby spanner888 » Fri Nov 06, 2020 9:38 pm

sliptonic wrote:
Fri Nov 06, 2020 4:34 pm
spanner888 wrote:
Fri Nov 06, 2020 9:44 am
Issue B: While in above Task form, clicked on property - immdiate FreeCAD crash

Are you running a style sheet? I think this is the crash I referred to earlier. I can reproduce it reliably but only if FreeCAD has no stylesheet set. Others have not been able to reproduce it at all.
stylesheet.png

No, not running a style sheet ATM, but I last week I did try the Glass theme which uses a style sheet along with many other preference changes, but I turned off the theme as my old male eyes can't cope with those colors. So some of those other settings remain in place. I will do some more investigation, including clean ~/.Freecad dir and see if I can find anything.
spanner888
Posts: 78
Joined: Tue May 28, 2019 10:51 am

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby spanner888 » Fri Nov 06, 2020 10:27 pm

mlampert wrote:
Fri Nov 06, 2020 8:47 pm
I think the root of the problem is that we chose to use the ToolBit name as the name for ToolController (blame me for that poor choice) - now that both are in the tree they clash. We should give the ToolController a different label, maybe "TC-<ToolBitName>".

What adds to the confusion is the auto naming of FC adding 3 digits on conflict (or perceived conflict) - when most ppl (including the default library shipped with FC) already have a numeric postfix ...
I strongly support the use of "TC...". As it stands having a default Tool Controller of "Default Tool" is confusing for many users both because nothing in the tree is called Tool Controller and also the (draft) wiki doco talks about :

Code: Select all

    Tool Controller
    Tool 
    ToolShapes
    Toolbit
    Library 
Another reason is that the Tool controllers can appear anywhere at the top level of the Job tree, ie not always grouped together at the top, sometimes at the bottom, which can make them easy to miss or misunderstand, if there is no standard prefix that identifies this thing as a ToolController (or at least default prefix if user can over ride).

In addition there are a "fair few" users who get lost with the predecessor system, especially with ToolControllers and rapids/feeds, so that now there are more elements/layers in the entire Tool/Toolbit hierarchy, it needs to be very clear at all stages what the user is interacting with.
User avatar
dubstar-04
Posts: 626
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby dubstar-04 » Sat Nov 07, 2020 3:36 pm

Hi Brad,

I really like the new toolbits and the toolbit dock is very slick. A few things I noticed while testing:

If you close and reopen the tooldock, multiple instances are created.
tooldock.png
tooldock.png (31.57 KiB) Viewed 332 times



changing the parameters and pressing OK doesn't seem to save the new value.
toolbitdockpara.png
toolbitdockpara.png (31.4 KiB) Viewed 332 times



Changing the toolbit shape resets the toolbit name:
toolbitshapechange.png
toolbitshapechange.png (46.49 KiB) Viewed 332 times
toolbitnamechange.png
toolbitnamechange.png (14.46 KiB) Viewed 332 times



Thanks,

Dan
User avatar
dubstar-04
Posts: 626
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby dubstar-04 » Sat Nov 07, 2020 3:55 pm

Editing newly created tools causes the tool to disappear from the library:


ToolDisappears.webm
(513.38 KiB) Downloaded 9 times
Thanks,

Dan