X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=majenko.co.uk; s=key1; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=gdgxJTmM4CZPuWTEYTYPjVWdjJXUhIsQ7IeR27iL8Rk=; b=GVYdS2OSQbJeaBg73wJSyCkcpBZxmjgTSOyMDxsx2U66BooBO/zS9RqRDOixIeEj5N 2pXV714iWuvOyYL/cXD0eyDJjcgY7wfaqMwIsJz9sKPGCemXmC2Ky01xzah+7jnRJHM0 BZoAv8i1nsfVmAmYNPI/FltA92zUZxa7q0vp8OLQ93NDe+6F9dRUf5WGB2yEuocOvLDO X6MKhs7yvEQ75JsP1FwG8PbVOnqrjYs4EfSDxftEhk0kkpnhqzRL2xI7RwMow9W3tK7Z szEO5l3+ihMze5p9D6ceePREabYLgDX3UxCebExTv+mfj30AGtDxfn0DH0XGu8uivP6n bSWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=gdgxJTmM4CZPuWTEYTYPjVWdjJXUhIsQ7IeR27iL8Rk=; b=Hqn+ahvkXMqqscyrLoF4bSY+57485O0S3bgmZ0xkR4rRzo4qpkhQBDxBOyrOcOiTzT LsZ7fX+V/H1kMffU0Hq/AOsGkZsLJ1NhnEyfa9wsAsRHFdS+wKDwXxwnA08SWs2zDddr CTlwdxqZqAq3A4Jbhb7vyVyWJ4zyir6ZJVOCifg9QWwDgW5jev773rGI15pPViljT3Nx uxyh501C5o+OdtrtE1N7dGuSl+VGsbHllLorV3u8a4f7dAsrLK12Wl0OqOWiLRYJHrEd O9gcWK6lX9VYjs7O0j9yIVDofwwBPwcRjG9VLTccR5OZshZqXcCmTvoPuMV0KqLorHtW /IeA== X-Gm-Message-State: APjAAAXRDq1RHpuN+yNt1DbqnCMtpYlVBe4hXHBm61/IDfvTT0ussD4W FvC3euL26EmmhOn+86iD9f2aXp2accY7zPe6EC7RyqHh X-Google-Smtp-Source: APXvYqzRPY2wgy3YdLCFKI42cjpl573z9zFxmTYEgTMH7x+qs0Y1eEUvtezwuY7x5LPZtBI+pxjiN66V48iuDKrngVk= X-Received: by 2002:a2e:85d7:: with SMTP id h23mr17409998ljj.129.1567437843384; Mon, 02 Sep 2019 08:24:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Majenko Technologies (matt AT majenko DOT co DOT uk) [via geda-user AT delorie DOT com]" Date: Mon, 2 Sep 2019 16:23:52 +0100 Message-ID: Subject: Re: [geda-user] gschem interaction from external processes To: geda-user AT delorie DOT com Content-Type: multipart/alternative; boundary="000000000000dce16d0591938f8b" Reply-To: geda-user AT delorie DOT com --000000000000dce16d0591938f8b Content-Type: text/plain; charset="UTF-8" I often work with schematics that cover multiple pages. I then use "refdes_renum --pgskip ..." to number all the components with a page prefix (R101, R102, R201, R202, etc). Once that renumbering has been done any pages from the design that are open (which would normally be all of them with my program) need reverting so they pick up the new refdes numbers. The sequence is: 1. "Save all" on gschem 2. "Save" on PCB 3. refdes_renum 4. gsch2pcb 5. "Revert all" on gschem 6 "Revert" on PCB And all of that is tied to one "Update PCB from schematics" button on a toolbar. On Mon, Sep 2, 2019 at 4:16 PM Roland Lutz wrote: > On Mon, 2 Sep 2019, Majenko Technologies (matt AT majenko DOT co DOT uk) [via > geda-user AT delorie DOT com] wrote: > > For saving I simply iterate over any open windows (not sure if that's > > really needed?) > > It is. > > > and then call gschem_action_activate (action_file_save_all, item); on > > that window. > > That's in principle the right thing to do. The problem is that "Save all" > doesn't do the right thing--saving each modified page, asking for a > filename if necessary--but calls s_page_save_all which doesn't do any user > interaction. > > That's where the spurious "untitled_1.sch" files come from. To be more > precise, it's a combination of three kinds of undesireable behavior: > > - If gschem has been invoked without specifying file names on the command > line, or all pages have been closed at some point (including reverting a > single open page, as you pointed out), an untitled page is created. This > page is still present in the background after other files have been > opened. > > - "Save all" doesn't care if a page has been changed; it simply saved all > pages to their internally assigned filename. > > - For unsaved buffers, "Save all" doesn't ask for a filename like "Save" > does but simply uses the auto-generated "untitled_1.sch" filename. > > > > [Reverting is] made even more complex by the fact that you can't modify > > the GList of pages whilst iterating that GList of pages - so I just dump > > the page pointers into a temporary array first and work from that > > instead. It seems to work. > > In what kind of situation would you use a "Revert all" action? > -- *Matt Jenkins* Majenko Technologies --000000000000dce16d0591938f8b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I often work with schematics that cover multiple pages. I = then use "refdes_renum --pgskip ..." to number all the components= with a page prefix (R101, R102, R201, R202, etc). Once that renumbering ha= s been done any pages from the design that are open (which would normally b= e all of them with my program) need reverting so they pick up the new refde= s numbers.=C2=A0

The sequence is:

1. "Save all" on gschem
2. "Save" on PCB
3. refdes_renum
4. gsch2pcb
5. "Revert al= l" on gschem
6 "Revert" on PCB

And all of that is tied to one "Update PCB from schematics"= button on a toolbar.

On Mon, Sep 2, 2019 at 4:16 PM Roland Lutz <<= a href=3D"mailto:rlutz AT hedmen DOT org">rlutz AT hedmen DOT org> wrote:
On Mon, 2 Sep 2019, Maje= nko Technologies (m= att AT majenko DOT co DOT uk) [via
geda-user AT delori= e.com] wrote:
> For saving I simply iterate over any open windows (not sure if that= 9;s
> really needed?)

It is.

> and then call=C2=A0gschem_action_activate (action_file_save_all, item)= ; on
> that window.

That's in principle the right thing to do.=C2=A0 The problem is that &q= uot;Save all"
doesn't do the right thing--saving each modified page, asking for a filename if necessary--but calls s_page_save_all which doesn't do any u= ser
interaction.

That's where the spurious "untitled_1.sch" files come from.= =C2=A0 To be more
precise, it's a combination of three kinds of undesireable behavior:
- If gschem has been invoked without specifying file names on the command line, or all pages have been closed at some point (including reverting a single open page, as you pointed out), an untitled page is created.=C2=A0 T= his
page is still present in the background after other files have been
opened.

- "Save all" doesn't care if a page has been changed; it simp= ly saved all
pages to their internally assigned filename.

- For unsaved buffers, "Save all" doesn't ask for a filename = like "Save"
does but simply uses the auto-generated "untitled_1.sch" filename= .


> [Reverting is] made even more complex by the fact that you can't m= odify
> the GList of pages whilst iterating that GList of pages - so I just du= mp
> the page pointers into a temporary array first and work from that
> instead. It seems to work.

In what kind of situation would you use a "Revert all" action?


--
Matt Jenkins
Majenko= Technologies

--000000000000dce16d0591938f8b--