Autoplot PDF etc when saving project

Bug #1636549 reported by Frank Severinsen
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
KiCad
Expired
Wishlist

Bug Description

Hey Guys

thanks for the awesome job!

At my company we came up with a feature request, which I think could easily be beneficial to others.
The idea is simply to add an option to automatically replot the PDF whenever the schematic is saved.

It is often necessary to share the project on git with software developers or other team members who only need to consult the schematics, without applying changes.
As they would normally rely on the .pdf provided in the repository, it is particularly important to keep it up-to-date with the .sch document.

Currently this is a manual process which is both time-consuming and prone to being overlooked; by adding this feature the PDF would always reflect the content of the schematics.

I made a quick mockup on how it could look but it is only meant as an idea of how this could be implemented

Cheers
Frank Severinsen

Tags: export
Revision history for this message
Frank Severinsen (shack) wrote :
Frank Severinsen (shack)
description: updated
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I'm not sure I like this idea. I know for what I do at work, this would be annoying. I would have to clean out the unwanted pdf files from the project folder every time I saved the schematic. The only way I would approve a change like this is if A: it could be disable by the user (default) and B: it could be configured to write the pdf files in a folder other than the current project folder. Hopefully in the not too distant future, we will get the python scripting support implemented for the schematic editor. This feature seems like it would better to implement as a user script.

Revision history for this message
Frank Severinsen (a-frank-b) wrote :

Hey Wayne

Thanks for the response
As shown in the photo my idea was to have the user check the checkbox (default off) to have Eeschema replot on every save. I don't quite get what you mean with unwanted PDF files(different revisions?), my idea was to update only one PDF. Regarding where to save the file I was hoping it could reuse the place set when plotting (default is project folder). Hope this clears up things

Frank Severinsen (shack)
information type: Public → Public Security
information type: Public Security → Public
information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Daniel Overgaard Nielsen (daniel-overgaard-nielsen) wrote :

This is a cool idea! It should probably be disabled by default, but having the option to enable it, and always have an up to date PDF of the schematic in the repo is awesome. Software guys are going to love that!

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1636549] Re: Autoplot PDF etc when saving project

I'm OK with an option that defaults to off and using the plot path.

I don't want any unnecessary files (pdf or otherwise) in my project
folders that are not required so any plot or print files except gerbers
are just noise to me because I don't use them. I would find it annoying
to always create them on file save. That is what I meant by unwanted
pdf files.

On 10/26/2016 5:48 PM, Frank Severinsen wrote:
> Hey Wayne
>
> Thanks for the response
> As shown in the photo my idea was to have the user check the checkbox (default off) to have Eeschema replot on every save. I don't quite get what you mean with unwanted PDF files(different revisions?), my idea was to update only one PDF. Regarding where to save the file I was hoping it could reuse the place set when plotting (default is project folder). Hope this clears up things
>

Changed in kicad:
importance: Undecided → Wishlist
Revision history for this message
xzcvczx (xzcvczx) wrote :

I agree with wayne that it would be more suitable for a user script that adding it to the dialog unnecessarily

Revision history for this message
Nick Østergaard (nickoe) wrote :

@Simon, but I think it would be an "easy" option to have in the mean time. We all know that it will still take quite some time before scripting will be supported in eeschema.

tags: added: starter
Mudit Joshi (joshi-ji)
Changed in kicad:
assignee: nobody → Mudit Joshi (joshi-ji)
Mudit Joshi (joshi-ji)
Changed in kicad:
status: New → In Progress
Revision history for this message
Mudit Joshi (joshi-ji) wrote :

Add support in eeschema to autoplot schematic in PDF format whenever schematic is saved.

Revision history for this message
Frank Severinsen (shack) wrote :

@mudit thank you very much for doing this :)
Hopefully one of the lead devs will have look at the patch soon :)

Revision history for this message
Jeff Young (jeyjey) wrote :

We're in feature freeze for 5.0 right now, but it should go out very soon now, and then we can look at stuff for the next release.

Changed in kicad:
milestone: none → 6.0.0-rc1
Revision history for this message
Frank Severinsen (shack) wrote :

Hi Jeff
Do you think something like this could be added in V5.1? V6.0 seems so far away :) Since I use KiCad Professionally, and don't have the skillset to debug the code, I have a strong preference for stable releases at work :)

Revision history for this message
Frank Severinsen (shack) wrote :

@Mudit I tested the Patch and it works great :) thank you for the work

Revision history for this message
Nick Østergaard (nickoe) wrote :

I guess we can evaluate bugs assigned to the milestone KiCad 6.0.0-rc1 when we thin we could release a 5.1.

Revision history for this message
endofexclusive (endofexclusive) wrote :

Non-interactive generation of PDF output is indeed a very useful feature.

However, adding this specific functionality to the GUI and to the program code takes KiCad in a direction I would prefer not to see.

The reason is that this kind of functionality does not scale well with the possible use cases, and may generate the GUI and code base unmanageable.

Consider for example automatic generation of the following when a schematic is saved:
- Perform electrical rule check
- Automatic BOM generation, possibly with different BOM exportes
- Automatic netlist generation to user selectable format.
- Plot to any of Postscript, SVG, DXF, HPGL, in either Color or "Black and white", etc.

The example above are all useful features and likely use cases.

Therefore, the scripting solution as suggested by Wayne and xzcvczx is the preferrable.

One could imagine a user defined a Python script ("hook") which executes every time the schematic is saved. That hook could use the Python API to generate the PDF, PS, BOM, etc. One could also imagine a pre-save hook which brings up a warning (or prevents saving) if electrical rule check failed before save. The point is that this method is much more flexible and fully decoupled from the eeschema program logic.

Thank you

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I reviewed this patch and while it does solve a problem, I do not care for the solution. It has too many issues is not a complete solution for plotting. Here is a short list of issues:

The plot on save setting it part of the dialog. This setting has nothing to do with the plot dialog and should be handled in the schematic editor code.

The plot type and setting will always be the last plot the user performed using the plot dialog. This may or may not be what the user expected and there is no way to set this without performing a plot using plot dialog.

The plotting is called before the schematic is saved and the cache library is saved. If something causes the plotting to crash, the schematic will not be saved and the cache library will not be saved. I consider this a grave design flaw. Saving the schematic should be a priority over plotting.

I am planning to create a plot manager feature for Pcbnew which would allow for complex plotting requirements including multiple plots, custom file name suffixes, prefixes, and extensions, custom destination folders, etc. This should lay a foundation for a similar feature in Eeschema. It will be a while before I get to this because the new schematic file formats are my next project after the stable 5 release. I am hesitant to apply this patch because it will be removed at some point in the future. If there is enough support for this, I would consider it if you move the check for plot on save out of the dialog code and into the schematic editor frame code and you moved the plotting after the schematic and cache library are saved.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

For example, some save window dialog (of other softwares) have some check box (see https://www.exceldemy.com/wp-content/uploads/2014/01/save-as-dialog-box.png) to allow some option.
This may be one way to implement in the "save as" dialog.

Revision history for this message
ronnie (ronnie81) wrote :

@Wayne in respect with your plans introducing a plot manager, I assume this is not a "starter" anymore and will remove that tag.

tags: added: export
removed: starter
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@ronnie, this is definitely not a starter project. It will require a
new file format for saving and loading the plot configurations, support
for plotting from the command line (preferably without showing the UI),
and python scripting support.

On 8/25/2018 8:07 PM, ronnie wrote:
> @Wayne in respect with your plans introducing a plot manager, I assume
> this is not a "starter" anymore and will remove that tag.
>
> ** Tags removed: starter
> ** Tags added: export
>

Revision history for this message
Frank Severinsen (shack) wrote :

I strongly agree either a complete plot manager, Eeschema python interface or similar would be a much nicer solution.

My original proposed solution was definitely not a one size fits all, but had the intent of being a small shim which could be added (and removed later) fairly easy

I don't see any of the more complete solutions being feasible within the next 2 years or so, meaning 4 years fromt I made this bug report, which was why I hoped for the smaller fix.

I do however completely acknowledge Wayne & co's priority in developing the project with the bigger picture in mind

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/2037

Changed in kicad:
status: In Progress → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.