Paths corrupted on save (and reload)

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!
michmerr
Posts: 11
Joined: Wed Aug 16, 2017 9:35 pm

Paths corrupted on save (and reload)

Post by michmerr »

Issue

When I save a file containing Path elements, some Job hierarchies get flattened into single elements at the root, and neither those nor Job elements still in a tree structure are editable. Instead of editing the properties of the element, a double-click opens a translation edit.

In usage terms, this means that everything is great as long as I don't close the file. I can generate PathJobs, Operations, and generate post-processed gcode that looks good. But if I load it up again, all I get is a soup sandwich.

I created a simple project with a simple, sketch-based part, and a single profile job. I saved it and re-opened it without negative effect. Thinking that something might have been corrupted in my original, slightly (but not much) more complex project, I recreated the parts and jobs of my initial project in a new project. Upon save and load, it too was corrupted.

With the latest project file (added to the issue as I type this up), here's the report window output during the load (and before I try anything else):

Thread size out of range
Fatal Error at file C:/Users/mike/Google Drive/Models/CoreXY/ZAxisPlates.FCStd, line 2354, char 45
Invalid Document.xml: equal sign expected
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_trunk\Mod\Path\PathScripts\PathJobGui.py", line 153, in claimChildren
children = self.obj.ToolController
<type 'exceptions.AttributeError'>: 'FeaturePython' object has no attribute 'ToolController'
Error in T1: 1/8" EndMill: Property not found

It's not clear if the references to tools and tool controllers are important as details, or just represent a general corruption of many attributes on the PathJobs that fail to load properly.

I had a previous issue where deleting the default tool controller made it impossible to open the tool manager in any project, but I don't want to jump straight to assuming a relationship between that and error messages involving tools. I resolved the mentioned issue by nuking my user settings cache (in my case the FreeCAD directories in AppData), and rebuilding the tree. After this, I got to my current state where everything works just fine until I save and reload.

What can I do to either identify or eliminate tool/tool controller/tool manager issues as the root cause?

Thanks,

--Mike
michmerr
Posts: 11
Joined: Wed Aug 16, 2017 9:35 pm

Re: Paths corrupted on save (and reload)

Post by michmerr »

When I create a single job, save, and reload, the job hierarchy in the IDE looks like it's intact, but the one operation on the job still lacks any of the properties of an uncorrupted instance.

Focusing on the tools, because of the output referencing issues with the a tool controller, I find that the the tool controller configured for the job and assigned to the operation (before saving and reloading) no longer has the speeds that had been configured, and when I look at the tool associated with the controller, it contains nothing but the default values. All the values of the specific tool that had been assigned, including the label, are gone.

So, the PathJob's entry for the tool controller created to add a specific tool is persisted through the save and load, but the tool controller for that entry is not.
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Paths corrupted on save (and reload)

Post by chrisb »

According to the bug submission guidelines you should have discussed the issue here first and create the issue in the tracker at the end of the discussion. This is to unburden the developers.
Your FreeCAD info as given in the tracker looks strange to me since you have no version number. Did you compile it yourself? If yes, please reproduce the issue with an official FreeCAD.
If the issue is reproducible with a current official FreeCAD please tell us which version you used and upload a file showing the issue, preferably simplified as far as possible.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Paths corrupted on save (and reload)

Post by chrisb »

I just saw that you uploaded files to the bug tracker, so there is only the version question left.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Paths corrupted on save (and reload)

Post by chrisb »

I added a Pocket for Face15 of the file CNC2 given in the tracker.
I saved, closed, reloaded: Everything is alright, the new operation is in the tree below the operations node; nothing is destroyed.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12608 (Git)
Build type: Release
Branch: (HEAD detached at 36301ff)
Hash: 36301ff67b6e165bddbabe5b63be0d90dd296cde
Python version: 2.7.14
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Paths corrupted on save (and reload)

Post by GeneFC »

This appears to the a self-compiled version of FC. The latest commit is very recent, equivalent to version 0.17.12594 (which was never provided on the download page). However, the OCC version is 7.0.0, which was superceded in the official development snapshots for Windows about 6 months ago.

Gene
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Paths corrupted on save (and reload)

Post by mlampert »

duplicate of issue #3260
michmerr
Posts: 11
Joined: Wed Aug 16, 2017 9:35 pm

Re: Paths corrupted on save (and reload)

Post by michmerr »

Looked at the linked duplicate issue, and confirmed that removing the inches " symbol from the tool name resolved the issue.
michmerr
Posts: 11
Joined: Wed Aug 16, 2017 9:35 pm

Re: Paths corrupted on save (and reload)

Post by michmerr »

GeneFC wrote: Sat Nov 18, 2017 12:53 am This appears to the a self-compiled version of FC. The latest commit is very recent, equivalent to version 0.17.12594 (which was never provided on the download page). However, the OCC version is 7.0.0, which was superceded in the official development snapshots for Windows about 6 months ago.

Gene
I pull, cmake, and build on a fairly regular basis, and particularly if something isn't working well (in case I'm missing a change that might be relevant). Shouldn't the dependencies (such as OCC) be kept uniform by the cmake files in source control? I want to make sure that anything I post is fully defined in terms of version, branch, and commit. If dependencies can vary from those defined (or not defined) in source controlled makefiles, I'll make sure to gather additional data in the future.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Paths corrupted on save (and reload)

Post by GeneFC »

As a Windows user I rarely compile FreeCAD. Sgrogan provides compiled snapshots several times a week, including the very latest commits. Occasionally I want to test something that has not yet made it into the snapshots. When I do so, I always find that the final set of files looks a bit different from the snapshots.

I do not know what other magic is performed for the snapshots beyond the typical pull and build from git.

You are correct that the latest pull should be fully up to date. I do not know why it isn't.

Gene
Post Reply