Class: TECSCDE::TECSModel::TmEPortArray

Inherits:
TmPortArray show all
Defined in:
lib/tecscde/tecs_model/tm_e_port_array.rb

Instance Attribute Summary

Attributes inherited from TmPortArray

#actual_size, #ports

Attributes inherited from TECSCDE::TmObject

#owner

Instance Method Summary collapse

Methods inherited from TmPortArray

#array?, #clone_for_undo, #complete?, #delete, #delete_highlighted, #editable?, #get_member, #get_near_port, #get_port_for_new_join, #insert, #moved, #moved_edge, #setup_clone, #unsubscripted_array?

Methods inherited from TECSCDE::TmObject

#copy_from, #model, #modified

Constructor Details

#initialize(cell, port_def) ⇒ TmEPortArray

Returns a new instance of TmEPortArray.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/tecscde/tecs_model/tm_e_port_array.rb', line 55

def initialize(cell, port_def)
  # p "TmEPortArray port_def:#{port_def}"
  @port_def = port_def
  @owner = cell
  if port_def.get_array_size == "[]"
    @actual_size = 1
  else
    @actual_size = port_def.get_array_size
  end

  @ports = []
  (0..(@actual_size - 1)).each do |subscript|
    @ports << TECSCDE::TECSModel::TmEPort.new(self, port_def, subscript)
  end
  modified {}
end

Instance Method Details

#new_port(subscript) ⇒ Object

TmEPortArray#new_port



73
74
75
# File 'lib/tecscde/tecs_model/tm_e_port_array.rb', line 73

def new_port(subscript)
  TECSCDE::TECSModel::TmEPort.new(self, @port_def, subscript)
end