#!/bin/bash

## This script generate alternative data names (Required by some PCB manufacturers such as Pragoboard.cz)
##
## Usage:
##
## Run this script with parameter of directory in which Gerber data is located.
##
## Example:
##
## ./gen_PragoBoard.sh /home/kaklik/svnMLAB/Modules/CommRF/GSM01A/CAM_PROFI/ GSM01A
##
## This command generates new directory PragoBoard with these files:
## bot.gbr  mill.gbr  plt.gbr  pth.exc  smb.gbr  smt.gbr  top.gbr
##
##
## TODO: non plated drill is not properly handled. 
##

cd $1

mkdir ./PragoBoard/

# from MLAB standard file names generated mainly by PADS PCB software. 

#cp V1.PHO ./PragoBoard/top.gbr
#cp V2.PHO ./PragoBoard/bot.gbr
#cp M1.PHO ./PragoBoard/smt.gbr
#cp M2.PHO ./PragoBoard/smb.gbr
#cp T1.PHO ./PragoBoard/plt.gbr
#cp BOARD.PHO ./PragoBoard/mill.gbr
#cp DRILL.DRL ./PragoBoard/pth.exc
#cp nDRILL.DRL ./PragoBoard/npth.exc   #non plated holes

# sources generated by KiCAD software

cp $2-F.Cu.gbr ./PragoBoard/top.gbr
cp $2-B.Cu.gbr ./PragoBoard/bot.gbr
cp $2-F.Mask.gbr ./PragoBoard/smt.gbr
cp $2-B.Mask.gbr ./PragoBoard/smb.gbr
cp $2-F.SilkS.gbr ./PragoBoard/plt.gbr
cp $2-Edge.Cuts.gbr ./PragoBoard/mill.gbr
cp $2.drl ./PragoBoard/pth.exc
cp $2.NPTH.drl ./PragoBoard/npth.exc   #non plated holes


#cp $2-F_Cu.gbr ./PragoBoard/top.gbr
#cp $2-B_Cu.gbr ./PragoBoard/bot.gbr
#cp $2-F_Mask.gbr ./PragoBoard/smt.gbr
#cp $2-B_Mask.gbr ./PragoBoard/smb.gbr
#cp $2-F_SilkS.gbr ./PragoBoard/plt.gbr
#cp $2-Edge_Cuts.gbr ./PragoBoard/mill.gbr
#cp $2.drl ./PragoBoard/pth.exc
#cp $2-NPTH.drl ./PragoBoard/npth.exc   #non plated holes