First post in this topic
Path Workbench Code restructuring - heads up
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Path Workbench Code restructuring - heads up
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
-
- Posts: 541
- Joined: Fri Aug 26, 2016 9:07 pm
- Location: Munich - Gemany
Re: Path Workbench Code restructuring - heads up
All my jobs are going to be broken after this changes (I'm using build 30377).
This is insane!
I applied a lot of tweaks and adjustments to produce that jobs. I absolutely do not want to make all of the jobs again from scratch.
Usually, after a first run on the CNC-machine then I return to home and I make all of the necessary adjustments.
An offset reduced to avoid that screw fixing the stock...
A geometric extension 0.5 mm larger or narrower to avoid creating deburr problems...
A certain speed because I got best results with a DLC-bit instead of Steel one...
...and so on.
Now I should remember all of those stuff???
This is not possible.
There is any possibility to get a script for linux converting the old FCstd files in new FCstd files compatible with the new arrangement of the three?
This would be vital for me.
This is insane!
I applied a lot of tweaks and adjustments to produce that jobs. I absolutely do not want to make all of the jobs again from scratch.
Usually, after a first run on the CNC-machine then I return to home and I make all of the necessary adjustments.
An offset reduced to avoid that screw fixing the stock...
A geometric extension 0.5 mm larger or narrower to avoid creating deburr problems...
A certain speed because I got best results with a DLC-bit instead of Steel one...
...and so on.
Now I should remember all of those stuff???
This is not possible.
There is any possibility to get a script for linux converting the old FCstd files in new FCstd files compatible with the new arrangement of the three?
This would be vital for me.
Re: Path Workbench Code restructuring - heads up
While I agree a migration script would be great, you could also just keep a stable 20.x AppImage for working with older files..?Giulio Buccini wrote: ↑Fri Nov 11, 2022 5:31 pm All my jobs are going to be broken after this changes (I'm using build 30377).
This is insane!
-
- Posts: 541
- Joined: Fri Aug 26, 2016 9:07 pm
- Location: Munich - Gemany
Re: Path Workbench Code restructuring - heads up
I think your is the most practicable solution: two Freecad applications on my PC.
- build 30377 for my old projects,
- build >30377 for the new ones.
Anyway, I want to cry... may I?
From what build this "fantastic change" was introduced?
Maybe I can download something more recent than build 30377, while maintaining the backward job-compatibility?
- build 30377 for my old projects,
- build >30377 for the new ones.
Anyway, I want to cry... may I?
From what build this "fantastic change" was introduced?
Maybe I can download something more recent than build 30377, while maintaining the backward job-compatibility?
Re: Path Workbench Code restructuring - heads up
At this time there are not that many changes in the main code of FreeCAD. Going from 30377 to 305xx, for example, is probably not worth it unless there were some very specific improvements for your needs.Giulio Buccini wrote: ↑Fri Nov 11, 2022 5:50 pm Maybe I can download something more recent than build 30377, while maintaining the backward job-compatibility?
In any case there is no easy way to download older versions.
I keep both an old FC version (30454) and the latest FC version. I create new Jobs with the new version and reopen old Jobs with the old version. I do not believe there is any other reasonable method.
Here is a cry for you
Gene
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Path Workbench Code restructuring - heads up
This isn't a complete solution but it's something. Maybe someone smarter than me can improve it.
Attached file JobFixer.py is a standalone python script.
execute it like this
This will attempt to fix the jobs and write the result to outpufilename.FCStd.
How it works
At the beginning of the file are two dictionaries. These are used to map the old module names to the new reorganized modules. The script works directly on the GuiDocument.xml file and the Document.xml file inside the FreeCAD project. It basically does a simple substitution -- look up the old name, and stick in the new name.
It will output in the console the name of any module that it doesn't find a match for. Non-Path objects are normal. If you find Path related objects listed, those need to be added to the map and the process restarted.
Caveats:
1) The substitution maps may be incomplete or wrong.
2) The viewproviders for operations don't work. Double clicking on the operation won't bring up the task panel. You can still modify the operation through the property pane and it appears to work.
3) It's very experimental. Make sure to back up your original files.
Even with the broken viewproviders, it might be useful to add new operations and copy the properties to rebuild your documents.
Discussion of ViewProvider limitations:
The script works by searching the XML for a Property whose name is 'Proxy'. Then searching for the "module" attrib and replacing it.
In the old scheme, the operations had a viewprovider whose module is "PathScripts.PathOpGui". This is a base class. The viewprovider is actually provided through PathScripts.PathSlotGui, for instance. Simply substituting in the new string, "Path.Op.Gui.Base" doesn't work. It still tries to find the viewprovider in the PathScripts.PathOpGui, presumably because that's encoded in the pickled object.
I don't see a way around this. Like I said, maybe someone smarter than me does.
Attached file JobFixer.py is a standalone python script.
execute it like this
Code: Select all
JobFixer.py -i <inputfilename> -o <outputfilename.FCStd>
How it works
At the beginning of the file are two dictionaries. These are used to map the old module names to the new reorganized modules. The script works directly on the GuiDocument.xml file and the Document.xml file inside the FreeCAD project. It basically does a simple substitution -- look up the old name, and stick in the new name.
It will output in the console the name of any module that it doesn't find a match for. Non-Path objects are normal. If you find Path related objects listed, those need to be added to the map and the process restarted.
Caveats:
1) The substitution maps may be incomplete or wrong.
2) The viewproviders for operations don't work. Double clicking on the operation won't bring up the task panel. You can still modify the operation through the property pane and it appears to work.
3) It's very experimental. Make sure to back up your original files.
Even with the broken viewproviders, it might be useful to add new operations and copy the properties to rebuild your documents.
Discussion of ViewProvider limitations:
The script works by searching the XML for a Property whose name is 'Proxy'. Then searching for the "module" attrib and replacing it.
In the old scheme, the operations had a viewprovider whose module is "PathScripts.PathOpGui". This is a base class. The viewprovider is actually provided through PathScripts.PathSlotGui, for instance. Simply substituting in the new string, "Path.Op.Gui.Base" doesn't work. It still tries to find the viewprovider in the PathScripts.PathOpGui, presumably because that's encoded in the pickled object.
I don't see a way around this. Like I said, maybe someone smarter than me does.
- Attachments
-
- JobFixer.py
- (5.01 KiB) Downloaded 141 times
Re: Path Workbench Code restructuring - heads up
Maybe this is useful?:
Scripted_objects_migration
Scripted_objects_migration
Re: Path Workbench Code restructuring - heads up
I very much appreciate this approach of not supporting every old version in FreeCAD but rather to migrate old projects to a new format!
Thanks!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Path Workbench Code restructuring - heads up
I kept the "old" version. I can put it online for download.
- Attachments
-
- Снимок экрана от 2022-11-15 11-28-06.jpg (127.93 KiB) Viewed 17006 times