← Back to team overview

kicad-developers team mailing list archive

Re: Eeschema Subsheets

 

Thanks for the feedback.  It helps me get my head around how the subsheets
are meant to work.

Here is one of the bugs:

1) Take the attached project and unzip into KiCad.
2) Open the schematic and you will find a schematic with 5 subsheets
referencing 3 subsheet files.
  - Each subsheet file has a label with its associated file name.  So A.sch
contains "A".
3) Rename the file for Sheet B to "A.sch"
  - This works as expected for linking.  There is a warning, you replace
the contents of B with the contents A.sch.
4) Rename the file for Sheet B again, this time to "D.sch"
  - You get a warning about the sheet using shared data in a complex
hierarchy.  Click "OK"

At this point, Eeschema creates "D.sch" using the data from "A.sch".  If I
understand Wayne correctly, the mixing of these metaphors is fine.
Renaming a sheet filename to an existing filename replaces the sheet's
current contents with the existing file contents but renaming a sheet
filename to a non-existing filename will create a new copy of the current
contents.

5) Now, open the subsheet "B", notice that it has the label "A".  Edit the
contents to be "D" and save.

The bug here is that if you now open the original subsheet A, its contents
have also been changed to "D".  But only until you close and re-open the
project.  At that point, it is back to "A".  I'll deal with this bug but
leave the copying/linking behavior as is unless people feel otherwise.  It
confused me but I think I can clarify it in the dialog text.

-S

Hmm... Apparently Gmail has started blocking my attachments.  So here is
the zipped project
https://drive.google.com/file/d/1W9aEzpx_mh4sS2ebtAOPQrw5QeuJrlKK/view?usp=sharing


2018-03-29 5:04 GMT-07:00 Wayne Stambaugh <stambaughw@xxxxxxxxx>:

> On 3/28/2018 10:34 PM, Seth Hillbrand wrote:
> > ​Hi All-
> >
> > I'm working on a bug in renaming sub-sheets.  In testing the fix, I've
> > run up against a set of conflicting paradigms for how subsheets are
> > handled.  I'd like some feedback on how we expect to handle the
> subsheets.
> >
> > Either:
> > 1) we treat them as actual objects such that renaming the sheet's
> > filename renames the file on the computer but keeps the contents
> > unchanged​ or
>
> Renaming the files could break sheets that are used in other projects
> breaking re-usability so I would be reluctant to rename files.
>
> > ​2) we treat them as links to the objects and renaming the filename​ of
> > the subsheet doesn't change the subsheet's file but instead just changes
> > which file is referenced.
> >
> > Right now, we do both depending on whether there is an existing file and
> > more than one reference to the subsheet or not.  This is confusing as it
> > is difficult to determine when an operation will result in actually
> > overwriting an existing file and thereby losing data.
>
> The question is when do we allow the user to overwrite and existing
> file.  The current logic seem reasonable to me.  What would happen if
> the user edited the contents of a sheet and decided to change the sheet
> file name to an existing file.  If you only allow linking, the users
> edits will be replaced by the contents of the new file also resulting in
> data loss.  I think the current logic handle both cases.
>
> Do we not currently warn the user that an existing file will be
> overwritten?  If not, we should.
>
> >
> > I'm inclined to make all actions (2).  This would allow a subsheet file
> > to become unlinked from the project if you change the filename
> > referencing it but would not allow overwriting subsheets on disk.
> >
> > Does anyone feel strongly that (1) is the correct action?
> >
> > -S
> >
> >
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> >
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References