add reformating option

This commit is contained in:
King Kévin 2013-10-11 14:35:09 +02:00
parent 08381458b6
commit 6fcb31eabc
1 changed files with 13 additions and 3 deletions

View File

@ -73,6 +73,16 @@ desc "export gerber"
task :gerber => GERBERS
CLOBBER.include(GERBERS)
desc "reformat gerber and drill output (some programs like LPKF CircuitPro have difficulties with gEDA pcb output)"
task :reformat => GERBERS do
GERBERS.each do |gerber|
if gerber.end_with? ".gbr" then
sh "gerbv --export=rs274x --output=#{gerber} #{gerber}"
elsif gerber.end_with? ".cnc" then
sh "gerbv --export=drill --output=#{gerber} #{gerber}"
end
end
end
# ================
# helper functions
@ -158,7 +168,7 @@ file "#{target}_layout.pdf" => vpcb do |t|
sh "rm #{t.name}.ps 2> /dev/null"
end
desc "generate note file from schematich, listing the 'note' attributes from elements"
desc "generate note file from schematic, listing the 'note' attributes from elements"
file "notes.txt" => vsch do |t|
notes_data = bom2(t.prerequisites[0],"note")
File.open(t.name,"w") do |notes_file|
@ -169,12 +179,12 @@ file "notes.txt" => vsch do |t|
end
end
desc "generate photo realistich picture from layout (front side)"
desc "generate photo realistic picture from layout (front side)"
file "#{target}_layout-top.png" => vpcb do |t|
sh "pcb -x png --dpi 600 --format PNG --photo-mode --outfile #{target}_layout-top.png #{t.prerequisites.join(' ')}"
end
desc "generate photo realistich picture from layout (bottom side)"
desc "generate photo realistic picture from layout (bottom side)"
file "#{target}_layout-bottom.png" => vpcb do |t|
sh "pcb -x png --dpi 600 --format PNG --photo-mode --photo-flip-x --outfile #{target}_layout-bottom.png #{t.prerequisites.join(' ')}"
end