How to Provide Feedback When No Supported Tool Controllers

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
freecader2
Posts: 99
Joined: Thu Oct 22, 2020 11:19 pm

How to Provide Feedback When No Supported Tool Controllers

Post by freecader2 »

Hi,

I'm trying to find where's the right place to add some feedback to a user when they try to create a vcarve operation in a job without a supported tool controller. Currently the vcarve button silently fails to do anything at all (no error, no GUI response) in this case. So I want to add a log error message to explain why nothing happened when they clicked the vcarve button.

Some ways I think this could work are:
1) in PathUtils.getToolControllers, it returns a list of tool controllers supported by an operation. It could warn here if the list is empty. But this might affect other operations where it's not a problem to have an empty list of supported tool controllers. I don't know if there are any like that or it would warn at times when it shouldn't.
2) in PathVcarve.ObjectVcarve.__init__. It could check and warn if the job has no supported tool controlers for a vcarve.
3) in PathVcarve.Create. This is another possibility.

Does anyone more familiar than me with the overall architecture of Path Ops have any suggestion about the best place to add this kind of feedback?

Thanks!
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: How to Provide Feedback When No Supported Tool Controllers

Post by onekk »

Are you trying to script Path Operations?

If yes, simply there is some more work to be done to make Operation "fully scriptable" simply they are created to be managed by GUI.

I have tried to script some Op, but mileage may vary, some thing are scriptable flawlessy, some other need some workaround and various tricks to make them work, some other else are very difficult or simply don't expose the "scripting interface" and rely on the GUI.

As example Jobs are not taylored to be scripted, you have to do many workarounds, as the GUi will come in if you create more than one job and want to create an operation there is no way to have the GUI came out and ask you in which job you want the operation to go.

There are however plans to make Path more "scripting friendly" but apprently nothing is yet done.


What you whant to achieve, maybe bringing some code here, I may have some solution, and maybe this will led to some advancing on "path scriptability".

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
freecader2
Posts: 99
Joined: Thu Oct 22, 2020 11:19 pm

Re: How to Provide Feedback When No Supported Tool Controllers

Post by freecader2 »

No, my intention here wasn't related to scripting. It's more of a user experience concern- someone may click the vcarve button, and nothing at all happens to show that it was successful/failed. It seems like it's just a "dead" button. Instead, I'd like it to tell the user why the vcarve operation couldn't be created.
david69
Veteran
Posts: 1780
Joined: Wed Jan 01, 2014 7:48 pm

Re: How to Provide Feedback When No Supported Tool Controllers

Post by david69 »

may be you can add something on the wiki page Path_Vcarve like a chapter "Note".
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: How to Provide Feedback When No Supported Tool Controllers

Post by onekk »

From the content of the post , referring to the python methods name, I have supposed it was a scripting problem.

Maybe edit the post title to clearly state "possible bug" or "no failure cause reported using...." or something more clear will make some developer like
@sliptonic to note the post and gave an "autoritative answer".


Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
imm
Posts: 267
Joined: Wed Nov 03, 2021 1:00 pm

Re: How to Provide Feedback When No Supported Tool Controllers

Post by imm »

I have been trying to get a handle on the association of a 'tool' to a 'path' associated with a new process...specifically the dressups.
I have tried to stack 2 dressup processes (boundary dressup then leadinleadout dressup) but have run into a situation where the gui indicates that all the links are in place but the tool association no longer exists for the active object.

It is not immediately clear how that association is established....and from historical references it sounds like the underlying method has changed with time.

Maybe @sliptonic or one of the other dev's can provide a snippet for insight as to the most up-to-date method.
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: How to Provide Feedback When No Supported Tool Controllers

Post by onekk »

Usually you use a similar workflow:
  1. create a Job.
  2. add some Tools to the job (in old terminology they was called ToolControllers), these Tools have the proper endmill (using tools is confusing due the name of the actual property) as subproperties, in Python they are members of the Job.Tools.Group list.
  3. add some operations, like a profile that use some endmill.
  4. add ancillary operations, like dressup that use an already existing operations.
The "ancillary operation" should use the endmill used for the "main operation", as it is a modification of the "main operation".

Maybe problems arise if you remove or modify something in "main operation" and the change is not propagated to the "ancillary operation"?

Try to explain the workflow as a sequence of action you made and maybe point out when problem happens.

As the post is not populated from some time, maybe open a new post with a proper workflow and a better "problem description"

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply