add photo support for multiple targets
This commit is contained in:
parent
3d920f6a5f
commit
0da4b8167c
|
@ -39,37 +39,31 @@ end
|
||||||
|
|
||||||
desc "main building task"
|
desc "main building task"
|
||||||
#task :default => [:version,:print,:notes,:photo,:gerber]
|
#task :default => [:version,:print,:notes,:photo,:gerber]
|
||||||
task :default => [:version,:print]
|
task :default => [:version,:print,:notes,:photo]
|
||||||
|
|
||||||
desc "create release file"
|
desc "create release file"
|
||||||
release = "hardware-release_v#{version}.tar.gz"
|
release = "hardware-release_v#{version}.tar.gz"
|
||||||
task :release => release
|
task :release => release
|
||||||
CLOBBER.include(release) if File.exist? release
|
CLOBBER.include(release)
|
||||||
|
|
||||||
desc "set version in schematic and layout"
|
desc "set version in schematic and layout"
|
||||||
versions = targets.collect{|target| [target[:vsch],target[:vpcb]]}.flatten
|
versions = targets.collect{|target| [target[:vsch],target[:vpcb]]}.flatten
|
||||||
task :version => versions
|
task :version => versions
|
||||||
versions.each do |version|
|
CLEAN.include(versions)
|
||||||
CLEAN.include(version) if File.exist? version
|
|
||||||
end
|
|
||||||
targets.each do |target|
|
targets.each do |target|
|
||||||
CLOBBER.include("#{target[:name]}_*.sch") if File.exist? "#{target[:name]}_*.sch"
|
CLOBBER.include("#{target[:name]}_*.sch")
|
||||||
CLOBBER.include("#{target[:name]}_*.pcb") if File.exist? "#{target[:name]}_*.pcb"
|
CLOBBER.include("#{target[:name]}_*.pcb")
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "print schematic and layout (as pdf)"
|
desc "print schematic and layout (as pdf)"
|
||||||
prints = targets.collect{|target| ["#{target[:name]}_schematic.pdf","#{target[:name]}_layout.pdf"]}.flatten
|
prints = targets.collect{|target| ["#{target[:name]}_schematic.pdf","#{target[:name]}_layout.pdf"]}.flatten
|
||||||
task :print => prints
|
task :print => prints
|
||||||
prints.each do |print|
|
CLEAN.include(prints)
|
||||||
CLEAN.include(print) if File.exist? print
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "export notes from schematic"
|
desc "export notes from schematic"
|
||||||
notes = targets.collect{|target| "#{target[:name]}_notes.txt"}
|
notes = targets.collect{|target| "#{target[:name]}_notes.txt"}
|
||||||
task :notes => notes
|
task :notes => notes
|
||||||
notes.each do |note|
|
CLEAN.include(notes)
|
||||||
CLEAN.include(note) if File.exist? note
|
|
||||||
end
|
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
desc "verify schematic attributes"
|
desc "verify schematic attributes"
|
||||||
|
@ -94,12 +88,14 @@ desc "convert schematic to pcb layout"
|
||||||
task :sch2pcb => vsch do |t|
|
task :sch2pcb => vsch do |t|
|
||||||
sh "gsch2pcb #{t.prerequisites[0]} --elements-dir #{File.dirname(__FILE__)}/lib/footprints --skip-m4 --output-name #{target}"
|
sh "gsch2pcb #{t.prerequisites[0]} --elements-dir #{File.dirname(__FILE__)}/lib/footprints --skip-m4 --output-name #{target}"
|
||||||
end
|
end
|
||||||
|
=end
|
||||||
|
|
||||||
PHOTOS = ["#{target}_layout-top.png","#{target}_layout-bottom.png"]
|
photos = targets.collect{|target| ["#{target[:name]}_layout-top.png","#{target[:name]}_layout-bottom.png"]}.flatten
|
||||||
desc "render layout"
|
desc "render layout"
|
||||||
task :photo => PHOTOS
|
task :photo => photos
|
||||||
CLOBBER.include(PHOTOS)
|
CLOBBER.include(photos)
|
||||||
|
|
||||||
|
=begin
|
||||||
GERBERS = [".top.gbr",".topmask.gbr",".toppaste.gbr",".topsilk.gbr",".bottom.gbr",".bottommask.gbr",".bottompaste.gbr",".bottomsilk.gbr",".outline.gbr",".fab.gbr",".plated-drill.cnc",".unplated-drill.cnc"].collect{|suffix| target+suffix}
|
GERBERS = [".top.gbr",".topmask.gbr",".toppaste.gbr",".topsilk.gbr",".bottom.gbr",".bottommask.gbr",".bottompaste.gbr",".bottomsilk.gbr",".outline.gbr",".fab.gbr",".plated-drill.cnc",".unplated-drill.cnc"].collect{|suffix| target+suffix}
|
||||||
desc "export gerber"
|
desc "export gerber"
|
||||||
task :gerber => GERBERS
|
task :gerber => GERBERS
|
||||||
|
@ -156,7 +152,7 @@ def bom2(schematic, attributes)
|
||||||
end
|
end
|
||||||
return to_return
|
return to_return
|
||||||
end
|
end
|
||||||
CLEAN.include("attribs") if File.exist? "attribs"
|
CLEAN.include("attribs")
|
||||||
|
|
||||||
# ===============
|
# ===============
|
||||||
# file generation
|
# file generation
|
||||||
|
@ -222,19 +218,21 @@ targets.each do |target|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
=begin
|
|
||||||
desc "generate photo realistic picture from layout (front side)"
|
desc "generate photo realistic picture from layout (front side)"
|
||||||
file "#{target}_layout-top.png" => vpcb do |t|
|
targets.each do |target|
|
||||||
# sh "pcb -x png --dpi 600 --format PNG --photo-mode --outfile #{target}_layout-top.png #{t.prerequisites.join(' ')}"
|
file "#{target[:name]}_layout-top.png" => target[:vpcb] do |t|
|
||||||
sh "pcb -x png --format PNG --photo-mode --outfile #{target}_layout-top.png #{t.prerequisites.join(' ')}"
|
sh "pcb -x png --dpi 600 --format PNG --photo-mode --outfile #{t.name} #{t.prerequisites.join(' ')}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "generate photo realistic picture from layout (bottom side)"
|
desc "generate photo realistic picture from layout (bottom side)"
|
||||||
file "#{target}_layout-bottom.png" => vpcb do |t|
|
targets.each do |target|
|
||||||
# sh "pcb -x png --dpi 600 --format PNG --photo-mode --photo-flip-x --outfile #{target}_layout-bottom.png #{t.prerequisites.join(' ')}"
|
file "#{target[:name]}_layout-bottom.png" => target[:vpcb] do |t|
|
||||||
sh "pcb -x png --format PNG --photo-mode --photo-flip-x --outfile #{target}_layout-bottom.png #{t.prerequisites.join(' ')}"
|
sh "pcb -x png --dpi 600 --format PNG --photo-mode --photo-flip-x --outfile #{t.name} #{t.prerequisites.join(' ')}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
=begin
|
||||||
desc "export gerber (and drill) files from layout"
|
desc "export gerber (and drill) files from layout"
|
||||||
GERBERS.each do |gerber|
|
GERBERS.each do |gerber|
|
||||||
file gerber => vpcb do |t|
|
file gerber => vpcb do |t|
|
||||||
|
|
Loading…
Reference in New Issue