fix dfp generation
This commit is contained in:
parent
d67ac812a0
commit
9dc2d6bbe9
10
dfp_clone.rb
10
dfp_clone.rb
|
@ -4,12 +4,12 @@
|
|||
ORIGINAL_PATH = "usb_hub-dfp1.sch"
|
||||
ORIGINAL_FILE = IO.read(ORIGINAL_PATH)
|
||||
(2..7).to_a.each do |number|
|
||||
number = number.to_s
|
||||
output = ORIGINAL_FILE.dup
|
||||
output.gsub!(/netname=(.*)1/, "netname=" + '\1' + number)
|
||||
output.gsub!(/refdes=(.*)10/, "refdes=" + '\1' + number + "0")
|
||||
output.gsub!(/ - DFP1/, " - DFP" + number)
|
||||
File.open("#{ORIGINAL_PATH.gsub('1', number)}", "w") do |file|
|
||||
output.gsub!(/netname=(.*)1/, "netname=" + '\1' + number.to_s)
|
||||
output.gsub!(/refdes=(.*)10/, "refdes=" + '\1' + number.to_s + "0")
|
||||
output.gsub!(/ - DFP1/, " - DFP#{number}")
|
||||
output.gsub!(/USB2517_part-2-8-DFP1/, "USB2517_part-#{number + 1}-8-DFP#{number}")
|
||||
File.open("#{ORIGINAL_PATH.gsub('1', number.to_s)}", "w") do |file|
|
||||
file.write output
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue