Mail Archives: geda-user/2015/12/18/15:51:09
X-Authentication-Warning: | delorie.com: mail set sender to geda-user-bounces using -f
|
X-Recipient: | geda-user AT delorie DOT com
|
X-Mailer: | exmh version 2.8.0 04/21/2012 (debian 1:2.8.0~rc1-2) with nmh-1.5
|
X-Exmh-Isig-CompType: | comp
|
X-Exmh-Isig-Folder: | inbox
|
From: | karl AT aspodata DOT se
|
To: | geda-user AT delorie DOT com
|
Subject: | [geda-user] gnetlist -g partlist3 in error
|
Mime-Version: | 1.0
|
Message-Id: | <20151218205019.1C1FF809D78C@turkos.aspodata.se>
|
Date: | Fri, 18 Dec 2015 21:50:19 +0100 (CET)
|
X-Virus-Scanned: | ClamAV using ClamSMTP
|
Reply-To: | geda-user AT delorie DOT com
|
Doing:
$ gnetlist -g partslist2 -o partslist2 regulator.v02.sch
...
$ gnetlist -g partslist3 -o partslist3 regulator.v02.sch
...
$ grep R13 partslist[23]
partslist2:R13 resistor 1k m1608_a.fp 1
partslist3:Resistor 10k m1608_a.fp 23 5Rb1 R8 5Rt1 5Rt2 R13 R14 R15 R16 R17 R18 R2 R4 R6 5Rsc1 R7 acRsc1 acRsc2 nRb3 acRt1 acRb1 nRb1 pRb1 pRb3
$ grep -A 2 R13 regulator.v02.sch
refdes=R13
T 42300 71400 5 10 1 1 0 3 1
value=1k
$ gnetlist -V
gEDA 1.9.0 (g01f8d13)
...
$
shows that partlist2 and partlist3 don't agree with each other,
and that partlist3 is in error, it gave the 1k resistor the
value 10k.
The difference between them seems to be that
gnetlist/scheme/gnet-partslist3.scm has:
(define (count-same-parts ls)
(if (null? ls)
(append ls)
(let* ((parts-table-no-uref (let ((result '()))
(for-each (lambda (l) (set! result (cons (cdr l) result))) (reverse ls))
(append result)))
(first-ls (car parts-table-no-uref))
(match-length (length (member first-ls (reverse parts-table-no-uref))))
(rest-ls (list-tail ls match-length))
(match-ls (list-tail (reverse ls) (- (length ls) match-length)))
(uref-ls (let ((result '()))
(for-each (lambda (l) (set! result (cons (car l) result))) match-ls)
(append result))))
(cons (cons uref-ls (append first-ls (list match-length))) (count-same-parts rest-ls)))))
I don't know what's wrong with it, no scheme expert, so made a
workaround, doing partlist2 in a perl script which I let handle
the sorting etc:
http://turkos.aspodata.se/git/openhw/bin/GnetParts1.pl
$ grep R13 regulator.v02.sch.list[12]
regulator.v02.sch.list1:Resistor m1608_a.fp 1k R13
regulator.v02.sch.list2:Resistor m1608_a.fp 1k 11 R2 R4 R6 R13 R14 R15 R16 R17 R18 acRt3 nRt1
$
which "works for me" (the "11" before R2 on the second line is a
count), and give straight columns and sorts lines better (e.g. C9
before C10, and 3.3 before 100k).
Output files are available at:
http://turkos.aspodata.se/tmp/gEDA/
if you'd care to have a look.
///
If anyone would like to debug partlist3, my file, configs, and
"source="-dir are at:
http://turkos.aspodata.se/git/openhw/regulator/regulator.v02.sch
http://turkos.aspodata.se/git/openhw/config/
http://turkos.aspodata.se/git/openhw/share/gschem/include/
///
Is there any script that let's me point to a .sch file, and it
finds all .sym and source (and possible .fp) files, and tar's them
up so I can upload something that is easier for others to download
and test ?
Regards,
/Karl Hammar
-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57
- Raw text -