www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/06/29/17:02:14

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=gmail.com; s=20120113;
h=date:from:to:subject:message-id:mail-followup-to:references
:mime-version:content-type:content-disposition:in-reply-to
:user-agent;
bh=wD8epwxL9IglWKS04bgg7+0AjtvtDqqIQNhBYQaXT8A=;
b=c6oyQR55QKB6UjfIuOwtdCcaJGj5Xi083xmfW5OsapNqpsreV+whpkVa0iZNgSkrzr
msNeA2KHHc2mdQ1gebIb2YEkUh7+AxGVNqz19SEPXGsYrz9wvM9foUYR0nILXJeic8cH
9bDfU9/0xp/84XHlTwksbnDBvFbVDHnClXpPYCSpxIGyQc5XB5oFYhQ9pCCBfO9ac1xL
ByoS9i9AtszetuTJ4lHwwQQME8w5Qy4HhIB0YRWFGCOtSBpkucGGG/Qp9tS9YWzoKNFu
RP1rWVKZDdmQkURaeQVmXqQyBY4xveautoH4KjUHE7HmPGduBWm70DGpGiHBEJSpCEnp
qGLQ==
X-Received: by 10.112.125.166 with SMTP id mr6mr16020461lbb.83.1435611719456;
Mon, 29 Jun 2015 14:01:59 -0700 (PDT)
Date: Tue, 30 Jun 2015 00:01:56 +0300
From: "Vladimir Zhbanov (vzhbanov AT gmail DOT com)" <geda-user AT delorie DOT com>
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] gEDA/gschem still alive?
Message-ID: <20150629210156.GB28458@localhost.localdomain>
Mail-Followup-To: geda-user AT delorie DOT com
References: <1435510363 DOT 682 DOT 26 DOT camel AT ssalewski DOT de>
<55902AB9 DOT 9000004 AT neurotica DOT com>
<alpine DOT DEB DOT 2 DOT 00 DOT 1506281932040 DOT 6924 AT igor2priv>
<20150629113018 DOT GH19654 AT fi DOT muni DOT cz>
<1435581145 DOT 1447 DOT 19 DOT camel AT ssalewski DOT de>
<CAOFvGD7npho6fPKAEmce6L1nXy=5EEsVaEH-Vj_XEuiLddodDA AT mail DOT gmail DOT com>
<1435592698 DOT 1607 DOT 17 DOT camel AT ssalewski DOT de>
<D8B09027-EF94-4C8D-ADC8-C5CCEAC36552 AT noqsi DOT com>
<1435599996 DOT 2704 DOT 20 DOT camel AT ssalewski DOT de>
MIME-Version: 1.0
In-Reply-To: <1435599996.2704.20.camel@ssalewski.de>
User-Agent: Mutt/1.5.23 (2014-03-12)
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

On Mon, Jun 29, 2015 at 07:46:36PM +0200, Stefan Salewski wrote:
> On Mon, 2015-06-29 at 10:54 -0600, John Doty wrote:
> > On Jun 29, 2015, at 9:44 AM, Stefan Salewski <mail AT ssalewski DOT de> wrote:
> > 
> > > On Mon, 2015-06-29 at 10:47 -0400, Jason White
> > > (whitewaterssoftwareinfo AT gmail DOT com) wrote:
> > >> Stefan, I think the easiest solution to net grouping attributes such as
> > >> "Power", "Analog", or "Digital" is to allow for each net to be displayed
> > >> with a different color.
> > 
> > The file format already supports line colors and styles. I have always
> > thought it would make more sense to represent nets and busses with
> > lines that have attached attributes than to have primitives for these.
> > What we have now is a factoring error. Not too serious, but a barrier
> > to the future.
> > 
> 
> gschem file format supports line colors and styles. But for nets only
> color index is available currently:
> 
> N 53500 61600 53000 61600 4

I wish nets had the same format as lines, too. For instance, schematic
for, say, a lathe plant could have centered earth nets, and power nets
could be more thick than others.

> 
> And my fear is that many colors and styles for nets are really confusing
> when displayed all the time. It may be OK when we generally use plain
> color/style for all nets, but when we query "show high current +5V nets"
> then these are shown in a special color and style. But I am not sure, we
> have to test that in real live, and that is some works...

You can always distinguish something by selecting it. For example, the
attached scheme script selects nets which netname attribute has the
value "power". It's trivially to assign a shortcut for it and, for
example, use a selected attribute as template. (For sure, there are
other ways to select what you want, but I think it's enough info yet for
those who are interested.)

Cheers,
  Vladimir

--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename="filter-power-nets.scm"

(use-modules (geda page))
(use-modules (geda attrib))
(use-modules (gschem selection))

(define (select-if-net! object)
  (and (net? object)
       (not (object-selected? object))
       (select-object! object)
       (select-net! object)))

(define (select-net! net-segment)
  (for-each select-if-net! (object-connections net-segment)))

(define (has-attrib? value objects)
  (and (pair? objects)
       (not (null? (car objects)))
       (or (string=? value (attrib-value (car objects)))
           (has-attrib? value (cdr objects)))))

(define (net-with-netname-value? netname-value object)
  (and (net? object)
       (has-attrib? netname-value (object-attribs object))))

(define (select-nets-with-netname! netname-value)
  (let ((power-segments
          (filter (lambda (object)
                    (net-with-netname-value? netname-value object))
                  (page-contents (active-page)))))
    (for-each deselect-object! (page-selection (active-page)))
    (for-each select-object! power-segments)
    (for-each select-net! power-segments)))

; main procedure
(select-nets-with-netname! "power")

--fUYQa+Pmc3FrFX/N--

- Raw text -


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