add notes support for multiple targets
This commit is contained in:
parent
fd1e97e60f
commit
3d920f6a5f
|
@ -47,26 +47,31 @@ task :release => release
|
||||||
CLOBBER.include(release) if File.exist? release
|
CLOBBER.include(release) if File.exist? release
|
||||||
|
|
||||||
desc "set version in schematic and layout"
|
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|
|
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]}_*.sch") if File.exist? "#{target[:name]}_*.sch"
|
||||||
CLOBBER.include("#{target[:name]}_*.pcb") if File.exist? "#{target[:name]}_*.pcb"
|
CLOBBER.include("#{target[:name]}_*.pcb") if File.exist? "#{target[:name]}_*.pcb"
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "print schematic and layout (as pdf)"
|
desc "print schematic and layout (as pdf)"
|
||||||
task :print => 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
|
||||||
targets.each do |target|
|
task :print => prints
|
||||||
CLEAN.include("#{target[:name]}_schematic.pdf") if File.exist? "#{target[:name]}_schematic.pdf"
|
prints.each do |print|
|
||||||
CLEAN.include("#{target[:name]}_layout.pdf") if File.exist? "#{target[:name]}_layout.pdf"
|
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
|
end
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
desc "export notes from schematic"
|
|
||||||
task :notes => "notes.txt"
|
|
||||||
CLOBBER.include("notes.txt")
|
|
||||||
|
|
||||||
desc "verify schematic attributes"
|
desc "verify schematic attributes"
|
||||||
task :verify => vsch do |t|
|
task :verify => vsch do |t|
|
||||||
["value","footprint"].each do |attribute|
|
["value","footprint"].each do |attribute|
|
||||||
|
@ -204,9 +209,9 @@ targets.each do |target|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
=begin
|
|
||||||
desc "generate note file from schematic, listing the 'note' attributes from elements"
|
desc "generate note file from schematic, listing the 'note' attributes from elements"
|
||||||
file "notes.txt" => vsch do |t|
|
targets.each do |target|
|
||||||
|
file "#{target[:name]}_notes.txt" => target[:vsch] do |t|
|
||||||
notes_data = bom2(t.prerequisites[0],"note")
|
notes_data = bom2(t.prerequisites[0],"note")
|
||||||
File.open(t.name,"w") do |notes_file|
|
File.open(t.name,"w") do |notes_file|
|
||||||
notes_data.each do |note|
|
notes_data.each do |note|
|
||||||
|
@ -214,8 +219,10 @@ file "notes.txt" => vsch do |t|
|
||||||
notes_file.puts "#{note[:refdes]*','}:\n#{note["note"]}\n\n"
|
notes_file.puts "#{note[:refdes]*','}:\n#{note["note"]}\n\n"
|
||||||
end
|
end
|
||||||
end
|
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|
|
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(' ')}"
|
# sh "pcb -x png --dpi 600 --format PNG --photo-mode --outfile #{target}_layout-top.png #{t.prerequisites.join(' ')}"
|
||||||
|
|
Loading…
Reference in New Issue