delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2019/09/02/11:45:31

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: <CAPp8_DqaZpOpdKFrUF7HC9sbCG2ag0a2iuWQrSkOY76U1kRQ6g AT mail DOT gmail DOT com>
<alpine DOT DEB DOT 2 DOT 20 DOT 1909021356320 DOT 1863 AT nimbus> <CAPp8_DpMmfLQ1MzYkSyXCQ6KiGxf1+TBLz12s0ztRL7qK4sCCw AT mail DOT gmail DOT com>
<alpine DOT DEB DOT 2 DOT 20 DOT 1909021622220 DOT 1424 AT nimbus>
In-Reply-To: <alpine.DEB.2.20.1909021622220.1424@nimbus>
From: "Majenko Technologies (matt AT majenko DOT co DOT uk) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
Date: Mon, 2 Sep 2019 16:23:52 +0100
Message-ID: <CAPp8_DrAkq+GZr7aXzNBu4+Cvep7K1m81aob5-12JSTOL2BPZA@mail.gmail.com>
Subject: Re: [geda-user] gschem interaction from external processes
To: geda-user AT delorie DOT com
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 <rlutz AT hedmen DOT org> 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

<div dir=3D"ltr">I often work with schematics that cover multiple pages. I =
then use &quot;refdes_renum --pgskip ...&quot; 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<div><br></div><div>The sequence is:</div><div><br></div><d=
iv>1. &quot;Save all&quot; on gschem</div><div>2. &quot;Save&quot; on PCB</=
div><div>3. refdes_renum</div><div>4. gsch2pcb</div><div>5. &quot;Revert al=
l&quot; on gschem</div><div>6 &quot;Revert&quot; on PCB</div><div><br></div=
><div>And all of that is tied to one &quot;Update PCB from schematics&quot;=
 button on a toolbar.</div></div><br><div class=3D"gmail_quote"><div dir=3D=
"ltr" class=3D"gmail_attr">On Mon, Sep 2, 2019 at 4:16 PM Roland Lutz &lt;<=
a href=3D"mailto:rlutz AT hedmen DOT org">rlutz AT hedmen DOT org</a>&gt; wrote:<br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 2 Sep 2019, Maje=
nko Technologies (<a href=3D"mailto:matt AT majenko DOT co DOT uk" target=3D"_blank">m=
att AT majenko DOT co DOT uk</a>) [via <br>
<a href=3D"mailto:geda-user AT delorie DOT com" target=3D"_blank">geda-user AT delori=
e.com</a>] wrote:<br>
&gt; For saving I simply iterate over any open windows (not sure if that&#3=
9;s <br>
&gt; really needed?)<br>
<br>
It is.<br>
<br>
&gt; and then call=C2=A0gschem_action_activate (action_file_save_all, item)=
; on <br>
&gt; that window.<br>
<br>
That&#39;s in principle the right thing to do.=C2=A0 The problem is that &q=
uot;Save all&quot; <br>
doesn&#39;t do the right thing--saving each modified page, asking for a <br=
>
filename if necessary--but calls s_page_save_all which doesn&#39;t do any u=
ser <br>
interaction.<br>
<br>
That&#39;s where the spurious &quot;untitled_1.sch&quot; files come from.=
=C2=A0 To be more<br>
precise, it&#39;s a combination of three kinds of undesireable behavior:<br=
>
<br>
- If gschem has been invoked without specifying file names on the command<b=
r>
line, or all pages have been closed at some point (including reverting a<br=
>
single open page, as you pointed out), an untitled page is created.=C2=A0 T=
his<br>
page is still present in the background after other files have been<br>
opened.<br>
<br>
- &quot;Save all&quot; doesn&#39;t care if a page has been changed; it simp=
ly saved all<br>
pages to their internally assigned filename.<br>
<br>
- For unsaved buffers, &quot;Save all&quot; doesn&#39;t ask for a filename =
like &quot;Save&quot;<br>
does but simply uses the auto-generated &quot;untitled_1.sch&quot; filename=
.<br>
<br>
<br>
&gt; [Reverting is] made even more complex by the fact that you can&#39;t m=
odify <br>
&gt; the GList of pages whilst iterating that GList of pages - so I just du=
mp <br>
&gt; the page pointers into a temporary array first and work from that <br>
&gt; instead. It seems to work.<br>
<br>
In what kind of situation would you use a &quot;Revert all&quot; action?<br=
>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature"><div dir=3D"ltr"><b>Matt Jenkins</b><div>Majenko=
 Technologies</div><div><br></div></div></div>

--000000000000dce16d0591938f8b--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019