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=VqAIDcY60hLlWZCAPAWA9eFQ+qAAidznRaugeno8q0U=; b=EhcqUSfyCnIC12rhzt7UWuT0PjDRacNwUs29dJ3bT0rT3K0HipmvyWJFrIhXD65Kl4 xQI+977Jf+ECK5K3s5XFeeaMgoSoElj5kHqOJUQnz00Be+mCIdpAZE5oAJHzQN09NTpx OjqGFeUGicijOUscDw6Dk1Uz7iGqPGluOMtJn4ckf47yOMZT1LdoKB+cLuoeU8AdJcjM tORbKB/kEHd8QhcE3tA8SfLdQvW6C4xbMHK64UuUh5+BlKUrVDBIF3qzM19j97VMFsvv 8mD2L9wFSc2WiX4bHoZ6et51PoSmprK9QWjHaITQB8dSRNumJUtsoYrGoz0myb1UiDgR cLoQ== 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=VqAIDcY60hLlWZCAPAWA9eFQ+qAAidznRaugeno8q0U=; b=AW80ByLchjWbUlzwHqY7AfJeNG94RTEOh1I+9LJ974t91q+LsPQCt/QgQ4XDD9YuuB FygW0Yx7lKh66D56XtLqkmncpsBbte+Kb6z5wQOqMBvr60axrjdibRpehTIU2JXd1sRq 04BLYzSZGrlE8jfzgPMMWKO3QKLice/u27fk+3JrwKC6WcuFWT+pcQ4CD7kq9U+lTepa N2sxqF7y4IZRc1Kkw/FnHWY8AdjtkHGrWdc6dXMtfsXEe5zlURfxU2i753izYdZUeDzk 8KRbMW1TZH6hQURoFnkdX//sh/KmLXxkxymlU19itzxX4S+7/M3hw8hjTiGn7+A/SfN/ 7fUw== X-Gm-Message-State: APjAAAX+HUuVopcsZ30MZXq99WMclKL7FQe0+oHctcPRwuOZm5237+6T ecfRFC1P1U0mwFFOjTRtESGLyzzk1yPR41dKqggn/kaC X-Google-Smtp-Source: APXvYqw5zuJiAg20kj1BN94DmYUZVmt+zUPRDPMQmrJjnd/b4b/nQQWUN/ZkgLirj9cTKNeiYC5wcSv7V5yQKfTzmYE= X-Received: by 2002:a19:cb46:: with SMTP id b67mr17687018lfg.154.1567437917798; Mon, 02 Sep 2019 08:25:17 -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:25:07 +0100 Message-ID: Subject: Re: [geda-user] gschem interaction from external processes To: geda-user AT delorie DOT com Content-Type: multipart/alternative; boundary="0000000000004c5b2005919394ad" Reply-To: geda-user AT delorie DOT com --0000000000004c5b2005919394ad Content-Type: text/plain; charset="UTF-8" A better scenario would be (since I know the names of the schematic files already) if I could tell gchem to save and revert just certain files (if they happen to be open). That way it wouldn't touch any extra things you may have open. On Mon, Sep 2, 2019 at 4:23 PM Majenko Technologies wrote: > 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 > > -- *Matt Jenkins* Majenko Technologies --0000000000004c5b2005919394ad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
A better scenario would be (since I know the names of the = schematic files already) if I could tell gchem to save and revert just cert= ain files (if they happen to be open).=C2=A0 That way it wouldn't touch= any extra things you may have open.

On Mon, Sep 2, 2019 at 4:23 PM Majenko = Technologies <matt AT majenko DOT co DOT uk> wrote:
I often work with schematics that cover multiple pages. I th= en use "refdes_renum --pgskip ..." to number all the components w= ith 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.=C2=A0

The sequence is:

1. "Save all" on gschem
2. "Save" on PCB
3. refdes_renum
4. gsch2pcb
5. "Revert all&= quot; on gschem
6 "Revert" on PCB

<= div>And all of that is tied to one "Update PCB from schematics" b= utton on a toolbar.

On Mon, = 2 Sep 2019, Majenko Technologies (matt 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



--
Matt Jenkins
Majenko= Technologies

--0000000000004c5b2005919394ad--