← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Saving plot dialog settings


Le 30/01/2011 14:58, Dick Hollenbeck a écrit :
On 01/30/2011 07:20 AM, jean-pierre charras wrote:
Le 29/01/2011 22:01, Marco Mattila a écrit :
On Sat, Jan 29, 2011 at 10:24 PM, Marco Mattila<marcom99@xxxxxxxxx>   wrote:
I've been rearranging the plot dialog. The current status is shown in
the attachment. There should be enough room to add a checkbox for
marking the path relative.
On second thought, it should be possible to infer from the path
whether it is relative or not (starts with / or not (in linux)). In
this case relative to the project directory, I guess. Need to check
how wxWidgets deals with paths.


Most of time plot subdirectory is a subdirectory of the current working directory.
Mainly in this case (easy to detect), the stored path must be relative to the CWD.
Do not forget the CWD can easily change for a given project( for instance when you copy/move/save your projects)

Do do forget to store paths names in "unix like" form, i.e. replace \ by / (if any).
This ensure Kicad files compatibility between platforms, especially for subdirectories in the CWD, because (unlike the full path)
the relative path usually does not depend of platform.



What is the the established convention on the CWD while running the various
Kicad programs?  Marco will need to understand this, and any code is
dependent on (hopefully) solid assumptions about where CWD is pointing.



Kicad, Eeschema and pcbnew set the CWD from the path of their main file:
The .pro file for Kicad
The .sch root file for Eeschema.
The .brd file for pcbnew.

It is expected the project file, the main schematic file and the .brd are in the same directory.
(Eeschema, Cvpcb, Pcbnew are searching the corresponding .pro config file in their own CWD).

Therefore it is also expected when opening <myfile.sch> the corresponding project file is <myfile.pro> in the same directory.

For other files (netlists amd .cmp files) they are created/searched, in the CWD of each kicad program (unless an other path is given in dialogs)

When the full path is not given (or no file name given) Kicad programs use the last opened directory (that can be different for kicad, eeschema pcbnew and gerbview).

For pcbnew, the CWD should be the path where the .brd was loaded

Component and footprint libraries have a set of "system paths" defined, and the CWD is always in the list of paths where libraries are searched.

Note also, for libraries, when a library is added, its path is not stored in config if it is the CWD or a "system path".

Jean-Pierre CHARRAS

Follow ups