[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: gnet-osmond.scm



  User: ahvezda 
  Date: 07/05/13 23:36:01

  Added:       .        gnet-osmond.scm
  Log:
  Oops, forgot to commit new gnet-osmond.scm file
  
  
  
  
  Revision  Changes    Path
  1.1                  eda/geda/gaf/gnetlist/scheme/gnet-osmond.scm
  
  Index: gnet-osmond.scm
  ===================================================================
  ;;; $Id: gnet-osmond.scm,v 1.1 2007/05/14 03:36:01 ahvezda Exp $
  ;;;
  ;;; gEDA - GNU Electronic Design Automation
  ;;; gnetlist back end for Osmond PCB Design
  ;;; Copyright (C) 2007 John P. Doty
  ;;;
  ;;; This program is free software; you can redistribute it and/or modify
  ;;; it under the terms of the GNU General Public License as published by
  ;;; the Free Software Foundation; either version 2 of the License, or
  ;;; (at your option) any later version.
  ;;;
  ;;; This program is distributed in the hope that it will be useful,
  ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ;;; GNU General Public License for more details.
  ;;;
  ;;; You should have received a copy of the GNU General Public License
  ;;; along with this program; if not, write to the Free Software
  ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
  ;;
  ;; Parts list 
  ;;
  (define osmond:parts
     (lambda (port ls)
        (if (not (null? ls))
           (let ((package (car ls)))
              (begin
  	       (display "Part " port)
                 (display (gnetlist:get-package-attribute package "footprint") port)
  	       (display " { Name " port)
  	       (display package port )
  	       (display " }" port)
                 (newline port)
                 (osmond:parts port (cdr ls)))))))
  
  ;;
  ;; List all connections to a net
  ;;
  (define (osmond:list-connections nets)
    (let ((k ""))
      (for-each (lambda (in-string)
                  (set! k (string-append k in-string)))
                (map (lambda (net)
                       (string-append " " (car net) "-" (car (cdr net))))
                     nets))
     k))
  
  ;
  ; Write out each signal
  ;
  (define osmond:write-signal
     (lambda (port signals)
        (if (not (null? signals))
           (let ((signal (car signals)))
  	    (begin
  	       (display "Signal " port )
  	       (write-char #\" port)
  	       (display signal port)
  	       (write-char #\" port)
                 (newline port)
  	       (display "  {" port)
                 (display (osmond:list-connections 
  	          (gnetlist:get-all-connections signal)) port)
  	       (display " }" port)
  	       (newline port)
  	       (osmond:write-signal port (cdr signals)))))))
  	              
  ;;
  ;; Write out all the signals
  ;;	       
  (define osmond:signal
     (lambda (port)
        (let ((all-uniq-nets (gnetlist:get-all-unique-nets "dummy")))
           (osmond:write-signal port all-uniq-nets))))
  
  
  (define osmond 
     (lambda (output-filename)
        (let ((port (open-output-file output-filename)))
           (begin
  	    (osmond:parts port packages)
  	    (osmond:signal port)
           )
           (close-output-port port))))
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs