Missing paths in AppImage (Hatch Pattern File, Line Group File, Welding Directory and PAT File)

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
wandererfan
Veteran
Posts: 6321
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Missing pathes in AppImage (Hatch Pattern File, Line Group File, Welding Directory and PAT File)

Post by wandererfan »

kaktus wrote: Thu Jun 02, 2022 5:27 am Does your silence on the subject mean that my problem is only localized to me :?:
No, it means there is only one of me and sometimes FreeCAD comes second oe even third on my personal priority list. :D

It is embarrassing to admit, but the error message is incorrect. The file name reported is the default, and not the preference. The test, however, is for the readability of the preference file. A fix for this is on the way.

I don't use AppImage very much, but as far as I can tell, it creates a new temporary Resource directory every time it executes. So preferences that refer to the Resource files from execution 1 will be invalid in execution 2.

I think the AppImage looks for an existing user.cfg file and uses it if found. If not it creates a new user.cfg.

We have a similar problem with Snap versions - issue #6707.

I have my templates, patterns, etc stored in permanent locations, so I don't run into this problem.
User avatar
kaktus
Veteran
Posts: 1184
Joined: Sun Aug 11, 2019 11:59 am
Location: opolskie
Contact:

Re: Missing pathes in AppImage (Hatch Pattern File, Line Group File, Welding Directory and PAT File)

Post by kaktus »

thanks for clarifying.

My goal was not to rush you but only to get information. :P

Yes, when you run AppImage, it creates an environment folder in the tmp system directory.
However some files (probably configuration etc) are located in the user's home directory.

You have clarified the message issue. What could be the reason for the "Line Width Group" option not working :?:
Take another look at the screenshot I posted.


Greetings :mrgreen:
Twórca polskiej wersji Wiki dla FreeCAD, współwórca polskiej wersji GUI.
"Cierpliwym być musisz, by wiedzę zgłębiać tajemną, gdyż ciemna strona mocy niszczącą i silną jest".
User avatar
M4x
Veteran
Posts: 1483
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Missing pathes in AppImage (Hatch Pattern File, Line Group File, Welding Directory and PAT File)

Post by M4x »

During the reconfiguration of FreeCAD, I've got those error messages I've described initially again (me: "No, not my config again!" :shock: ).

I've investigated a little further and I think FreeCAD is writing the paths to temporary directories of TD into the user.cfg when it shouldn't do it.

FreeCAD is writing a bunch of TechDraw related stuff into user.cfg after opening the TD preferences and hitting Apply > Okay:
  1. Delete my config files (user.cfg, system.cfg and FreeCAD.conf
  2. Start FreeCAD
  3. Load TechDraw Workbench
  4. Open Preferences (Edit > Preferences)
  5. Open TD preferences
  6. Apply
  7. Okay
  8. Close FreeCAD
Part of the described changes are the paths to the temporary directories:

Code: Select all

            <FCParamGroup Name="Files">
              <FCText Name="TemplateFile">/tmp/.mount_FreeCADNtjzu/usr/share/Mod/TechDraw/Templates/A4_LandscapeTD.svg</FCText>
              <FCText Name="TemplateDir">/tmp/.mount_FreeCADNtjzu/usr/share/Mod/TechDraw/Templates</FCText>
              <FCText Name="FileHatch">/tmp/.mount_FreeCADNtjzu/usr/share/Mod/TechDraw/Patterns/simple.svg</FCText>
              <FCText Name="LineGroupFile">/tmp/.mount_FreeCADNtjzu/usr/share/Mod/TechDraw/LineGroup/LineGroup.csv</FCText>
              <FCText Name="WeldingDir">/tmp/.mount_FreeCADNtjzu/usr/share/Mod/TechDraw/Symbols/Welding/AWS/</FCText>
            </FCParamGroup>
            <FCParamGroup Name="PAT">
              <FCText Name="FilePattern">/tmp/.mount_FreeCADNtjzu/usr/share/Mod/TechDraw/PAT/FCPAT.pat</FCText>
              <FCText Name="NamePattern">Diamond</FCText>
              <FCInt Name="MaxSeg" Value="10000"/>
            </FCParamGroup>
To me it looks like FreeCAD is checking the user.cfg and if there's nothing relevant, the correct temporary directories are being used. Unfortunately, if some previous temporary directory can be found in user.cfg, FreeCAD is using that one instead.

In 0.19, I've deleted the temp-directories as soon as the "[...] is not readable" error shows up. After restarting FreeCAD, the temp-directories where there again (using the correct values). This isn't working in 0.20. Instead, the path in user.cfg looks like this and stays like this (the path shown in the GUI is empty of course):

Code: Select all

<FCText Name="LineGroupFile"></FCText>
As long as there are no paths to the temporary directories within the user.cfg, I'm not able to reproduce those "[...] is not readable" error messages.

To take it one step further, I've opened my "corrupted" config files and removed this part (FCParamGroup Name="Files" and "PAT"):

Code: Select all

            <FCParamGroup Name="Files">
              <FCText Name="TemplateFile">/home/max/Downloads/Programme/FreeCAD_TechDraw_Templates/A3_Landscape_ISO7200_Pep_M4x.svg</FCText>
              <FCText Name="TemplateDir">/tmp/.mount_FreeCAZfIMCe/usr/share/Mod/TechDraw/Templates</FCText>
              <FCText Name="FileHatch"/>
              <FCText Name="LineGroupFile"/>
              <FCText Name="WeldingDir"/>
            </FCParamGroup>
            <FCParamGroup Name="PAT">
              <FCText Name="FilePattern"/>
              <FCText Name="NamePattern">Diamond</FCText>
              <FCInt Name="MaxSeg" Value="10000"/>
            </FCParamGroup>
            

Result: No error messages, TechDraw is using the correct temporary directories and those paths can be found in the GUI of the TD preferences too. :mrgreen:

I've taken a look at git commit 977127012e. If I've got it right, FreeCAD shouldn't throw "false" error messages. But if wrong (= previous) temp-directories can be found in the user.cfg, won't FreeCAD still try to use those instead of the current temp-directories?



For the record, this is the Version I'm using right now:

Code: Select all

OS: Ubuntu 20.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.28929 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 6f24fd3)
Hash: 6f24fd3053a89a5fb12ab765f9df93ec04deeac1
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * LCInterlocking
  * kicadStepUpMod 10.12.4
  * Lithophane
  * lattice2 1.0.0
  * Defeaturing
  * Manipulator
  * fasteners 0.3.41
  * sheetmetal 0.2.49
  * Assembly4
  * Curves 0.4.4
  * POV-Ray-Rendering
  * 3DfindIT 1.2.0
User avatar
wandererfan
Veteran
Posts: 6321
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Missing pathes in AppImage (Hatch Pattern File, Line Group File, Welding Directory and PAT File)

Post by wandererfan »

kaktus wrote: Thu Jun 02, 2022 7:17 pm What could be the reason for the "Line Width Group" option not working :?:
The group selector in the Annotation tab looks at the LineGroup.csv file from the General tab. If the LineGroup.csv file is not found then the drop box will not be populated with the various group names.
User avatar
kaktus
Veteran
Posts: 1184
Joined: Sun Aug 11, 2019 11:59 am
Location: opolskie
Contact:

Re: Missing paths in AppImage (Hatch Pattern File, Line Group File, Welding Directory and PAT File)

Post by kaktus »

Yes, but I noticed this inconvenience before I deleted the TechDraw folder in the "Mod".

AppImage at startup creates a temporary directory in my case

Code: Select all

/tmp/.mount_FreeCAr2dVnx/usr/share/Mod/TechDraw/LineGroup/
where the mentioned file always existed.

Therefore I think that this is not a normal situation. (no option to expand)

So if the program did not find the needed files in the location

Code: Select all

~/.FreeCAD/usr/share/Mod/
then the tem file was still available in the location I presented above.

I don't know how FreeCAD searches the file system.
However this problem is still not letting me rest.

At the moment I can browse the menu successfully.
Twórca polskiej wersji Wiki dla FreeCAD, współwórca polskiej wersji GUI.
"Cierpliwym być musisz, by wiedzę zgłębiać tajemną, gdyż ciemna strona mocy niszczącą i silną jest".
User avatar
M4x
Veteran
Posts: 1483
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Missing paths in AppImage (Hatch Pattern File, Line Group File, Welding Directory and PAT File)

Post by M4x »

@kaktus can you reproduce what I've described above two days ago? For the link:
M4x wrote: Thu Jun 02, 2022 7:59 pm
User avatar
kaktus
Veteran
Posts: 1184
Joined: Sun Aug 11, 2019 11:59 am
Location: opolskie
Contact:

Re: Missing paths in AppImage (Hatch Pattern File, Line Group File, Welding Directory and PAT File)

Post by kaktus »

I'll check it out today and give you the answer.
;)
Twórca polskiej wersji Wiki dla FreeCAD, współwórca polskiej wersji GUI.
"Cierpliwym być musisz, by wiedzę zgłębiać tajemną, gdyż ciemna strona mocy niszczącą i silną jest".
User avatar
wandererfan
Veteran
Posts: 6321
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Missing paths in AppImage (Hatch Pattern File, Line Group File, Welding Directory and PAT File)

Post by wandererfan »

git commit 2b0dd54fe7 should fix the saving of temporary files in default locations (ie /tmp/*) as preferences.
User avatar
M4x
Veteran
Posts: 1483
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Missing paths in AppImage (Hatch Pattern File, Line Group File, Welding Directory and PAT File)

Post by M4x »

You're the best, thanks! I'll try it as son as it lands "in" the AppImage. :P
Post Reply