Class: OrigenTesters::IGXLBasedTester::Base::Patsets

Inherits:
Object
  • Object
show all
Includes:
Generator
Defined in:
lib/origen_testers/igxl_based_tester/base/patsets.rb

Direct Known Subclasses

J750::Patsets, UltraFLEX::Patsets

Constant Summary collapse

OUTPUT_POSTFIX =
'patsets'

Instance Method Summary collapse

Methods included from Generator

#close, #collection, #collection=, #compiler, #current_dir, #dont_diff=, execute_source, #file_extension, #file_pipeline, #filename, #filename=, #identity_map, #import, #inhibit_output, #name, #on_close, original_reference_file, original_reference_file=, #output_file, #output_inhibited?, #platform, #reference_file, #render, #set_flow_description, #stats, #to_be_written?, #write_from_template, #write_to_file

Instance Method Details

#add(name, options = {}) ⇒ Object



9
10
11
12
13
# File 'lib/origen_testers/igxl_based_tester/base/patsets.rb', line 9

def add(name, options = {})
  p = platform::Patset.new(name, options)
  collection << p
  p
end

#finalize(options = {}) ⇒ Object



15
16
17
18
# File 'lib/origen_testers/igxl_based_tester/base/patsets.rb', line 15

def finalize(options = {})
  uniq!
  sort!
end

#sort!Object

Present the patsets in the final sheet in alphabetical order



21
22
23
# File 'lib/origen_testers/igxl_based_tester/base/patsets.rb', line 21

def sort!
  collection.sort_by!(&:name)
end

#uniq!Object

Removes all duplicate patsets



26
27
28
29
30
31
32
33
34
# File 'lib/origen_testers/igxl_based_tester/base/patsets.rb', line 26

def uniq!
  uniques = []
  collection.each do |patset|
    unless uniques.any? { |p| p == patset }
      uniques << patset
    end
  end
  self.collection = uniques
end