#!/bin/sh
#
#                            COPYRIGHT
#
#  pcb_route, simple script to route a file.pcb+file.net
#  Copyright (C) 2001 Luis Claudio Gamba Lopes
#
#  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.
#
#  Contact address for Email:
#  lcgamboa@yahoo.com
#
#

if [ "$1" != "" ]
then
  rm -f $1.ncap.ddir/*.ps
  pcb2ncap $1.pcb $1.net
  netex -f $1.ncap
  track -dF $1.ncap
  cp $1.ncap.ddir/lines.l* .
  up2ps $1.ncap.ddir/*
  up2pcb lines.l*
  cat $1.pcb lines.l*.vpcb >$1_routed.tmp
  catlayer 1 $1_routed.tmp lines.l1.lpcb >$1_routed1.tmp
  catlayer 4 $1_routed1.tmp lines.l2.lpcb >$1_routed.pcb
  rm -f lines.l* *.tmp
else
  echo "usage: pcb_route project_name"
fi
