add notes support for multiple targets

This commit is contained in:
King Kévin 2014-03-26 12:31:17 +01:00
parent 525121c7f2
commit 488c214153
1 changed files with 25 additions and 18 deletions

View File

@ -47,26 +47,31 @@ task :release => release
CLOBBER.include(release) if File.exist? release
desc "set version in schematic and layout"
task :version => targets.collect{|target| [target[:vsch],target[:vpcb]]}.flatten
versions = targets.collect{|target| [target[:vsch],target[:vpcb]]}.flatten
task :version => versions
versions.each do |version|
CLEAN.include(version) if File.exist? version
end
targets.each do |target|
CLEAN.include(target[:vsch]) if File.exist? target[:vsch]
CLEAN.include(target[:vpcb]) if File.exist? target[:vpcb]
CLOBBER.include("#{target[:name]}_*.sch") if File.exist? "#{target[:name]}_*.sch"
CLOBBER.include("#{target[:name]}_*.pcb") if File.exist? "#{target[:name]}_*.pcb"
end
desc "print schematic and layout (as pdf)"
task :print => targets.collect{|target| ["#{target[:name]}_schematic.pdf","#{target[:name]}_layout.pdf"]}.flatten
targets.each do |target|
CLEAN.include("#{target[:name]}_schematic.pdf") if File.exist? "#{target[:name]}_schematic.pdf"
CLEAN.include("#{target[:name]}_layout.pdf") if File.exist? "#{target[:name]}_layout.pdf"
prints = targets.collect{|target| ["#{target[:name]}_schematic.pdf","#{target[:name]}_layout.pdf"]}.flatten
task :print => prints
prints.each do |print|
CLEAN.include(print) if File.exist? print
end
desc "export notes from schematic"
notes = targets.collect{|target| "#{target[:name]}_notes.txt"}
task :notes => notes
notes.each do |note|
CLEAN.include(note) if File.exist? note
end
=begin
desc "export notes from schematic"
task :notes => "notes.txt"
CLOBBER.include("notes.txt")
desc "verify schematic attributes"
task :verify => vsch do |t|
["value","footprint"].each do |attribute|
@ -204,18 +209,20 @@ targets.each do |target|
end
end
=begin
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|
notes_data.each do |note|
next if note["note"]=="unknown"
notes_file.puts "#{note[:refdes]*','}:\n#{note["note"]}\n\n"
targets.each do |target|
file "#{target[:name]}_notes.txt" => target[:vsch] do |t|
notes_data = bom2(t.prerequisites[0],"note")
File.open(t.name,"w") do |notes_file|
notes_data.each do |note|
next if note["note"]=="unknown"
notes_file.puts "#{note[:refdes]*','}:\n#{note["note"]}\n\n"
end
end
end
end
=begin
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(' ')}"