delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2020/12/05/04:24:07

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=20161025;
h=date:from:to:subject:message-id:mail-followup-to:references
:mime-version:content-disposition:content-transfer-encoding
:in-reply-to:user-agent;
bh=eyVXsxhBwGXd9y4RJJR3cdpOxG6ht8zGqo8lAvbbIIM=;
b=iYPBzJid3r7i0PkYE683R+EW/jq9k/NM0QYKOyWnd4ObRN0L9Oqq3H/wdIrP6nISnL
0oQqVr78NzJK+Ye4thaoooIL3A7PJ+tvNprhg5+iorZ7hbPrBRtYDfVCbwFOy1SVG01+
+SkKINuo2a+P+xAMS3CPx/xirweGRKB/WxeqdJr29IdRahynO6dt+BaQAw5nbpdUBBLk
SnknwoFH7ZTaCljGF0wTAvFJo4+MStK/MykyUWAT5RvFjGbs17OnD7OnVt/WVBYbw7AN
zKiasrKc3ApoK44blzVdPzOWP6FiT82WdqKKUlRUi8QZQ3tBmSUPyKPW40WeZIuS5ZbY
vbQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to
:references:mime-version:content-disposition
:content-transfer-encoding:in-reply-to:user-agent;
bh=eyVXsxhBwGXd9y4RJJR3cdpOxG6ht8zGqo8lAvbbIIM=;
b=iJKCqLqP+RLsj64tKBOZ4wOew+Und7haBtty0CSJfUQHDeu4MDdV8uzUpc27eaAPeq
2rWjmYzUwWmYGGze3N3YaRw8PB2n9EGd++h5Yi9nvcqpQm0XLKx8PLbwjlHBTiycudqO
irOKI9u7RTQ4AwWLlHhU1Q28S2fxKWgV0M7yjn8Q886QfXQMySbTUvA9vw5zNd+MLu7Q
8Uh1cMdLkN8ZF/e03p3+RPT2gqBkAmbJCAKU/f83I87o9cukebdJ2c4olqpp4xlkueB/
slGEUvctU8adWRUS/ZUIOKjByI8ec4V1Qf1ml8+GRFChV2MjwnKBnFs17lYiz6evk6Fy
txqw==
X-Gm-Message-State: AOAM531QhwLbykGMVlboKR4VgURVL6gcFwN+TCaEDtJSu8IEd8QYW5Eu
/Bs6UUEBX/HGIXj5X/AhhpzC/N+z494=
X-Google-Smtp-Source: ABdhPJzhTHO8KwN63DYmucNva09FcAjn8gP0yqvnNyE2SLLcmKJGCeOAcTIx65vBIM4Lnp9dJV7DfA==
X-Received: by 2002:a19:6e4c:: with SMTP id q12mr4606476lfk.162.1607159095249;
Sat, 05 Dec 2020 01:04:55 -0800 (PST)
Date: Sat, 5 Dec 2020 12:04:22 +0300
From: "Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] automatically create a .sch file containing a single
component?
Message-ID: <20201205090422.GB1617@newvzh.lokolhoz>
Mail-Followup-To: geda-user AT delorie DOT com
References: <CAC4O8c_Gssuua3aHJSEMTW_Sw5W9rvtwrys1e=BP=CvHmEifJA AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAC4O8c_Gssuua3aHJSEMTW_Sw5W9rvtwrys1e=BP=CvHmEifJA@mail.gmail.com>
User-Agent: Mutt/1.10.1 (2018-07-13)
Note-from-DJ: This may be spam
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

Hi Britton,

On Thu, Dec 03, 2020 at 11:12:41AM -0900, Britton Kerin (britton DOT kerin AT gmail DOT com) [via geda-user AT delorie DOT com] wrote:
> Another small thing I'd like to automate is my setup for validating
> footprints of symbols.  I use heavy symbols with footprints associated
> with each part.  To check a symbol I first create a .sym and .fpt,
> then create a file checkfpt.sch which contains just the .sym, then use
> gsh2pcb to create a pcb file containing the symbol, and launch pcb to
> take a look at it.
> 
> The part that's pointlessly interactive is the creation of the .sch
> file.  I have to have gschem launched and manually add the symbol.
> 
> I'd like to do one of these instead:
> 
> * create an sch containing just the sch using some batch mode op
> 
> * just create the sch by script.  but I don't get why some text
> elements (refdes=, device=) end up
>   repeated in the .sch file and other stay in the element.  what
> distinguishes these elements?
> 
> * create the pcb file directly.  sort of a hassle but probably what
> I'll do unless there's a better way,
>   a little weird in my case since I have a lot of footprints using a
> text library of my own
> 
> * view the footprint file in a way that shows the refdes.  I know it
> possible to view footprints directly
>   with pcb, the only problem with this is it doesn't show the refdes.
> Is there some way to make it
>   do so?
> 
> Britton

I'm not sure if I understood anything correctly.  Still I propose
my solution of the problem you mentioned as I understood it.

The following Scheme script creates a schematic from one symbol:

=======================================8<=======================================
(use-modules (lepton page)
             (lepton object)
             (srfi srfi-1))

;;; First argument in program arguments is the name of the script
;;; itself.
(define file-name (second (program-arguments)))
(define symbol-name (third (program-arguments)))

(define (save-page page)
  (display (page->string page)))

(let ((page (make-page file-name)))
  (page-append! page (make-component/library symbol-name '(0 . 0) 0 #f #f))
    (with-output-to-file file-name (lambda () (save-page page))))
=======================================>8=======================================    

Its usage is simple:
  lepton-cli shell -s ./schematic-from-symbol.scm /tmp/schematic.sch resistor-1.sym

A call for lepton-schpcb could be added in the script as well
using '(system "lepton-sch2pcb" arg1 arg2 ...)', though I omit
this as not very significant here.  Another way would be to use
some sh scripting for that.

If you still use geda-gaf the above script should be changed a bit
(I suspect nothing changed in Scheme code there since 1.9.2), just
use '(geda object)' instead of '(lepton object)', etc, the 'gaf'
command instead of 'lepton-cli', and 'gsch2pcb' instead of
'lepton-sch2pcb'.

HTH

-- 
  Vladimir

(λ)επτόν EDA — https://github.com/lepton-eda

- Raw text -


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