I would like to know if it’s possible to modify the behaviour of EESchema upon ‘save schematic’.
First of I would like to use this to re-plot a PDF of the schematic everytime i save it.
Furthermore, this could be useful to update a BOM-List, netlist, or even trigger an ERC everytime i hit ‘Ctrl+S’
Is there a way to do this, without going ‘under the hood’, thus, into the source-code?
Alternatively, can this be triggered upon saving or closing the whole project?
To be honest i highly doubt you would like the result of these features being activated (At the very least it would increase the time that the GUI must be frozen as there is more to do). It would definitely ensure that you start to save less often which might not be the best idea (risk of data loss increases the longer the instance between saves).
However, a single “release” button (and hotkey) that can be configured to create a number of output formats might be a good option. It should not bring up a dialog everytime but be configurated once and then the hotkey just does what needs to be done (global plus project local overwrite).
This button could even interact with version control systems sometime in the far future (create a commit or possibly even a tag) That would then however require a popup for the commit or tag message.
Just a heads up: the netlist export is not necessary if you plan to work with pcbnew. The better tool is using “update pcb from schematic” (hotkey F8 if i remember correctly).
Right now both options have the same feature set but the update workflow does not add the danger of forgetting to export the netlist or loading the wrong one.
Thank you for the quick reply, and in parts i agree with you.
The frozen GUI is not necessary, when PDF creation is executed as a separate process. On the other hand, i agree that an updated PDF for every saved schematic is too often.
Once upon closing the whole project should be sufficient, giving the elegant option to also trigger a commit into the repository.
As you suggested a release button+hotkey would be a very nice option. Possibly not even with a deidcated function behind, but to kick off a dedicated shell-script or python-file, where every user can specify for himself, what to do. Like generating PDFs, Gerbers, BOMs, Commits and what-not-else.
Thanks also for the heads up, I am familiar with the F8-process
It is as you could otherwise get raise conditions. The user can not be allowed to change anything impacting the internal data structures until the full save behaviour is done. (Or very complex multi process synchronization stuff must happen to ensure that data can not be compromised. This is quite complex and error prone.)
One should make more commits than one per day. So this might set the wrong incentive. (I would never couple version control interactions with closing of a program as it would teach users to rely on that one interaction and create unmanageable large commits)
While this sounds like a reasonable solution one must keep in mind that such a feature would exclude a large number of users (it seems like a similar hack to the current BOM creation mess)
I would prefer this action to be at least partially configurable via the GUI and only offer a script loader for advanced user interactions.
Vaguely related feature request: https://gitlab.com/kicad/code/kicad/issues/2346
(that issue only mentions pcbnew, but the underlying request for automation of “release tasks” is the same)
Well, frozen GUI and multiprocessing would be off the table, when we agree to ask for a ‘Release feature’ that acts on project level, not within eeschema.
I will try to add our ideas to the wishlist entry, that craftyjon mentioned.
Eeschema was scriptable. It will be in the future, but I don’t know to what extent. AND…
KiCad would utilize pre and post hooks. Certain named python functions were called before and after the actual internal function was called, for example pre_save_schematic() and post_save_schematic(). That way everyone could define their own favorite behavior without affecting other users.