Default template is never the default

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!
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Default template is never the default

Post by GeneFC »

Russ4262 wrote: Sat Jul 24, 2021 9:54 pm Confirmed. PR #4939
I made the changes and it appears to work.

Thanks :!:

Gene
Russ4262
Posts: 941
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Default template is never the default

Post by Russ4262 »

GeneFC wrote: Sun Jul 25, 2021 12:03 am ... I made the changes and it appears to work. ...
Your testing and feedback are very helpful and appreciated, GeneFC! :)

Russell
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Default template is never the default

Post by Syres »

Russ4262 wrote: Sun Jul 25, 2021 12:40 am feedback are very helpful and appreciated
Using your PR, the path is now corrected to the standard, thanks, so running:

Code: Select all

import PathScripts.PathPreferences as pp
pp.defaultJobTemplate()
now correctly outputs:

Code: Select all

'E:/Data/FreeCAD/Extras/job_JPS.json'
but in my case I still don't have the template available in the template combo box of the Create Job window, I only have <none>, could this be due to me using a drive other than C:?
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Default template is never the default

Post by Syres »

OK, I think I've worked out my mistake, I wanted to have the Job Preferences, General, Defaults, Path to be my GCode folder and have the Template location to be in my Extras folder which isn't allowed.

So putting the template in the GCode folder (or my macro folder) now makes it appear in the combo box, it seems a little restrictive but more importantly the user shouldn't be allowed to save the template in an incorrect folder in the first place which I'll try to produce a fix for.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Default template is never the default

Post by Syres »

Russ4262 wrote: Sun Jul 25, 2021 12:40 am Suggestion
Would this https://github.com/FreeCAD/FreeCAD/comp ... 6:patch-26 be acceptable or is it highly likely to cause regressions elsewhere? It saves a lot of error checking elsewhere to stop (new) users making a similar mistake to myself.
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Default template is never the default

Post by sliptonic »

Syres wrote: Sun Jul 25, 2021 9:25 am I wanted to have the Job Preferences, General, Defaults, Path to be my GCode folder ...
Is this to avoid selecting the gcode location during post-processing?
Because you can set the Post Processing Output File to a directory location in the job/template to achieve that.
Russ4262
Posts: 941
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Default template is never the default

Post by Russ4262 »

Syres wrote: Sun Jul 25, 2021 3:04 pm ... Would this https://github.com/FreeCAD/FreeCAD/comp ... 6:patch-26 be acceptable or is it highly likely to cause regressions elsewhere? It saves a lot of error checking elsewhere to stop (new) users making a similar mistake to myself.
Evening Sir.
I am uncertain of what you are wanting to achieve with the code change. I differ to project managers for your question.

Russell
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Default template is never the default

Post by Syres »

sliptonic wrote: Sun Jul 25, 2021 11:38 pm Is this to avoid selecting the gcode location during post-processing?
This is purely historical, back in 2017 (when Path had no simulator) I had 5 different pieces of software which either output GCode or took in a GCode file to generate the simulation. It seemed perfectly reasonable to have all the software point a single location hence that Default Path is still there today.

With regard to the issue I discovered, the bit of the coding that seems to have been a little disjointed IMHO is that the Template Export routine has no restrictions or warnings for the user if they decide to choose a folder other than the two search paths.

So what I'll do is run as many tests both using the Windows LP builds and my Linux Mint compiled build with the extra search path code I quoted above over the next four weeks. If I can verify that any errors which I get are still there with the existing search path code and therefore no new regressions are generated then I'll submit the PR at that stage.
Post Reply